GEOSX
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
geosx::DofManager Class Reference

The DoFManager is responsible for allocating global dofs, constructing sparsity patterns, and generally simplifying the interaction between PhysicsSolvers and linear algebra operations. More...

#include <DofManager.hpp>

Classes

struct  CouplingDescription
 
struct  FieldDescription
 
struct  SubComponent
 Describes a selection of components from a DoF field. More...
 

Public Types

enum  Location { Location::Elem, Location::Face, Location::Edge, Location::Node }
 Enumeration of geometric objects for support location. Note that this enum is nearly identical to Connectivity, but we keep both for code readability in function calls. More...
 
enum  Connector {
  Connector::Elem, Connector::Face, Connector::Edge, Connector::Node,
  Connector::None, Connector::Stencil
}
 Enumeration of geometric objects for connectivity type. Note that this enum is nearly identical to Location, but we keep both for code readability in function calls. More...
 

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 &&)=delete
 Deleted move assignment. More...
 
 ~DofManager ()=default
 Destructor.
 
void clear ()
 
void setMesh (DomainPartition &domain, localIndex const meshLevelIndex=0, localIndex const meshBodyIndex=0)
 Assign a mesh. More...
 
void addField (string const &fieldName, Location const location)
 Just an interface to allow only three parameters. More...
 
void addField (string const &fieldName, Location const location, localIndex const components)
 Just another interface to allow four parameters (no regions, default is everywhere). More...
 
void addField (string const &fieldName, Location const location, arrayView1d< string const > const &regions)
 Just another interface to allow four parameters (no components, default is 1). More...
 
void addField (string const &fieldName, Location const location, localIndex const components, arrayView1d< string const > const &regions)
 The user can add a field with a support location, connectivity type, string key, number of scalar components, and a list of element regions over which the field is active. If the region list is empty, it is assumed the field exists on all regions. More...
 
void addCoupling (string const &rowFieldName, string const &colFieldName, Connector const connectivity)
 Just an interface to allow only three parameters. More...
 
void addCoupling (string const &rowFieldName, string const &colFieldName, Connector const connectivity, arrayView1d< string const > const &regions)
 Just another interface to allow four parameters (no symmetry, default is true). More...
 
void addCoupling (string const &rowFieldName, string const &colFieldName, Connector const connectivity, bool const symmetric)
 Just another interface to allow four parameters (no regions, default is everywhere). More...
 
void addCoupling (string const &rowFieldName, string const &colFieldName, Connector const connectivity, arrayView1d< string const > const &regions, bool const symmetric)
 Add coupling between two fields. The connectivity argument defines how the two fields couple. If the first field has support location A, the second field has support location B, and the connecting object is C, the sparsity pattern will be defined as (AC)(CB). The final argument indicates if the coupling is symmetric, in the sense that there is a two-way coupling between the fields. Without this argument, a nonzero block will be added to the system matrix for block AB, but block BA will remain zero (one-way coupling). More...
 
void addCoupling (string const &fieldName, FluxApproximationBase const &stencils)
 Special interface for self-connectivity through a stencil. More...
 
void reorderByRank ()
 Finish populating fields and apply appropriate dof renumbering. More...
 
bool fieldExists (string const &name) const
 Check if string key is already being used. More...
 
string const & getKey (string const &fieldName) const
 Return the key used to record the field in the DofManager. More...
 
globalIndex numGlobalDofs (string const &fieldName="") const
 Return global number of dofs across all processors. If field argument is empty, return monolithic size. More...
 
localIndex numLocalDofs (string const &fieldName="") const
 Return local number of dofs on this processor. If field argument is empty, return monolithic size. More...
 
array1d< localIndexnumLocalDofsPerField () const
 Return an array of local number of dofs on this processor sorted by field registration order. More...
 
array1d< localIndexgetLocalDofComponentLabels () const
 Computes an array of size equal to sum of all field local number of dofs containing unique integer labels associated to components stored in the field descriptions. More...
 
globalIndex rankOffset (string const &fieldName="") const
 Return the sum of local dofs across all previous processors w.r.t. to the calling one for the specified field. More...
 
localIndex numComponents (string const &fieldName="") const
 Get the number of components in a field. If field argument is empty, return the total number of components across fields. More...
 
