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

This is the class with default implementations for discrete function. The methods not marked with having a default in the interface class must be provided by the implementation; all other methods have a default implementation here. More...

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/space/common/discretefunctionspace.hh>

Inheritance diagram for Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >:
Inheritance graph

Public Types

enum  { localBlockSize = BaseType :: localBlockSize }
 size of local blocks More...
 
typedef FunctionSpaceTraits Traits
 
typedef Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
 
typedef BaseType::GridPartType GridPartType
 
typedef BaseType::GridType GridType
 
typedef BaseType::IndexSetType IndexSetType
 
typedef BaseType::IteratorType IteratorType
 
typedef BaseType::EntityType EntityType
 
typedef DofManager< GridTypeDofManagerType
 type of DoF manager More...
 
typedef CommunicationManager< DiscreteFunctionSpaceTypeCommunicationManagerType
 type of communication manager More...
 
enum  { localBlockSize = Traits :: localBlockSize }
 size of local blocks More...
 
typedef Traits::FunctionSpaceType FunctionSpaceType
 type of function space More...
 
typedef Traits::BasisFunctionSetType BasisFunctionSetType
 type of basis function set of this space More...
 
typedef Traits::BlockMapperType BlockMapperType
 type of block mapper of this space More...
 
typedef GridPartType::IntersectionType IntersectionType
 type of the intersections More...
 

