1#ifndef DUNE_FEM_SPACE_FINITEVOLUME_BASISFUNCTIONSET_HH
2#define DUNE_FEM_SPACE_FINITEVOLUME_BASISFUNCTIONSET_HH
10#include <dune/geometry/referenceelements.hh>
11#include <dune/geometry/type.hh>
24 template<
class Entity,
class Range >
31 typedef FunctionSpace<
typename Entity::Geometry::ctype,
typename Range::value_type,
32 Entity::Geometry::coorddimension, Range::dimension
45 typedef std::decay_t<
decltype( Dune::ReferenceElements< typename EntityType::Geometry::ctype, EntityType::Geometry::coorddimension >::general( std::declval< const Dune::GeometryType & >() ) ) >
ReferenceElementType;
64 static constexpr int order () {
return 0; }
67 static constexpr std::size_t
size () {
return RangeType::dimension; }
70 template<
class Quadrature,
class Vector,
class DofVector >
73 const unsigned int nop = quadrature.
nop();
74 for(
unsigned int qp = 0; qp < nop; ++qp )
75 axpy( quadrature[ qp ], values[ qp ],
dofs );
79 template<
class Quadrature,
class VectorA,
class VectorB,
class DofVector >
80 void axpy (
const Quadrature &quadrature,
const VectorA &valuesA,
const VectorB &valuesB, DofVector &
dofs )
const
82 const unsigned int nop = quadrature.
nop();
83 for(
unsigned int qp = 0; qp < nop; ++qp )
85 axpy( quadrature[ qp ], valuesA[ qp ],
dofs );
86 axpy( quadrature[ qp ], valuesB[ qp ],
dofs );
91 template<
class Po
int,
class DofVector >
94 for(
int i = 0; i < RangeType::dimension; ++i )
95 dofs[ i ] += valueFactor[ i ];
99 template<
class Po
int,
class DofVector >
104 template<
class Po
int,
class DofVector >
106 DofVector &
dofs )
const
112 template<
class Quadrature,
class DofVector,
class RangeArray >
115 const unsigned int nop = quadrature.
nop();
116 for(
unsigned int qp = 0; qp < nop; ++qp )
121 template<
class Po
int,
class DofVector >
124 for(
int i = 0; i < RangeType::dimension; ++i )
125 value[ i ] =
dofs[ i ];
129 template<
class Po
int,
class RangeArray >
132 for(
int i = 0; i < RangeType::dimension; ++i )
135 values[ i ][ i ] =
typename RangeType::field_type( 1 );
140 template<
class QuadratureType,
class DofVector,
class JacobianArray >
141 void jacobianAll (
const QuadratureType &quadrature,
const DofVector &
dofs, JacobianArray &jacobians )
const
143 const unsigned int nop = quadrature.nop();
144 for(
unsigned int qp = 0; qp < nop; ++qp )
149 template<
class Po
int,
class DofVector >
156 template<
class Po
int,
class JacobianRangeArray >
157 void jacobianAll (
const Point &x, JacobianRangeArray &jacobians )
const
159 for(
int i = 0; i < RangeType::dimension; ++i )
164 template<
class QuadratureType,
class DofVector,
class HessianArray >
165 void hessianAll (
const QuadratureType &quadrature,
const DofVector &
dofs, HessianArray &hessians )
const
167 assert( hessians.size() >= quadrature.nop() );
168 const unsigned int nop = quadrature.nop();
169 for(
unsigned int qp = 0; qp < nop; ++qp )
170 hessians[qp] =
HessianRangeType(
typename HessianRangeType::value_type( 0 ) );
174 template<
class Po
int,
class DofVector >
181 template<
class Po
int,
class HessianRangeArray >
182 void hessianAll (
const Point &x, HessianRangeArray &hessians )
const
184 for(
int i = 0; i < RangeType::dimension; ++i )
185 hessians[ i ] =
HessianRangeType(
typename HessianRangeType::value_type( 0 ) );
197 -> decltype(
Dune::ReferenceElements< typename
EntityType::Geometry::ctype,
EntityType::Geometry::coorddimension >::general(
std::declval< const
Dune::GeometryType & >() ) )
199 return Dune::ReferenceElements< typename EntityType::Geometry::ctype, EntityType::Geometry::coorddimension >::general(
type() );
206 bool valid ()
const {
return bool(entity_); }
Definition: bindguard.hh:11
IteratorRange< typename DF::DofIteratorType > dofs(DF &df)
Iterates over all DOFs.
Definition: rangegenerators.hh:76
Definition: explicitfieldvector.hh:75
int nop() const
obtain the number of integration points
Definition: quadrature.hh:295
actual interface class for quadratures
Definition: quadrature.hh:405
A vector valued function space.
Definition: functionspace.hh:60
FunctionSpaceTraits::RangeType RangeType
Type of range vector (using type of range field) has a Dune::FieldVector type interface.
Definition: functionspaceinterface.hh:71
FunctionSpaceTraits::LinearMappingType JacobianRangeType
Intrinsic type used for the jacobian values has a Dune::FieldMatrix type interface.
Definition: functionspaceinterface.hh:75
FunctionSpaceTraits::DomainType DomainType
Type of domain vector (using type of domain field) has a Dune::FieldVector type interface.
Definition: functionspaceinterface.hh:67
Definition: finitevolume/basisfunctionset.hh:26
void hessianAll(const Point &x, const DofVector &dofs, HessianRangeType &hessian) const
Definition: finitevolume/basisfunctionset.hh:175
void axpy(const Point &x, const RangeType &valueFactor, DofVector &dofs) const
evaluate all basis function and multiply with given values and add to dofs
Definition: finitevolume/basisfunctionset.hh:92
void axpy(const Quadrature &quadrature, const Vector &values, DofVector &dofs) const
evaluate all basis function and multiply with given values and add to dofs
Definition: finitevolume/basisfunctionset.hh:71
void jacobianAll(const Point &x, JacobianRangeArray &jacobians) const
evaluate the jacobian of all basis functions and store the result in the jacobians array
Definition: finitevolume/basisfunctionset.hh:157
void evaluateAll(const Point &x, RangeArray &values) const
evaluate all basis functions and store the result in the ranges array
Definition: finitevolume/basisfunctionset.hh:130
FunctionSpaceType::DomainType DomainType
range type
Definition: finitevolume/basisfunctionset.hh:36
static constexpr std::size_t size()
return size of basis function set
Definition: finitevolume/basisfunctionset.hh:67
const EntityType & entity() const
return entity
Definition: finitevolume/basisfunctionset.hh:189
void hessianAll(const QuadratureType &quadrature, const DofVector &dofs, HessianArray &hessians) const
Definition: finitevolume/basisfunctionset.hh:165
void jacobianAll(const Point &x, const DofVector &dofs, JacobianRangeType &jacobian) const
evaluate the jacobian of all basis functions and store the result in the jacobians array
Definition: finitevolume/basisfunctionset.hh:150
FunctionSpaceType::RangeType RangeType
range type
Definition: finitevolume/basisfunctionset.hh:38
FiniteVolumeBasisFunctionSet()
Definition: finitevolume/basisfunctionset.hh:51
bool valid() const
return true if entity pointer is set
Definition: finitevolume/basisfunctionset.hh:206
FunctionSpaceType::HessianRangeType HessianRangeType
hessian range type
Definition: finitevolume/basisfunctionset.hh:42
void evaluateAll(const Point &x, const DofVector &dofs, RangeType &value) const
evaluate all basis functions and store the result in the ranges array
Definition: finitevolume/basisfunctionset.hh:122
void axpy(const Point &x, const JacobianRangeType &jacobianFactor, DofVector &dofs) const
evaluate all basis function and multiply with given values and add to dofs
Definition: finitevolume/basisfunctionset.hh:100
std::decay_t< decltype(Dune::ReferenceElements< typename EntityType::Geometry::ctype, EntityType::Geometry::coorddimension >::general(std::declval< const Dune::GeometryType & >())) > ReferenceElementType
type of reference element
Definition: finitevolume/basisfunctionset.hh:45
Dune::GeometryType type() const
Definition: finitevolume/basisfunctionset.hh:203
void axpy(const Point &x, const RangeType &valueFactor, const JacobianRangeType &jacobianFactor, DofVector &dofs) const
evaluate all basis function and multiply with given values and add to dofs
Definition: finitevolume/basisfunctionset.hh:105
void hessianAll(const Point &x, HessianRangeArray &hessians) const
Definition: finitevolume/basisfunctionset.hh:182
FiniteVolumeBasisFunctionSet(const EntityType &entity)
Definition: finitevolume/basisfunctionset.hh:53
void axpy(const Quadrature &quadrature, const VectorA &valuesA, const VectorB &valuesB, DofVector &dofs) const
evaluate all basis function and multiply with given values and add to dofs
Definition: finitevolume/basisfunctionset.hh:80
Entity EntityType
entity type
Definition: finitevolume/basisfunctionset.hh:28
void jacobianAll(const QuadratureType &quadrature, const DofVector &dofs, JacobianArray &jacobians) const
evaluate the jacobian of all basis functions and store the result in the jacobians array
Definition: finitevolume/basisfunctionset.hh:141
static constexpr int order()
return order of basis function set
Definition: finitevolume/basisfunctionset.hh:64
void evaluateAll(const Quadrature &quadrature, const DofVector &dofs, RangeArray &ranges) const
evaluate all basis functions and store the result in the ranges array
Definition: finitevolume/basisfunctionset.hh:113
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian range type
Definition: finitevolume/basisfunctionset.hh:40
auto referenceElement() const -> decltype(Dune::ReferenceElements< typename EntityType::Geometry::ctype, EntityType::Geometry::coorddimension >::general(std::declval< const Dune::GeometryType & >()))
Definition: finitevolume/basisfunctionset.hh:196
FunctionSpace< typename Entity::Geometry::ctype, typename Range::value_type, Entity::Geometry::coorddimension, Range::dimension > FunctionSpaceType
function space type
Definition: finitevolume/basisfunctionset.hh:33