dune-composites (2.5.1)

composite_properties_lop.hh
1#ifndef COMP_PROP_LOP_HH
2#define COMP_PROP_LOP_HH
3
4#include <dune/geometry/type.hh>
5#include <dune/geometry/referenceelements.hh>
6#include <dune/geometry/quadraturerules.hh>
7
8namespace Dune {
9 namespace PDELab {
10
11 template<typename GV, typename MODEL>
12 class composite_properties :
14 public NumericalJacobianApplyVolume<composite_properties<GV,MODEL> >,
15 public FullVolumePattern,
16 public LocalOperatorDefaultFlags,
17 public InstationaryLocalOperatorDefaultMethods<double>,
18 public NumericalJacobianVolume<composite_properties<GV,MODEL> >
19 {
20 public:
21 // pattern assembly flags
22 enum { doPatternVolume = false };
23
24 // residual assembly flags
25 enum { doAlphaVolume = true };
26
27 //Constructor
28 composite_properties (const GV& gv_, const MODEL& model_) : model(model_), gv(gv_) {}
29 //
30 // alpha_volume for getStress
31 //
32 // Volume Integral Depending on Test and Ansatz Functions
33 template<typename EG, typename LFSU, typename X, typename LFSV, typename R>
34 void alpha_volume (const EG& eg, const LFSU& lfsu, const X& x, const LFSV& lfsv, R& r) const
35 {
36 //Unwrap stress
37 const auto& lfsv1 = lfsv.template child<0>();
38 const auto& lfsv2 = lfsv.template child<1>();
39
40 int id = gv.indexSet().index(eg.entity());
41
42 int materialType = model.getMaterialTypeFromElement(id);
43
44 int orientation = model.getOrientation(id);
45
46 r.accumulate(lfsv1, 0, materialType);
47 r.accumulate(lfsv2, 0, orientation);
48 }
49 private:
50 const MODEL& model;
51 const GV& gv;
52 };
53
54 }
55}
56
57#endif
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Sep 4, 22:38, 2025)