dune-fem  2.4.1-rc
Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Related Functions | List of all members
Dune::Fem::DiscreteFunctionDefault< Impl > Class Template Reference

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/function/common/discretefunction.hh>

Inheritance diagram for Dune::Fem::DiscreteFunctionDefault< Impl >:
Inheritance graph

Classes

struct  CommDataHandle
 

Public Types

enum  { blockSize = BaseType::blockSize }
 size of the dof blocks More...
 
typedef BaseType::Traits Traits
 
typedef Impl DiscreteFunctionType
 type of the discrete function (Barton-Nackman parameter) More...
 
typedef BaseType::DiscreteFunctionInterfaceType DiscreteFunctionInterfaceType
 
typedef BaseType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
 type of discrete function space More...
 
typedef BaseType::GridPartType GridPartType
 type of the underlying grid part More...
 
typedef DiscreteFunctionSpaceType::DomainType DomainType
 type of domain vector More...
 
typedef DiscreteFunctionSpaceType::RangeType RangeType
 type of range vector More...
 
typedef DiscreteFunctionSpaceType::JacobianRangeType JacobianRangeType
 type of jacobian More...
 
typedef DiscreteFunctionSpaceType::HessianRangeType HessianRangeType
 type of hessian More...
 
typedef DiscreteFunctionSpaceType::DomainFieldType DomainFieldType
 type of domain field (usually a float type) More...
 
typedef DiscreteFunctionSpaceType::RangeFieldType RangeFieldType
 type of range field (usually a float type) More...
 
typedef Traits::DofIteratorType DofIteratorType
 type of the dof iterator More...
 
typedef Traits::ConstDofIteratorType ConstDofIteratorType
 type of the const dof iterator More...
 
typedef Traits::DofVectorType DofVectorType
 type of DofVector More...
 
typedef Traits::LocalDofVectorType LocalDofVectorType
 type of LocalDofVector More...
 
typedef Traits::LocalDofVectorAllocatorType LocalDofVectorAllocatorType
 type of LocalDofVector More...
 
typedef BaseType::LocalFunctionType LocalFunctionType
 type of local functions More...
 
typedef BaseType::DofBlockType DofBlockType
 
typedef BaseType::ConstDofBlockType ConstDofBlockType
 
typedef BaseType::DofBlockPtrType DofBlockPtrType
 
typedef BaseType::ConstDofBlockPtrType ConstDofBlockPtrType
 
typedef BaseType::EntityType EntityType
 
typedef BaseType::DofType DofType
 
typedef DofVectorType::SizeType SizeType
 size type of the block vector More...
 
enum  { blockSize = DiscreteFunctionSpaceType::localBlockSize }
 size of the dof blocks More...
 
typedef DiscreteFunctionSpaceType::GridType GridType
 Type of the underlying grid. More...
 
typedef BaseType::MappingType MappingType
 type of mapping base class for this discrete function More...
 
typedef LoadBalanceLeafData< ThisTypeDefaultLoadBalanceContainsCheckType
 
typedef DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType
 type of function space this function belongs to More...
 
typedef Impl FunctionType
 type of the implementation (Barton-Nackman) More...
 

Public Member Functions

const std::string & name () const
 obtain the name of the discrete function More...
 
const DiscreteFunctionSpaceTypespace () const
 obtain a reference to the corresponding DiscreteFunctionSpace More...
 
const GridPartTypegridPart () const
 obtain a reference to the underlying grid part More...
 
LocalFunctionType localFunction (const EntityType &entity)
 obtain a local function for an entity (read-write) More...
 
const LocalFunctionType localFunction (const EntityType &entity) const
 obtain a local function for an entity (read-write) More...
 
void clear ()
 set all degrees of freedom to zero More...
 
DofVectorTypedofVector ()
 
const DofVectorTypedofVector () const
 
int blocks () const
 obtain total number of blocks, i.e. size / blockSize. More...
 
DofBlockPtrType block (unsigned int index)
 obtain pointer to block of discrete function with block number index (read-only) More...
 
ConstDofBlockPtrType block (unsigned int index) const
 obtain pointer to block of discrete function with block number index More...
 
SizeType size () const
 Return the number of blocks in the block vector. More...
 
ConstDofIteratorType dbegin () const
 Obtain the constant iterator pointing to the first dof. More...
 
