DUNE-FEM (unstable)

DofManager

Classes

class  Dune::Fem::DofManager< Grid >
 
class  Dune::Fem::DofManagerFactory< DofManagerImp >
 Singleton provider for the DofManager. More...
 
class  Dune::Fem::ManagedIndexSetInterface
 
class  Dune::Fem::DofStorageInterface
 Interface class for a dof storage object to be stored in discrete functions. More...
 
class  Dune::Fem::ManagedDofStorageInterface
 Interface class for a dof storage object that can be managed (resized and compressed) by the DofManager. More...
 
class  Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >
 
class  Dune::Fem::ManagedDofStorage< GridImp, MapperType, DofArrayType >
 
class  Dune::Fem::DofIteratorInterface< DofImp, DofIteratorImp >
 interface for DoF iterators of discrete functions More...
 
class  Dune::Fem::DofIteratorDefault< DofImp, DofIteratorImp >
 default implementation of DofManagerInterface More...
 

Typedefs

typedef ManagedIndexSetInterface Dune::Fem::ManagedIndexSet< IndexSetType, EntityType >::BaseType
 type of base class
 
typedef Grid Dune::Fem::DofManager< Grid >::GridType
 type of Grid this DofManager belongs to
 

Functions

virtual void Dune::Fem::ManagedIndexSetInterface::resize ()=0
 resize of index set
 
virtual bool Dune::Fem::ManagedIndexSetInterface::compress ()=0
 compress of index set
 
virtual void Dune::Fem::ManagedIndexSetInterface::backup () const =0
 :: backup More...
 
virtual void Dune::Fem::ManagedIndexSetInterface::restore ()=0
 :: restore More...
 
virtual void Dune::Fem::ManagedIndexSetInterface::write (StandardOutStream &out) const =0
 new read/write methods using binary streams
 
void Dune::Fem::ManagedIndexSetInterface::addReference ()
 increase reference counter
 
bool Dune::Fem::ManagedIndexSetInterface::removeReference ()
 decrease reference counter and return true if zero reached
 
 Dune::Fem::ManagedIndexSet< IndexSetType, EntityType >::ManagedIndexSet (const IndexSetType &iset, LocalIndexSetObjectsType &insertList, LocalIndexSetObjectsType &removeList)
 Constructor of MemObject, only to call from DofManager.
 
 Dune::Fem::ManagedIndexSet< IndexSetType, EntityType >::~ManagedIndexSet ()
 destructor
 
void Dune::Fem::ManagedIndexSet< IndexSetType, EntityType >::resize ()
 wrap resize of index set
 
bool Dune::Fem::ManagedIndexSet< IndexSetType, EntityType >::compress ()
 wrap compress of index set
 
virtual void Dune::Fem::ManagedIndexSet< IndexSetType, EntityType >::read (StandardInStream &in)
 new write method
 
virtual void Dune::Fem::ManagedIndexSet< IndexSetType, EntityType >::write (StandardOutStream &out) const
 new write method
 
 Dune::Fem::DofStorageInterface::DofStorageInterface ()=default
 do not allow to create explicit instances
 
virtual Dune::Fem::DofStorageInterface::~DofStorageInterface ()=default
 destructor
 
virtual void Dune::Fem::DofStorageInterface::enableDofCompression ()
 enable dof compression for dof storage (default is empty)
 
virtual SizeType Dune::Fem::DofStorageInterface::size () const =0
 size of space, i.e. mapper.size()
 
 Dune::Fem::ManagedDofStorageInterface::ManagedDofStorageInterface ()=default
 do not allow to create explicit instances
 
virtual Dune::Fem::ManagedDofStorageInterface::~ManagedDofStorageInterface ()=default
 destructor
 
virtual void Dune::Fem::ManagedDofStorageInterface::resize (const bool enlargeOnly)=0
 resize memory
 
virtual void Dune::Fem::ManagedDofStorageInterface::reserve (const SizeType newSize)=0
 resize memory
 
virtual void Dune::Fem::ManagedDofStorageInterface::dofCompress (const bool clearResizedArrays)=0
 
virtual size_t Dune::Fem::ManagedDofStorageInterface::usedMemorySize () const =0
 return size of mem used by MemObject
 
 Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::ManagedDofStorageImplementation (const GridImp &grid, const MapperType &mapper, DofArrayType &array)
 Constructor of ManagedDofStorageImplementation, only to call from derived classes.
 
 Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::~ManagedDofStorageImplementation ()
 destructor deleting MemObject from resize and reserve List
 