array1d< localIndexnumComponentsPerField () const
 Return an array of number of components per field, sorted by field registration order. More...
 
localIndex numLocalSupport (string const &fieldName) const
 Get the local number of support points on this processor. More...
 
globalIndex numGlobalSupport (string const &fieldName) const
 Get the local number of support points across all processors. More...
 
Location getLocation (string const &fieldName) const
 Get the support location type of the field. More...
 
globalIndex globalOffset (string const &fieldName) const
 Get global offset of field's block on current processor in the system matrix. More...
 
template<typename MATRIX >
void setSparsityPattern (MATRIX &matrix, bool closePattern=true) const
 Populate sparsity pattern of the entire system matrix. More...
 
template<typename MATRIX >
void setSparsityPattern (MATRIX &matrix, string const &rowFieldName, string const &colFieldName, bool closePattern=true) const
 Populate sparsity pattern for one block of the system matrix. More...
 
void setSparsityPattern (SparsityPattern< globalIndex > &pattern) const
 Populate sparsity pattern of the entire system matrix. More...
 
void setSparsityPattern (SparsityPattern< globalIndex > &pattern, string const &rowFieldName, string const &colFieldName) const
 Populate sparsity pattern for one block of the system matrix. More...
 
template<typename VECTOR >
void copyVectorToField (VECTOR const &vector, string const &srcFieldName, string const &dstFieldName, real64 const scalingFactor, localIndex const loCompIndex=0, localIndex const hiCompIndex=-1) const
 Copy values from LA vectors to simulation data arrays. More...
 
void copyVectorToField (arrayView1d< real64 const > const &localVector, string const &srcFieldName, string const &dstFieldName, real64 const scalingFactor, localIndex const loCompIndex=0, localIndex const hiCompIndex=-1) const
 Copy values from LA vectors to simulation data arrays. More...
 
template<typename VECTOR >
void addVectorToField (VECTOR const &vector, string const &srcFieldName, string const &dstFieldName, real64 const scalingFactor, localIndex const loCompIndex=0, localIndex const hiCompIndex=-1) const
 Add values from LA vectors to simulation data arrays. More...
 
void addVectorToField (arrayView1d< real64 const > const &localVector, string const &srcFieldName, string const &dstFieldName, real64 const scalingFactor, localIndex const loCompIndex=0, localIndex const hiCompIndex=-1) const
 Add values from LA vectors to simulation data arrays. More...
 
template<typename VECTOR >
void copyFieldToVector (VECTOR &vector, string const &srcFieldName, string const &dstFieldName, real64 const scalingFactor, localIndex const loCompIndex=0, localIndex const hiCompIndex=-1) const
 Copy values from nodes to DOFs. More...
 
void copyFieldToVector (arrayView1d< real64 > const &localVector, string const &srcFieldName, string const &dstFieldName, real64 const scalingFactor, localIndex const loCompIndex=0, localIndex const hiCompIndex=-1) const
 Copy values from simulation data arrays to vectors. More...
 
template<typename VECTOR >
void addFieldToVector (VECTOR &vector, string const &srcFieldName, string const &dstFieldName, real64 const scalingFactor, localIndex const loCompIndex=0, localIndex const hiCompIndex=-1) const
 Add values from a simulation data array to a DOF vector. More...
 
void addFieldToVector (arrayView1d< real64 > const &localVector, string const &srcFieldName, string const &dstFieldName, real64 const scalingFactor, localIndex const loCompIndex=0, localIndex const hiCompIndex=-1) const
 Add values from a simulation data array to a DOF vector. More...
 
std::vector< SubComponentfilterDofs (std::vector< SubComponent > const &excluded) const
 Create a dof selection by filtering out excluded components. More...
 
template<typename MATRIX >
void makeRestrictor (std::vector< SubComponent > const &selection, MPI_Comm const &comm, bool transpose, MATRIX &restrictor) const
 Create a matrix that restricts vectors and matrices to a subset of DOFs. More...
 
void printFieldInfo (std::ostream &os=std::cout) const
 Print the summary of declared fields and coupling. More...
 

Static Public Attributes

static localIndex constexpr MAX_FIELDS = 10
 

Detailed Description