DofIteratorType dbegin ()
 Obtain the non-constant iterator pointing to the first dof. More...
 
ConstDofIteratorType dend () const
 Obtain the constant iterator pointing to the last dof. More...
 
DofIteratorType dend ()
 Obtain the non-constant iterator pointing to the last dof. More...
 
RangeFieldTypeallocDofPointer () const
 allocate a pointer to a consecutive array storing the DoFs More...
 
void freeDofPointer (RangeFieldType *dofPointer)
 allocate a pointer to a consecutive array storing the DoFs More...
 
void freeDofPointerNoCopy (const RangeFieldType *dofPointer) const
 allocate a pointer to a consecutive array storing the DoFs More...
 
template<class DFType >
void axpy (const RangeFieldType &s, const DiscreteFunctionInterface< DFType > &g)
 axpy operation More...
 
void axpy (const RangeFieldType &s, const DiscreteFunctionInterfaceType &g)
 axpy operation More...
 
template<class DFType >
RangeFieldType scalarProductDofs (const DiscreteFunctionInterface< DFType > &other) const
 Scalar product between the DoFs of two discrete functions. More...
 
Dune::FieldTraits< RangeFieldType >::real_type normSquaredDofs () const
 Squared small l^2 norm of all dofs. More...
 
void print (std::ostream &out) const
 print all DoFs to a stream (for debugging purposes) More...
 
bool dofsValid () const
 check for NaNs More...
 
template<class DFType >
void assign (const DiscreteFunctionInterface< DFType > &g)
 
void assign (const DiscreteFunctionType &g)
 
template<class Operation >
CommDataHandle< Operation >::Type dataHandle (const Operation *operation)
 return reference to data handle object More...
 
void communicate ()
 do default communication of space for this discrete function More...
 
void evaluate (const DomainType &x, RangeType &value) const
 evaluate the function More...
 
void jacobian (const DomainType &x, JacobianRangeType &jacobian) const
 evaluate the Jacobian of the function More...
 
void hessian (const DomainType &x, HessianRangeType &hessian) const
 evaluate the hessian of the function (const DomainType &x,HessianRangeType &hessian) const More...
 
template<class DFType >
DiscreteFunctionTypeoperator+= (const DiscreteFunctionInterface< DFType > &g)
 add another discrete function to this one More...
 
DiscreteFunctionTypeoperator+= (const DiscreteFunctionType &g)
 add another discrete function to this one More...
 
template<class DFType >
DiscreteFunctionTypeoperator-= (const DiscreteFunctionInterface< DFType > &g)
 substract all degrees of freedom from given discrete function using the dof iterators More...
 
DiscreteFunctionTypeoperator-= (const DiscreteFunctionType &g)
 substract all degrees of freedom from given discrete function using the dof iterators More...
 
DiscreteFunctionTypeoperator*= (const RangeFieldType &scalar)
 multiply all DoFs with a scalar factor More...
 
DiscreteFunctionTypeoperator/= (const RangeFieldType &scalar)
 devide all DoFs by a scalar factor More...
 
template<class StreamTraits >
void read (InStreamInterface< StreamTraits > &in)
 read the discrete function from a stream More...
 
template<class StreamTraits >
void write (OutStreamInterface< StreamTraits > &out) const
 write the discrete function into a stream More...
 
void enableDofCompression ()
 Enable this discrete function for dof compression, i.e. during grdi changes a dof compression is done when the DofManagers compress is called. More...
 
template<class DFType >
bool operator== (const DiscreteFunctionInterface< DFType > &g) const
 
template<class DFType >
bool operator!= (const DiscreteFunctionInterface< DFType > &g) const
 
LocalDofVectorAllocatorTypelocalDofVectorAllocator () const
 obtain the local function storage More...
 
template<class LocalDofs >
void addScaledLocalDofs (const EntityType &entity, const RangeFieldType &s, const LocalDofs &localDofs)
 add scaled local Dofs to dof vector More...
 
template<class LocalDofs >
void addLocalDofs (const EntityType &entity, const LocalDofs &localDofs)
 add local Dofs to dof vector More...
 
template<class LocalDofs >
void setLocalDofs (const EntityType &entity, const LocalDofs &localDofs)
 set local Dofs to dof vector More...
 
