Go to the documentation of this file. 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 typedef typename LA::Traits::Residual
Residual;
43 typedef typename LA::Traits::Solution
Solution;
47 typedef typename LA::LFSU
LFSU;
49 typedef typename LFSU::Traits::GridFunctionSpace
GFSU;
50 typedef typename LA::LFSV
LFSV;
52 typedef typename LFSV::Traits::GridFunctionSpace
GFSV;
54 typedef typename Solution::template ConstAliasedLocalView<LFSUCache>
SolutionView;
55 typedef typename Residual::template AliasedLocalView<LFSVCache>
ResidualView;
64 : local_assembler(local_assembler_),
65 lop(local_assembler_.localOperator())
71 {
return local_assembler.doAlphaSkeleton(); }
73 {
return local_assembler.doSkeletonTwoSided(); }
75 {
return local_assembler.doAlphaVolume(); }
77 {
return local_assembler.doAlphaSkeleton(); }
79 {
return local_assembler.doAlphaBoundary(); }
81 {
return local_assembler.doAlphaVolumePostSkeleton(); }
88 const typename LocalAssembler::Traits::TrialGridFunctionSpaceConstraints&
trialConstraints()
const
94 const typename LocalAssembler::Traits::TestGridFunctionSpaceConstraints&
testConstraints()
const
103 global_rl_view.attach(residual_);
104 global_rn_view.attach(residual_);
111 global_sl_view.attach(solution_);
112 global_sn_view.attach(solution_);
118 template<
typename EG,
typename LFSUC,
typename LFSVC>
119 void onBindLFSUV(
const EG & eg,
const LFSUC & lfsu_cache,
const LFSVC & lfsv_cache)
121 global_sl_view.bind(lfsu_cache);
124 template<
typename EG,
typename LFSVC>
127 global_rl_view.bind(lfsv_cache);
130 template<
typename IG,
typename LFSUC,
typename LFSVC>
133 global_sl_view.bind(lfsu_cache);
136 template<
typename IG,
typename LFSUC,
typename LFSVC>
138 const LFSUC & lfsu_s_cache,
const LFSVC & lfsv_s_cache,
139 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache)
141 global_sn_view.bind(lfsu_n_cache);
144 template<
typename IG,
typename LFSVC>
147 global_rl_view.bind(lfsv_cache);
150 template<
typename IG,
typename LFSVC>
152 const LFSVC & lfsv_s_cache,
153 const LFSVC & lfsv_n_cache)
155 global_rn_view.bind(lfsv_n_cache);
163 template<
typename EG,
typename LFSVC>
166 global_rl_view.commit();
167 global_rl_view.unbind();
170 template<
typename IG,
typename LFSVC>
173 global_rl_view.commit();
174 global_rl_view.unbind();
177 template<
typename IG,
typename LFSVC>
179 const LFSVC & lfsv_s_cache,
180 const LFSVC & lfsv_n_cache)
182 global_rn_view.commit();
183 global_rn_view.unbind();
189 template<
typename LFSUC>
193 template<
typename LFSUC>
197 template<
typename LFSUC>
200 DUNE_THROW(Dune::NotImplemented,
"No coupling lfsu available for ");
209 if(local_assembler.doPostProcessing())
211 global_rl_view.container());
225 template<
typename EG>
228 return LocalAssembler::isNonOverlapping && eg.entity().partitionType() != Dune::InteriorEntity;
231 template<
typename EG,
typename LFSUC,
typename LFSVC>
234 global_rl_view.setWeight(local_assembler.weight());
236 jacobian_apply_volume(lop,eg,lfsu_cache.localFunctionSpace(),global_sl_view,lfsv_cache.localFunctionSpace(),global_rl_view);
239 template<
typename IG,
typename LFSUC,
typename LFSVC>
241 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache)
243 global_rl_view.setWeight(local_assembler.weight());
244 global_rn_view.setWeight(local_assembler.weight());
247 lfsu_s_cache.localFunctionSpace(),global_sl_view,lfsv_s_cache.localFunctionSpace(),
248 lfsu_n_cache.localFunctionSpace(),global_sn_view,lfsv_n_cache.localFunctionSpace(),
249 global_rl_view,global_rn_view);
252 template<
typename IG,
typename LFSUC,
typename LFSVC>
255 global_rl_view.setWeight(local_assembler.weight());
257 jacobian_apply_boundary(lop,
ig,lfsu_s_cache.localFunctionSpace(),global_sl_view,lfsv_s_cache.localFunctionSpace(),global_rl_view);
260 template<
typename IG,
typename LFSUC,
typename LFSVC>
262 const LFSUC & lfsu_s_cache,
const LFSVC & lfsv_s_cache,
263 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache,
264 const LFSUC & lfsu_coupling_cache,
const LFSVC & lfsv_coupling_cache)
266 DUNE_THROW(Dune::NotImplemented,
"Assembling of coupling spaces is not implemented for ");
269 template<
typename EG,
typename LFSUC,
typename LFSVC>
272 global_rl_view.setWeight(local_assembler.weight());
void onBindLFSV(const EG &eg, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:125
Definition: localfunctionspacetags.hh:54
LA::LFSV LFSV
Definition: fastdg/jacobianapplyengine.hh:50
void loadCoefficientsLFSUInside(const LFSUC &lfsu_s_cache)
Definition: fastdg/jacobianapplyengine.hh:190
LA::Traits::Solution Solution
The type of the solution vector.
Definition: fastdg/jacobianapplyengine.hh:43
void assembleUVVolumePostSkeleton(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:270
void onBindLFSVOutside(const IG &ig, const LFSVC &lfsv_s_cache, const LFSVC &lfsv_n_cache)
Definition: fastdg/jacobianapplyengine.hh:151
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:261
The local assembler for DUNE grids.
Definition: fastdg/localassembler.hh:38
void assembleUVVolume(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:232
const LocalAssembler & localAssembler() const
Public access to the wrapping local assembler.
Definition: fastdg/jacobianapplyengine.hh:85
const LocalAssembler::Traits::TestGridFunctionSpaceConstraints & testConstraints() const
Test space constraints.
Definition: fastdg/jacobianapplyengine.hh:94
Residual::template AliasedLocalView< LFSVCache > ResidualView
Definition: fastdg/jacobianapplyengine.hh:55
bool requireSkeleton() const
Definition: fastdg/jacobianapplyengine.hh:70
The fast DG local assembler engine for DUNE grids which assembles the local application of the Jacobi...
Definition: fastdg/jacobianapplyengine.hh:21
LA::Traits::Residual Residual
The type of the residual vector.
Definition: fastdg/jacobianapplyengine.hh:39
void postAssembly(const GFSU &gfsu, const GFSV &gfsv)
Definition: fastdg/jacobianapplyengine.hh:207
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
void onBindLFSVInside(const IG &ig, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:145
LA::LocalOperator LOP
The type of the local operator.
Definition: fastdg/jacobianapplyengine.hh:36
Solution::template ConstAliasedLocalView< LFSUCache > SolutionView
Definition: fastdg/jacobianapplyengine.hh:54
FastDGLocalJacobianApplyAssemblerEngine(const LocalAssembler &local_assembler_)
Constructor.
Definition: fastdg/jacobianapplyengine.hh:63
LA::LFSUCache LFSUCache
Definition: fastdg/jacobianapplyengine.hh:48
static void jacobian_apply_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:136
LA LocalAssembler
The type of the wrapping local assembler.
Definition: fastdg/jacobianapplyengine.hh:33
bool assembleCell(const EG &eg)
Definition: fastdg/jacobianapplyengine.hh:226
Solution::ElementType SolutionElement
Definition: fastdg/jacobianapplyengine.hh:44
static void jacobian_apply_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, Y &y_s)
Definition: callswitch.hh:147
void onBindLFSUVInside(const IG &ig, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:131
void onUnbindLFSVInside(const IG &ig, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:171
bool requireUVVolume() const
Definition: fastdg/jacobianapplyengine.hh:74
void onUnbindLFSVOutside(const IG &ig, const LFSVC &lfsv_s_cache, const LFSVC &lfsv_n_cache)
Definition: fastdg/jacobianapplyengine.hh:178
const IG & ig
Definition: constraints.hh:148
Residual::ElementType ResidualElement
Definition: fastdg/jacobianapplyengine.hh:40
static void jacobian_apply_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:132
void loadCoefficientsLFSUCoupling(const LFSUC &lfsu_c_cache)
Definition: fastdg/jacobianapplyengine.hh:198
void constrain_residual(const CG &cg, XG &xg)
transform residual into transformed basis: r -> r~
Definition: constraints.hh:906
void loadCoefficientsLFSUOutside(const LFSUC &lfsu_n_cache)
Definition: fastdg/jacobianapplyengine.hh:194
Definition: localfunctionspacetags.hh:48
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:137
void onUnbindLFSV(const EG &eg, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:164
const LocalAssembler::Traits::TrialGridFunctionSpaceConstraints & trialConstraints() const
Trial space constraints.
Definition: fastdg/jacobianapplyengine.hh:88
void assembleUVBoundary(const IG &ig, const LFSUC &lfsu_s_cache, const LFSVC &lfsv_s_cache)
Definition: fastdg/jacobianapplyengine.hh:253
Base class for LocalAssemblerEngine implementations to avoid boilerplate code.
Definition: localassemblerenginebase.hh:21
void onBindLFSUV(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianapplyengine.hh:119
bool needsConstraintsCaching(const TrialConstraintsContainer &cu, const TestConstraintsContainer &cv) const
Definition: fastdg/jacobianapplyengine.hh:27
LA::LFSVCache LFSVCache
Definition: fastdg/jacobianapplyengine.hh:51
void setResidual(Residual &residual_)
Definition: fastdg/jacobianapplyengine.hh:101
bool requireSkeletonTwoSided() const
Definition: fastdg/jacobianapplyengine.hh:72
void setSolution(const Solution &solution_)
Definition: fastdg/jacobianapplyengine.hh:109
bool requireUVVolumePostSkeleton() const
Definition: fastdg/jacobianapplyengine.hh:80
LA::LFSU LFSU
The local function spaces.
Definition: fastdg/jacobianapplyengine.hh:47
LFSV::Traits::GridFunctionSpace GFSV
Definition: fastdg/jacobianapplyengine.hh:52
LFSU::Traits::GridFunctionSpace GFSU
Definition: fastdg/jacobianapplyengine.hh:49
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:240
bool requireUVSkeleton() const
Definition: fastdg/jacobianapplyengine.hh:76
bool requireUVBoundary() const
Definition: fastdg/jacobianapplyengine.hh:78
static void jacobian_apply_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, Y &y_s, Y &y_n)
Definition: callswitch.hh:140