dune-fem  2.4.1-rc
Public Types | Public Member Functions | Static Public Member Functions | List of all members

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

Inheritance diagram for Dune::Fem::DofManager< Grid >:
Inheritance graph

Public Types

typedef Grid GridType
 type of Grid this DofManager belongs to More...
 
typedef GridObjectStreamTraits< GridType >::InStreamType XtractStreamImplType
 
typedef GridObjectStreamTraits< GridType >::OutStreamType InlineStreamImplType
 
typedef MessageBufferIF< XtractStreamImplTypeXtractStreamType
 
typedef MessageBufferIF< InlineStreamImplTypeInlineStreamType
 
typedef DataCollectorInterface< GridType, XtractStreamTypeDataXtractorType
 
typedef DataCollectorInterface< GridType, InlineStreamTypeDataInlinerType
 
typedef GridType::template Codim< 0 >::Entity ElementType
 
typedef IndexSetRestrictProlong< ThisType, LocalIndexSetObjectsType, true > NewIndexSetRestrictProlongType
 
typedef IndexSetRestrictProlong< ThisType, LocalIndexSetObjectsType, false > IndexSetRestrictProlongNoResizeType
 
typedef EmptyIndexSetRestrictProlong IndexSetRestrictProlongType
 

Public Member Functions

double memoryFactor () const
 return factor to over estimate new memory allocation More...
 
template<class IndexSetType >
void addIndexSet (const IndexSetType &iset)
 add index set to dof manager's list of index sets More...
 
template<class IndexSetType >
void removeIndexSet (const IndexSetType &iset)
 removed index set from dof manager's list of index sets More...
 
template<class ManagedDofStorageImp >
void addDofStorage (ManagedDofStorageImp &dofStorage)
 add a managed dof storage to the dof manager. More...
 
template<class ManagedDofStorageImp >
void removeDofStorage (ManagedDofStorageImp &dofStorage)
 remove a managed dof storage from the dof manager. More...
 
NewIndexSetRestrictProlongTypeindexSetRestrictProlong ()
 returns the index set restriction and prolongation operator More...
 
IndexSetRestrictProlongNoResizeTypeindexSetRestrictProlongNoResize ()
 returns the index set restriction and prolongation operator More...
 
bool hasIndexSets () const
 if dofmanagers list is not empty return true More...
 
size_t usedMemorySize () const
 return used memory size of all MemObjects in bytes. More...
 
void resizeForRestrict ()
 resize memory before data restriction during grid adaptation is done. More...
 
void reserveMemory (int nsize, bool dummy=false)
 reserve memory for at least nsize elements, dummy is needed for dune-grid ALUGrid version More...
 
int sequence () const
 return number of sequence, if dofmanagers memory was changed by calling some method like resize, then also this number will increase More...
 
void resize ()
 Resize index sets and memory due to what the mapper has as new size. More...
 
void insertEntity (ConstElementType &element)
 Inserts entity to all index sets added to dof manager. More...
 
void removeEntity (ConstElementType &element)
 Removes entity from all index sets added to dof manager. More...
 
void resizeMemory ()
 resize the MemObject if necessary More...
 
void incrementSequenceNumber ()
 increase the DofManagers internal sequence number More...
 
void compress ()
 Compress all data that is hold by this dofmanager. More...
 
bool notifyGlobalChange (const bool wasChanged) const
 communicate new sequence number More...
 
template<class DataCollType >
void addDataInliner (DataCollType &d)
 add data handler for data inlining to dof manager More...
 
void clearDataInliners ()
 clear data inliner list More...
 
template<class DataCollType >
void addDataXtractor (DataCollType &d)
 add data handler for data xtracting to dof manager More...
 
void clearDataXtractors ()
 clear data xtractor list More...
 
bool contains (const int dim, const int codim) const
 the dof manager only transfers element data during load balancing More...
 
bool fixedsize (const int dim, const int codim) const
 fixed size is false More...
 
template<class Entity >
size_t size (const Entity &) const
 for convenience More...
 
void gather (InlineStreamType &str, ConstElementType &element) const
 packs all data attached to this entity More...
 
template<class MessageBuffer , class Entity >
void gather (MessageBuffer &str, const Entity &entity) const
 
void scatter (XtractStreamType &str, ConstElementType &element, size_t)
 unpacks all data attached of this entity from message buffer More...
 