void getLocalDofs (const EntityType &entity, LocalDofVectorType &localDofs)
 get local Dofs and store a reference to it in the LocalDofVector More...
 
template<class A >
void getLocalDofs (const EntityType &entity, Dune::DynamicVector< DofType, A > &localDofs) const
 get local Dofs and store the values in LocalDofVector More...
 
template<class Operation >
DiscreteFunctionDefault< Impl >::template CommDataHandle< Operation >::Type dataHandle (const Operation *operation)
 
DefaultLoadBalanceContainsCheckType defaultLoadBalanceContainsCheck () const
 
virtual void operator() (const DomainType &arg, RangeType &dest) const
 application operator call evaluate More...
 
void operator() (const DomainType &arg, RangeType &dest) const
 Application operator that applies all operators in the linear combination stack. More...
 
void evaluate (const DomainType &x, RangeType &value) const
 evaluate the function More...
 
void jacobian (const DomainType &x, JacobianRangeType &jacobian) const
 evaluate the Jacobian of the function More...
 
void hessian (const DomainType &x, HessianRangeType &hessian) const
 evaluate the hessian of the function More...
 

Protected Member Functions

 DiscreteFunctionDefault (const std::string &name, const DiscreteFunctionSpaceType &dfSpace)
 Constructor storing discrete function space and local function factory. More...
 
virtual void backup () const
 
virtual void restore ()
 
virtual void insertSubData ()
 
virtual void removeSubData ()
 
template<class Functor >
void evaluateGlobal (const DomainType &x, Functor functor) const
 evaluate functor in global coordinate More...
 
const Impl & asImp () const
 
Impl & asImp ()
 
virtual void * pointer ()
 

Static Protected Member Functions

static const Impl & asImp (const ThisType &other)
 
static Impl & asImp (ThisType &other)
 

Protected Attributes

const DiscreteFunctionSpaceTypedfSpace_
 
Traits::LocalDofVectorStackType ldvStack_
 
LocalDofVectorAllocatorType ldvAllocator_
 
DebugLock dofPointerLock_
 
std::string name_
 
ScalarProductType scalarProduct_
 

Related Functions

(Note that these are not member functions.)

template<class Impl >
std::ostream & operator<< (std::ostream &out, const DiscreteFunctionInterface< Impl > &df)
 write a discrete function into an STL stream More...
 

Detailed Description

template<class Impl>
class Dune::Fem::DiscreteFunctionDefault< Impl >

Default implementation of the discrete function. This class is responsible for the dof storage. Different implementations of the discrete function use different dof storage. The default implementation provides +=, -= and so on operators and a DofIterator access, which can run over all dofs in an efficient way. Furthermore with an entity you can access a local function to evaluate the discrete function by multiplying the dofs and the basefunctions.

Member Typedef Documentation

type of the const dof iterator

template<class Impl>
typedef BaseType::DiscreteFunctionInterfaceType Dune::Fem::DiscreteFunctionDefault< Impl >::DiscreteFunctionInterfaceType

type of discrete function space

template<class Impl>
typedef Impl Dune::Fem::DiscreteFunctionDefault< Impl >::DiscreteFunctionType

type of the discrete function (Barton-Nackman parameter)

template<class Impl>
typedef BaseType :: DofBlockType Dune::Fem::DiscreteFunctionDefault< Impl >::DofBlockType

type of the dof iterator

template<class Impl>
typedef BaseType :: DofType Dune::Fem::DiscreteFunctionDefault< Impl >::DofType
template<class Impl>
typedef Traits :: DofVectorType Dune::Fem::DiscreteFunctionDefault< Impl >::DofVectorType

type of DofVector

type of domain field (usually a float type)

type of domain vector

template<class Impl>
typedef BaseType :: EntityType Dune::Fem::DiscreteFunctionDefault< Impl >::EntityType
typedef DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType Dune::Fem::Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType , Impl >::FunctionSpaceType
inherited

type of function space this function belongs to

typedef Impl Dune::Fem::Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType , Impl >::FunctionType
inherited

type of the implementation (Barton-Nackman)

template<class Impl>
typedef BaseType::GridPartType Dune::Fem::DiscreteFunctionDefault< Impl >::GridPartType

type of the underlying grid part

template<class Impl>
typedef DiscreteFunctionSpaceType :: GridType Dune::Fem::DiscreteFunctionInterface< Impl >::GridType
inherited