The DoFManager is responsible for allocating global dofs, constructing sparsity patterns, and generally simplifying the interaction between PhysicsSolvers and linear algebra operations.

Definition at line 42 of file DofManager.hpp.

Member Enumeration Documentation

◆ Connector

Enumeration of geometric objects for connectivity type. Note that this enum is nearly identical to Location, but we keep both for code readability in function calls.

Enumerator
Elem 

connectivity is element (like in finite elements)

Face 

connectivity is face (like in finite volumes TPFA)

Edge 

connectivity is edge (like fracture element connectors)

Node 

connectivity is node (like in finite volumes MPFA)

None 

there is no connectivity (self connected field, like a lumped mass matrix)

Stencil 

connectivity is through a (set of) user-provided stencil(s)

Definition at line 64 of file DofManager.hpp.

◆ Location

Enumeration of geometric objects for support location. Note that this enum is nearly identical to Connectivity, but we keep both for code readability in function calls.

Enumerator
Elem 

location is element (like pressure in finite volumes)

Face 

location is face (like flux in mixed finite elements)

Edge 

location is edge (like flux between fracture elements)

Node 

location is node (like displacements in finite elements)

Definition at line 51 of file DofManager.hpp.

Constructor & Destructor Documentation

◆ DofManager()

geosx::DofManager::DofManager ( string  name)
explicit

Constructor.

Parameters
[in]namea unique name for this DoF manager

Member Function Documentation

◆ addCoupling() [1/5]

void geosx::DofManager::addCoupling ( string const &  rowFieldName,
string const &  colFieldName,
Connector const  connectivity 
)

Just an interface to allow only three parameters.

Parameters
[in]rowFieldNamestring the name of the row field.
[in]colFieldNamestring the name of the col field.
[in]connectivityConnectivity through what they are connected.

◆ addCoupling() [2/5]

void geosx::DofManager::addCoupling ( string const &  rowFieldName,
string const &  colFieldName,
Connector const  connectivity,
arrayView1d< string const > const &  regions 
)

Just another interface to allow four parameters (no symmetry, default is true).

Parameters
[in]rowFieldNamestring the name of the row field.
[in]colFieldNamestring the name of the col field.
[in]connectivityConnectivity through what they are connected.
[in]regionsnames of regions where this coupling is defined.

◆ addCoupling() [3/5]

void geosx::DofManager::addCoupling ( string const &  rowFieldName,
string const &  colFieldName,
Connector const  connectivity,
bool const  symmetric 
)

Just another interface to allow four parameters (no regions, default is everywhere).

Parameters
[in]rowFieldNamestring the name of the row field.
[in]colFieldNamestring the name of the col field.
[in]connectivityConnectivity through what they are connected.
[in]symmetricbool is it symmetric, i.e., both row-col and col-row?

◆ addCoupling() [4/5]

void geosx::DofManager::addCoupling ( string const &  rowFieldName,
string const &  colFieldName,
Connector const  connectivity,
arrayView1d< string const > const &  regions,
bool const  symmetric 
)

Add coupling between two fields. The connectivity argument defines how the two fields couple. If the first field has support location A, the second field has support location B, and the connecting object is C, the sparsity pattern will be defined as (AC)(CB). The final argument indicates if the coupling is symmetric, in the sense that there is a two-way coupling between the fields. Without this argument, a nonzero block will be added to the system matrix for block AB, but block BA will remain zero (one-way coupling).

  • Example 1 = ("node_field","elem_field", ELEM, true) couples all dofs sharing a common element (two-way coupling)
  • Example 2 = ("node_field_1","node_field_2", NODE, true) couples all dofs sharing a common node (two-way coupling)
  • Example 3 = ("node_field_1","face_field", NODE, false) couples nodal dofs to adjacent faces (one-way coupling)
Parameters
[in]rowFieldNamestring the name of the row field.
[in]colFieldNamestring the name of the col field.
[in]connectivityConnectivity through what they are connected.
[in]regionsnames of regions where this coupling is defined.
[in]symmetricbool is it symmetric, i.e., both row-col and col-row?

◆ addCoupling() [5/5]

void geosx::DofManager::addCoupling ( string const &  fieldName,
FluxApproximationBase const &  stencils 
)

