Sundance::MixedDOFMap Class Reference

A MixedDOFMap is a DOF map for the case where every function is defined on every cell in the mesh, but where functions may have different bases. More...

Inheritance diagram for Sundance::MixedDOFMap:

Sundance::SpatiallyHomogeneousDOFMapBase Sundance::DOFMapBase Playa::Printable

List of all members.

Public Member Functions

 MixedDOFMap (const Mesh &mesh, const Array< RCP< BasisDOFTopologyBase > > &basis, const CellFilter &maxCells, int setupVerb)
virtual ~MixedDOFMap ()
RCP< const MapStructuregetDOFsForCellBatch (int cellDim, const Array< int > &cellLID, const Set< int > &requestedFuncSet, Array< Array< int > > &dofs, Array< int > &nNodes, int verbosity) const
 Return the global DOFs for a batch of cells for a given set of functions on those cells.
RCP< const MapStructuremapStruct () const
int chunkForFuncID (int funcID) const
int indexForFuncID (int funcID) const
int nFuncs (int basisChunk) const
int nBasisChunks () const
const RCP< BasisDOFTopologyBase > & basis (int basisChunk) const
const Array< int > & funcID (int basisChunk) const

Private Member Functions

void checkTable () const
int getInitialDOFForCell (int cellDim, int cellLID, int basisChunk) const
int * getInitialDOFPtrForCell (int cellDim, int cellLID, int basisChunk)
const int * getInitialDOFPtrForCell (int cellDim, int cellLID, int basisChunk) const
void allocate (const Mesh &mesh)
void buildMaximalDofTable () const
bool hasBeenAssigned (int cellDim, int cellLID) const
void markAsAssigned (int cellDim, int cellLID)
void initMap ()
void setDOFs (int basisChunk, int cellDim, int cellLID, int &nextDOF, bool isRemote=false)
void shareDOFs (int cellDim, const Array< Array< int > > &outgoingCellRequests)
void computeOffsets (int dim, int localCount)

Static Private Member Functions

static int uninitializedVal ()

Private Attributes

CellFilter maxCells_
int dim_
 spatial dimension
Array< Array< Array< int > > > dofs_
 Tables of DOFs, indexed by dimension and chunk number.
Array< Array< int > > maximalDofs_
 DOFs for maximal cells, indexed by basis chunk number.
bool haveMaximalDofs_
 whether maximal DOFs have been tabulated
Array< Array< Array< Array
< Array< int > > > > > 
localNodePtrs_
 localNodePtrs_[basisChunk][cellDim][facetDim][facetNumber][nodeNumber]
Array< Array< int > > nNodesPerCell_
 The number of nodes per cell, for each basis function type, not including the nodes of the facets of the cell.
Array< Array< int > > nDofsPerCell_
 The number of DOFs per cell, for each basis function type, not including the DOFs of the facets of the cell.
Array< Array< int > > totalNNodesPerCell_
 The number of nodes per cell, for each basis function type, including the nodes of the facets of the cell.
Array< Array< int > > totalNDofsPerCell_
 The number of DOFs per cell, for each basis function type, including the DOFs of the facets of the cell.
Array< int > cellHasAnyDOFs_
 Indicates whether the cells of each dimension have any DOFs in this map, for any chunk.
Array< Array< int > > numFacets_
 number of facets of dimension facetDim for cells of dimension cellDim.
Array< Array< int > > originalFacetOrientation_
 Orientation of each edge or face as seen by the maximal cell from which its DOFs were originally assigned.
Array< Array< int > > hasBeenAssigned_
RCP< const MapStructurestructure_
Array< int > nFuncs_


Detailed Description

A MixedDOFMap is a DOF map for the case where every function is defined on every cell in the mesh, but where functions may have different bases.

Definition at line 52 of file SundanceMixedDOFMap.hpp.


Constructor & Destructor Documentation

MixedDOFMap::MixedDOFMap ( const Mesh mesh,
const Array< RCP< BasisDOFTopologyBase > > &  basis,
const CellFilter maxCells,
int  setupVerb 
)

virtual Sundance::MixedDOFMap::~MixedDOFMap (  )  [inline, virtual]

Definition at line 62 of file SundanceMixedDOFMap.hpp.


Member Function Documentation

void MixedDOFMap::allocate ( const Mesh mesh  )  [private]

const RCP<BasisDOFTopologyBase>& Sundance::MixedDOFMap::basis ( int  basisChunk  )  const [inline]

Definition at line 94 of file SundanceMixedDOFMap.hpp.

References structure_.

Referenced by allocate(), and MixedDOFMap().

void MixedDOFMap::buildMaximalDofTable (  )  const [private]

void MixedDOFMap::checkTable (  )  const [private]

int Sundance::MixedDOFMap::chunkForFuncID ( int  funcID  )  const [inline]

Definition at line 78 of file SundanceMixedDOFMap.hpp.

References structure_.

void MixedDOFMap::computeOffsets ( int  dim,
int  localCount 
) [private]

