dune-fem  2.4.1-rc
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Dune::Fem::TemporaryLocalFunction< DiscreteFunctionSpace, Dof > Class Template Reference

A temporary function carrying values for one entity. More...

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/function/localfunction/temporary.hh>

Inheritance diagram for Dune::Fem::TemporaryLocalFunction< DiscreteFunctionSpace, Dof >:
Inheritance graph

Public Types

typedef BaseType::EntityType EntityType
 type of Entity More...
 
typedef BaseType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
 type of the discrete function space More...
 
typedef BaseType::BasisFunctionSetType BasisFunctionSetType
 type of BasisFunctionSet More...
 
typedef BaseType::LocalDofVectorType LocalDofVectorType
 type of LocalDofVector More...
 
typedef LocalDofVectorType::value_type DofType
 type of DoF use with the discrete function More...
 
typedef LocalDofVectorType::size_type SizeType
 type of index More...
 
typedef BasisFunctionSetType::FunctionSpaceType FunctionSpaceType
 type of functionspace More...
 
typedef FunctionSpaceType::DomainFieldType DomainFieldType
 field type of the domain More...
 
typedef FunctionSpaceType::RangeFieldType RangeFieldType
 field type of the range More...
 
typedef FunctionSpaceType::DomainType DomainType
 type of domain vectors, i.e., type of coordinates More...
 
typedef FunctionSpaceType::RangeType RangeType
 type of range vectors, i.e., type of function values More...
 
typedef FunctionSpaceType::JacobianRangeType JacobianRangeType
 type of the Jacobian, i.e., type of evaluated Jacobian matrix More...
 
typedef FunctionSpaceType::HessianRangeType HessianRangeType
 type of the Hessian More...
 
typedef EntityType::Geometry::LocalCoordinate LocalCoordinateType
 type of local coordinates More...
 

Public Member Functions

 TemporaryLocalFunction (const DiscreteFunctionSpaceType &dfSpace)
 constructor creating a local function without binding it to an entity More...
 
 TemporaryLocalFunction (const DiscreteFunctionSpaceType &dfSpace, const EntityType &entity)
 constructor creating a local function and binding it to an entity More...
 
void init (const EntityType &entity)
 initialize the local function for an entity More...
 
void init (const BasisFunctionSetType &basisFunctionSet)
 
const DofTypeoperator[] (SizeType num) const
 access to local dofs (read-only) More...
 
DofTypeoperator[] (SizeType num)
 access to local dofs (read-write) More...
 
ThisTypeoperator+= (const LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType, T > &other)
 add another local function to this one More...
 
void assign (const LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType, T > &other)
 assign all DoFs of this local function More...
 
void clear ()
 set all DoFs to zero More...
 
ThisTypeoperator-= (const LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType, T > &other)
 subtract another local function to this one More...
 
ThisTypeaxpy (const RangeFieldType s, const LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType, T > &other)
 add a multiple of another local function to this one More...
 
void axpy (const PointType &x, const RangeType &factor)
 axpy operation for local function More...
 
void axpy (const PointType &x, const JacobianRangeType &factor)
 axpy operation for local function More...
 
void axpy (const PointType &x, const RangeType &factor1, const JacobianRangeType &factor2)
 axpy operation for local function More...
 
int order () const
 obtain the order of this local function More...
 
const BasisFunctionSetTypebasisFunctionSet () const
 obtain the basis function set for this local function More...
 
const EntityTypeentity () const
 obtain the entity, this local function lives on More...
 
void evaluate (const PointType &x, RangeType &ret) const
 evaluate the local function More...
 
void jacobian (const PointType &x, JacobianRangeType &ret) const
 evaluate Jacobian of the local function More...
 
void hessian (const PointType &x, HessianRangeType &ret) const
 evaluate Hessian of the local function More...
 
int numDofs () const
 obtain the number of local DoFs More...
 
SizeType size () const
 
int numScalarDofs () const
 obtain the number of local DoFs in the scalar case More...
 