Type of the underlying grid.

type of hessian

type of jacobian

type of LocalDofVector

type of LocalDofVector

type of local functions

template<class Impl>
typedef BaseType :: MappingType Dune::Fem::DiscreteFunctionInterface< Impl >::MappingType
inherited

type of mapping base class for this discrete function

type of range field (usually a float type)

type of range vector

template<class Impl>
typedef DofVectorType::SizeType Dune::Fem::DiscreteFunctionDefault< Impl >::SizeType

size type of the block vector

template<class Impl>
typedef BaseType :: Traits Dune::Fem::DiscreteFunctionDefault< Impl >::Traits

Member Enumeration Documentation

template<class Impl>
anonymous enum
inherited

size of the dof blocks

Enumerator
blockSize 
template<class Impl>
anonymous enum

size of the dof blocks

Enumerator
blockSize 

Constructor & Destructor Documentation

template<class Impl >
Dune::Fem::DiscreteFunctionDefault< Impl >::DiscreteFunctionDefault ( const std::string &  name,
const DiscreteFunctionSpaceType dfSpace 
)
inlineprotected

Constructor storing discrete function space and local function factory.

The discrete function space is passed to the interface class and the local function storage is initialized.

Parameters
[in]namename of the discrete function
[in]dfSpacediscrete function space
[in]lfFactorylocal function factory

Member Function Documentation

template<class Impl>
template<class LocalDofs >
void Dune::Fem::DiscreteFunctionDefault< Impl >::addLocalDofs ( const EntityType entity,
const LocalDofs &  localDofs 
)
inline

add local Dofs to dof vector

template<class Impl>
template<class LocalDofs >
void Dune::Fem::DiscreteFunctionDefault< Impl >::addScaledLocalDofs ( const EntityType entity,
const RangeFieldType s,
const LocalDofs &  localDofs 
)
inline

add scaled local Dofs to dof vector

template<class Impl >
DiscreteFunctionDefault< Impl >::RangeFieldType * Dune::Fem::DiscreteFunctionDefault< Impl >::allocDofPointer ( ) const
inline

allocate a pointer to a consecutive array storing the DoFs

To support external packages, it is often required to have the DoFs in a consecutive array. This function ensures this, making a copy if necessary.

Note
The allocated pointer has to be freed by freeDofPointer.
Only one DoF pointer may be allocated at a time.
Returns
a pointer to a consecutive copy of the DoF vector
Note
The default implementation make a copy of the DoF vector using the DoF iterators.

References Dune::Fem::DiscreteFunctionDefault< Impl >::freeDofPointer().

static const Impl & Dune::Fem::BartonNackmanInterface< Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType, Impl > , Impl >::asImp ( const ThisType other)
inlinestaticprotectedinherited
static Impl & Dune::Fem::BartonNackmanInterface< Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType, Impl > , Impl >::asImp ( ThisType other)
inlinestaticprotectedinherited
const Impl & Dune::Fem::BartonNackmanInterface< Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType, Impl > , Impl >::asImp ( ) const
inlineprotectedinherited
Impl & Dune::Fem::BartonNackmanInterface< Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType, Impl > , Impl >::asImp ( )
inlineprotectedinherited
template<class Impl >
template<class DFType >
void Dune::Fem::DiscreteFunctionDefault< Impl >::assign ( const DiscreteFunctionInterface< DFType > &  g)
inline
template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::assign ( const DiscreteFunctionType g)
inline

template<class Impl >
template<class DFType >
void Dune::Fem::DiscreteFunctionDefault< Impl >::axpy ( const RangeFieldType s,
const DiscreteFunctionInterface< DFType > &  g 
)
inline

axpy operation

Adds s * g to this discrete function.

Parameters
[in]sscalar value to scale g with
[in]gdiscrete function to add

References Dune::Fem::DiscreteFunctionDefault< Impl >::assign(), Dune::Fem::DiscreteFunctionInterface< Impl >::dbegin(), and Dune::Fem::DiscreteFunctionInterface< Impl >::size().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::dofsValid().

template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::axpy ( const RangeFieldType s,
const DiscreteFunctionInterfaceType g 
)
inline

axpy operation

Adds s * g to this discrete function.