const Array<int>& Sundance::MixedDOFMap::funcID ( int  basisChunk  )  const [inline]

Definition at line 98 of file SundanceMixedDOFMap.hpp.

References structure_.

RCP< const MapStructure > MixedDOFMap::getDOFsForCellBatch ( int  cellDim,
const Array< int > &  cellLIDs,
const Set< int > &  requestedFuncSet,
Array< Array< int > > &  dofs,
Array< int > &  nNodes,
int  verb 
) const [virtual]

Return the global DOFs for a batch of cells for a given set of functions on those cells.

Parameters:
cellDim [in] The dimension of the cells in the batch of cells
cellLIDs [in] Local IDs (LIDs) for the batch of cells
requestedFuncSet [in] Set of function IDs for which DOFs are requested. Note that this must be equal to the allowed set of requested functions this->allowedFuncsOnCellBatch(cellDim,cellLIDs).
dofs [out] Global IDs for DOFs of the requested functions on the batch of cells. The size of this array on output is
           dofs.size()==mapStructure.numBasisChunks() 
. The global DOFs for cell cellLIDs[c] (where 0 <= c < cellLIDs.size()) for the cell for the basis chunk basisChunk (where 0 <= basisChunk < mapStructure.numBasisChunks()) are given by
           dofs[c*nDOFsPerCell[c]+k] 
, where
           k=0...nDOFsPerCell[c]-1 
and
 nDOFsPerCell[c]
           = mapStructure.basis(basisChunk).nNodes( spatialDim,
           this->mesh()->cellType(cellDim) ) *
           mapStructure.numFuncs(basisChunk) 
. Note that the array nDOFsPerCell used above is not actually computed here or returned by this interface. It is only used abstractly to define the dofs array above.
nNodes [out] Array giving the number of coefficients for each type of basis family in mapStructure for each function. The size of this array on return is nNodes.size()==mapStructure.numBasisChunks() and nNodes[b]==mapStructure.basis(b).nNodes(spatialDim,cellType), for b=0...mapStructure.numBasisChunks()-1.
Preconditions:
  • requestedFuncSet.setDifference( this->allowedFuncsOnCellBatch(cellDim,cellLIDs) ).size() == 0
  • ???Others???

Returns:
The map structure that groups sets of different functions according with respect to those that have the same basis family. Above, we will refer to this returned object as mapStructure where mapStructure = *returnVal.
ToDo: Remove the argument requestedFuncSet since all current use cases and implemenations asume that all of the functions are requested and returned.

ToDo: Remove the nNodes return argument since this information can be gotten just from the return mapStructure object. Specifically, nNodes[basisChunk] = mapStructure.basis(basisChunk).nNodes(spatialDim,cellType) so what is the point in returning this array? Since this is needed for a whole batch of cells, it is cheap to just grab this from the returned mapStructure object as shown above.

Implements Sundance::DOFMapBase.

Definition at line 568 of file SundanceMixedDOFMap.cpp.

References Sundance::numFacets(), SUNDANCE_MSG3, and SUNDANCE_MSG4.

int Sundance::MixedDOFMap::getInitialDOFForCell ( int  cellDim,
int  cellLID,
int  basisChunk 
) const [inline, private]

Definition at line 108 of file SundanceMixedDOFMap.hpp.

References dofs_, and nDofsPerCell_.

Referenced by shareDOFs().

const int* Sundance::MixedDOFMap::getInitialDOFPtrForCell ( int  cellDim,
int  cellLID,
int  basisChunk 
) const [inline, private]

Definition at line 118 of file SundanceMixedDOFMap.hpp.

References dofs_, and nDofsPerCell_.

int* Sundance::MixedDOFMap::getInitialDOFPtrForCell ( int  cellDim,
int  cellLID,
int  basisChunk 
) [inline, private]

Definition at line 113 of file SundanceMixedDOFMap.hpp.

References dofs_, and nDofsPerCell_.

Referenced by setDOFs().

bool Sundance::MixedDOFMap::hasBeenAssigned ( int  cellDim,
int  cellLID 
) const [inline, private]

Definition at line 130 of file SundanceMixedDOFMap.hpp.

References hasBeenAssigned_.

Referenced by initMap().

int Sundance::MixedDOFMap::indexForFuncID ( int  funcID  )  const [inline]

Definition at line 82 of file SundanceMixedDOFMap.hpp.

References structure_.

void MixedDOFMap::initMap (  )  [private]

RCP<const MapStructure> Sundance::MixedDOFMap::mapStruct (  )  const [inline, virtual]

Implements Sundance::SpatiallyHomogeneousDOFMapBase.

Definition at line 74 of file SundanceMixedDOFMap.hpp.

References structure_.

void Sundance::MixedDOFMap::markAsAssigned ( int  cellDim,
int  cellLID 
) [inline, private]

Definition at line 133 of file SundanceMixedDOFMap.hpp.

References hasBeenAssigned_.