template<class MessageBuffer , class Entity >
void scatter (MessageBuffer &str, const Entity &entity, size_t)
 unpacks all data of this entity from message buffer More...
 
void backup () const
 :: backup More...
 
void restore ()
 :: restore More...
 
template<class OutStream >
void write (OutStream &out) const
 write all index sets to a given stream More...
 
template<class InStream >
void read (InStream &in)
 read all index sets from a given stream More...
 

Static Public Member Functions

static ThisTypeinstance (const GridType &grid)
 obtain a reference to the DofManager for a given grid More...
 

Detailed Description

template<class Grid>
class Dune::Fem::DofManager< Grid >

The DofManager is responsible for managing memory allocation and freeing for all discrete functions living on the grid the manager belongs to. There is only one DofManager per grid. Each discrete function knows its dofmanager and can sign in. If the grid is adapted, then the dofmanager reorganizes the memory if necessary. The DofManager holds a list of MemObjects which manage the memory and the corresponding mapper so they can determine the size of new memory. Furthermore the DofManager holds an IndexSet which the DofMapper needs for calculating the indices in the dof vector for a given entity and local dof number. This IndexSet is delivered to the mapper when a function space is created. The default value for the IndexSet is the DefaultIndexSet class which is mostly a wrapper for the grid indices.

Member Typedef Documentation

template<class Grid >
typedef GridType :: template Codim< 0 >:: Entity Dune::Fem::DofManager< Grid >::ElementType
template<class Grid >
typedef Grid Dune::Fem::DofManager< Grid >::GridType

type of Grid this DofManager belongs to

template<class Grid >
typedef GridObjectStreamTraits< GridType >::OutStreamType Dune::Fem::DofManager< Grid >::InlineStreamImplType
template<class Grid >
typedef MessageBufferIF< InlineStreamImplType > Dune::Fem::DofManager< Grid >::InlineStreamType
template<class Grid >
typedef GridObjectStreamTraits< GridType >::InStreamType Dune::Fem::DofManager< Grid >::XtractStreamImplType
template<class Grid >
typedef MessageBufferIF< XtractStreamImplType > Dune::Fem::DofManager< Grid >::XtractStreamType

Member Function Documentation

template<class Grid >
template<class DataCollType >
void Dune::Fem::DofManager< Grid >::addDataInliner ( DataCollType &  d)
inline

add data handler for data inlining to dof manager

template<class Grid >
template<class DataCollType >
void Dune::Fem::DofManager< Grid >::addDataXtractor ( DataCollType &  d)
inline

add data handler for data xtracting to dof manager

template<class Grid >
void Dune::Fem::DofManager< Grid >::backup ( ) const
inline

:: backup

:: backup

template<class Grid >
void Dune::Fem::DofManager< Grid >::clearDataInliners ( )
inline
template<class Grid >
void Dune::Fem::DofManager< Grid >::clearDataXtractors ( )
inline
template<class Grid >
void Dune::Fem::DofManager< Grid >::compress ( )
inline
template<class Grid >
bool Dune::Fem::DofManager< Grid >::contains ( const int  dim,
const int  codim 
) const
inline

the dof manager only transfers element data during load balancing

template<class Grid >
bool Dune::Fem::DofManager< Grid >::fixedsize ( const int  dim,
const int  codim 
) const
inline

fixed size is false

template<class Grid >
void Dune::Fem::DofManager< Grid >::gather ( InlineStreamType str,
ConstElementType &  element 
) const
inline

packs all data attached to this entity

References Dune::Fem::DataCollectorInterface< GridType, ObjectStreamImp >::apply().

template<class Grid >
template<class MessageBuffer , class Entity >
void Dune::Fem::DofManager< Grid >::gather ( MessageBuffer &  str,
const Entity &  entity 
) const
inline
template<class Grid >
bool Dune::Fem::DofManager< Grid >::hasIndexSets ( ) const
inline

if dofmanagers list is not empty return true

References Dune::Fem::LocalInterface< ParamT >::empty().

template<class Grid >
void Dune::Fem::DofManager< Grid >::incrementSequenceNumber ( )
inline

increase the DofManagers internal sequence number

Note
This will increase the sequence counter by 1.
template<class Grid >
NewIndexSetRestrictProlongType& Dune::Fem::DofManager< Grid >::indexSetRestrictProlong ( )
inline
template<class Grid >
IndexSetRestrictProlongNoResizeType& Dune::Fem::DofManager< Grid >::indexSetRestrictProlongNoResize ( )
inline