void axpyQuadrature (const QuadratureType &quad, const VectorType &values)
 evaluate all basisfunctions for all quadrature points, multiply with the given factor and add the result to the local coefficients More...
 
void axpyQuadrature (const QuadratureType &quad, const RangeVectorType &rangeVector, const JacobianRangeVectorType &jacobianVector)
 evaluate all basisfunctions for all quadrature points, multiply with the given factor and add the result to the local coefficients More...
 
void evaluateQuadrature (const QuadratureType &quad, VectorType &result) const
 evaluate all basisfunctions for all quadrature points and store the results in the result vector More...
 
const LocalDofVectorTypelocalDofVector () const
 return const reference to local Dof Vector More...
 
LocalDofVectorTypelocalDofVector ()
 return mutable reference to local Dof Vector More...
 

Static Public Attributes

static const int dimDomain
 dimension of the domain More...
 
static const int dimRange
 dimension of the range More...
 

Protected Member Functions

void evaluateQuadrature (const QuadratureType &quad, VectorType &result, const RangeType &) const
 
void evaluateQuadrature (const QuadratureType &quad, VectorType &result, const JacobianRangeType &) const
 

Protected Attributes

const DiscreteFunctionSpaceTypedfSpace_
 
BasisFunctionSetType basisFunctionSet_
 
LocalDofVectorType localDofVector_
 

Detailed Description

template<class DiscreteFunctionSpace, class Dof = typename DiscreteFunctionSpace::RangeFieldType>
class Dune::Fem::TemporaryLocalFunction< DiscreteFunctionSpace, Dof >

A temporary function carrying values for one entity.

A TemporaryLocalFunction is a LocalFunction which is not associated with any DiscreteFunction. It can be used when generating discrete functions to temporarily store values for one entity.

Note
Local DoF numbers correspond directly to array indices. Hence it may be more cache efficient to generate a TemporaryLocalFunction and then do only one update step on the discrete function's LocalFunction.
Parameters
DiscreteFunctionSpaceImptype of the discrete function space, the local function shall belong to

Member Typedef Documentation

type of BasisFunctionSet

template<class DiscreteFunctionSpace, class Dof = typename DiscreteFunctionSpace::RangeFieldType>
typedef BaseType :: DiscreteFunctionSpaceType Dune::Fem::TemporaryLocalFunction< DiscreteFunctionSpace, Dof >::DiscreteFunctionSpaceType

type of the discrete function space

typedef LocalDofVectorType::value_type Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::DofType
inherited

type of DoF use with the discrete function

typedef FunctionSpaceType::DomainFieldType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::DomainFieldType
inherited

field type of the domain

typedef FunctionSpaceType::DomainType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::DomainType
inherited

type of domain vectors, i.e., type of coordinates

template<class DiscreteFunctionSpace, class Dof = typename DiscreteFunctionSpace::RangeFieldType>
typedef BaseType :: EntityType Dune::Fem::TemporaryLocalFunction< DiscreteFunctionSpace, Dof >::EntityType

type of Entity

typedef BasisFunctionSetType::FunctionSpaceType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::FunctionSpaceType
inherited

type of functionspace

typedef FunctionSpaceType::HessianRangeType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::HessianRangeType
inherited

type of the Hessian

typedef FunctionSpaceType::JacobianRangeType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::JacobianRangeType
inherited

type of the Jacobian, i.e., type of evaluated Jacobian matrix

typedef EntityType::Geometry::LocalCoordinate Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::LocalCoordinateType
inherited

type of local coordinates

type of LocalDofVector

typedef FunctionSpaceType::RangeFieldType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::RangeFieldType
inherited

field type of the range

typedef FunctionSpaceType::RangeType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::RangeType
inherited

type of range vectors, i.e., type of function values

typedef LocalDofVectorType::size_type Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::SizeType
inherited

type of index

Constructor & Destructor Documentation

template<class DiscreteFunctionSpace, class Dof = typename DiscreteFunctionSpace::RangeFieldType>
Dune::Fem::TemporaryLocalFunction< DiscreteFunctionSpace, Dof >::TemporaryLocalFunction ( const DiscreteFunctionSpaceType dfSpace)
inlineexplicit

