1 #ifndef DUNE_PDELAB_GRIDOPERATOR_FASTDG_JACOBIANAPPLYENGINE_HH
2 #define DUNE_PDELAB_GRIDOPERATOR_FASTDG_JACOBIANAPPLYENGINE_HH
26 template<
typename TrialConstra
intsContainer,
typename TestConstra
intsContainer>
36 typedef typename LA::LocalOperator
LOP;
39 static constexpr
bool isLinear = LOP::isLinear;
42 typedef typename LA::Traits::Range
Range;
46 typedef typename LA::Traits::Domain
Domain;
50 typedef typename LA::LFSU
LFSU;
52 typedef typename LFSU::Traits::GridFunctionSpace
GFSU;
53 typedef typename LA::LFSV
LFSV;
55 typedef typename LFSV::Traits::GridFunctionSpace
GFSV;
57 typedef typename Domain::template ConstAliasedLocalView<LFSUCache>
DomainView;
58 typedef typename Range::template AliasedLocalView<LFSVCache>
RangeView;
67 : local_assembler(local_assembler_),
68 lop(local_assembler_.localOperator())
74 {
return local_assembler.doAlphaSkeleton(); }
76 {
return local_assembler.doSkeletonTwoSided(); }
78 {
return local_assembler.doAlphaVolume(); }
80 {
return local_assembler.doAlphaSkeleton(); }
82 {
return local_assembler.doAlphaBoundary(); }
84 {
return local_assembler.doAlphaVolumePostSkeleton(); }
90 return local_assembler;
94 const typename LocalAssembler::Traits::TrialGridFunctionSpaceConstraints&
trialConstraints()
const
100 const typename LocalAssembler::Traits::TestGridFunctionSpaceConstraints&
testConstraints()
const
110 DUNE_THROW(Dune::Exception,
"In the linear case the jacobian apply does not depend on the current solution and this method should never be called.");
111 global_solution_view_inside.attach(solution_);
112 global_solution_view_outside.attach(solution_);
119 global_update_view_inside.attach(update_);
120 global_update_view_outside.attach(update_);
127 global_result_view_inside.attach(result_);
128 global_result_view_outside.attach(result_);
134 template<
typename EG,
typename LFSUC,
typename LFSVC>
135 void onBindLFSUV(
const EG & eg,
const LFSUC & lfsu_cache,
const LFSVC & lfsv_cache)
138 global_solution_view_inside.bind(lfsu_cache);
139 global_update_view_inside.bind(lfsu_cache);
142 template<
typename EG,
typename LFSVC>
145 global_result_view_inside.bind(lfsv_cache);
148 template<
typename IG,
typename LFSUC,
typename LFSVC>
152 global_solution_view_inside.bind(lfsu_cache);
153 global_update_view_inside.bind(lfsu_cache);
156 template<
typename IG,
typename LFSUC,
typename LFSVC>
158 const LFSUC & lfsu_s_cache,
const LFSVC & lfsv_s_cache,
159 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache)
162 global_solution_view_outside.bind(lfsu_n_cache);
163 global_update_view_outside.bind(lfsu_n_cache);
166 template<
typename IG,
typename LFSVC>
169 global_result_view_inside.bind(lfsv_cache);
172 template<
typename IG,
typename LFSVC>
174 const LFSVC & lfsv_s_cache,
175 const LFSVC & lfsv_n_cache)
177 global_result_view_outside.bind(lfsv_n_cache);
185 template<
typename EG,
typename LFSVC>
188 global_result_view_inside.commit();
189 global_result_view_inside.unbind();
192 template<
typename IG,
typename LFSVC>
195 global_result_view_inside.commit();
196 global_result_view_inside.unbind();
199 template<
typename IG,
typename LFSVC>
201 const LFSVC & lfsv_s_cache,
202 const LFSVC & lfsv_n_cache)
204 global_result_view_outside.commit();
205 global_result_view_outside.unbind();
211 template<
typename LFSUC>
215 template<
typename LFSUC>
219 template<
typename LFSUC>
222 DUNE_THROW(Dune::NotImplemented,
"No coupling lfsu available for ");
231 if(local_assembler.doPostProcessing())
233 global_result_view_inside.container());
247 (LocalAssembler::isNonOverlapping &&
248 eg.entity().partitionType() != Dune::InteriorEntity);
257 template<
typename IG>
263 template<
typename EG,
typename LFSUC,
typename LFSVC>
266 global_result_view_inside.setWeight(local_assembler.weight());
268 jacobian_apply_volume(lop,eg,lfsu_cache.localFunctionSpace(),global_solution_view_inside,global_update_view_inside,lfsv_cache.localFunctionSpace(),global_result_view_inside);
271 template<
typename IG,
typename LFSUC,
typename LFSVC>
273 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache)
275 global_result_view_inside.setWeight(local_assembler.weight());
276 global_result_view_outside.setWeight(local_assembler.weight());
279 lfsu_s_cache.localFunctionSpace(),global_solution_view_inside,global_update_view_inside,lfsv_s_cache.localFunctionSpace(),
280 lfsu_n_cache.localFunctionSpace(),global_solution_view_outside,global_update_view_outside,lfsv_n_cache.localFunctionSpace(),
281 global_result_view_inside,global_result_view_outside);
284 template<
typename IG,
typename LFSUC,
typename LFSVC>
287 global_result_view_inside.setWeight(local_assembler.weight());
289 jacobian_apply_boundary(lop,
ig,lfsu_s_cache.localFunctionSpace(),global_solution_view_inside,global_update_view_inside,lfsv_s_cache.localFunctionSpace(),global_result_view_inside);
292 template<
typename IG,
typename LFSUC,
typename LFSVC>
294 const LFSUC & lfsu_s_cache,
const LFSVC & lfsv_s_cache,
295 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache,
296 const LFSUC & lfsu_coupling_cache,
const LFSVC & lfsv_coupling_cache)
298 DUNE_THROW(Dune::NotImplemented,
"Assembling of coupling spaces is not implemented for ");
301 template<
typename EG,
typename LFSUC,
typename LFSVC>
304 global_result_view_inside.setWeight(local_assembler.weight());
306 jacobian_apply_volume_post_skeleton(lop,eg,lfsu_cache.localFunctionSpace(),global_solution_view_inside,global_update_view_inside,lfsv_cache.localFunctionSpace(),global_result_view_inside);
const IG & ig
Definition: constraints.hh:149
void constrain_residual(const CG &cg, XG &xg)
transform residual into transformed basis: r -> r~
Definition: constraints.hh:904
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Impl::LocalAssemblerCallSwitchHelper< LOP, doIt > LocalAssemblerCallSwitch
Definition: callswitch.hh:407
Definition: localfunctionspacetags.hh:48
Definition: localfunctionspacetags.hh:54
Base class for LocalAssemblerEngine implementations to avoid boilerplate code.
Definition: localassemblerenginebase.hh:22
The fast DG local assembler engine for DUNE grids which assembles the local application of the Jacobi...
Definition: fastdg/jacobianapplyengine.hh:23
LA LocalAssembler
The type of the wrapping local assembler.
Definition: fastdg/jacobianapplyengine.hh:33
void loadCoefficientsLFSUOutside(const LFSUC &lfsu_n_cache)
Definition: fastdg/jacobianapplyengine.hh:216
bool requireSkeletonTwoSided() const
Definition: fastdg/jacobianapplyengine.hh:75
bool skipEntity(const EG &eg)
Definition: fastdg/jacobianapplyengine.hh:244
void onBindLFSUV(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:135
LA::LocalOperator LOP
The type of the local operator.
Definition: fastdg/jacobianapplyengine.hh:36
LA::LFSU LFSU
The local function spaces.
Definition: fastdg/jacobianapplyengine.hh:50
void loadCoefficientsLFSUInside(const LFSUC &lfsu_s_cache)
Definition: fastdg/jacobianapplyengine.hh:212
void setResult(Range &result_)
Definition: fastdg/jacobianapplyengine.hh:125
LA::LFSV LFSV
Definition: fastdg/jacobianapplyengine.hh:53
void loadCoefficientsLFSUCoupling(const LFSUC &lfsu_c_cache)
Definition: fastdg/jacobianapplyengine.hh:220
bool skipIntersection(const IG &ig)
Definition: fastdg/jacobianapplyengine.hh:258
Domain::template ConstAliasedLocalView< LFSUCache > DomainView
Definition: fastdg/jacobianapplyengine.hh:57
LFSV::Traits::GridFunctionSpace GFSV
Definition: fastdg/jacobianapplyengine.hh:55
void postAssembly(const GFSU &gfsu, const GFSV &gfsv)
Definition: fastdg/jacobianapplyengine.hh:229
Range::ElementType RangeElement
Definition: fastdg/jacobianapplyengine.hh:43
LA::Traits::Range Range
The type of the result vector.
Definition: fastdg/jacobianapplyengine.hh:42
void assembleUVVolume(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:264
static constexpr bool isLinear
Wheter the local operator is linear.
Definition: fastdg/jacobianapplyengine.hh:39
bool requireUVVolumePostSkeleton() const
Definition: fastdg/jacobianapplyengine.hh:83
bool requireUVBoundary() const
Definition: fastdg/jacobianapplyengine.hh:81
LA::Traits::Domain Domain
The type of the solution vector.
Definition: fastdg/jacobianapplyengine.hh:46
void onBindLFSVOutside(const IG &ig, const LFSVC &lfsv_s_cache, const LFSVC &lfsv_n_cache)
Definition: fastdg/jacobianapplyengine.hh:173
void onBindLFSUVOutside(const IG &ig, const LFSUC &lfsu_s_cache, const LFSVC &lfsv_s_cache, const LFSUC &lfsu_n_cache, const LFSVC &lfsv_n_cache)
Definition: fastdg/jacobianapplyengine.hh:157
void assembleUVBoundary(const IG &ig, const LFSUC &lfsu_s_cache, const LFSVC &lfsv_s_cache)
Definition: fastdg/jacobianapplyengine.hh:285
bool requireUVVolume() const
Definition: fastdg/jacobianapplyengine.hh:77
void setSolution(const Domain &solution_)
Definition: fastdg/jacobianapplyengine.hh:107
bool needsConstraintsCaching(const TrialConstraintsContainer &cu, const TestConstraintsContainer &cv) const
Definition: fastdg/jacobianapplyengine.hh:27
Range::template AliasedLocalView< LFSVCache > RangeView
Definition: fastdg/jacobianapplyengine.hh:58
const LocalAssembler & localAssembler() const
Public access to the wrapping local assembler.
Definition: fastdg/jacobianapplyengine.hh:88
FastDGLocalJacobianApplyAssemblerEngine(const LocalAssembler &local_assembler_)
Constructor.
Definition: fastdg/jacobianapplyengine.hh:66
void assembleUVSkeleton(const IG &ig, const LFSUC &lfsu_s_cache, const LFSVC &lfsv_s_cache, const LFSUC &lfsu_n_cache, const LFSVC &lfsv_n_cache)
Definition: fastdg/jacobianapplyengine.hh:272
const LocalAssembler::Traits::TrialGridFunctionSpaceConstraints & trialConstraints() const
Trial space constraints.
Definition: fastdg/jacobianapplyengine.hh:94
void onBindLFSVInside(const IG &ig, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:167
void onBindLFSUVInside(const IG &ig, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:149
LA::LFSVCache LFSVCache
Definition: fastdg/jacobianapplyengine.hh:54
void onUnbindLFSVOutside(const IG &ig, const LFSVC &lfsv_s_cache, const LFSVC &lfsv_n_cache)
Definition: fastdg/jacobianapplyengine.hh:200
const LocalAssembler::Traits::TestGridFunctionSpaceConstraints & testConstraints() const
Test space constraints.
Definition: fastdg/jacobianapplyengine.hh:100
LA::LFSUCache LFSUCache
Definition: fastdg/jacobianapplyengine.hh:51
void onBindLFSV(const EG &eg, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:143
void assembleUVVolumePostSkeleton(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:302
LFSU::Traits::GridFunctionSpace GFSU
Definition: fastdg/jacobianapplyengine.hh:52
Domain::ElementType DomainElement
Definition: fastdg/jacobianapplyengine.hh:47
bool requireSkeleton() const
Definition: fastdg/jacobianapplyengine.hh:73
void setUpdate(const Domain &update_)
Definition: fastdg/jacobianapplyengine.hh:117
void onUnbindLFSV(const EG &eg, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:186
void onUnbindLFSVInside(const IG &ig, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:193
bool requireUVSkeleton() const
Definition: fastdg/jacobianapplyengine.hh:79
static void assembleUVEnrichedCoupling(const IG &ig, const LFSUC &lfsu_s_cache, const LFSVC &lfsv_s_cache, const LFSUC &lfsu_n_cache, const LFSVC &lfsv_n_cache, const LFSUC &lfsu_coupling_cache, const LFSVC &lfsv_coupling_cache)
Definition: fastdg/jacobianapplyengine.hh:293