1 #ifndef DUNE_FEM_FUNCTION_LOCALFUNCTION_CONST_HH 2 #define DUNE_FEM_FUNCTION_LOCALFUNCTION_CONST_HH 7 #include <dune/common/dynvector.hh> 21 struct DiscreteFunctionTraits;
30 template<
class DiscreteFunction >
34 template <
class BasisFunctionSet,
class LocalDofVector >
65 : BaseType( basisFunctionSet, localDofVector )
79 using BaseType::operator[];
85 return static_cast< BaseType &
>( *this )[ num ];
90 using BaseType::operator +=;
91 using BaseType::operator -=;
112 template<
class DiscreteFunction >
115 typename DiscreteFunctionTraits<
116 typename std::remove_const< DiscreteFunction > :: type >::DiscreteFunctionSpaceType::BasisFunctionSetType,
117 Dune::DynamicVector< typename DiscreteFunctionTraits< typename std::remove_const< DiscreteFunction > :: type >::DofType,
118 typename DiscreteFunctionTraits< typename std::remove_const< DiscreteFunction > :: type >::LocalDofVectorAllocatorType
119 :: template rebind< typename DiscreteFunctionTraits< typename std::remove_const< DiscreteFunction >::type > ::DofType > ::other > >
123 Dune::DynamicVector< typename DiscreteFunctionTraits< typename std::remove_const< DiscreteFunction > :: type >
::DofType,
125 :: template rebind< typename DiscreteFunctionTraits< typename std::remove_const< DiscreteFunction >::type >::DofType >::other > >
151 : BaseType( LocalDofVectorType( df.localDofVectorAllocator() ) ),
152 discreteFunction_( &df )
158 : BaseType( localFunction.
basisFunctionSet(), LocalDofVectorType( localFunction.
size(), localFunction.discreteFunction().localDofVectorAllocator() ) ),
159 discreteFunction_( &localFunction.discreteFunction() )
161 std::copy( localFunction.localDofVector().begin(), localFunction.localDofVector().end(),
localDofVector().begin() );
178 : BaseType( df.space().
basisFunctionSet( entity ), LocalDofVectorType( df.localDofVectorAllocator() ) ),
179 discreteFunction_( &df )
186 : BaseType( static_cast<const BaseType &>( other ) ),
187 discreteFunction_( other.discreteFunction_ )
192 : BaseType( static_cast< BaseType &&>( other ) ),
193 discreteFunction_( other.discreteFunction_ )
215 #endif // #ifndef DUNE_FEM_FUNCTION_LOCALFUNCTION_CONST_HH ConstLocalFunction(const DiscreteFunctionType &df, const EntityType &entity)
constructor creating a local function and binding it to an entity
Definition: const.hh:177
ConstLocalFunction(const ThisType &other)
copy constructor
Definition: const.hh:185
BasicConstLocalFunction(const BasisFunctionSetType &basisFunctionSet, LocalDofVectorType &&localDofVector)
Definition: const.hh:70
LocalDofVectorType::value_type DofType
type of DoF use with the discrete function
Definition: localfunction.hh:53
BaseType::LocalDofVectorType LocalDofVectorType
Definition: const.hh:135
const DiscreteFunctionType * discreteFunction_
Definition: const.hh:208
BasicConstLocalFunction(const LocalDofVectorType &localDofVector)
Definition: const.hh:62
Traits class for a DiscreteFunction.
Definition: discretefunction.hh:60
BaseType::EntityType EntityType
type of Entity
Definition: const.hh:46
ConstLocalFunction(ThisType &&other)
move constructor
Definition: const.hh:191
BasicConstLocalFunction()
default ctor
Definition: const.hh:58
BaseType::EntityType EntityType
Definition: const.hh:133
BaseType::SizeType SizeType
type of SizeType
Definition: const.hh:55
ConstLocalFunction(const typename DiscreteFunctionType::LocalFunctionType &localFunction)
cast a MutableLocalFunction into this one !!! expensive !!!
Definition: const.hh:157
const BasisFunctionSetType & basisFunctionSet() const
obtain the basis function set for this local function
Definition: localfunction.hh:279
interface for local functions
Definition: localfunction.hh:41
BasisFunctionSetType::EntityType EntityType
type of the entity, the local function lives on is given by the space
Definition: localfunction.hh:59
ConstLocalFunction(const DiscreteFunctionType &df)
constructor creating a local function without binding it to an entity
Definition: const.hh:150
BaseType::LocalDofVectorType LocalDofVectorType
type of LocalDofVector
Definition: const.hh:52
BaseType::DofType DofType
type of Dof
Definition: const.hh:43
LocalDofVectorType::size_type SizeType
type of index
Definition: localfunction.hh:56
BasicConstLocalFunction(const BasisFunctionSetType &basisFunctionSet)
Definition: const.hh:60
Definition: coordinate.hh:4
DofType & operator[](SizeType num)
Definition: const.hh:83
BaseType::BasisFunctionSetType BasisFunctionSetType
type of BasisFunctionSet
Definition: const.hh:49
void clear()
set all DoFs to zero
Definition: localfunction.hh:170
const EntityType & entity() const
obtain the entity, this local function lives on
Definition: localfunction.hh:285
BaseType::DofType DofType
Definition: const.hh:132
BasicConstLocalFunction(ThisType &&other)
Definition: const.hh:77
BasicConstLocalFunction(const BasisFunctionSetType &basisFunctionSet, const LocalDofVectorType &localDofVector)
Definition: const.hh:64
void init(const EntityType &entity)
interface for local functions :: init
Definition: const.hh:199
std::remove_const< DiscreteFunction >::type DiscreteFunctionType
Definition: const.hh:129
Dune::DynamicVector< DiscreteFunctionTraits< std::remove_const< DiscreteFunction >::type >::DofType, DiscreteFunctionTraits< std::remove_const< DiscreteFunction >::type >::LocalDofVectorAllocatorType::template rebind< DiscreteFunctionTraits< std::remove_const< DiscreteFunction >::type >::DofType >::other > LocalDofVectorType
type of local Dof Vector
Definition: localfunction.hh:50
A constant local function carrying values for one entity.
Definition: const.hh:31
void init(const BasisFunctionSetType &basisFunctionSet)
Definition: localfunction.hh:288
BasicConstLocalFunction(const BaseType &other)
Definition: const.hh:74
const DiscreteFunctionType & discreteFunction() const
Definition: const.hh:205
void assign(const LocalFunction< BasisFunctionSet, T > &other)
assign all DoFs of this local function
Definition: localfunction.hh:164
BasicConstLocalFunction(LocalDofVectorType &&localDofVector)
Definition: const.hh:68
BasicConstLocalFunction(const ThisType &other)
Definition: const.hh:76
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: const.hh:130
SizeType size() const
Definition: localfunction.hh:342
DiscreteFunctionTraits< std::remove_const< DiscreteFunction >::type >::DiscreteFunctionSpaceType::BasisFunctionSetType BasisFunctionSetType
type of basis function set
Definition: localfunction.hh:47
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: const.hh:134
Definition: basisfunctionset/basisfunctionset.hh:31
ThisType & axpy(const RangeFieldType s, const LocalFunction< BasisFunctionSet, T > &other)
add a multiple of another local function to this one
Definition: localfunction.hh:202
const LocalDofVectorType & localDofVector() const
return const reference to local Dof Vector
Definition: localfunction.hh:386