Public Member Functions

 DiscreteFunctionSpaceDefault (GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
 constructor More...
 
int sequence () const
 get index of the sequence in grid sequences More...
 
int order (const EntityType &entity) const
 default implementation of the method order More...
 
LocalFunctionType localFunction (const EntityType &entity) const
 
const GridTypegrid () const
 get reference to grid this discrete function space belongs to More...
 
GridTypegrid ()
 get reference to grid this discrete function space belongs to More...
 
GridPartTypegridPart () const
 
const IndexSetTypeindexSet () const
 Get a reference to the associated index set. More...
 
int size () const
 get number of DoFs for this space More...
 
IteratorType begin () const
 get iterator pointing to the first entity of the associated grid partition More...
 
IteratorType end () const
 get iterator pointing behind the last entity of the associated grid partition More...
 
template<class FunctorType >
void forEach (FunctorType &f) const
 apply a functor to each entity in the associated grid partition More...
 
bool multipleGeometryTypes () const
 returns true if the grid has more than one geometry type More...
 
bool multipleBasisFunctionSets () const
 returns true if base function sets depend on the entity More...
 
InterfaceType communicationInterface () const
 return the communication interface appropriate for this space More...
 
CommunicationDirection communicationDirection () const
 return the communication interface appropriate for this space More...
 
const CommunicationManagerTypecommunicator () const
 return reference to communicator (see CommunicationManager) More...
 
template<class DiscreteFunction >
void communicate (DiscreteFunction &discreteFunction) const
 communicate data for given discrete function using the space's default communication operation More...
 
template<class DiscreteFunction , class Operation >
void communicate (DiscreteFunction &discreteFunction, const Operation *op) const
 communicate data for given discrete function More...
 
template<class DiscreteFunction , class Operation >
BaseType::template CommDataHandle< DiscreteFunction, Operation >::Type createDataHandle (DiscreteFunction &discreteFunction, const Operation *operation) const
 
template<class DiscreteFunction >
void addFunction (DiscreteFunction &df) const
 default implementation of addFunction does nothing at the moment More...
 
template<class DiscreteFunction >
void removeFunction (DiscreteFunction &df) const
 default implementation of removeFunction does nothing at the moment More...
 
template<class Vector >
void adapt (const Vector &polynomialOrders, const int polOrderShift=0) const
 default implementation of adapt does nothing, its only used in PAdaptiveLagrangeSpace More...
 
DFSpaceIdentifier type () const
 return type identifier of discrete function space More...
 
const BasisFunctionSetType basisFunctionSet (const EntityType &entity) const
 get basis function set for given entity More...
 
bool continuous () const
 returns true if the space contains only globally continuous functions More...
 
bool continuous (const IntersectionType &intersection) const
 returns true if discrete functions over this space have zero jump over the given intersection. More...
 
int order () const
 get global order of space More...
 
BlockMapperTypeblockMapper () const
 get a reference to the block mapper More...
 
GridPartTypegridPart ()
 get a reference to the associated grid partition More...
 

Protected Types

typedef ThreadSafeValue< UninitializedObjectStackLocalDofVectorStackType
 
typedef StackAllocator< typename BaseType::RangeFieldType, LocalDofVectorStackType * > LocalDofVectorAllocatorType
 
typedef Dune::DynamicVector< typename BaseType::RangeFieldType, LocalDofVectorAllocatorTypeLocalDofVectorType
 
typedef BasicTemporaryLocalFunction< ThisType, LocalDofVectorTypeLocalFunctionType
 
typedef AllGeomTypes< IndexSetType, GridTypeAllGeometryTypes
 

Protected Member Functions

const std::vector< GeometryType > & geomTypes (int codim) const
 returns true if the grid has more than one geometry type More...
 
const DiscreteFunctionSpaceTypeasImp () const
 
DiscreteFunctionSpaceTypeasImp ()
 

Protected Attributes

GridPartTypegridPart_
 
LocalDofVectorStackType ldvStack_
 
LocalDofVectorAllocatorType ldvAllocator_
 
const AllGeometryTypes allGeomTypes_
 
DofManagerTypedofManager_
 
const InterfaceType commInterface_
 
const CommunicationDirection commDirection_
 
std::unique_ptr< CommunicationManagerTypecommunicator_
 

Related Functions

(Note that these are not member functions.)

template<class Traits >
bool operator== (const DiscreteFunctionSpaceInterface< Traits > &X, const DiscreteFunctionSpaceInterface< Traits > &Y)
 check two spaces for equality More...
 

Detailed Description

template<class FunctionSpaceTraits>
class Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >

This is the class with default implementations for discrete function. The methods not marked with having a default in the interface class must be provided by the implementation; all other methods have a default implementation here.

Remarks
An reference to the GridPart is stored in the default implementation.

Member Typedef Documentation

template<class FunctionSpaceTraits>
typedef AllGeomTypes< IndexSetType, GridType > Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::AllGeometryTypes
protected
template<class FunctionSpaceTraits>
typedef Traits :: BasisFunctionSetType Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::BasisFunctionSetType
inherited

type of basis function set of this space

template<class FunctionSpaceTraits>
typedef Traits :: BlockMapperType Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::BlockMapperType
inherited

type of block mapper of this space

template<class FunctionSpaceTraits>
typedef CommunicationManager< DiscreteFunctionSpaceType > Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::CommunicationManagerType

type of communication manager

template<class FunctionSpaceTraits>
typedef Traits :: DiscreteFunctionSpaceType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::DiscreteFunctionSpaceType
template<class FunctionSpaceTraits>
typedef DofManager< GridType > Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::DofManagerType

type of DoF manager

template<class FunctionSpaceTraits>
typedef BaseType :: EntityType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::EntityType
template<class FunctionSpaceTraits>
typedef Traits :: FunctionSpaceType Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::FunctionSpaceType
inherited

type of function space

template<class FunctionSpaceTraits>
typedef BaseType :: GridPartType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::GridPartType
template<class FunctionSpaceTraits>
typedef BaseType :: GridType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::GridType
template<class FunctionSpaceTraits>
typedef BaseType :: IndexSetType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::IndexSetType
template<class FunctionSpaceTraits>
typedef GridPartType :: IntersectionType Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::IntersectionType
inherited

type of the intersections

template<class FunctionSpaceTraits>
typedef BaseType :: IteratorType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::IteratorType
template<class FunctionSpaceTraits>
typedef StackAllocator< typename BaseType::RangeFieldType, LocalDofVectorStackType* > Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::LocalDofVectorAllocatorType
protected
template<class FunctionSpaceTraits>
typedef ThreadSafeValue< UninitializedObjectStack > Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::LocalDofVectorStackType
protected
template<class FunctionSpaceTraits>
typedef Dune::DynamicVector< typename BaseType::RangeFieldType, LocalDofVectorAllocatorType > Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::LocalDofVectorType
protected
template<class FunctionSpaceTraits>
typedef BasicTemporaryLocalFunction< ThisType, LocalDofVectorType > Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::LocalFunctionType
protected
template<class FunctionSpaceTraits>
typedef FunctionSpaceTraits Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::Traits

Member Enumeration Documentation

template<class FunctionSpaceTraits>
anonymous enum
inherited

size of local blocks

Enumerator
localBlockSize 
template<class FunctionSpaceTraits>
anonymous enum

size of local blocks

Enumerator
localBlockSize 

Constructor & Destructor Documentation

template<class FunctionSpaceTraits>
Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::DiscreteFunctionSpaceDefault ( GridPartType gridPart,
const InterfaceType  commInterface = InteriorBorder_All_Interface,
const CommunicationDirection  commDirection = ForwardCommunication 
)
inlineexplicit

constructor

Member Function Documentation

template<class FunctionSpaceTraits>
template<class Vector >
void Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::adapt ( const Vector &  polynomialOrders,
const int  polOrderShift = 0 
) const
inline

default implementation of adapt does nothing, its only used in PAdaptiveLagrangeSpace

template<class FunctionSpaceTraits>
template<class DiscreteFunction >
void Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::addFunction ( DiscreteFunction &  df) const
inline

default implementation of addFunction does nothing at the moment

template<class FunctionSpaceTraits>
const DiscreteFunctionSpaceType& Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::asImp ( ) const
inlineprotectedinherited
template<class FunctionSpaceTraits>
DiscreteFunctionSpaceType& Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::asImp ( )
inlineprotectedinherited
template<class FunctionSpaceTraits>
const BasisFunctionSetType Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::basisFunctionSet ( const EntityType entity) const
inlineinherited

get basis function set for given entity

Parameters
[in]entityentity (of codim 0) for which base function is requested
Returns
BasisFunctionSet for the entity
template<class FunctionSpaceTraits>
IteratorType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::begin ( ) const
inline

get iterator pointing to the first entity of the associated grid partition

Returns
iterator pointing to first entity
Note
The default implementation uses the codim 0 iterators of the associated grid partition.
template<class FunctionSpaceTraits>
BlockMapperType& Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::blockMapper ( ) const
inlineinherited

get a reference to the block mapper

Returns
refernce to the block mapper

Referenced by Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::operator==().

template<class FunctionSpaceTraits>
template<class DiscreteFunction >
void Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::communicate ( DiscreteFunction &  discreteFunction) const
inline

communicate data for given discrete function using the space's default communication operation

Parameters
discreteFunctiondiscrete function to be communicated
template<class FunctionSpaceTraits>
template<class DiscreteFunction , class Operation >
void Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::communicate ( DiscreteFunction &  discreteFunction,
const Operation *  op 
) const
inline

communicate data for given discrete function

Parameters
discreteFunctiondiscrete function to be communicated
[in]opcommunication operation to use (see DFCommunicationOperation)
template<class FunctionSpaceTraits>
CommunicationDirection Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::communicationDirection ( ) const
inline

return the communication interface appropriate for this space

Returns
communication interface
template<class FunctionSpaceTraits>
InterfaceType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::communicationInterface ( ) const
inline

return the communication interface appropriate for this space

Returns
communication interface
template<class FunctionSpaceTraits>
const CommunicationManagerType& Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::communicator ( ) const
inline

return reference to communicator (see CommunicationManager)

Returns
reference to communicator
template<class FunctionSpaceTraits>
bool Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::continuous ( ) const
inlineinherited

returns true if the space contains only globally continuous functions

For example, a Lagrange space returns true while a discontiuous Galerkin space returns false.

Returns
true if the space contians only globally continous functions, false otherwise
template<class FunctionSpaceTraits>
bool Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::continuous ( const IntersectionType intersection) const
inlineinherited

returns true if discrete functions over this space have zero jump over the given intersection.

For example, a Lagrange space returns true iff the intersection is conforming while a discontiuous Galerkin space always returns false.

Parameters
intersectionIntersection for which we want to know the continuety
Returns
true if the space contians functions which are continuous over the intersection, false otherwise
template<class FunctionSpaceTraits>
template<class DiscreteFunction , class Operation >
BaseType :: template CommDataHandle< DiscreteFunction, Operation >:: Type Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::createDataHandle ( DiscreteFunction &  discreteFunction,
const Operation *  operation 
) const
inline

Note
The default implementation is
template<class FunctionSpaceTraits>
IteratorType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::end ( ) const
inline

get iterator pointing behind the last entity of the associated grid partition

Returns
iterator pointing behind last entity
Note
The default implementation uses the codim 0 iterators of the associated grid partition.
template<class FunctionSpaceTraits>
template<class FunctorType >
void Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::forEach ( FunctorType &  f) const
inline

apply a functor to each entity in the associated grid partition

The functor must provide an the following operator

template< class EntityType >
void operator() ( const EntityType & );
Parameters
[in]ffunctor to apply
Note
The default implementation simply does the following:
const IteratorType end = asImp().end();
for( IteratorType it = asImp().begin(); it != end; ++it )
f( *it );
template<class FunctionSpaceTraits>
const std::vector<GeometryType>& Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::geomTypes ( int  codim) const
inlineprotected

returns true if the grid has more than one geometry type

Returns
true if the underlying grid has more than one geometry type (hybrid grid), false otherwise
template<class FunctionSpaceTraits>
const GridType& Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::grid ( ) const
inline

get reference to grid this discrete function space belongs to

Returns
constant reference to grid
template<class FunctionSpaceTraits>
GridType& Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::grid ( )
inline

get reference to grid this discrete function space belongs to

Returns
reference to grid
template<class FunctionSpaceTraits>
GridPartType& Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::gridPart ( )
inlineinherited

get a reference to the associated grid partition

Returns
reference to the grid partition
template<class FunctionSpaceTraits>
GridPartType& Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::gridPart ( ) const
inline

template<class FunctionSpaceTraits>
const IndexSetType& Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::indexSet ( ) const
inline

Get a reference to the associated index set.

Returns
const reference to index set
template<class FunctionSpaceTraits>
LocalFunctionType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::localFunction ( const EntityType entity) const
inline

obtain a local function for an entity (to store intermediate values)

Parameters
[in]entityentity (of codim 0) for which a local function is desired
Returns
a local function backed by a small, fast array
template<class FunctionSpaceTraits>
bool Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::multipleBasisFunctionSets ( ) const
inline

returns true if base function sets depend on the entity

Returns
true if base function set depend on entities, false otherwise
Note
The default implementation returns false.
template<class FunctionSpaceTraits>
bool Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::multipleGeometryTypes ( ) const
inline

returns true if the grid has more than one geometry type

Returns
true if the underlying grid has more than one geometry type (hybrid grid), false otherwise
template<class FunctionSpaceTraits>
int Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::order ( ) const
inlineinherited

get global order of space

Returns
order of space, i.e., the maximal polynomial order of base functions
template<class FunctionSpaceTraits>
int Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::order ( const EntityType entity) const
inline

default implementation of the method order

Returns
returns max polynomial order for each entity using the method order()
template<class FunctionSpaceTraits>
template<class DiscreteFunction >
void Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::removeFunction ( DiscreteFunction &  df) const
inline

default implementation of removeFunction does nothing at the moment

template<class FunctionSpaceTraits>
int Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::sequence ( ) const
inline

get index of the sequence in grid sequences

Returns
number of current sequence
template<class FunctionSpaceTraits>
int Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::size ( ) const
inline

get number of DoFs for this space

Returns
number of DoFs (degrees of freedom)
template<class FunctionSpaceTraits>
DFSpaceIdentifier Dune::Fem::DiscreteFunctionSpaceInterface< FunctionSpaceTraits >::type ( ) const
inlineinherited

return type identifier of discrete function space

Returns
return type identifier of discrete function space

Member Data Documentation

template<class FunctionSpaceTraits>
const AllGeometryTypes Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::allGeomTypes_
protected
template<class FunctionSpaceTraits>
const CommunicationDirection Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::commDirection_
protected
template<class FunctionSpaceTraits>
const InterfaceType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::commInterface_
protected
template<class FunctionSpaceTraits>
std::unique_ptr< CommunicationManagerType > Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::communicator_
mutableprotected
template<class FunctionSpaceTraits>
DofManagerType& Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::dofManager_
protected
template<class FunctionSpaceTraits>
GridPartType& Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::gridPart_
protected
template<class FunctionSpaceTraits>
LocalDofVectorAllocatorType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::ldvAllocator_
mutableprotected
template<class FunctionSpaceTraits>
LocalDofVectorStackType Dune::Fem::DiscreteFunctionSpaceDefault< FunctionSpaceTraits >::ldvStack_
mutableprotected

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