Parameters
[in]sscalar value to scale g with
[in]gdiscrete function to add
template<class Impl>
virtual void Dune::Fem::DiscreteFunctionDefault< Impl >::backup ( ) const
inlineprotectedvirtual
template<class Impl>
DofBlockPtrType Dune::Fem::DiscreteFunctionDefault< Impl >::block ( unsigned int  index)
inline

obtain pointer to block of discrete function with block number index (read-only)

Returns
a DoFBlockPtrType pointing to block index (read-only)
template<class Impl>
ConstDofBlockPtrType Dune::Fem::DiscreteFunctionDefault< Impl >::block ( unsigned int  index) const
inline

obtain pointer to block of discrete function with block number index

Returns
a DoFBlockPtrType pointing to block index
template<class Impl>
int Dune::Fem::DiscreteFunctionDefault< Impl >::blocks ( ) const
inline

obtain total number of blocks, i.e. size / blockSize.

The number of blocks of DoFs (degrees of freedom) can also be seen as the size of the discrete function divided by the blockSize.

Returns
total number of DoFs blocks
template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::clear ( )
inline

set all degrees of freedom to zero

template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::communicate ( )
inline

do default communication of space for this discrete function

template<class Impl>
template<class Operation >
DiscreteFunctionDefault< Impl >:: template CommDataHandle< Operation >:: Type Dune::Fem::DiscreteFunctionDefault< Impl >::dataHandle ( const Operation *  operation)
inline
template<class Impl>
template<class Operation >
CommDataHandle< Operation >:: Type Dune::Fem::DiscreteFunctionDefault< Impl >::dataHandle ( const Operation *  operation)

return reference to data handle object

template<class Impl>
ConstDofIteratorType Dune::Fem::DiscreteFunctionDefault< Impl >::dbegin ( ) const
inline

Obtain the constant iterator pointing to the first dof.

Returns
Constant iterator pointing to the first dof

Referenced by Dune::Fem::GenericDiscreteFunctionSpace< Traits >::PAdaptiveDiscreteFunctionEntry< DF, LocalInterpolation >::adaptFunction().

template<class Impl>
DofIteratorType Dune::Fem::DiscreteFunctionDefault< Impl >::dbegin ( )
inline

Obtain the non-constant iterator pointing to the first dof.

Returns
Non-Constant iterator pointing to the first dof
template<class Impl>
DefaultLoadBalanceContainsCheckType Dune::Fem::DiscreteFunctionInterface< Impl >::defaultLoadBalanceContainsCheck ( ) const
inlineinherited
template<class Impl>
ConstDofIteratorType Dune::Fem::DiscreteFunctionDefault< Impl >::dend ( ) const
inline

Obtain the constant iterator pointing to the last dof.

Returns
Constant iterator pointing to the last dof

Referenced by Dune::Fem::GenericDiscreteFunctionSpace< Traits >::PAdaptiveDiscreteFunctionEntry< DF, LocalInterpolation >::adaptFunction().

template<class Impl>
DofIteratorType Dune::Fem::DiscreteFunctionDefault< Impl >::dend ( )
inline

Obtain the non-constant iterator pointing to the last dof.

Returns
Non-Constant iterator pointing to the last dof
template<class Impl >
bool Dune::Fem::DiscreteFunctionDefault< Impl >::dofsValid ( ) const
inline

check for NaNs

Returns
if one of the DoFs is NaN false is returned, otherwise true

References Dune::Fem::DiscreteFunctionDefault< Impl >::axpy().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::print().

template<class Impl>
DofVectorType& Dune::Fem::DiscreteFunctionDefault< Impl >::dofVector ( )
inline
template<class Impl>
const DofVectorType& Dune::Fem::DiscreteFunctionDefault< Impl >::dofVector ( ) const
inline
template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::enableDofCompression ( )
inline

Enable this discrete function for dof compression, i.e. during grdi changes a dof compression is done when the DofManagers compress is called.

Note
The default implementation does nothing.
void Dune::Fem::Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType , Impl >::evaluate ( const DomainType x,
RangeType value 
) const
inlineinherited

evaluate the function

Parameters
[in]xevaluation point
[out]valuevalue of the function in x
template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::evaluate ( const DomainType x,
RangeType value 
) const
inline

evaluate the function