constructor creating a local function without binding it to an entity

Creates the local function without initializing the fields depending on the current entity.

Note
Before using the local function it must be initilized by
localFunction.init( entity );
Parameters
[in]dfSpacediscrete function space the local function shall belong to
template<class DiscreteFunctionSpace, class Dof = typename DiscreteFunctionSpace::RangeFieldType>
Dune::Fem::TemporaryLocalFunction< DiscreteFunctionSpace, Dof >::TemporaryLocalFunction ( const DiscreteFunctionSpaceType dfSpace,
const EntityType entity 
)
inline

constructor creating a local function and binding it to an entity

Creates the local function and initilizes the fields depending on the current entity. It is not necessary, though allowed, to call init before using the discrete function.

Note
The degrees of freedom are not initialized by this function.
Parameters
[in]dfSpacediscrete function space the local function shall belong to
[in]entityentity for initialize the local function to

Member Function Documentation

void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::assign ( const LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , T > &  other)
inlineinherited

assign all DoFs of this local function

Parameters
[in]lflocal function to assign DoFs from
ThisType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::axpy ( const RangeFieldType  s,
const LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , T > &  other 
)
inlineinherited

add a multiple of another local function to this one

Note
The local function to add may be any implementation of a LocalFunction.
Parameters
[in]sscalar factor to scale lf with
[in]lflocal function to add
Returns
a reference to this local function (i.e., *this)
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::axpy ( const PointType &  x,
const RangeType factor 
)
inlineinherited

axpy operation for local function

Denoting the DoFs of the local function by $u_i$ and the basis functions by $\varphi_i$, this function performs the following operation:

\[ u_i = u_i + factor \cdot \varphi_i( x ) \]

Parameters
[in]xpoint to evaluate basis functions in
[in]factoraxpy factor
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::axpy ( const PointType &  x,
const JacobianRangeType factor 
)
inlineinherited

axpy operation for local function

Denoting the DoFs of the local function by $u_i$ and the basis functions by $\varphi_i$, this function performs the following operation:

\[ u_i = u_i + factor \cdot \nabla\varphi_i( x ) \]

Parameters
[in]xpoint to evaluate jacobian of basis functions in
[in]factoraxpy factor
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::axpy ( const PointType &  x,
const RangeType factor1,
const JacobianRangeType factor2 
)
inlineinherited

axpy operation for local function

Denoting the DoFs of the local function by $u_i$ and the basis functions by $\varphi_i$, this function performs the following operation:

\[ u_i = u_i + factor1 \cdot \varphi_i( x ) + factor2 \cdot \nabla\varphi_i( x ) \]

Parameters
[in]xpoint to evaluate basis functions in
[in]factor1axpy factor for $\varphi( x )$
[in]factor2axpy factor for $\nabla\varphi( x )$
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::axpyQuadrature ( const QuadratureType &  quad,
const VectorType &  values 
)
inlineinherited

evaluate all basisfunctions for all quadrature points, multiply with the given factor and add the result to the local coefficients

void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::axpyQuadrature ( const QuadratureType &  quad,
const RangeVectorType &  rangeVector,
const JacobianRangeVectorType &  jacobianVector 
)
inlineinherited

evaluate all basisfunctions for all quadrature points, multiply with the given factor and add the result to the local coefficients

const BasisFunctionSetType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::basisFunctionSet ( ) const
inlineinherited

obtain the basis function set for this local function

Returns
reference to the basis function set
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::clear ( )
inlineinherited

set all DoFs to zero

const EntityType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::entity ( ) const
inlineinherited

obtain the entity, this local function lives on

Returns
reference to the entity
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::evaluate ( const PointType &  x,
RangeType ret 
) const
inlineinherited

evaluate the local function

Parameters
[in]xevaluation point in local coordinates
[out]retvalue of the function in the given point
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::evaluateQuadrature ( const QuadratureType &  quad,
VectorType &  result 
) const
inlineinherited