Special interface for self-connectivity through a stencil.

Parameters
[in]fieldNamename of the field (this is only for diagonal blocks)
[in]stencilsa pointer to FluxApproximation storing the stencils

The field must be defined on element support. The set of regions is taken automatically from the field definition.

◆ addField() [1/4]

void geosx::DofManager::addField ( string const &  fieldName,
Location const  location 
)

Just an interface to allow only three parameters.

Parameters
[in]fieldNamestring the name of the field.
[in]locationLocation where it is defined.

◆ addField() [2/4]

void geosx::DofManager::addField ( string const &  fieldName,
Location const  location,
localIndex const  components 
)

Just another interface to allow four parameters (no regions, default is everywhere).

Parameters
[in]fieldNamestring the name of the field.
[in]locationLocation where it is defined.
[in]componentslocalIndex number of components (for vector fields).

◆ addField() [3/4]

void geosx::DofManager::addField ( string const &  fieldName,
Location const  location,
arrayView1d< string const > const &  regions 
)

Just another interface to allow four parameters (no components, default is 1).

Parameters
[in]fieldNamestring the name of the field.
[in]locationLocation where it is defined.
[in]regionsnames of regions where this field is defined.

◆ addField() [4/4]

void geosx::DofManager::addField ( string const &  fieldName,
Location const  location,
localIndex const  components,
arrayView1d< string const > const &  regions 
)

The user can add a field with a support location, connectivity type, string key, number of scalar components, and a list of element regions over which the field is active. If the region list is empty, it is assumed the field exists on all regions.

The connectivity type is used to infer the sparsity pattern that connects degrees of freedom. If LC denotes a boolean connectivity graph between support locations L and connectors C, the desired sparsity pattern will be computed as LC*CL. For example, for a TPFA discretization we have dofs located at cell centers, and connected through adjacent faces. In this example, LC is the cell-to-face connectivity, and LC*CL is the desired TPFA sparsity pattern. More generally,

  • Example 1 = ("displacement",NODE,ELEM,3) for a Q1 finite-element interpolation for elasticity
  • Example 2 = ("pressure",ELEM,FACE,1) for a scalar TPFA-type approximation
  • Example 3 = ("pressure",ELEM,NODE,1) for a scalar MPFA-type approximation
  • Example 4 = ("mass",ELEM,NONE,1) for a diagonal-only sparsity pattern (no connectivitys)

When the number of components is greater than one, we always assume they are tightly coupled to one another and form a dense block. The sparsity pattern LC*CL is then interpreted as the super-node pattern, containing dense sub-blocks.

Parameters
[in]fieldNamestring the name of the field.
[in]locationLocation where it is defined.
[in]componentslocalIndex number of components (for vector fields).
[in]regionsnames of regions where this field is defined.

◆ addFieldToVector() [1/2]

template<typename VECTOR >
void geosx::DofManager::addFieldToVector ( VECTOR &  vector,
string const &  srcFieldName,
string const &  dstFieldName,
real64 const  scalingFactor,
localIndex const  loCompIndex = 0,
localIndex const  hiCompIndex = -1 
) const

Add values from a simulation data array to a DOF vector.

Template Parameters
FIELD_OPoperation to perform (see FieldSpecificationOps.hpp)
Parameters
vectortarget LA vector
srcFieldNamename of the source field (view wrapper key on the manager)
dstFieldNamename of the destination field (as defined in DofManager)
scalingFactora factor to scale vector values by
loCompIndexindex of starting DoF component (for partial copy)
hiCompIndexindex past the ending DoF component (for partial copy)
Note
[loCompIndex , hiCompIndex) form a half-open interval. Negative value of hiCompIndex means use full number of field components

◆ addFieldToVector() [2/2]

void geosx::DofManager::addFieldToVector ( arrayView1d< real64 > const &  localVector,
string const &  srcFieldName,
string const &  dstFieldName,
real64 const  scalingFactor,
localIndex const  loCompIndex = 0,
localIndex const  hiCompIndex = -1 
) const

Add values from a simulation data array to a DOF vector.