Parameters
[in]xevaluation point
[out]valuevalue of the function in x
template<class Impl >
template<class Functor >
void Dune::Fem::DiscreteFunctionDefault< Impl >::evaluateGlobal ( const DomainType x,
Functor  functor 
) const
inlineprotected
template<class Impl >
void Dune::Fem::DiscreteFunctionDefault< Impl >::freeDofPointer ( RangeFieldType dofPointer)
inline

allocate a pointer to a consecutive array storing the DoFs

This method serves two purposes:

  • The user cannot know, if the DoF array returned by allocDofPointer has to be freed.
  • If the DoF array is just a copy, the DoFs shall be stored back into the discrete function.
Note
The pointer must have been allocated by allocDofPointer.
Only one DoF pointer may be allocated at a time.
Parameters
[in]dofPointerpointer to the dof array previously allocated by allocDofPointer
Note
The default implementation make a copy of the DoF vector using the DoF iterators.

References Dune::Fem::DiscreteFunctionDefault< Impl >::freeDofPointerNoCopy().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::allocDofPointer().

template<class Impl >
void Dune::Fem::DiscreteFunctionDefault< Impl >::freeDofPointerNoCopy ( const RangeFieldType dofPointer) const
inline

allocate a pointer to a consecutive array storing the DoFs

This method serves sincet the user cannot know, if the DoF array returned by allocDofPointer has to be freed.

Note
The pointer must have been allocated by allocDofPointer.
Only one DoF pointer may be allocated at a time.
DoFs are NOT stored back into the discrete function.
Parameters
[in]dofPointerpointer to the dof array previously allocated by allocDofPointer
Note
The default implementation make a copy of the DoF vector using the DoF iterators.

References Dune::Fem::DiscreteFunctionDefault< Impl >::print().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::freeDofPointer().

template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::getLocalDofs ( const EntityType entity,
LocalDofVectorType localDofs 
)
inline

get local Dofs and store a reference to it in the LocalDofVector

template<class Impl>
template<class A >
void Dune::Fem::DiscreteFunctionDefault< Impl >::getLocalDofs ( const EntityType entity,
Dune::DynamicVector< DofType, A > &  localDofs 
) const
inline

get local Dofs and store the values in LocalDofVector

template<class Impl>
const GridPartType& Dune::Fem::DiscreteFunctionDefault< Impl >::gridPart ( ) const
inline

obtain a reference to the underlying grid part

void Dune::Fem::Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType , Impl >::hessian ( const DomainType x,
HessianRangeType hessian 
) const
inlineinherited

evaluate the hessian of the function

Parameters
[in]xevaluation point
[out]hessianvalue of the hessian in x
template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::hessian ( const DomainType x,
HessianRangeType hessian 
) const
inline

evaluate the hessian of the function (const DomainType &x,HessianRangeType &hessian) const

Parameters
[in]xevaluation point
[out]hessianvalue of the hessian in x (const DomainType &x,HessianRangeType &hessian) const
template<class Impl >
void Dune::Fem::DiscreteFunctionDefault< Impl >::insertSubData ( )
protectedvirtual
void Dune::Fem::Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType , Impl >::jacobian ( const DomainType x,
JacobianRangeType jacobian 
) const
inlineinherited

evaluate the Jacobian of the function

Parameters
[in]xevaluation point
[out]jacobianvalue of the Jacobian in x
template<class Impl>
void Dune::Fem::DiscreteFunctionDefault< Impl >::jacobian ( const DomainType x,
JacobianRangeType jacobian 
) const
inline

evaluate the Jacobian of the function

Parameters
[in]xevaluation point
[out]jacobianvalue of the Jacobian in x
template<class Impl>
LocalDofVectorAllocatorType& Dune::Fem::DiscreteFunctionDefault< Impl >::localDofVectorAllocator ( ) const
inline

obtain the local function storage

Returns
a reference to the local function storage
template<class Impl>
LocalFunctionType Dune::Fem::DiscreteFunctionDefault< Impl >::localFunction ( const EntityType entity)
inline

obtain a local function for an entity (read-write)

Parameters
[in]entityEntity to focus view of discrete function
Returns
a local function associated with the entity
template<class Impl>
const LocalFunctionType Dune::Fem::DiscreteFunctionDefault< Impl >::localFunction ( const EntityType entity) const
inline

obtain a local function for an entity (read-write)