returns the index set restriction and prolongation operator

template<class Grid >
void Dune::Fem::DofManager< Grid >::insertEntity ( ConstElementType &  element)
inline

Inserts entity to all index sets added to dof manager.

References Dune::Fem::LocalInterface< ParamT >::apply().

template<class Grid >
static ThisType& Dune::Fem::DofManager< Grid >::instance ( const GridType grid)
inlinestatic
template<class Grid >
double Dune::Fem::DofManager< Grid >::memoryFactor ( ) const
inline
template<class Grid >
bool Dune::Fem::DofManager< Grid >::notifyGlobalChange ( const bool  wasChanged) const
inline
template<class Grid >
template<class InStream >
void Dune::Fem::DofManager< Grid >::read ( InStream &  in)
inline

read all index sets from a given stream

Parameters
[in]instream to read from
template<class Grid >
void Dune::Fem::DofManager< Grid >::removeEntity ( ConstElementType &  element)
inline

Removes entity from all index sets added to dof manager.

References Dune::Fem::LocalInterface< ParamT >::apply().

template<class Grid >
void Dune::Fem::DofManager< Grid >::reserveMemory ( int  nsize,
bool  dummy = false 
)
inline

reserve memory for at least nsize elements, dummy is needed for dune-grid ALUGrid version

References Dune::Fem::LocalInterface< ParamT >::apply(), and Dune::Std::max().

Referenced by Dune::Fem::RestrictProlongWrapper< Grid, DofManager, RestrictProlongOperator >::initialize().

template<class Grid >
void Dune::Fem::DofManager< Grid >::resize ( )
inline

Resize index sets and memory due to what the mapper has as new size.

Note
This will increase the sequence counter by 1.

Referenced by Dune::Fem::GenericDiscreteFunctionSpace< PAdaptiveLagrangeSpaceTraits< FS, GP, maxPolOrder, S > >::adapt().

template<class Grid >
void Dune::Fem::DofManager< Grid >::resizeForRestrict ( )
inline

resize memory before data restriction during grid adaptation is done.

template<class Grid >
void Dune::Fem::DofManager< Grid >::resizeMemory ( )
inline

resize the MemObject if necessary

References Dune::Fem::LocalInterface< ParamT >::apply().

template<class Grid >
void Dune::Fem::DofManager< Grid >::restore ( )
inline

:: restore

:: restore

template<class Grid >
void Dune::Fem::DofManager< Grid >::scatter ( XtractStreamType str,
ConstElementType &  element,
size_t   
)
inline

unpacks all data attached of this entity from message buffer

References Dune::Fem::DataCollectorInterface< GridType, ObjectStreamImp >::apply().

template<class Grid >
template<class MessageBuffer , class Entity >
void Dune::Fem::DofManager< Grid >::scatter ( MessageBuffer &  str,
const Entity &  entity,
size_t   
)
inline

unpacks all data of this entity from message buffer

References Dune::Fem::DataCollectorInterface< GridType, ObjectStreamImp >::apply().

template<class Grid >
int Dune::Fem::DofManager< Grid >::sequence ( ) const
inline

return number of sequence, if dofmanagers memory was changed by calling some method like resize, then also this number will increase

Note
The increase of this number could be larger than 1

Referenced by Dune::Fem::GridWidthProvider< GridType, MinMax >::calcWidths(), Dune::Fem::GridPartDefault< IntersectionAdaptiveLeafGridPartTraits< Grid, idxpitype > >::sequence(), and Dune::Fem::DiscreteFunctionSpaceDefault< PAdaptiveLagrangeSpaceTraits< FS, GP, maxPolOrder, S > >::sequence().

template<class Grid >
template<class Entity >
size_t Dune::Fem::DofManager< Grid >::size ( const Entity &  ) const
inline

for convenience

template<class Grid >
size_t Dune::Fem::DofManager< Grid >::usedMemorySize ( ) const
inline

return used memory size of all MemObjects in bytes.

References Dune::Fem::SpecialArrayFeatures< ArrayType >::used().

template<class Grid >
template<class OutStream >
void Dune::Fem::DofManager< Grid >::write ( OutStream &  out) const
inline

write all index sets to a given stream

Parameters
[out]outstream to write to

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