ResizeMemoryObjectType & Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::resizeMemoryObject ()
 return object that calls resize of this memory object
 
ReserveMemoryObjectType & Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::reserveMemoryObject ()
 return object that calls reserve of this memory object
 
SizeType Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::size () const override
 return size of underlying array
 
void Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::resize (const bool enlargeOnly) override
 resize the memory with the new size
 
void Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::reserve (const SizeType needed) override
 reserve memory for what is coming
 
void Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::dofCompress (const bool clearResizedArrays) override
 copy the dof from the rear section of the vector to the holes
 
size_t Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::usedMemorySize () const override
 return used memory size
 
void Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::enableDofCompression () override
 enable dof compression for this MemObject
 
DofArrayType & Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::getArray ()
 return reference to array for DiscreteFunction
 
void Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::moveToFront (const SizeType oldSize, const int block)
 move block to front again
 
 Dune::Fem::ManagedDofStorage< GridImp, MapperType, DofArrayType >::ManagedDofStorage (const GridImp &grid, const MapperType &mapper)
 Constructor of ManagedDofStorage.
 
template<class DofStorageType , class GridType , class MapperType >
static std::pair< DofStorageInterface *, DofStorageType * > Dune::Fem::allocateManagedDofStorage (const GridType &grid, const MapperType &mapper, const DofStorageType *=0)
 default implementation for creating a managed dof storage
 
void Dune::Fem::RemoveIndicesFromSet< IndexSetType, EntityType >::apply (EntityType &entity)
 apply wraps the removeEntity Method of the index set
 
void Dune::Fem::InsertIndicesToSet< IndexSetType, EntityType >::apply (EntityType &entity)
 apply wraps the insertEntity method of the index set
 
template<class EntityType >
void Dune::Fem::IndexSetRestrictProlong< DofManagerType, RestrictProlongIndexSetType, doResize >::restrictLocal (const EntityType &father, const EntityType &son, bool initialize) const
 restrict data to father and resize memory if doResize is true
 
template<class EntityType >
void Dune::Fem::IndexSetRestrictProlong< DofManagerType, RestrictProlongIndexSetType, doResize >::prolongLocal (const EntityType &father, const EntityType &son, bool initialize) const
 prolong data to children and resize memory if doResize is true
 
template<class EntityType >
void Dune::Fem::EmptyIndexSetRestrictProlong::restrictLocal (EntityType &father, EntityType &son, bool initialize) const
 restrict data to father and resize memory if doResize is true
 
template<class EntityType >
void Dune::Fem::EmptyIndexSetRestrictProlong::prolongLocal (EntityType &father, EntityType &son, bool initialize) const
 prolong data to children and resize memory if doResize is true
 
double Dune::Fem::DofManager< Grid >::memoryFactor () const
 return factor to over estimate new memory allocation
 
template<class IndexSetType >
void Dune::Fem::DofManager< Grid >::addIndexSet (const IndexSetType &iset)
 add index set to dof manager's list of index sets More...
 
template<class IndexSetType >
void Dune::Fem::DofManager< Grid >::removeIndexSet (const IndexSetType &iset)
 removed index set from dof manager's list of index sets More...
 
template<class ManagedDofStorageImp >
void Dune::Fem::DofManager< Grid >::addDofStorage (ManagedDofStorageImp &dofStorage)
 add a managed dof storage to the dof manager. More...
 
template<class ManagedDofStorageImp >
void Dune::Fem::DofManager< Grid >::removeDofStorage (ManagedDofStorageImp &dofStorage)
 remove a managed dof storage from the dof manager. More...
 
NewIndexSetRestrictProlongType & Dune::Fem::DofManager< Grid >::indexSetRestrictProlong ()
 returns the index set restriction and prolongation operator
 
IndexSetRestrictProlongNoResizeType & Dune::Fem::DofManager< Grid >::indexSetRestrictProlongNoResize ()
 returns the index set restriction and prolongation operator
 
bool Dune::Fem::DofManager< Grid >::hasIndexSets () const
 if dofmanagers list is not empty return true
 
size_t Dune::Fem::DofManager< Grid >::usedMemorySize () const
 return used memory size of all MemObjects in bytes.
 
void Dune::Fem::DofManager< Grid >::resizeForRestrict ()
 resize memory before data restriction during grid adaptation is done.
 
void Dune::Fem::DofManager< Grid >::reserveMemory (std::size_t nsize, bool dummy=false)
 reserve memory for at least nsize elements, dummy is needed for dune-grid ALUGrid version
 
int Dune::Fem::DofManager< Grid >::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 Dune::Fem::DofManager< Grid >::resize ()
 Resize index sets and memory due to what the mapper has as new size. More...
 