Parameters
[in]entityEntity to focus view of discrete function
Returns
a local function associated with the entity
template<class Impl>
const std::string& Dune::Fem::DiscreteFunctionDefault< Impl >::name ( ) const
inline

obtain the name of the discrete function

Returns
string holding name of discrete function
template<class Impl>
Dune::FieldTraits< RangeFieldType >::real_type Dune::Fem::DiscreteFunctionDefault< Impl >::normSquaredDofs ( ) const
inline

Squared small l^2 norm of all dofs.

Note
This is already parallel, so do not sum over all processes after calling scalarProductDofs!
It is assumed that the discrete function has been communicated (i.e., every local DoF hat the value of the corresponding global DoF).
Returns
the squared norm of the DoF-vectors
template<class Impl>
template<class DFType >
bool Dune::Fem::DiscreteFunctionDefault< Impl >::operator!= ( const DiscreteFunctionInterface< DFType > &  g) const
inline
virtual void Dune::Fem::Function< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType , Impl >::operator() ( const DomainType arg,
RangeType dest 
) const
inlinevirtualinherited

application operator call evaluate

Parameters
[in]argargument
[out]destdestination, i.e. f(arg)
void Dune::Fem::Mapping< DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType::DomainFieldType , DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType::RangeFieldType , DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType::DomainType , DiscreteFunctionTraits< Impl >::DiscreteFunctionSpaceType::FunctionSpaceType::RangeType >::operator() ( const DomainType arg,
RangeType dest 
) const
inlineinherited

Application operator that applies all operators in the linear combination stack.

Parameters
[in]argargument
[out]destdestination
template<class Impl >
DiscreteFunctionDefault< Impl >::DiscreteFunctionType & Dune::Fem::DiscreteFunctionDefault< Impl >::operator*= ( const RangeFieldType scalar)
inline

multiply all DoFs with a scalar factor

Parameters
[in]scalarfactor to multiply DoFs with
Returns
reference to this discrete function (i.e. *this)

References Dune::Fem::DiscreteFunctionDefault< Impl >::read().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::operator-=().

template<class Impl >
template<class DFType >
DiscreteFunctionDefault< Impl >::DiscreteFunctionType & Dune::Fem::DiscreteFunctionDefault< Impl >::operator+= ( const DiscreteFunctionInterface< DFType > &  g)
inline

add another discrete function to this one

Parameters
[in]gdiscrete function to add
Returns
a reference to this discrete function (i.e. *this)

References Dune::Fem::DiscreteFunctionInterface< Impl >::dbegin(), Dune::Fem::DiscreteFunctionDefault< Impl >::operator-=(), and Dune::Fem::DiscreteFunctionInterface< Impl >::size().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::evaluateGlobal().

template<class Impl>
DiscreteFunctionType& Dune::Fem::DiscreteFunctionDefault< Impl >::operator+= ( const DiscreteFunctionType g)
inline

add another discrete function to this one

Parameters
[in]gdiscrete function to add
Returns
a reference to this discrete function (i.e. *this)
template<class Impl >
template<class DFType >
DiscreteFunctionDefault< Impl >::DiscreteFunctionType & Dune::Fem::DiscreteFunctionDefault< Impl >::operator-= ( const DiscreteFunctionInterface< DFType > &  g)
inline

substract all degrees of freedom from given discrete function using the dof iterators

Parameters
[in]gdiscrete function which is substracted from this discrete function
Returns
reference to this (i.e. *this)

References Dune::Fem::DiscreteFunctionInterface< Impl >::dbegin(), Dune::Fem::DiscreteFunctionDefault< Impl >::operator*=(), and Dune::Fem::DiscreteFunctionInterface< Impl >::size().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::operator+=().

template<class Impl>
DiscreteFunctionType& Dune::Fem::DiscreteFunctionDefault< Impl >::operator-= ( const DiscreteFunctionType g)
inline

substract all degrees of freedom from given discrete function using the dof iterators

Parameters
[in]gdiscrete function which is substracted from this discrete function
Returns
reference to this (i.e. *this)
template<class Impl>
DiscreteFunctionType& Dune::Fem::DiscreteFunctionDefault< Impl >::operator/= ( const RangeFieldType scalar)
inline

devide all DoFs by a scalar factor

