GEOS
Classes | Public Member Functions | List of all members
geos::multiscale::DofManager Class Reference

Degree-of-freedom manager that works with multiscale mesh levels. More...

#include <DofManager.hpp>

Public Member Functions

 DofManager (string name)
 Constructor. More...
 
 DofManager (DofManager const &)=delete
 Deleted copy constructor.
 
 DofManager (DofManager &&)=default
 Move constructor.
 
DofManageroperator= (DofManager const &)=delete
 Deleted copy assignment. More...
 
DofManageroperator= (DofManager &&)=default
 Defaulted move assignment. More...
 
void clear ()
 Remove all previously added fields.
 
void setDomain (DomainPartition &domain)
 Assign a domain. More...
 
void addField (string const &fieldName, integer const components, MeshObjectManager &manager)
 Add a field. More...
 
void reorderByRank ()
 Finish populating fields and apply appropriate dof renumbering.
 
std::size_t numFields () const
 
bool fieldExists (string const &name) const
 Check if string key is already being used. More...
 
string const & key (string const &fieldName) const
 Return the key used to record the field in the DofManager. More...
 
globalIndex numGlobalDofs (string const &fieldName) const
 
globalIndex numGlobalDofs () const
 
localIndex numLocalDofs (string const &fieldName) const
 
localIndex numLocalDofs () const
 
localIndex localOffset (string const &fieldName) const
 
globalIndex rankOffset (string const &fieldName) const
 
globalIndex rankOffset () const
 
integer numComponents (string const &fieldName) const
 
integer numComponents () const
 
globalIndex globalOffset (string const &fieldName) const
 
MeshObjectManager const & manager (string const &fieldName) const
 
DomainPartitiondomain ()
 
template<typename MATRIX >
void makeRestrictor (string const &fieldName, MPI_Comm const &comm, bool transpose, MATRIX &restrictor) const
 Create a matrix that restricts vectors and matrices to a subset of DOFs. More...
 

Detailed Description

Degree-of-freedom manager that works with multiscale mesh levels.

Simplified implementation and capabilities compared to the geos::DofManager.

Definition at line 36 of file DofManager.hpp.

Constructor & Destructor Documentation

◆ DofManager()

geos::multiscale::DofManager::DofManager ( string  name)
explicit

Constructor.

Parameters
[in]namea unique name for this DoF manager

Member Function Documentation

◆ addField()

void geos::multiscale::DofManager::addField ( string const &  fieldName,
integer const  components,
MeshObjectManager manager 
)

Add a field.

Parameters
fieldNamename of the field
componentsnumber of components
managerthe mesh manager the field is defined on

◆ domain()

DomainPartition& geos::multiscale::DofManager::domain ( )
inline
Returns
the physical domain

Definition at line 182 of file DofManager.hpp.

◆ fieldExists()

bool geos::multiscale::DofManager::fieldExists ( string const &  name) const

Check if string key is already being used.

Parameters
namefield key to check
Returns
flag true if exists

◆ globalOffset()

globalIndex geos::multiscale::DofManager::globalOffset ( string const &  fieldName) const
Returns
global offset of field's block on current processor in the system matrix.
Parameters
[in]fieldNamename of the field.

◆ key()

string const& geos::multiscale::DofManager::key ( string const &  fieldName) const

Return the key used to record the field in the DofManager.

Parameters
[in]fieldNamestring the name of the field.
Returns
string indicating name of the field.

◆ localOffset()

localIndex geos::multiscale::DofManager::localOffset ( string const &  fieldName) const
Returns
local offset of field's block on current processor in the system matrix.
Parameters
[in]fieldNamename of the field.

◆ makeRestrictor()

template<typename MATRIX >
void geos::multiscale::DofManager::makeRestrictor ( string const &  fieldName,
MPI_Comm const &  comm,
bool  transpose,
MATRIX &  restrictor 
) const

Create a matrix that restricts vectors and matrices to a subset of DOFs.

Template Parameters
MATRIXtype of matrix used for restrictor
Parameters
fieldNamea fields to select
commthe MPI communicator to use in the operator
transposeif true, the transpose (prolongation) operator will be created
restrictorresulting operator
Note
Can only be called after reorderByRank(), since global DOF indexing is required for the restrictor to make sense.

◆ manager()

MeshObjectManager const& geos::multiscale::DofManager::manager ( string const &  fieldName) const
Returns
reference to the mesh object manager for field fieldName.
Parameters
fieldNamename name of the field.

◆ numComponents() [1/2]

integer geos::multiscale::DofManager::numComponents ( ) const
Returns
number of dof components across all fields.

◆ numComponents() [2/2]

integer geos::multiscale::DofManager::numComponents ( string const &  fieldName) const
Returns
number of components in a given field.
Parameters
fieldNamename of the field

◆ numFields()

std::size_t geos::multiscale::DofManager::numFields ( ) const
inline
Returns
the number of registered fields.

Definition at line 98 of file DofManager.hpp.

◆ numGlobalDofs() [1/2]

globalIndex geos::multiscale::DofManager::numGlobalDofs ( ) const
Returns
total number of dofs across all fields and processors.

◆ numGlobalDofs() [2/2]

globalIndex geos::multiscale::DofManager::numGlobalDofs ( string const &  fieldName) const
Returns
number of global dofs of a given field.
Parameters
fieldNamethe name of the field

◆ numLocalDofs() [1/2]

localIndex geos::multiscale::DofManager::numLocalDofs ( ) const
Returns
total number of dofs across all fields on current processor.

◆ numLocalDofs() [2/2]

localIndex geos::multiscale::DofManager::numLocalDofs ( string const &  fieldName) const
Returns
number of local dofs of a given field.
Parameters
fieldNamename of the field

◆ operator=() [1/2]

DofManager& geos::multiscale::DofManager::operator= ( DofManager &&  )
default

Defaulted move assignment.

Returns

◆ operator=() [2/2]

DofManager& geos::multiscale::DofManager::operator= ( DofManager const &  )
delete

Deleted copy assignment.

Returns

◆ rankOffset() [1/2]

globalIndex geos::multiscale::DofManager::rankOffset ( ) const
Returns
rank offset of current processor, i.e. total number of dofs on previous processors.

◆ rankOffset() [2/2]

globalIndex geos::multiscale::DofManager::rankOffset ( string const &  fieldName) const
Returns
rank offset of given field, i.e. total number of dofs of this field on previous processors.
Parameters
fieldNamename of the field

◆ setDomain()

void geos::multiscale::DofManager::setDomain ( DomainPartition domain)

Assign a domain.

Parameters
domainthe target domain

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