Template Parameters
FIELD_OPoperation to perform (see FieldSpecificationOps.hpp)
Parameters
localVectortarget vector
srcFieldNamename of the source field (view wrapper key on the manager)
dstFieldNamename of the destination field (as defined in DofManager)
scalingFactora factor to scale vector values by
loCompIndexindex of starting DoF component (for partial copy)
hiCompIndexindex past the ending DoF component (for partial copy)
Note
[loCompIndex , hiCompIndex) form a half-open interval. Negative value of hiCompIndex means use full number of field components

◆ addVectorToField() [1/2]

template<typename VECTOR >
void geosx::DofManager::addVectorToField ( VECTOR const &  vector,
string const &  srcFieldName,
string const &  dstFieldName,
real64 const  scalingFactor,
localIndex const  loCompIndex = 0,
localIndex const  hiCompIndex = -1 
) const

Add values from LA vectors to simulation data arrays.

Template Parameters
FIELD_OPoperation to perform (see FieldSpecificationOps.hpp)
Parameters
vectorsource LA vector
srcFieldNamename of the source field (as defined in DofManager)
dstFieldNamename of the destination field (view wrapper key on the manager)
scalingFactora factor to scale vector values by
loCompIndexindex of starting DoF component (for partial copy)
hiCompIndexindex past the ending DoF component (for partial copy)
Note
[loCompIndex , hiCompIndex) form a half-open interval. Negative value of hiCompIndex means use full number of field components

◆ addVectorToField() [2/2]

void geosx::DofManager::addVectorToField ( arrayView1d< real64 const > const &  localVector,
string const &  srcFieldName,
string const &  dstFieldName,
real64 const  scalingFactor,
localIndex const  loCompIndex = 0,
localIndex const  hiCompIndex = -1 
) const

Add values from LA vectors to simulation data arrays.

Parameters
localVectorsource local vector
srcFieldNamename of the source field (as defined in DofManager)
dstFieldNamename of the destination field (view wrapper key on the manager)
scalingFactora factor to scale vector values by
loCompIndexindex of starting DoF component (for partial copy)
hiCompIndexindex past the ending DoF component (for partial copy)
Note
[loCompIndex , hiCompIndex) form a half-open interval. Negative value of hiCompIndex means use full number of field components

◆ clear()

void geosx::DofManager::clear ( )

Remove all fields

◆ copyFieldToVector() [1/2]

template<typename VECTOR >
void geosx::DofManager::copyFieldToVector ( VECTOR &  vector,
string const &  srcFieldName,
string const &  dstFieldName,
real64 const  scalingFactor,
localIndex const  loCompIndex = 0,
localIndex const  hiCompIndex = -1 
) const

Copy values from nodes to DOFs.

Template Parameters
FIELD_OPoperation to perform (see FieldSpecificationOps.hpp)
Parameters
vectortarget LA vector
srcFieldNamename of the source field (view wrapper key on the manager)
dstFieldNamename of the destination field (as defined in DofManager)
scalingFactora factor to scale vector values by
loCompIndexindex of starting DoF component (for partial copy)
hiCompIndexindex past the ending DoF component (for partial copy)
Note
[loCompIndex , hiCompIndex) form a half-open interval. Negative value of hiCompIndex means use full number of field components

◆ copyFieldToVector() [2/2]

void geosx::DofManager::copyFieldToVector ( arrayView1d< real64 > const &  localVector,
string const &  srcFieldName,
string const &  dstFieldName,
real64 const  scalingFactor,
localIndex const  loCompIndex = 0,
localIndex const  hiCompIndex = -1 
) const

Copy values from simulation data arrays to vectors.

Template Parameters
FIELD_OPoperation to perform (see FieldSpecificationOps.hpp)
Parameters
localVectortarget LA vector
srcFieldNamename of the source field (view wrapper key on the manager)
dstFieldNamename of the destination field (as defined in DofManager)
scalingFactora factor to scale vector values by
loCompIndexindex of starting DoF component (for partial copy)
hiCompIndexindex past the ending DoF component (for partial copy)
Note
[loCompIndex , hiCompIndex) form a half-open interval. Negative value of hiCompIndex means use full number of field components

◆ copyVectorToField() [1/2]

template<typename VECTOR >
void geosx::DofManager::copyVectorToField ( VECTOR const &  vector,
string const &  srcFieldName,
string const &  dstFieldName,
real64 const  scalingFactor,
localIndex const  loCompIndex = 0,
localIndex const  hiCompIndex = -1 
) const