void Dune::Fem::DofManager< Grid >::insertEntity (ConstElementType &element)
 Inserts entity to all index sets added to dof manager.
 
void Dune::Fem::DofManager< Grid >::removeEntity (ConstElementType &element) const
 Removes entity from all index sets added to dof manager.
 
void Dune::Fem::DofManager< Grid >::resizeMemory ()
 resize the MemObject if necessary
 
void Dune::Fem::DofManager< Grid >::enlargeMemory ()
 resize the MemObject if necessary
 
void Dune::Fem::DofManager< Grid >::incrementSequenceNumber ()
 increase the DofManagers internal sequence number More...
 
void Dune::Fem::DofManager< Grid >::compress ()
 Compress all data that is hold by this dofmanager. More...
 
bool Dune::Fem::DofManager< Grid >::notifyGlobalChange (const bool wasChanged) const
 communicate new sequence number
 
template<class DataCollType >
void Dune::Fem::DofManager< Grid >::addDataInliner (DataCollType &d)
 add data handler for data inlining to dof manager
 
void Dune::Fem::DofManager< Grid >::clearDataInliners ()
 clear data inliner list
 
template<class DataCollType >
void Dune::Fem::DofManager< Grid >::addDataXtractor (DataCollType &d)
 add data handler for data xtracting to dof manager
 
void Dune::Fem::DofManager< Grid >::clearDataXtractors ()
 clear data xtractor list
 
bool Dune::Fem::DofManager< Grid >::contains (const int dim, const int codim) const
 the dof manager only transfers element data during load balancing
 
bool Dune::Fem::DofManager< Grid >::fixedSize (const int dim, const int codim) const
 fixed size is false
 
template<class Entity >
size_t Dune::Fem::DofManager< Grid >::size (const Entity &) const
 for convenience
 
void Dune::Fem::DofManager< Grid >::gather (InlineStreamType &str, ConstElementType &element) const
 packs all data attached to this entity
 
void Dune::Fem::DofManager< Grid >::scatter (XtractStreamType &str, ConstElementType &element, size_t)
 unpacks all data attached of this entity from message buffer
 
template<class MessageBuffer , class Entity >
void Dune::Fem::DofManager< Grid >::scatter (MessageBuffer &str, const Entity &entity, size_t)
 unpacks all data of this entity from message buffer
 
void Dune::Fem::DofManager< Grid >::backup () const
 :: backup More...
 
void Dune::Fem::DofManager< Grid >::restore ()
 :: restore More...
 
template<class OutStream >
void Dune::Fem::DofManager< Grid >::write (OutStream &out) const
 write all index sets to a given stream More...
 
template<class InStream >
void Dune::Fem::DofManager< Grid >::read (InStream &in)
 read all index sets from a given stream More...
 
static ThisTypeDune::Fem::DofManager< Grid >::instance (const GridType &grid)
 obtain a reference to the DofManager for a given grid More...
 
static DofManagerType & Dune::Fem::DofManagerFactory< DofManagerImp >::instance (const GridType &grid)
 obtain a reference to the DofManager for a given grid More...
 
static bool Dune::Fem::DofManagerFactory< DofManagerImp >::writeDofManagerNew (const GridType &grid, const std ::string &filename, int timestep)
 writes DofManager of corresponding grid, when DofManager exists
 
static bool Dune::Fem::DofManagerFactory< DofManagerImp >::readDofManagerNew (const GridType &grid, const std ::string &filename, int timestep)
 reads DofManager of corresponding grid, when DofManager exists
 
static void Dune::Fem::DofManagerFactory< DofManagerImp >::deleteDofManager (DofManagerType &dm)
 delete the dof manager that belong to the given grid
 

Detailed Description

Function Documentation

◆ addDofStorage()

template<class GridType >
template<class ManagedDofStorageImp >
void Dune::Fem::DofManager< GridType >::addDofStorage ( ManagedDofStorageImp &  dofStorage)

add a managed dof storage to the dof manager.

Parameters
dofStoragedof storage to add which must fulfill the ManagedDofStorageInterface

Referenced by Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::ManagedDofStorageImplementation().

◆ addIndexSet()

template<class GridType >
template<class IndexSetType >
void Dune::Fem::DofManager< GridType >::addIndexSet ( const IndexSetType &  iset)
inline

add index set to dof manager's list of index sets

During adaptation, all index sets known to the dof manager are notified of the changes.

To register an index set with the dof manager, it has to satisfy the following interface:

