1#ifndef DUNE_PDELAB_GRIDOPERATOR_ONESTEP_RESIDUALENGINE_HH
2#define DUNE_PDELAB_GRIDOPERATOR_ONESTEP_RESIDUALENGINE_HH
4#include <dune/pdelab/gridoperator/onestep/enginebase.hh>
18 template<
typename OSLA>
21 typename OSLA::LocalAssemblerDT0::LocalResidualAssemblerEngine,
22 typename OSLA::LocalAssemblerDT1::LocalResidualAssemblerEngine
27 typename OSLA::LocalAssemblerDT0::LocalResidualAssemblerEngine,
28 typename OSLA::LocalAssemblerDT1::LocalResidualAssemblerEngine
34 using BaseT::implicit;
35 using BaseT::setLocalAssemblerEngineDT0;
36 using BaseT::setLocalAssemblerEngineDT1;
45 typedef typename OSLA::LocalAssemblerDT1 LocalAssemblerDT1;
47 typedef typename LocalAssemblerDT0::LocalResidualAssemblerEngine ResidualEngineDT0;
48 typedef typename LocalAssemblerDT1::LocalResidualAssemblerEngine ResidualEngineDT1;
52 typedef typename OSLA::Traits::Residual
Residual;
55 typedef typename OSLA::Traits::Solution
Solution;
58 typedef typename OSLA::Real
Real;
60 typedef OSLA LocalAssembler;
69 :
BaseT(local_assembler_)
70 , invalid_residual(nullptr)
71 , invalid_solution(nullptr)
72 , residual_0(invalid_residual)
73 , residual_1(invalid_residual)
74 , const_residual_0(invalid_residual)
75 , const_residual_1(invalid_residual)
76 , solution(invalid_solution)
83 solution = &solution_;
90 const_residual_0 = &const_residual_;
91 const_residual_1 = &const_residual_;
98 residual_0 = &residual_;
99 residual_1 = &residual_;
102 assert(solution != invalid_solution);
103 setLocalAssemblerEngineDT0(la.la0.localResidualAssemblerEngine(*residual_0,*solution));
104 setLocalAssemblerEngineDT1(la.la1.localResidualAssemblerEngine(*residual_1,*solution));
113 const_residual_0 = &const_residual_0_;
114 const_residual_1 = &const_residual_1_;
123 residual_0 = &residual_0_;
124 residual_1 = &residual_1_;
127 assert(solution != invalid_solution);
128 setLocalAssemblerEngineDT0(la.la0.localResidualAssemblerEngine(*residual_0,*solution));
129 setLocalAssemblerEngineDT1(la.la1.localResidualAssemblerEngine(*residual_1,*solution));
137 la.la0.setWeight(b_rr * la.dt_factor0);
138 la.la1.setWeight(la.dt_factor1);
149 b_rr = la.osp_method->b(la.stage,la.stage);
150 d_r = la.osp_method->d(la.stage);
152 implicit = abs(b_rr) > 1e-6;
155 la.la0.setTime(la.time + d_r * la.dt);
156 la.la1.setTime(la.time + d_r * la.dt);
161 template<
typename GFSU,
typename GFSV>
162 void postAssembly(
const GFSU& gfsu,
const GFSV& gfsv)
166 assert(const_residual_0 != invalid_residual);
167 assert(const_residual_1 != invalid_residual);
168 *residual_0 += *const_residual_0;
169 if(residual_0 != residual_1){
170 assert(const_residual_0 != const_residual_1);
171 *residual_1 += *const_residual_1;
174 lae0->postAssembly(gfsu,gfsv);
175 lae1->postAssembly(gfsu,gfsv);
The local assembler engine for UDG sub triangulations which assembles the residual vector.
Definition: enginebase.hh:16
const LocalAssembler & la
Definition: enginebase.hh:472
The local assembler engine for one step methods which assembles the residual vector.
Definition: residualengine.hh:24
OSLA::Real Real
The type for real numbers.
Definition: residualengine.hh:58
OSLA::Traits::Solution Solution
The type of the solution vector.
Definition: residualengine.hh:55
void setResiduals(Residual &residual_0_, Residual &residual_1_)
Definition: residualengine.hh:121
OSLA OneStepLocalAssembler
The type of the wrapping local assembler.
Definition: residualengine.hh:40
OSLA::LocalAssemblerDT0 LocalAssemblerDT0
Definition: residualengine.hh:44
void setWeights()
Definition: residualengine.hh:135
void setConstResidual(const Residual &const_residual_)
Definition: residualengine.hh:88
void setSolution(const Solution &solution_)
Definition: residualengine.hh:81
OneStepLocalResidualAssemblerEngine(const LocalAssembler &local_assembler_)
Constructor.
Definition: residualengine.hh:68
void preAssembly()
Definition: residualengine.hh:143
void setConstResiduals(const Residual &const_residual_0_, const Residual &const_residual_1_)
Definition: residualengine.hh:111
OSLA::Traits::Residual Residual
The type of the residual vector.
Definition: residualengine.hh:52
void setResidual(Residual &residual_)
Definition: residualengine.hh:96
Dune namespace.
Definition: alignedallocator.hh:13