Copy values from LA vectors to simulation data arrays.

Template Parameters
FIELD_OPoperation to perform (see FieldSpecificationOps.hpp)
Parameters
vectorsource LA vector
srcFieldNamename of the source field (as defined in DofManager)
dstFieldNamename of the destination field (view wrapper key on the manager)
scalingFactora factor to scale vector values by
loCompIndexindex of starting DoF component (for partial copy)
hiCompIndexindex past the ending DoF component (for partial copy)
Note
[loCompIndex , hiCompIndex) form a half-open interval. Negative value of hiCompIndex means use full number of field components

◆ copyVectorToField() [2/2]

void geosx::DofManager::copyVectorToField ( arrayView1d< real64 const > const &  localVector,
string const &  srcFieldName,
string const &  dstFieldName,
real64 const  scalingFactor,
localIndex const  loCompIndex = 0,
localIndex const  hiCompIndex = -1 
) const

Copy values from LA vectors to simulation data arrays.

Parameters
localVectorsource local vector
srcFieldNamename of the source field (as defined in DofManager)
dstFieldNamename of the destination field (view wrapper key on the manager)
scalingFactora factor to scale vector values by
loCompIndexindex of starting DoF component (for partial copy)
hiCompIndexindex past the ending DoF component (for partial copy)
Note
[loCompIndex , hiCompIndex) form a half-open interval. Negative value of hiCompIndex means use full number of field components

◆ fieldExists()

bool geosx::DofManager::fieldExists ( string const &  name) const

Check if string key is already being used.

Parameters
namefield key to check
Returns
flag true if exists

◆ filterDofs()

std::vector< SubComponent > geosx::DofManager::filterDofs ( std::vector< SubComponent > const &  excluded) const

Create a dof selection by filtering out excluded components.

Parameters
excludeda list of dof components to exclude
Returns
a vector of remaining dof components
Note
Removed components must not have repeats, and each entry must either have loComp = 0 or hiComp = numComponents(fieldName) (or both). In other words, filtered out components must not leave "holes" in DOFs.

◆ getKey()

