DUNE-FEM (unstable)
localfunctionadapter.hh
58 // store the local function object by value if it can be copy constructed - otherwise store a reference
59 static constexpr bool localFunctionHasCopyConstructor = std::is_copy_constructible<LocalFunctionImpl>::value;
60 typedef typename LocalFuncType< LocalFunctionImpl, localFunctionHasCopyConstructor >::Type LocalFuncStorageType;
76 typedef DiscreteFunctionSpaceAdapter< FunctionSpaceType, GridPartType > DiscreteFunctionSpaceType;
135 : public Function< typename LocalFunctionImpl::FunctionSpaceType, LocalFunctionAdapter< LocalFunctionImpl > >,
396 Hybrid::ifElse( hasCopyConstructor, [ & ]( auto&& ){ argInitializer_->initialize( localFunctionPtr ); } );
479 LocalFunctionAdapterLocalFunction ( const EntityType &entity, const DiscreteFunctionType &adapter )
540 static_assert( sizeof...( Vectors ) > 0, "evaluateQuadrature needs to be called with at least one vector." );
548 static_assert( sizeof...( Vectors ) > 0, "evaluateQuadrature needs to be called with at least one vector." );
588 -> std::enable_if_t< std::is_same< std::decay_t< decltype(result[ 0 ] ) >, JacobianRangeType >::value >
655 typedef std::function<RangeType(const DomainType&,double,const EntityType&)> AnalyticalFunctionType;
656 typedef std::function<JacobianRangeType(const DomainType&,double,const EntityType&)> AnalyticalJacobianType;
657 typedef std::function<HessianRangeType(const DomainType&,double,const EntityType&)> AnalyticalHessianType;
660 LocalAnalyticalFunctionBinder(const AnalyticalFunctionType& f=[](const auto& ,auto ,const auto& ){return RangeType(0.0);},
661 const AnalyticalJacobianType& j=[](const auto& ,auto ,const auto& ){return JacobianRangeType(0.0);},
662 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
implementation of entity and geometry storage for basis function set and local functions
Definition: entitygeometry.hh:35
const Entity & entity() const
return entity
Definition: entitygeometry.hh:101
const Geometry & geometry() const
return geometry
Definition: entitygeometry.hh:111
void unbind()
release entity and geometry object
Definition: entitygeometry.hh:164
void bind(const EntityType &entity)
set new entity object and geometry if enabled
Definition: entitygeometry.hh:135
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:637
LocalFunctionAdapter wrapped a class with a local evaluate method into a grid function.
Definition: localfunctionadapter.hh:137
DiscreteFunctionType & operator/=(const RangeFieldType &scalar)
devide all DoFs by a scalar factor
Definition: localfunctionadapter.hh:381
~LocalFunctionAdapterLocalFunction()
destructor
Definition: localfunctionadapter.hh:504
LocalFunctionAdapter(const std::string &name, LocalFunctionImplType &localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
Definition: localfunctionadapter.hh:212
void init(const EntityType &entity)
initialize entity
Definition: localfunctionadapter.hh:735
AnalyticalFunctionType & function()
get local function
Definition: localfunctionadapter.hh:678
Traits::LocalFunctionType LocalFunctionType
type of local function to export
Definition: localfunctionadapter.hh:177
Traits::RangeFieldType RangeFieldType
range type
Definition: localfunctionadapter.hh:462
void jacobian(const PointType &x, JacobianRangeType &ret) const
jacobian of local function
Definition: localfunctionadapter.hh:525
Traits::GridType GridType
type of grid
Definition: localfunctionadapter.hh:162
LocalFunctionType localFunction(const EntityType &entity)
obtain a local function for an entity (read-write)
Definition: localfunctionadapter.hh:317
void jacobian(const PointType &x, JacobianRangeType &ret) const
evaluate jacobian local function
Definition: localfunctionadapter.hh:722
Traits::RangeType RangeType
range type
Definition: localfunctionadapter.hh:466
void hessian(const PointType &x, HessianRangeType &ret) const
evaluate hessian local function
Definition: localfunctionadapter.hh:729
Traits::HessianRangeType HessianRangeType
hessian type
Definition: localfunctionadapter.hh:470
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:225
AnalyticalJacobianType & jacobian()
get jacobian local function
Definition: localfunctionadapter.hh:690
Traits::DomainFieldType DomainFieldType
domain type
Definition: localfunctionadapter.hh:164
DiscreteFunctionType & operator+=(const DFType &g)
Definition: localfunctionadapter.hh:346
LocalFunctionAdapterLocalFunction(const ThisType &other)
copy constructor
Definition: localfunctionadapter.hh:496
Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of discrete function space
Definition: localfunctionadapter.hh:159
Traits::DomainType DomainType
domain type
Definition: localfunctionadapter.hh:464
void init(const EntityType &entity)
init local function
Definition: localfunctionadapter.hh:554
LocalFunctionAdapterLocalFunction(const DiscreteFunctionType &adapter)
constructor
Definition: localfunctionadapter.hh:488
double time() const
get time
Definition: localfunctionadapter.hh:748
void registerLocalFunction(LocalFunctionType *lf) const
add LocalFunction to list of local functions
Definition: localfunctionadapter.hh:403
const std::string & name() const
obtain the name of the discrete function
Definition: localfunctionadapter.hh:329
DiscreteFunctionType & operator-=(const DFType &g)
substract all degrees of freedom from given discrete function using the dof iterators
Definition: localfunctionadapter.hh:357
const EntityType & entity() const
get entity
Definition: localfunctionadapter.hh:560
Traits::DomainFieldType DomainFieldType
domain type
Definition: localfunctionadapter.hh:460
void evaluate(const PointType &x, RangeType &ret) const
evaluate local function
Definition: localfunctionadapter.hh:518
LocalFunctionImpl LocalFunctionImplType
type of local function implementation
Definition: localfunctionadapter.hh:452
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:238
LocalFunctionImpl LocalFunctionImplType
Evaluate class.
Definition: localfunctionadapter.hh:147
Traits::DomainType DomainType
domain type
Definition: localfunctionadapter.hh:168
void initialize(Arg &&, double time)
initialize time
Definition: localfunctionadapter.hh:742
unsigned int order() const
return the order of the space
Definition: localfunctionadapter.hh:287
void evaluate(const PointType &x, RangeType &ret) const
evaluate local function
Definition: localfunctionadapter.hh:715
LocalFunctionAdapterLocalFunction(const EntityType &entity, const DiscreteFunctionType &adapter)
constructor initializing local function
Definition: localfunctionadapter.hh:479
Traits::RangeType RangeType
range type
Definition: localfunctionadapter.hh:170
Traits::JacobianRangeType JacobianRangeType
jacobian type
Definition: localfunctionadapter.hh:468
unsigned int order() const
return order of the space
Definition: localfunctionadapter.hh:511
Traits::EntityType EntityType
type of codim 0 entity
Definition: localfunctionadapter.hh:174
LocalFunctionAdapter(const std::string &name, const GridPartType &gridPart, const std::tuple< Args &... > &args, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
Definition: localfunctionadapter.hh:269
LocalFunctionAdapterTraits< LocalFunctionImplType > Traits
traits class
Definition: localfunctionadapter.hh:153
GridPartType::template Codim< 0 >::IteratorType IteratorType
type of iterator
Definition: localfunctionadapter.hh:72
AnalyticalHessianType & hessian()
get hessian local function
Definition: localfunctionadapter.hh:702
void deleteLocalFunction(LocalFunctionType *lf) const
remove LocalFunction to list of local functions
Definition: localfunctionadapter.hh:414
const AnalyticalJacobianType & jacobian() const
get jacobian local function
Definition: localfunctionadapter.hh:696
LocalFunctionAdapter(const std::string &name, const GridPartType &gridPart, unsigned int order, Args &... args)
Definition: localfunctionadapter.hh:253
Traits::GridPartType GridPartType
type of grid part
Definition: localfunctionadapter.hh:156
LocalFunctionAdapterTraits< LocalFunctionImplType > Traits
type of the traits class
Definition: localfunctionadapter.hh:455
const Geometry & geometry() const
get entity
Definition: localfunctionadapter.hh:566
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:660
Traits::JacobianRangeType JacobianRangeType
jacobian type
Definition: localfunctionadapter.hh:172
GridPartType::IndexSetType IndexSetType
type of IndexSet
Definition: localfunctionadapter.hh:74
const LocalFunctionType localFunction(const EntityType &entity) const
obtain a local function for an entity (read-write)
Definition: localfunctionadapter.hh:323
const AnalyticalHessianType & hessian() const
get hessian local function
Definition: localfunctionadapter.hh:708
bool continuous() const
return true, probably
Definition: localfunctionadapter.hh:293
DiscreteFunctionType & operator*=(const RangeFieldType &scalar)
multiply all DoFs with a scalar factor
Definition: localfunctionadapter.hh:369
const LocalFuncStorageType & localFunctionImpl() const
return local function implementation
Definition: localfunctionadapter.hh:299
const AnalyticalFunctionType & function() const
get local function
Definition: localfunctionadapter.hh:684
BaseType::FunctionType FunctionType
type of function
Definition: localfunctionadapter.hh:150
Traits::RangeFieldType RangeFieldType
range type
Definition: localfunctionadapter.hh:166
void evaluate(const DomainType &global, RangeType &result) const
evaluate function on local coordinate local
Definition: localfunctionadapter.hh:311
void initialize(const ArgumentType &arg, double time)
initialize local function with argument and time
Definition: localfunctionadapter.hh:389
LocalFuncStorageType & localFunctionImpl()
return local function implementation
Definition: localfunctionadapter.hh:305
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:41
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Nov 13, 23:29, 2024)