void insertEntity ( const Element & );
void removeEntity ( const Element & );
void resize();
bool compress();
abstract interface for an input stream
Definition: streams.hh:190
abstract interface for an output stream
Definition: streams.hh:48
void resize()
Resize index sets and memory due to what the mapper has as new size.
Definition: dofmanager.hh:1012
void insertEntity(ConstElementType &element)
Inserts entity to all index sets added to dof manager.
Definition: dofmanager.hh:1020
void read(InStream &in)
read all index sets from a given stream
Definition: dofmanager.hh:1235
void compress()
Compress all data that is hold by this dofmanager.
Definition: dofmanager.hh:1068
void removeEntity(ConstElementType &element) const
Removes entity from all index sets added to dof manager.
Definition: dofmanager.hh:1030
void write(OutStream &out) const
write all index sets to a given stream
Definition: dofmanager.hh:1224
Parameters
[in]isetindex set to add to list

References Dune::Fem::ManagedIndexSetInterface::addReference(), and DUNE_THROW.

◆ backup() [1/2]

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

:: backup

:: backup

◆ backup() [2/2]

virtual void Dune::Fem::ManagedIndexSetInterface::backup ( ) const
pure virtual

:: backup

:: backup

◆ compress()

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

Compress all data that is hold by this dofmanager.

Note
This will increase the sequence counter by 1.

References Dune::Fem::DofManager< Grid >::incrementSequenceNumber().

Referenced by Dune::Fem::GenericDiscreteFunctionSpace< Traits >::adapt().

◆ dofCompress()

virtual void Dune::Fem::ManagedDofStorageInterface::dofCompress ( const bool  clearResizedArrays)
pure virtual

compressed the underlying dof vector and clear the array if it's temporary and clearresizedarrays is enabled (default)

Implemented in Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >, and Dune::Fem::ManagedDofStorageImplementation< GridType, BlockMapperType, DofVectorType >.

◆ incrementSequenceNumber()

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.

References Dune::Grid< dim, dimworld, ct, GridFamily >::comm().

Referenced by Dune::Fem::DofManager< Grid >::compress().

◆ instance() [1/2]

template<class Grid >
static ThisType & Dune::Fem::DofManager< Grid >::instance ( const GridType grid)
inlinestatic

obtain a reference to the DofManager for a given grid

Parameters
[in]gridgrid for which the DofManager is desired
Returns
a reference to the singleton instance of the DofManager

Referenced by Dune::Fem::CheckPointer< GridImp >::GridPersistentObject::backup().

◆ instance() [2/2]

template<class DofManagerImp >
static DofManagerType & Dune::Fem::DofManagerFactory< DofManagerImp >::instance ( const GridType &  grid)
inlinestaticprotected

obtain a reference to the DofManager for a given grid

Parameters
[in]gridgrid for which the DofManager is desired
Returns
a reference to the singleton instance of the DofManager

References Dune::Fem::SingletonList< Key, Object, Factory >::getObject().

◆ read()

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

◆ removeDofStorage()

template<class GridType >
template<class ManagedDofStorageImp >
void Dune::Fem::DofManager< GridType >::removeDofStorage ( ManagedDofStorageImp &  dofStorage)

remove a managed dof storage from the dof manager.

Parameters
dofStoragedof storage to remove which must fulfill the ManagedDofStorageInterface

Referenced by Dune::Fem::ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >::~ManagedDofStorageImplementation().

◆ removeIndexSet()

template<class GridType >
template<class IndexSetType >
void Dune::Fem::DofManager< GridType >::removeIndexSet ( const IndexSetType &  iset)
inline

removed index set from dof manager's list of index sets

During adaptation, all index sets known to the dof manager are notified of the changes.

Parameters
[in]isetindex set to add to list

References DUNE_THROW, and Dune::Fem::ManagedIndexSetInterface::removeReference().

◆ resize()

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.

References Dune::Fem::DofManager< Grid >::resizeMemory().

Referenced by Dune::Fem::GenericDiscreteFunctionSpace< Traits >::adapt(), and Dune::Fem::DofManager< Grid >::restore().

◆ restore() [1/2]

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

:: restore

:: restore

References Dune::Fem::DofManager< Grid >::resize().

◆ restore() [2/2]

virtual void Dune::Fem::ManagedIndexSetInterface::restore ( )
pure virtual

:: restore

:: restore

◆ sequence()

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::DomainDecomposedIterator< GridPart >::update(), and Dune::Fem::ThreadIterator< GridPart, ptype >::update().

◆ write()

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
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 20, 23:30, 2024)