string const& geosx::DofManager::getKey ( 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.

◆ getLocalDofComponentLabels()

array1d< localIndex > geosx::DofManager::getLocalDofComponentLabels ( ) const

Computes an array of size equal to sum of all field local number of dofs containing unique integer labels associated to components stored in the field descriptions.

Returns
array1d of localIndex labels

◆ getLocation()

Location geosx::DofManager::getLocation ( string const &  fieldName) const

Get the support location type of the field.

Parameters
[in]fieldNamename of the field
Returns
support location type

◆ globalOffset()

globalIndex geosx::DofManager::globalOffset ( string const &  fieldName) const

Get global offset of field's block on current processor in the system matrix.

Parameters
[in]fieldNamename of the field.
Returns
global offset of the field

◆ makeRestrictor()

template<typename MATRIX >
void geosx::DofManager::makeRestrictor ( std::vector< SubComponent > const &  selection,
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
selectiona list of fields to select; each entry is a struct containing the name of the field and low and high selected component indices
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.

◆ numComponents()

localIndex geosx::DofManager::numComponents ( string const &  fieldName = "") const

Get the number of components in a field. If field argument is empty, return the total number of components across fields.

Parameters
[in]fieldNameOptional string the name of the field.
Returns
the number of dof components

◆ numComponentsPerField()

array1d< localIndex > geosx::DofManager::numComponentsPerField ( ) const

Return an array of number of components per field, sorted by field registration order.

Returns
array of number of components

◆ numGlobalDofs()

globalIndex geosx::DofManager::numGlobalDofs ( string const &  fieldName = "") const

Return global number of dofs across all processors. If field argument is empty, return monolithic size.

Parameters
[in]fieldNameOptional string the name of the field.
Returns
number of global dofs

◆ numGlobalSupport()

globalIndex geosx::DofManager::numGlobalSupport ( string const &  fieldName) const

Get the local number of support points across all processors.

Parameters
[in]fieldNamename of the field
Returns
number of global support points

◆ numLocalDofs()

localIndex geosx::DofManager::numLocalDofs ( string const &  fieldName = "") const

Return local number of dofs on this processor. If field argument is empty, return monolithic size.

Parameters
[in]fieldNameOptional string the name of the field.
Returns
number of local dofs

◆ numLocalDofsPerField()

array1d< localIndex > geosx::DofManager::numLocalDofsPerField ( ) const

Return an array of local number of dofs on this processor sorted by field registration order.

Returns
array of number of local dofs

◆ numLocalSupport()

localIndex geosx::DofManager::numLocalSupport ( string const &  fieldName) const

Get the local number of support points on this processor.

Parameters
[in]fieldNamethe name of the field
Returns
number of local support points

◆ operator=() [1/2]

DofManager& geosx::DofManager::operator= ( DofManager const &  )
delete

Deleted copy assignment.

Returns

◆ operator=() [2/2]

DofManager& geosx::DofManager::operator= ( DofManager &&  )
delete

Deleted move assignment.

Returns

◆ printFieldInfo()

void geosx::DofManager::printFieldInfo ( std::ostream &  os = std::cout) const

Print the summary of declared fields and coupling.

Parameters
osoutput stream

◆ rankOffset()

globalIndex geosx::DofManager::rankOffset ( string const &  fieldName = "") const

Return the sum of local dofs across all previous processors w.r.t. to the calling one for the specified field.

Parameters
[in]fieldNameOptional string the name of the field.
Returns
the rank offset

◆ reorderByRank()

void geosx::DofManager::reorderByRank ( )

Finish populating fields and apply appropriate dof renumbering.

This function must be called after all field and coupling information has been added. It adjusts DoF index arrays to account for presence of other fields (in a global monolithic fashion).

Note
After DofManager has been closed, new fields and coupling cannot be added, until clear or setMesh is called.
After reorderByRank() is called, the meaning of FieldDescription::globalOffset changes from "global offset of field's block in a global field-wise ordered (block) system" to "global offset of field's block on current processor in a rank-wise ordered system". This meaning is consistent with its use throughout. For example, this is the row/col global offset used to insert the field's sparsity block into a global coupled system.

◆ setMesh()

void geosx::DofManager::setMesh ( DomainPartition domain,
localIndex const  meshLevelIndex = 0,
localIndex const  meshBodyIndex = 0 
)

Assign a mesh.

Parameters
[in]domainDomainPartition the input domain.
[in]meshLevelIndexOptional localIndex the mesh level.
[in]meshBodyIndexOptional localIndex the body level.

◆ setSparsityPattern() [1/4]

template<typename MATRIX >
void geosx::DofManager::setSparsityPattern ( MATRIX &  matrix,
bool  closePattern = true 
) const

Populate sparsity pattern of the entire system matrix.

Parameters
[out]matrixthe target parallel matrix
[in]closePatternwhether to reorderByRank the matrix upon pattern assembly

◆ setSparsityPattern() [2/4]

template<typename MATRIX >
void geosx::DofManager::setSparsityPattern ( MATRIX &  matrix,
string const &  rowFieldName,
string const &  colFieldName,
bool  closePattern = true 
) const

Populate sparsity pattern for one block of the system matrix.

Parameters
[out]matrixthe target parallel matrix
[in]rowFieldNamethe name of the row field.
[in]colFieldNamethe name of the col field.
[in]closePatternwhether to reorderByRank the matrix upon pattern assembly

◆ setSparsityPattern() [3/4]

void geosx::DofManager::setSparsityPattern ( SparsityPattern< globalIndex > &  pattern) const

Populate sparsity pattern of the entire system matrix.

Parameters
[out]patternthe target sparsity pattern

◆ setSparsityPattern() [4/4]

void geosx::DofManager::setSparsityPattern ( SparsityPattern< globalIndex > &  pattern,
string const &  rowFieldName,
string const &  colFieldName 
) const

Populate sparsity pattern for one block of the system matrix.

Parameters
[out]patternthe target sparsity pattern
[in]rowFieldNamename of the row field
[in]colFieldNamename of the col field

Member Data Documentation

◆ MAX_FIELDS

localIndex constexpr geosx::DofManager::MAX_FIELDS = 10
static

Limit on max number of fields

Definition at line 77 of file DofManager.hpp.


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