250 lforms_.push_back(&lform);
256 bforms_.push_back(&bform);
281 norm_fs_.push_back(&func);
282 norm_ws_.push_back(w);
283 norm_s_.push_back(s);
286 norm_d_.push_back(1);
288 norm_d_.push_back(2);
301 virtual const Real operator()()
const {
return this->operator()();}
303 virtual ImplicitResidual2D<F>* clone()
const{
return new ImplicitResidual2D<F>(*
this);}
307 virtual std::ostream& info(std::ostream& os)
const {
308 return os <<
"Implicit Residual Error Estimator 2D()";
341 virtual void computeError_(){
350 LocalEstimator<F>::locError_.resize(this->spc_.nelm());
367 DEBUGL(COMPUTE_D,
"start iteration");
369 std::auto_ptr<hp2D::hpAdaptiveSpaceH1::Scan> sc(spc->
scan());
390 for(uint i = 0 ; (edge = quad->
support().edge(i)) != 0; ++i){
396 if(bc(edge->
attrib()).type() != concepts::Boundary::DIRICHLET)
420 DEBUGL(COMPUTE_D,
"on Cell K = " << K <<
" +++++++++++");
432 DEBUGL(COMPUTE_D,
"start build system matrix ");
436 for(uint k = 0 ; k < bforms_.size(); ++k){
438 A_k.addInto(A, ws_[k]);
441 DEBUGL(COMPUTE_D,
"done ...");
444 for(uint l = 0 ; l < lforms_.size(); ++l)
447 DEBUGL(COMPUTE_D,
"rhs weak residual = " << rhs);
454 DEBUGL(COMPUTE_D,
" mean tracespace = " << tspc_mean);
456 std::auto_ptr<hp2D::TraceSpace::Scan> tsc(tspc_mean.scan());
457 while ( *(tsc.get()) ) {
461 DEBUGL(COMPUTE_D,
" scan " << elm);
465 DEBUGL(COMPUTE_D,
" T.m() > 0 ");
469 bool isFirst = ntspc.isFirstUelm(elm.support(), K);
470 DEBUGL(COMPUTE_D,
"is First = " << isFirst);
474 Real s = (isFirst) ? 1.0 : -1.0;
475 DEBUGL(COMPUTE_D,
" s = " << s);
478 DEBUGL(COMPUTE_D,
" compute mean application");
480 DEBUGL(COMPUTE_D,
" transpose and write into B");
481 A.transpose(); T(A, B); B.transpose();
482 DEBUGL(COMPUTE_D,
" done ...");
483 DEBUGL(COMPUTE_D,
" B = " << B);
484 for(
int i = T.
n(); i--;){
485 DEBUGL(COMPUTE_D,
"write into rhs at " << T.
index(i) <<
" while size = "<< rhs_mean.size());
486 rhs_mean[T.
index(i)] += s * B(i,0);
489 DEBUGL(COMPUTE_D,
"current contribution done ...");
493 DEBUGL(COMPUTE_D,
"rhs mean residual = " << rhs_mean);
500 if(bnd_free_attrb.size()){
504 for(uint i = 0 ; i < this->gAttrbs_.size(); ++i){
506 if((bnd_free_attrb&&this->gAttrbs_[i]).size()){
518 DEBUGL(COMPUTE_D,
"final rhs = " << rhs);
524 std::auto_ptr<concepts::Operator<F> > solver(0);
530 std::cout << e << std::endl;
539 for(uint n = 0; n < norm_fs_.size(); ++n){
540 const uint dim = norm_d_[n];
565 this->globError_ += error_K;
568 LocalEstimator<F>::locError_[K] = std::sqrt(error_K);
569 DEBUGL(COMPUTE_D,
"estimated error on K = " << K <<
" : " << LocalEstimator<F>::locError_[K])
574 this->globError_ = std::sqrt(this->globError_);
Real L2product(const ElementWithCell< G > &elm, const ElementFormula< F, G > &u, const ElementFormula< Real > *c=0, const Real t=0.0, IntegrationCell::intFormType form=IntegrationCell::ZERO)