Go to the documentation of this file. 1 #ifndef DUNE_PDELAB_GRIDOPERATOR_FASTDG_JACOBIANENGINE_HH
2 #define DUNE_PDELAB_GRIDOPERATOR_FASTDG_JACOBIANENGINE_HH
30 template<
typename TrialConstra
intsContainer,
typename TestConstra
intsContainer>
33 return cu.containsNonDirichletConstraints() || cv.containsNonDirichletConstraints();
40 typedef typename LA::LocalOperator
LOP;
43 typedef typename LA::LFSU
LFSU;
45 typedef typename LFSU::Traits::GridFunctionSpace
GFSU;
46 typedef typename LA::LFSV
LFSV;
48 typedef typename LFSV::Traits::GridFunctionSpace
GFSV;
51 typedef typename LA::Traits::Jacobian
Jacobian;
53 typedef typename Jacobian::template AliasedLocalView<LFSVCache,LFSUCache>
JacobianView;
56 typedef typename LA::Traits::Solution
Solution;
58 typedef typename Solution::template ConstAliasedLocalView<LFSUCache>
SolutionView;
67 : local_assembler(local_assembler_),
68 lop(local_assembler_.localOperator())
87 local_assembler(other.local_assembler), lop(other.lop),
88 global_s_s_view(other.global_s_s_view),
89 global_s_n_view(other.global_s_n_view),
90 global_a_ss_view(other.global_a_ss_view),
91 global_a_sn_view(other.global_a_sn_view),
92 global_a_ns_view(other.global_a_ns_view),
93 global_a_nn_view(other.global_a_nn_view)
99 {
return local_assembler.doAlphaSkeleton(); }
101 {
return local_assembler.doSkeletonTwoSided(); }
103 {
return local_assembler.doAlphaVolume(); }
105 {
return local_assembler.doAlphaSkeleton(); }
107 {
return local_assembler.doAlphaBoundary(); }
109 {
return local_assembler.doAlphaVolumePostSkeleton(); }
115 return local_assembler;
119 const typename LocalAssembler::Traits::TrialGridFunctionSpaceConstraints&
trialConstraints()
const
125 const typename LocalAssembler::Traits::TestGridFunctionSpaceConstraints&
testConstraints()
const
134 global_a_ss_view.attach(jacobian_);
135 global_a_sn_view.attach(jacobian_);
136 global_a_ns_view.attach(jacobian_);
137 global_a_nn_view.attach(jacobian_);
144 global_s_s_view.attach(solution_);
145 global_s_n_view.attach(solution_);
151 template<
typename EG,
typename LFSUC,
typename LFSVC>
152 void onBindLFSUV(
const EG & eg,
const LFSUC & lfsu_cache,
const LFSVC & lfsv_cache)
154 global_s_s_view.bind(lfsu_cache);
155 global_a_ss_view.bind(lfsv_cache,lfsu_cache);
158 template<
typename IG,
typename LFSUC,
typename LFSVC>
160 const LFSUC & lfsu_s_cache,
const LFSVC & lfsv_s_cache,
161 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache)
163 global_s_n_view.bind(lfsu_n_cache);
164 global_a_sn_view.bind(lfsv_s_cache,lfsu_n_cache);
165 global_a_ns_view.bind(lfsv_n_cache,lfsu_s_cache);
166 global_a_nn_view.bind(lfsv_n_cache,lfsu_n_cache);
174 template<
typename EG,
typename LFSUC,
typename LFSVC>
175 void onUnbindLFSUV(
const EG & eg,
const LFSUC & lfsu_cache,
const LFSVC & lfsv_cache)
177 global_a_ss_view.unbind();
180 template<
typename IG,
typename LFSUC,
typename LFSVC>
182 const LFSUC & lfsu_s_cache,
const LFSVC & lfsv_s_cache,
183 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache)
185 global_a_sn_view.unbind();
186 global_a_ns_view.unbind();
187 global_a_nn_view.unbind();
194 template<
typename LFSUC>
197 template<
typename LFSUC>
200 template<
typename LFSUC>
203 DUNE_THROW(Dune::NotImplemented,
"No coupling lfsu_cache available for ");
211 Jacobian& jacobian = global_a_ss_view.container();
212 global_s_s_view.detach();
213 global_s_n_view.detach();
214 global_a_ss_view.detach();
215 global_a_sn_view.detach();
216 global_a_ns_view.detach();
217 global_a_nn_view.detach();
219 if(local_assembler.doPostProcessing())
220 local_assembler.handle_dirichlet_constraints(gfsv,jacobian);
233 template<
typename EG>
236 return LocalAssembler::isNonOverlapping && eg.entity().partitionType() != Dune::InteriorEntity;
239 template<
typename EG,
typename LFSUC,
typename LFSVC>
242 global_a_ss_view.setWeight(local_assembler.weight());
244 jacobian_volume(lop,eg,lfsu_cache.localFunctionSpace(),global_s_s_view,lfsv_cache.localFunctionSpace(),global_a_ss_view);
247 template<
typename IG,
typename LFSUC,
typename LFSVC>
249 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache)
251 global_a_ss_view.setWeight(local_assembler.weight());
252 global_a_sn_view.setWeight(local_assembler.weight());
253 global_a_ns_view.setWeight(local_assembler.weight());
254 global_a_nn_view.setWeight(local_assembler.weight());
257 lfsu_s_cache.localFunctionSpace(),global_s_s_view,lfsv_s_cache.localFunctionSpace(),
258 lfsu_n_cache.localFunctionSpace(),global_s_n_view,lfsv_n_cache.localFunctionSpace(),
259 global_a_ss_view, global_a_sn_view,
260 global_a_ns_view, global_a_nn_view);
263 template<
typename IG,
typename LFSUC,
typename LFSVC>
266 global_a_ss_view.setWeight(local_assembler.weight());
268 jacobian_boundary(lop,
ig,lfsu_s_cache.localFunctionSpace(),global_s_s_view,lfsv_s_cache.localFunctionSpace(),global_a_ss_view);
271 template<
typename IG,
typename LFSUC,
typename LFSVC>
273 const LFSUC & lfsu_s_cache,
const LFSVC & lfsv_s_cache,
274 const LFSUC & lfsu_n_cache,
const LFSVC & lfsv_n_cache,
275 const LFSUC & lfsu_coupling_cache,
const LFSVC & lfsv_coupling_cache)
277 DUNE_THROW(Dune::NotImplemented,
"Assembling of coupling spaces is not implemented for ");
280 template<
typename IG,
typename LFSVC>
282 const LFSVC & lfsv_s_cache,
283 const LFSVC & lfsv_n_cache,
284 const LFSVC & lfsv_coupling_cache)
286 DUNE_THROW(Dune::NotImplemented,
"Assembling of coupling spaces is not implemented for ");
289 template<
typename EG,
typename LFSUC,
typename LFSVC>
292 global_a_ss_view.setWeight(local_assembler.weight());
323 typedef typename std::conditional<
330 >::type JacobianMatrix;
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/jacobianengine.hh:272
void onBindLFSUV(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianengine.hh:152
Definition: localfunctionspacetags.hh:54
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/jacobianengine.hh:159
bool requireSkeletonTwoSided() const
Definition: fastdg/jacobianengine.hh:100
Jacobian::template AliasedLocalView< LFSVCache, LFSUCache > JacobianView
Definition: fastdg/jacobianengine.hh:53
bool requireSkeleton() const
Definition: fastdg/jacobianengine.hh:98
void postAssembly(const GFSU &gfsu, const GFSV &gfsv)
Definition: fastdg/jacobianengine.hh:209
static void assembleVEnrichedCoupling(const IG &ig, const LFSVC &lfsv_s_cache, const LFSVC &lfsv_n_cache, const LFSVC &lfsv_coupling_cache)
Definition: fastdg/jacobianengine.hh:281
The local assembler for DUNE grids.
Definition: fastdg/localassembler.hh:38
static void jacobian_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, M &mat_ss)
Definition: callswitch.hh:194
const LocalAssembler & localAssembler() const
Public access to the wrapping local assembler.
Definition: fastdg/jacobianengine.hh:113
bool assembleCell(const EG &eg)
Definition: fastdg/jacobianengine.hh:234
static void jacobian_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:182
static void jacobian_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, M &mat_ss, M &mat_sn, M &mat_ns, M &mat_nn)
Definition: callswitch.hh:186
A dense matrix for storing data associated with the degrees of freedom of a pair of LocalFunctionSpac...
Definition: diagonallocalmatrix.hh:28
void setSolution(const Solution &solution_)
Definition: fastdg/jacobianengine.hh:142
LFSV::Traits::GridFunctionSpace GFSV
Definition: fastdg/jacobianengine.hh:48
static void jacobian_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:178
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
void loadCoefficientsLFSUOutside(const LFSUC &lfsu_n_cache)
Definition: fastdg/jacobianengine.hh:198
bool needsConstraintsCaching(const TrialConstraintsContainer &cu, const TestConstraintsContainer &cv)
Definition: fastdg/jacobianengine.hh:31
LA::Traits::Solution Solution
The type of the solution vector.
Definition: fastdg/jacobianengine.hh:56
const LocalAssembler::Traits::TrialGridFunctionSpaceConstraints & trialConstraints() const
Trial space constraints.
Definition: fastdg/jacobianengine.hh:119
LA LocalAssembler
The type of the wrapping local assembler.
Definition: fastdg/jacobianengine.hh:37
const LocalAssembler::Traits::TestGridFunctionSpaceConstraints & testConstraints() const
Test space constraints.
Definition: fastdg/jacobianengine.hh:125
LA::LocalOperator LOP
The type of the local operator.
Definition: fastdg/jacobianengine.hh:40
Solution::template ConstAliasedLocalView< LFSUCache > SolutionView
Definition: fastdg/jacobianengine.hh:58
const IG & ig
Definition: constraints.hh:148
FastDGLocalJacobianAssemblerEngine(const LocalAssembler &local_assembler_)
Constructor.
Definition: fastdg/jacobianengine.hh:66
void onUnbindLFSUV(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianengine.hh:175
bool requireUVVolumePostSkeleton() const
Definition: fastdg/jacobianengine.hh:108
Solution::ElementType SolutionElement
Definition: fastdg/jacobianengine.hh:57
void assembleUVBoundary(const IG &ig, const LFSUC &lfsu_s_cache, const LFSVC &lfsv_s_cache)
Definition: fastdg/jacobianengine.hh:264
Definition: localfunctionspacetags.hh:48
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/jacobianengine.hh:248
void loadCoefficientsLFSUInside(const LFSUC &lfsu_cache)
Definition: fastdg/jacobianengine.hh:195
A dense matrix for storing data associated with the degrees of freedom of a pair of LocalFunctionSpac...
Definition: localmatrix.hh:184
Base class for LocalAssemblerEngine implementations to avoid boilerplate code.
Definition: localassemblerenginebase.hh:21
The fast DG local assembler engine for DUNE grids which assembles the jacobian matrix.
Definition: fastdg/jacobianengine.hh:25
Decorator base class for local operators that have a diagonal jacobian matrix.
Definition: flags.hh:98
LA::LFSV LFSV
Definition: fastdg/jacobianengine.hh:46
LFSU::Traits::GridFunctionSpace GFSU
Definition: fastdg/jacobianengine.hh:45
void loadCoefficientsLFSUCoupling(const LFSUC &lfsu_c_cache)
Definition: fastdg/jacobianengine.hh:201
Jacobian::ElementType JacobianElement
Definition: fastdg/jacobianengine.hh:52
void assembleUVVolume(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianengine.hh:240
void assembleUVVolumePostSkeleton(const EG &eg, const LFSUC &lfsu_cache, const LFSVC &lfsv_cache)
Definition: fastdg/jacobianengine.hh:290
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
void setJacobian(Jacobian &jacobian_)
Definition: fastdg/jacobianengine.hh:132
bool requireUVBoundary() const
Definition: fastdg/jacobianengine.hh:106
LA::LFSUCache LFSUCache
Definition: fastdg/jacobianengine.hh:44
LA::LFSVCache LFSVCache
Definition: fastdg/jacobianengine.hh:47
void onUnbindLFSUVOutside(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/jacobianengine.hh:181
bool requireUVVolume() const
Definition: fastdg/jacobianengine.hh:102
bool requireUVSkeleton() const
Definition: fastdg/jacobianengine.hh:104
LA::LFSU LFSU
The local function spaces.
Definition: fastdg/jacobianengine.hh:43
LA::Traits::Jacobian Jacobian
The type of the jacobian matrix.
Definition: fastdg/jacobianengine.hh:51