Referenced by initMap().

int Sundance::MixedDOFMap::nBasisChunks (  )  const [inline]

Definition at line 90 of file SundanceMixedDOFMap.hpp.

References nFuncs_.

Referenced by allocate(), buildMaximalDofTable(), initMap(), and shareDOFs().

int Sundance::MixedDOFMap::nFuncs ( int  basisChunk  )  const [inline]

Definition at line 86 of file SundanceMixedDOFMap.hpp.

References nFuncs_.

Referenced by allocate(), and buildMaximalDofTable().

void MixedDOFMap::setDOFs ( int  basisChunk,
int  cellDim,
int  cellLID,
int &  nextDOF,
bool  isRemote = false 
) [private]

void MixedDOFMap::shareDOFs ( int  cellDim,
const Array< Array< int > > &  outgoingCellRequests 
) [private]

static int Sundance::MixedDOFMap::uninitializedVal (  )  [inline, static, private]

Definition at line 151 of file SundanceMixedDOFMap.hpp.

Referenced by allocate().


Member Data Documentation

Indicates whether the cells of each dimension have any DOFs in this map, for any chunk.

Definition at line 203 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), and initMap().

spatial dimension

Definition at line 157 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), buildMaximalDofTable(), initMap(), and shareDOFs().

Array<Array<Array<int> > > Sundance::MixedDOFMap::dofs_ [private]

Tables of DOFs, indexed by dimension and chunk number.

dof(cellDim, cellLID, chunk, func, node) = dofs_[cellDim][chunk][(cellLID*nFunc + func)*nNode + node]

Definition at line 164 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), buildMaximalDofTable(), checkTable(), computeOffsets(), getInitialDOFForCell(), getInitialDOFPtrForCell(), and shareDOFs().

Array<Array<int> > Sundance::MixedDOFMap::hasBeenAssigned_ [private]

Definition at line 215 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), hasBeenAssigned(), and markAsAssigned().

bool Sundance::MixedDOFMap::haveMaximalDofs_ [mutable, private]

whether maximal DOFs have been tabulated

Definition at line 174 of file SundanceMixedDOFMap.hpp.

Referenced by buildMaximalDofTable().

Array<Array<Array<Array<Array<int> > > > > Sundance::MixedDOFMap::localNodePtrs_ [private]

localNodePtrs_[basisChunk][cellDim][facetDim][facetNumber][nodeNumber]

Definition at line 179 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), and buildMaximalDofTable().

Definition at line 154 of file SundanceMixedDOFMap.hpp.

Referenced by initMap().

Array<Array<int> > Sundance::MixedDOFMap::maximalDofs_ [mutable, private]

DOFs for maximal cells, indexed by basis chunk number.

dof(cellLID, chunk, func, node) = maximalDofs_[chunk][(cellLID*nFunc + func)*nNode + node];

Definition at line 171 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), and buildMaximalDofTable().

Array<Array<int> > Sundance::MixedDOFMap::nDofsPerCell_ [private]

The number of DOFs per cell, for each basis function type, not including the DOFs of the facets of the cell.

Indexed as nDofsPerCell_[basis][dimension]

Definition at line 189 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), buildMaximalDofTable(), getInitialDOFForCell(), getInitialDOFPtrForCell(), setDOFs(), and shareDOFs().

Array<int> Sundance::MixedDOFMap::nFuncs_ [private]

Definition at line 221 of file SundanceMixedDOFMap.hpp.

Referenced by MixedDOFMap(), nBasisChunks(), and nFuncs().

Array<Array<int> > Sundance::MixedDOFMap::nNodesPerCell_ [private]

The number of nodes per cell, for each basis function type, not including the nodes of the facets of the cell.

Indexed as nNodesPerCell_[basis][dimension]

Definition at line 184 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), and buildMaximalDofTable().

Array<Array<int> > Sundance::MixedDOFMap::numFacets_ [private]

number of facets of dimension facetDim for cells of dimension cellDim.

Indexed as numFacets_[cellDim][facetDim]

Definition at line 208 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), and initMap().

Orientation of each edge or face as seen by the maximal cell from which its DOFs were originally assigned.

Definition at line 212 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), buildMaximalDofTable(), initMap(), and shareDOFs().

Array<Array<int> > Sundance::MixedDOFMap::totalNDofsPerCell_ [private]

The number of DOFs per cell, for each basis function type, including the DOFs of the facets of the cell.

Indexed as nDofsPerCell_[basis][dimension]

Definition at line 199 of file SundanceMixedDOFMap.hpp.

Referenced by allocate().

Array<Array<int> > Sundance::MixedDOFMap::totalNNodesPerCell_ [private]

The number of nodes per cell, for each basis function type, including the nodes of the facets of the cell.

Indexed as nNodesPerCell_[basis][dimension]

Definition at line 194 of file SundanceMixedDOFMap.hpp.

Referenced by allocate(), and buildMaximalDofTable().

Site Contact