evaluate all basisfunctions for all quadrature points and store the results in the result vector

void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::evaluateQuadrature ( const QuadratureType &  quad,
VectorType &  result,
const RangeType  
) const
inlineprotectedinherited
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::evaluateQuadrature ( const QuadratureType &  quad,
VectorType &  result,
const JacobianRangeType  
) const
inlineprotectedinherited
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::hessian ( const PointType &  x,
HessianRangeType ret 
) const
inlineinherited

evaluate Hessian of the local function

Note
Though the Hessian is evaluated on the reference element, the return value is the Hessian with respect to the actual entity.
Parameters
[in]xevaluation point in local coordinates
[out]retHessian of the function in the evaluation point
void Dune::Fem::BasicTemporaryLocalFunction< DiscreteFunctionSpace, Dune::DynamicVector< Dof > >::init ( const EntityType entity)
inlineinherited

initialize the local function for an entity

Binds the local function to an entity.

Note
A local function must be initialized to an entity before it can be used.
This function can be called multiple times to use the local function for more than one entity.
Parameters
[in]entityentity to bind the local function to
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::init ( const BasisFunctionSetType basisFunctionSet)
inlineinherited
Todo:
please doc me
void Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::jacobian ( const PointType &  x,
JacobianRangeType ret 
) const
inlineinherited

evaluate Jacobian of the local function

Note
Though the Jacobian is evaluated on the reference element, the return value is the Jacobian with respect to the actual entity.
Parameters
[in]xevaluation point in local coordinates
[out]retJacobian of the function in the evaluation point
const LocalDofVectorType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::localDofVector ( ) const
inlineinherited

return const reference to local Dof Vector

LocalDofVectorType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::localDofVector ( )
inlineinherited

return mutable reference to local Dof Vector

int Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::numDofs ( ) const
inlineinherited

obtain the number of local DoFs

Obtain the number of local DoFs of this local function. The value is identical to the number of basis functons on the entity.

Returns
number of local DoFs
int Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::numScalarDofs ( ) const
inlineinherited

obtain the number of local DoFs in the scalar case

Obtain the number of local DoFs of the scalar case of this local function. The value is identical to the number of basis functons on the entity.

Returns
number of local DoFs, scalar case
ThisType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::operator+= ( const LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , T > &  other)
inlineinherited

add another local function to this one

Note
The local function to add may be any implementation of a LocalFunction.
Parameters
[in]lflocal function to add
Returns
a reference to this local function (i.e., *this)
ThisType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::operator-= ( const LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , T > &  other)
inlineinherited

subtract another local function to this one

Note
The local function to suctract may be any implementation of a LocalFunction.
Parameters
[in]lflocal function to subtract
Returns
a reference to this local function (i.e., *this)
const DofType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::operator[] ( SizeType  num) const
inlineinherited

access to local dofs (read-only)

Parameters
[in]numlocal dof number
Returns
reference to dof
DofType& Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::operator[] ( SizeType  num)
inlineinherited

access to local dofs (read-write)

Parameters
[in]numlocal DoF number
Returns
reference to DoF
int Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::order ( ) const
inlineinherited

obtain the order of this local function

The order of a local function refers to the polynomial order required to integrate it exactly.

Note
It is not completely clear what this value should be, e.g., for bilinear basis functions.
Returns
order of the local function
SizeType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::size ( ) const
inlineinherited

Member Data Documentation

BasisFunctionSetType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::basisFunctionSet_
protectedinherited
const DiscreteFunctionSpaceType& Dune::Fem::BasicTemporaryLocalFunction< DiscreteFunctionSpace, Dune::DynamicVector< Dof > >::dfSpace_
protectedinherited
const int Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::dimDomain
staticinherited

dimension of the domain

const int Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::dimRange
staticinherited

dimension of the range

LocalDofVectorType Dune::Fem::LocalFunction< DiscreteFunctionSpace::BasisFunctionSetType , Dune::DynamicVector< Dof > >::localDofVector_
protectedinherited

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