DUNE PDELab (git)

linearelasticityparameter.hh
1// -*- tab-width: 8; indent-tabs-mode: nil -*-
2#ifndef DUNE_PDELAB_LOCALOPERATOR_LINEARELASTICITYPARAMETER_HH
3#define DUNE_PDELAB_LOCALOPERATOR_LINEARELASTICITYPARAMETER_HH
4
5#include<vector>
6
10#include<dune/geometry/referenceelements.hh>
12#include<dune/pdelab/common/geometrywrapper.hh>
13#include<dune/pdelab/common/function.hh>
14#include<dune/pdelab/common/functionutilities.hh>
15#include<dune/pdelab/constraints/common/constraintsparameters.hh>
16
17namespace Dune {
18 namespace PDELab {
19
26 template<typename GV, typename RF>
28 {
30 typedef GV GridViewType;
31
33 enum {
35 dimDomain = GV::dimension,
36 dimRange = GV::dimension
37 };
38
40 typedef typename GV::Grid::ctype DomainFieldType;
41
44
47
49 typedef RF RangeFieldType;
50
53
55 typedef typename GV::Traits::template Codim<0>::Entity ElementType;
56 typedef typename GV::Intersection IntersectionType;
57 };
58
60 template<class T, class Imp>
63 {
64 public:
65 typedef T Traits;
66
68 void
69 f (const typename Traits::ElementType& e, const typename Traits::DomainType& x,
70 typename Traits::RangeType & y) const
71 {
72 asImp().f(e,x,y);
73 }
74
75 template<typename I>
76 bool isDirichlet(const I & ig,
77 const typename Traits::IntersectionDomainType & coord
78 ) const
79 {
80 return asImp().isDirichlet( ig, coord );
81 }
82
84 void
85 u (const typename Traits::ElementType& e, const typename Traits::DomainType& x,
86 typename Traits::RangeType & y) const
87 {
88 asImp().g(e,x,y);
89 }
90
91 // //! Neumann boundary condition (surface force)
92 // void
93 // g (const typename Traits::ElementType& e, const typename Traits::DomainType& x,
94 // typename Traits::RangeType & y) const
95 // {
96 // asImp().g(e,x,y);
97 // }
98
100 typename Traits::RangeFieldType
101 lambda(const typename Traits::ElementType& e, const typename Traits::DomainType& x) const
102 {
103 return asImp().lambda(e,x);
104 }
105
107 typename Traits::RangeFieldType
108 mu(const typename Traits::ElementType& e, const typename Traits::DomainType& x) const
109 {
110 return asImp().mu(e,x);
111 }
112
113 private:
114 Imp& asImp () {return static_cast<Imp &> (*this);}
115 const Imp& asImp () const {return static_cast<const Imp &>(*this);}
116 };
117
122 template<typename T>
124 : public Dune::PDELab::GridFunctionBase<Dune::PDELab::GridFunctionTraits<typename T::Traits::GridViewType,
125 typename T::Traits::RangeFieldType,
126 T::Traits::dimRange, typename T::Traits::RangeType >
127 ,LinearElasticityDirichletExtensionAdapter<T> >
128 {
129 public:
130 typedef Dune::PDELab::GridFunctionTraits<typename T::Traits::GridViewType,
131 typename T::Traits::RangeFieldType,
132 T::Traits::dimRange, typename T::Traits::RangeType > Traits;
133
136 : g(g_), t(t_)
137 {}
138
140 inline void evaluate (const typename Traits::ElementType& e,
141 const typename Traits::DomainType& x,
142 typename Traits::RangeType& y) const
143 {
144 t.u(e,x,y);
145 }
146
147 inline const typename Traits::GridViewType& getGridView () const
148 {
149 return g;
150 }
151
152 private:
153 const typename Traits::GridViewType g;
154 T& t;
155 };
156
157 }
158}
159
160#endif // DUNE_PDELAB_LOCALOPERATOR_LINEARELASTICITYPARAMETER_HH
vector space out of a tensor product of fields.
Definition: fvector.hh:95
leaf of a function tree
Definition: function.hh:302
Definition: linearelasticityparameter.hh:128
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Evaluate the GridFunction at given position.
Definition: linearelasticityparameter.hh:140
LinearElasticityDirichletExtensionAdapter(const typename Traits::GridViewType &g_, T &t_)
constructor
Definition: linearelasticityparameter.hh:135
base class for linear elasticity parameter class
Definition: linearelasticityparameter.hh:63
Traits::RangeFieldType lambda(const typename Traits::ElementType &e, const typename Traits::DomainType &x) const
First Lame parameter.
Definition: linearelasticityparameter.hh:101
void f(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
volume force term
Definition: linearelasticityparameter.hh:69
void u(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Dirichlet boundary condition value (displacement)
Definition: linearelasticityparameter.hh:85
Traits::RangeFieldType mu(const typename Traits::ElementType &e, const typename Traits::DomainType &x) const
Second Lame parameter (shear modulus)
Definition: linearelasticityparameter.hh:108
A few common exception classes.
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
Definition: constraintsparameters.hh:26
traits class holding the function signature, same as in local function
Definition: function.hh:183
Traits class for linear elasticity parameters.
Definition: linearelasticityparameter.hh:28
GV GridViewType
the grid view
Definition: linearelasticityparameter.hh:30
@ dimDomain
dimension of the domain
Definition: linearelasticityparameter.hh:35
Dune::FieldVector< RF, dimRange > RangeType
range type
Definition: linearelasticityparameter.hh:52
GV::Traits::template Codim< 0 >::Entity ElementType
grid types
Definition: linearelasticityparameter.hh:55
Dune::FieldVector< DomainFieldType, dimDomain-1 > IntersectionDomainType
domain type
Definition: linearelasticityparameter.hh:46
Dune::FieldVector< DomainFieldType, dimDomain > DomainType
domain type
Definition: linearelasticityparameter.hh:43
GV::Grid::ctype DomainFieldType
Export type for domain field.
Definition: linearelasticityparameter.hh:40
RF RangeFieldType
Export type for range field.
Definition: linearelasticityparameter.hh:49
GV::Traits::template Codim< 0 >::Entity ElementType
codim 0 entity
Definition: function.hh:119
GV GridViewType
The type of the grid view the function lives on.
Definition: function.hh:116
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)