Parameters
[in]scalarfactor with which all dofs are devided
Returns
reference to this discrete function (i.e. *this)
template<class Impl >
template<class DFType >
bool Dune::Fem::DiscreteFunctionDefault< Impl >::operator== ( const DiscreteFunctionInterface< DFType > &  g) const
inline
virtual void* Dune::Fem::PersistentObject::pointer ( )
inlineprotectedvirtualinherited
template<class Impl >
void Dune::Fem::DiscreteFunctionDefault< Impl >::print ( std::ostream &  out) const
inline

print all DoFs to a stream (for debugging purposes)

Parameters
[in]outstream to print to

References Dune::Fem::DiscreteFunctionDefault< Impl >::dofsValid().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::freeDofPointerNoCopy().

template<class Impl >
template<class StreamTraits >
void Dune::Fem::DiscreteFunctionDefault< Impl >::read ( InStreamInterface< StreamTraits > &  in)
inline

read the discrete function from a stream

Parameters
[in]instream to read the discrete function from

References Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt(), Dune::Fem::spaceName(), and Dune::Fem::DiscreteFunctionDefault< Impl >::write().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::operator*=().

template<class Impl >
void Dune::Fem::DiscreteFunctionDefault< Impl >::removeSubData ( )
protectedvirtual
template<class Impl>
virtual void Dune::Fem::DiscreteFunctionDefault< Impl >::restore ( )
inlineprotectedvirtual
template<class Impl>
template<class DFType >
RangeFieldType Dune::Fem::DiscreteFunctionDefault< Impl >::scalarProductDofs ( const DiscreteFunctionInterface< DFType > &  other) const
inline

Scalar product between the DoFs of two discrete functions.

Note
This is a parallel scalar product, so do not sum over all processes after calling scalarProductDofs!
It is assumed that the discrete function has been communicated (i.e., every local DoF hat the value of the corresponding global DoF).
Parameters
[in]otherdiscrete function to evaluate the scalar product with
Returns
the scalar product of the DoF-vectors
template<class Impl>
template<class LocalDofs >
void Dune::Fem::DiscreteFunctionDefault< Impl >::setLocalDofs ( const EntityType entity,
const LocalDofs &  localDofs 
)
inline

set local Dofs to dof vector

template<class Impl>
SizeType Dune::Fem::DiscreteFunctionDefault< Impl >::size ( ) const
inline

Return the number of blocks in the block vector.

Returns
Number of block in the block vector
template<class Impl>
const DiscreteFunctionSpaceType& Dune::Fem::DiscreteFunctionDefault< Impl >::space ( ) const
inline
template<class Impl >
template<class StreamTraits >
void Dune::Fem::DiscreteFunctionDefault< Impl >::write ( OutStreamInterface< StreamTraits > &  out) const
inline

write the discrete function into a stream

Parameters
[in]outstream to write the discrete function to

References Dune::Fem::DiscreteFunctionDefault< Impl >::insertSubData().

Referenced by Dune::Fem::DiscreteFunctionDefault< Impl >::read().

Friends And Related Function Documentation

template<class Impl >
std::ostream & operator<< ( std::ostream &  out,
const DiscreteFunctionInterface< Impl > &  df 
)
related

write a discrete function into an STL stream

Parameters
[in]outSTL stream to write to
[in]dfdiscrete function to write
Returns
the STL stream (for concatenation)

References Dune::Fem::DiscreteFunctionInterface< Impl >::print().

Member Data Documentation

template<class Impl>
const DiscreteFunctionSpaceType& Dune::Fem::DiscreteFunctionDefault< Impl >::dfSpace_
protected
template<class Impl>
DebugLock Dune::Fem::DiscreteFunctionDefault< Impl >::dofPointerLock_
mutableprotected
template<class Impl>
LocalDofVectorAllocatorType Dune::Fem::DiscreteFunctionDefault< Impl >::ldvAllocator_
mutableprotected
template<class Impl>
Traits :: LocalDofVectorStackType Dune::Fem::DiscreteFunctionDefault< Impl >::ldvStack_
protected
template<class Impl>
std::string Dune::Fem::DiscreteFunctionDefault< Impl >::name_
protected
template<class Impl>
ScalarProductType Dune::Fem::DiscreteFunctionDefault< Impl >::scalarProduct_
protected

The documentation for this class was generated from the following files: