dune-fem 2.12-git
Loading...
Searching...
No Matches
localfunctiongeometry.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_GRIDPART_COMMON_LOCALFUNCTIONGEOMETRY_HH
2#define DUNE_FEM_GRIDPART_COMMON_LOCALFUNCTIONGEOMETRY_HH
3
4#include <type_traits>
5#include <utility>
6
9
12
13#include <dune/grid/common/geometry.hh>
14
16
18
19namespace Dune
20{
21
22 namespace Fem
23 {
24
25 // LocalFunctionBasicGeometry
26 // --------------------------
27
28 template< class LocalFunction >
30 {
33
34 static const int mydimension = Entity::mydimension;
36
39
41
42 template< class... Args, std::enable_if_t< std::is_constructible< LocalFunction, Args &&... >::value, int > = 0 >
43 LocalFunctionBasicGeometry ( Args &&... args )
44 : localFunction_( std::forward< Args >( args )... )
45 {}
46
48 {
51 return ret;
52 }
53
55 {
56 const auto gradFT = localFunction().geometry().jacobianTransposed( local );
57
59
60 localFunction().jacobian( local, gradPhi );
61
62 JacobianTransposed jacTransposed( 0 );
63 for( int i = 0; i < coorddimension; ++i )
64 {
66 gradFT.mv( gradPhi[ i ], col );
67 }
68 return jacTransposed;
69 }
70
72 {
73 return QuadratureRules< ctype, mydimension >::rule( type(), order + (2*localFunction().order() + 1) );
74 }
75
76 GeometryType type () const { return localFunction().entity().type(); }
77
78 void bind ( const Entity &entity ) { localFunction_.bind( entity ); }
79 void init ( const Entity &entity ) { bind( entity ); }
80
81 const LocalFunction &localFunction () const { return localFunction_; }
82
83 private:
84 LocalFunction localFunction_;
85 };
86
87
88
89 // LocalFunctionGeometry
90 // ---------------------
91
92 template< class LocalFunction >
94
95 } // namespace Fem
96
97} // namespace Dune
98
99#endif // #ifndef DUNE_FEM_GRIDPART_COMMON_LOCALFUNCTIONGEOMETRY_HH
Col col
LocalIndex & local()
STL namespace.
static const QuadratureRule & rule(const GeometryType &t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
static constexpr int mydimension
GeometryType type() const
Definition fmatrixcol.hh:16
interface for local functions
Definition localfunction.hh:77
void evaluate(const PointType &x, RangeType &ret) const
evaluate the local function
Definition localfunction.hh:320
void bind(const EntityType &entity)
initialize the local function for an entity
Definition localfunction.hh:459
const Geometry & geometry() const
obtain the geometry, this local function lives on
Definition localfunction.hh:311
const EntityType & entity() const
obtain the entity, this local function lives on
Definition localfunction.hh:305
void jacobian(const PointType &x, JacobianRangeType &ret) const
evaluate Jacobian of the local function
Definition localfunction.hh:334
Definition localfunctiongeometry.hh:30
static const int coorddimension
Definition localfunctiongeometry.hh:35
LocalFunction::FunctionSpaceType::RangeFieldType ctype
Definition localfunctiongeometry.hh:32
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Definition localfunctiongeometry.hh:40
LocalFunction::EntityType Entity
Definition localfunctiongeometry.hh:31
GlobalCoordinate global(const LocalCoordinate &local) const
Definition localfunctiongeometry.hh:47
GeometryType type() const
Definition localfunctiongeometry.hh:76
static const int mydimension
Definition localfunctiongeometry.hh:34
const QuadratureRule< ctype, mydimension > & quadrature(int order) const
Definition localfunctiongeometry.hh:71
FieldVector< ctype, mydimension > LocalCoordinate
Definition localfunctiongeometry.hh:37
void bind(const Entity &entity)
Definition localfunctiongeometry.hh:78
FieldVector< ctype, coorddimension > GlobalCoordinate
Definition localfunctiongeometry.hh:38
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
Definition localfunctiongeometry.hh:54
void init(const Entity &entity)
Definition localfunctiongeometry.hh:79
const LocalFunction & localFunction() const
Definition localfunctiongeometry.hh:81
LocalFunctionBasicGeometry(Args &&... args)
Definition localfunctiongeometry.hh:43
Definition simplegeometry.hh:26
FunctionSpaceTraits::LinearMappingType JacobianRangeType
Intrinsic type used for the jacobian values has a Dune::FieldMatrix type interface.
Definition functionspaceinterface.hh:75
FunctionSpaceTraits::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition functionspaceinterface.hh:63
@ dimRange
dimension of range vector space
Definition functionspaceinterface.hh:48