DUNE-FEM (2.10)
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
localfunctionadapter.hh
57 // store the local function object by value if it can be copy constructed - otherwise store a reference
58 static constexpr bool localFunctionHasCopyConstructor = std::is_copy_constructible<LocalFunctionImpl>::value;
59 typedef typename LocalFuncType< LocalFunctionImpl, localFunctionHasCopyConstructor >::Type LocalFuncStorageType;
75 typedef DiscreteFunctionSpaceAdapter< FunctionSpaceType, GridPartType > DiscreteFunctionSpaceType;
134 : public Function< typename LocalFunctionImpl::FunctionSpaceType, LocalFunctionAdapter< LocalFunctionImpl > >,
395 Hybrid::ifElse( hasCopyConstructor, [ & ]( auto&& ){ argInitializer_->initialize( localFunctionPtr ); } );
477 LocalFunctionAdapterLocalFunction ( const EntityType &entity, const DiscreteFunctionType &adapter )
538 static_assert( sizeof...( Vectors ) > 0, "evaluateQuadrature needs to be called with at least one vector." );
546 static_assert( sizeof...( Vectors ) > 0, "evaluateQuadrature needs to be called with at least one vector." );
582 -> std::enable_if_t< std::is_same< std::decay_t< decltype(result[ 0 ] ) >, JacobianRangeType >::value >
647 typedef std::function<RangeType(const DomainType&,double,const EntityType&)> AnalyticalFunctionType;
648 typedef std::function<JacobianRangeType(const DomainType&,double,const EntityType&)> AnalyticalJacobianType;
649 typedef std::function<HessianRangeType(const DomainType&,double,const EntityType&)> AnalyticalHessianType;
652 LocalAnalyticalFunctionBinder(const AnalyticalFunctionType& f=[](const auto& ,auto ,const auto& ){return RangeType(0.0);},
653 const AnalyticalJacobianType& j=[](const auto& ,auto ,const auto& ){return JacobianRangeType(0.0);},
654 const AnalyticalHessianType& h=[](const auto& ,auto ,const auto& ){return HessianRangeType(0.0);},
bool continuous() const
returns true if the space contains only globally continuous functions
Definition: discretefunctionspace.hh:1093
const GridPartType & gridPart() const
get a reference to the associated grid partition
Definition: discretefunctionspace.hh:1075
Traits::FunctionSpaceType FunctionSpaceType
type of function space
Definition: discretefunctionspace.hh:194
Definition: explicitfieldvector.hh:75
FunctionSpaceTraits::DomainFieldType DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspaceinterface.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
FunctionSpaceTraits::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:63
FunctionImp FunctionType
type of the implementation (Barton-Nackman)
Definition: function.hh:59
base class for determing whether a function has local functions or not
Definition: discretefunction.hh:57
LocalAnalyticalFunctionBinder binds a C++ local analytical function (and also its Jacobian and Hessia...
Definition: localfunctionadapter.hh:630
LocalFunctionAdapter wrapped a class with a local evaluate method into a grid function.
Definition: localfunctionadapter.hh:136
DiscreteFunctionType & operator/=(const RangeFieldType &scalar)
devide all DoFs by a scalar factor
Definition: localfunctionadapter.hh:380
~LocalFunctionAdapterLocalFunction()
destructor
Definition: localfunctionadapter.hh:502
LocalFunctionAdapter(const std::string &name, LocalFunctionImplType &localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
Definition: localfunctionadapter.hh:211
void init(const EntityType &entity)
initialize entity
Definition: localfunctionadapter.hh:722
AnalyticalFunctionType & function()
get local function
Definition: localfunctionadapter.hh:665
Traits::LocalFunctionType LocalFunctionType
type of local function to export
Definition: localfunctionadapter.hh:176
Traits::RangeFieldType RangeFieldType
range type
Definition: localfunctionadapter.hh:461
void jacobian(const PointType &x, JacobianRangeType &ret) const
jacobian of local function
Definition: localfunctionadapter.hh:523
Traits::GridType GridType
type of grid
Definition: localfunctionadapter.hh:161
LocalFunctionType localFunction(const EntityType &entity)
obtain a local function for an entity (read-write)
Definition: localfunctionadapter.hh:316
void jacobian(const PointType &x, JacobianRangeType &ret) const
evaluate jacobian local function
Definition: localfunctionadapter.hh:709
Traits::RangeType RangeType
range type
Definition: localfunctionadapter.hh:465
void hessian(const PointType &x, HessianRangeType &ret) const
evaluate hessian local function
Definition: localfunctionadapter.hh:716
Traits::HessianRangeType HessianRangeType
hessian type
Definition: localfunctionadapter.hh:469
LocalFunctionAdapter(const std::string &name, const LocalFunctionImplType &localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
constructor taking a const reference instance of the local function class
Definition: localfunctionadapter.hh:224
AnalyticalJacobianType & jacobian()
get jacobian local function
Definition: localfunctionadapter.hh:677
Traits::DomainFieldType DomainFieldType
domain type
Definition: localfunctionadapter.hh:163
DiscreteFunctionType & operator+=(const DFType &g)
Definition: localfunctionadapter.hh:345
LocalFunctionAdapterLocalFunction(const ThisType &other)
copy constructor
Definition: localfunctionadapter.hh:494
Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of discrete function space
Definition: localfunctionadapter.hh:158
Traits::DomainType DomainType
domain type
Definition: localfunctionadapter.hh:463
void init(const EntityType &entity)
init local function
Definition: localfunctionadapter.hh:552
LocalFunctionAdapterLocalFunction(const DiscreteFunctionType &adapter)
constructor
Definition: localfunctionadapter.hh:486
double time() const
get time
Definition: localfunctionadapter.hh:742
void registerLocalFunction(LocalFunctionType *lf) const
add LocalFunction to list of local functions
Definition: localfunctionadapter.hh:402
const std::string & name() const
obtain the name of the discrete function
Definition: localfunctionadapter.hh:328
DiscreteFunctionType & operator-=(const DFType &g)
substract all degrees of freedom from given discrete function using the dof iterators
Definition: localfunctionadapter.hh:356
const EntityType & entity() const
get entity
Definition: localfunctionadapter.hh:559
Traits::DomainFieldType DomainFieldType
domain type
Definition: localfunctionadapter.hh:459
void evaluate(const PointType &x, RangeType &ret) const
evaluate local function
Definition: localfunctionadapter.hh:516
LocalFunctionImpl LocalFunctionImplType
type of local function implementation
Definition: localfunctionadapter.hh:451
LocalFunctionAdapter(const std::string &name, LocalFunctionImplType &&localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
constructor taking a r-value reference instance of the local function class
Definition: localfunctionadapter.hh:237
LocalFunctionImpl LocalFunctionImplType
Evaluate class.
Definition: localfunctionadapter.hh:146
Traits::DomainType DomainType
domain type
Definition: localfunctionadapter.hh:167
void initialize(Arg &&, double time)
initialize time
Definition: localfunctionadapter.hh:729
unsigned int order() const
return the order of the space
Definition: localfunctionadapter.hh:286
void evaluate(const PointType &x, RangeType &ret) const
evaluate local function
Definition: localfunctionadapter.hh:702
LocalFunctionAdapterLocalFunction(const EntityType &entity, const DiscreteFunctionType &adapter)
constructor initializing local function
Definition: localfunctionadapter.hh:477
Traits::RangeType RangeType
range type
Definition: localfunctionadapter.hh:169
Traits::JacobianRangeType JacobianRangeType
jacobian type
Definition: localfunctionadapter.hh:467
unsigned int order() const
return order of the space
Definition: localfunctionadapter.hh:509
Traits::EntityType EntityType
type of codim 0 entity
Definition: localfunctionadapter.hh:173
LocalFunctionAdapter(const std::string &name, const GridPartType &gridPart, const std::tuple< Args &... > &args, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
Definition: localfunctionadapter.hh:268
LocalFunctionAdapterTraits< LocalFunctionImplType > Traits
traits class
Definition: localfunctionadapter.hh:152
GridPartType::template Codim< 0 >::IteratorType IteratorType
type of iterator
Definition: localfunctionadapter.hh:71
AnalyticalHessianType & hessian()
get hessian local function
Definition: localfunctionadapter.hh:689
const EntityType & entity() const
get entity
Definition: localfunctionadapter.hh:735
void deleteLocalFunction(LocalFunctionType *lf) const
remove LocalFunction to list of local functions
Definition: localfunctionadapter.hh:413
const AnalyticalJacobianType & jacobian() const
get jacobian local function
Definition: localfunctionadapter.hh:683
LocalFunctionAdapter(const std::string &name, const GridPartType &gridPart, unsigned int order, Args &... args)
Definition: localfunctionadapter.hh:252
Traits::GridPartType GridPartType
type of grid part
Definition: localfunctionadapter.hh:155
LocalFunctionAdapterTraits< LocalFunctionImplType > Traits
type of the traits class
Definition: localfunctionadapter.hh:454
LocalAnalyticalFunctionBinder(const AnalyticalFunctionType &f=[](const auto &, auto, const auto &){return RangeType(0.0);}, const AnalyticalJacobianType &j=[](const auto &, auto, const auto &){return JacobianRangeType(0.0);}, const AnalyticalHessianType &h=[](const auto &, auto, const auto &){return HessianRangeType(0.0);}, double t=0.0)
constructor
Definition: localfunctionadapter.hh:652
Traits::JacobianRangeType JacobianRangeType
jacobian type
Definition: localfunctionadapter.hh:171
GridPartType::IndexSetType IndexSetType
type of IndexSet
Definition: localfunctionadapter.hh:73
const LocalFunctionType localFunction(const EntityType &entity) const
obtain a local function for an entity (read-write)
Definition: localfunctionadapter.hh:322
const AnalyticalHessianType & hessian() const
get hessian local function
Definition: localfunctionadapter.hh:695
bool continuous() const
return true, probably
Definition: localfunctionadapter.hh:292
DiscreteFunctionType & operator*=(const RangeFieldType &scalar)
multiply all DoFs with a scalar factor
Definition: localfunctionadapter.hh:368
const LocalFuncStorageType & localFunctionImpl() const
return local function implementation
Definition: localfunctionadapter.hh:298
const AnalyticalFunctionType & function() const
get local function
Definition: localfunctionadapter.hh:671
BaseType::FunctionType FunctionType
type of function
Definition: localfunctionadapter.hh:149
Traits::RangeFieldType RangeFieldType
range type
Definition: localfunctionadapter.hh:165
void evaluate(const DomainType &global, RangeType &result) const
evaluate function on local coordinate local
Definition: localfunctionadapter.hh:310
void initialize(const ArgumentType &arg, double time)
initialize local function with argument and time
Definition: localfunctionadapter.hh:388
LocalFuncStorageType & localFunctionImpl()
return local function implementation
Definition: localfunctionadapter.hh:304
decltype(auto) ifElse(const Condition &condition, IfFunc &&ifFunc, ElseFunc &&elseFunc)
A conditional expression.
Definition: hybridutilities.hh:344
constexpr auto get(std::integer_sequence< T, II... >, std::integral_constant< std::size_t, pos >={})
Return the entry at position pos of the given sequence.
Definition: integersequence.hh:22
STL namespace.
traits of DiscreteFunctionAdapter
Definition: localfunctionadapter.hh:40
