Sundance::MeshBase Class Reference

Abstract interface to a mesh. More...

Inheritance diagram for Sundance::MeshBase:

Sundance::ObjectWithClassVerbosity< MeshBase > Sundance::ObjectWithInstanceID< MeshBase > Playa::ObjectWithVerbosity Sundance::HNMesh2D Sundance::HNMesh3D Sundance::IncrementallyCreatableMesh Sundance::PeriodicMesh1D Sundance::PeriodicSingleCellMesh1D Sundance::BasicSimplicialMesh

List of all members.

Public Member Functions

Constructors/Destructor


 MeshBase (int dim, const MPIComm &comm, const MeshEntityOrder &meshOrder)
 
virtual ~MeshBase ()
 
Topological Information


const MeshEntityOrdermeshOrder () const
 Get the ordering convention used by this mesh.
int spatialDim () const
 Get the spatial dimension of the mesh.
virtual int numCells (int cellDim) const =0
 Get the number of local cells having dimension cellDim.
virtual int numFacets (int cellDim, int cellLID, int facetDim) const =0
 Return the number of facets of the given relative cell.
virtual int facetLID (int cellDim, int cellLID, int facetDim, int facetIndex, int &facetOrientation) const =0
 Return the LID of a single facet cell (and optionally its orientation) with respect to a relative parent cell.
virtual void getFacetLIDs (int cellDim, const Array< int > &cellLIDs, int facetDim, Array< int > &facetLIDs, Array< int > &facetOrientations) const =0
 Return an array containing the LIDs of facets of dimension facetDim for the given batch of relative parent cells.
void getFacetArray (int cellDim, int cellLID, int facetDim, Array< int > &facetLIDs, Array< int > &facetOrientations) const
 Return an array containing the LIDs of the facets of dimension facetDim of the single relative parent cell (optionally also returning the facet orientations).
virtual const int * elemZeroFacetView (int maxCellLID) const
 Return a view of an array of LIDs for a maximum-dimensional cell's zero-dimensional facets (i.e. vertexes).
virtual int numMaxCofacets (int cellDim, int cellLID) const =0
 Return the number of maximal co-facets of the given cell.
virtual int maxCofacetLID (int cellDim, int cellLID, int cofacetIndex, int &facetIndex) const =0
 Return the LID of a maximal co-facet of a cell.
virtual void getMaxCofacetLIDs (const Array< int > &cellLIDs, MaximalCofacetBatch &cofacets) const
virtual void getCofacets (int cellDim, int cellLID, int cofacetDim, Array< int > &cofacetLIDs) const =0
 Return an array of the LIDs of all of the co-facets for a given relative cell.
virtual CellType cellType (int cellDim) const =0
 Get the cell type of the given cell dimension.
virtual int label (int cellDim, int cellLID) const =0
 Get the label of the given cell.
void getLabels (int cellDim, const Array< int > &cellLIDs, Array< int > &labels) const
 Get the labels for a batch of cells.
virtual void setLabel (int cellDim, int cellLID, int label)=0
 Set the label for the given cell.
virtual Set< int > getAllLabelsForDimension (int cellDim) const
virtual void getLIDsForLabel (int cellDim, int label, Array< int > &cellLIDs) const
Geometric Information


virtual Point nodePosition (int vertexLID) const =0
 Return the position of a local vertex.
virtual const double * nodePositionView (int vertexLID) const =0
 Return a const view into an raw array for the position of a local vertex.
virtual Point centroid (int cellDim, int cellLID) const
 Return the centroid of a cell.
virtual void getJacobians (int cellDim, const Array< int > &cellLID, CellJacobianBatch &jBatch) const
 Compute (or get) the Jacobians for a batch of cells.
virtual void getCellDiameters (int cellDim, const Array< int > &cellLIDs, Array< double > &diameters) const
 Compute the diameters of a batch of cells.
virtual void outwardNormals (const Array< int > &cellLIDs, Array< Point > &outwardNormals) const
virtual void tangentsToEdges (const Array< int > &cellLIDs, Array< Point > &tangenVectors) const
virtual void pushForward (int cellDim, const Array< int > &cellLIDs, const Array< Point > &refPts, Array< Point > &physPts) const
 Map points from a reference cell to physical points for a batch of cells.
Parallel Information


const MPICommcomm () const
 Return the MPI communicator over which this mesh is distributed.
virtual int ownerProcID (int cellDim, int cellLID) const =0
 Return the rank of the processor that owns the given cell.
virtual bool hasGID (int cellDim, int cellGID) const =0
 Determine whether a given cell GID exists on this processor.
virtual int mapGIDToLID (int cellDim, int cellGID) const =0
 Find the LID of a cell given its GID.
virtual int mapLIDToGID (int cellDim, int cellLID) const =0
 Find the global ID of a cell given its LID.
virtual bool hasIntermediateGIDs (int cellDim) const =0
 Return if cells of dimension cellDim have been assigned global IDs or not.
virtual void assignIntermediateCellGIDs (int cellDim)=0
 Assign global IDs to cells of dimension cellDim.
Reordering


void setReorderer (const CellReorderer &reorderer)
 Set the reordering strategy to be used with this mesh.
const CellReordererImplemBasereorderer () const
 Get the reordering strategy to be used with this mesh.
Functions for Mesh with hanging nodes


virtual bool allowsHangingHodes () const
virtual bool isElementHangingNode (int cellDim, int cellLID) const
virtual int indexInParent (int maxCellLID) const
virtual int maxChildren () const
virtual void returnParentFacets (int childCellLID, int dimFacets, Array< int > &facetsLIDs, int &parentCellLIDs) const
Store special weights in the mesh (for Adaptive Cell Integration)


virtual bool IsSpecialWeightValid () const
virtual void setSpecialWeightValid (bool val) const
virtual void flushSpecialWeights () const
virtual bool hasSpecialWeight (int dim, int cellLID) const
virtual void setSpecialWeight (int dim, int cellLID, Array< double > &w) const
virtual void getSpecialWeight (int dim, int cellLID, Array< double > &w) const

Static Public Member Functions

Output


static bool & staggerOutput ()
 Set whether to stagger output in parallel. Set to true for readable output in parallel debugging sessions.

Private Attributes

int dim_
MPIComm comm_
MeshEntityOrder order_
RCP< CellReordererImplemBasereorderer_
bool validWeights_
Array< Sundance::Map< int,
Array< double > > > 
specialWeights_
bool curvePoints_Are_Valid_
int nrCurvesForIntegral_
Array< Sundance::Map< int,
Array< Point > > > 
curvePoints_
Array< Sundance::Map< int,
Array< Point > > > 
curveDerivative_
Array< Sundance::Map< int,
Array< Point > > > 
curveNormal_
Sundance::Map< int, int > curveID_to_ArrayIndex_

Store the intersection/quadrature points for the curve/surf integral <br>

for a curve or surf integral we need some quadrature points along the curve in one curve
These

virtual bool IsCurvePointsValid () const
virtual void setCurvePointsValid (bool val) const
virtual void flushCurvePoints () const
virtual bool hasCurvePoints (int maxCellLID, int curveID) const
virtual void setCurvePoints (int maxCellLID, int curveID, Array< Point > &points, Array< Point > &derivs, Array< Point > &normals) const
virtual void getCurvePoints (int maxCellLID, int curveID, Array< Point > &points, Array< Point > &derivs, Array< Point > &normals) const
virtual int mapCurveID_to_Index (int curveID) const


Detailed Description

Abstract interface to a mesh.

Outline

Introduction

A mesh is a collection of connected cells (also called elements). This mesh interface is designed to allow for the representation of 1D, 2D, and 3D (and even higher dimensional) meshes. A mesh contains both topological information and geometric information about the cells and their subparts (i.e. facets). Topological information refers to information about how cells of various types and dimensions are connected to each other within the mesh. Geometric information refers to information about the position, size, and shape of cells within the mesh.

Currently, this interface only handles meshes where all cells of a given cell dimension have the same cell type. For example, this only allows meshes with all triangles or all quads in 2D or all tetrahedrals in 3D.

Todo:
Add some diagrams to show different cell types to help define cells, facets, co-facets, vertices, etc.

Definitions

The following definitions are used in the specification of this mesh interface.

Common Function Arguments and Pre/Post-Conditions

Below, a common set of Mesh arguments are described along with relevant pre- and post conditions.

Possible Refactorings

Definition at line 381 of file SundanceMeshBase.hpp.


Constructor & Destructor Documentation

MeshBase::MeshBase ( int  dim,
const MPIComm comm,
const MeshEntityOrder meshOrder 
)

Definition at line 45 of file SundanceMeshBase.cpp.

References curveDerivative_, curveNormal_, curvePoints_, dim_, and specialWeights_.

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

Definition at line 395 of file SundanceMeshBase.hpp.


Member Function Documentation

virtual bool Sundance::MeshBase::allowsHangingHodes (  )  const [inline, virtual]

Function returns true if the mesh allows hanging nodes (by refinement), false otherwise

Reimplemented in Sundance::HNMesh2D, and Sundance::HNMesh3D.

Definition at line 930 of file SundanceMeshBase.hpp.

virtual void Sundance::MeshBase::assignIntermediateCellGIDs ( int  cellDim  )  [pure virtual]

Assign global IDs to cells of dimension cellDim.

Parameters:
cellDim [in] Dimension of the cell
Postconditions:
  • hasIntermediateGIDs(cellDim)==true

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

virtual CellType Sundance::MeshBase::cellType ( int  cellDim  )  const [pure virtual]

Get the cell type of the given cell dimension.

Note: This function by its very definition assumes that all cells of a given dimension have the same cell type within a mesh!

Todo:
This function must be changed in order to deal with mixed cell types with the same cellDim!

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Point MeshBase::centroid ( int  cellDim,
int  cellLID 
) const [virtual]

Return the centroid of a cell.

The default implementation just averages the positions of the zero-dimensional facets (i.e. vertexes).

Definition at line 73 of file SundanceMeshBase.cpp.

References facetLID(), nodePosition(), and numFacets().

Referenced by outwardNormals().

const MPIComm& Sundance::MeshBase::comm (  )  const [inline]

const int * MeshBase::elemZeroFacetView ( int  maxCellLID  )  const [virtual]

Return a view of an array of LIDs for a maximum-dimensional cell's zero-dimensional facets (i.e. vertexes).

Parameters:
maxCellLID [in] Local ID of the maximum dimensional cell (i.e. element).
Preconditions:
  • The cell maxCellLID must be a maximum-dimensional cell!

Returns:
A raw pointer into an array which stores the local process IDs of the vertices. These IDs are the local process IDs, not the facet indexes relative to the relative parent cell. The dimension of this array is determined by the cell type given by cellType(maxCellLID).
Todo:
Return this array as a Teuchos::ArrayView<int> object which will have the dimension embedded in it and will have full range checking!
Todo:
Rename to something like getMaxCellZeroFacetsLIDsView(...).

Reimplemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Definition at line 65 of file SundanceMeshBase.cpp.

virtual int Sundance::MeshBase::facetLID ( int  cellDim,
int  cellLID,
int  facetDim,
int  facetIndex,
int &  facetOrientation 
) const [pure virtual]

Return the LID of a single facet cell (and optionally its orientation) with respect to a relative parent cell.

Parameters:
cellDim [in] Dimension of the parent cell whose facets are being obtained.
cellLID [in] Local ID of the parent cell whose facets are being obtained
facetDim [in] Dimension of the desired facet.
facetIndex [in] The relative index into the list of the cell's facets.
facetOrientation [out] The orientation of the facet w.r.t the parent cell.
Todo:
Change the facetOrientation argument to be a raw pointer that can be NULL and therefore easily ignored.

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Referenced by centroid(), getFacetArray(), outwardNormals(), and tangentsToEdges().

void MeshBase::flushCurvePoints (  )  const [virtual]

detletes all the points and its normals which have been stored

Definition at line 255 of file SundanceMeshBase.cpp.

References curveDerivative_, curveID_to_ArrayIndex_, curveNormal_, curvePoints_, curvePoints_Are_Valid_, and nrCurvesForIntegral_.

void MeshBase::flushSpecialWeights (  )  const [virtual]

deletes all special weights so those have to be recreated

Definition at line 244 of file SundanceMeshBase.cpp.

References dim_, specialWeights_, and validWeights_.

Set< int > MeshBase::getAllLabelsForDimension ( int  cellDim  )  const [virtual]

Get the list of all labels defined for cells of the given dimension

Reimplemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Definition at line 214 of file SundanceMeshBase.cpp.

References label(), numCells(), and Sundance::Set< Key, Compare >::put().

virtual void Sundance::MeshBase::getCellDiameters ( int  cellDim,
const Array< int > &  cellLIDs,
Array< double > &  diameters 
) const [inline, virtual]

Compute the diameters of a batch of cells.

Parameters:
cellDim [in] Dimension of the cells whose diameters are to be computed
cellLIDs [in] Local IDs of the cells for which diameters are to be computed
diameters [out] Array (size = cellLIDs.size()) of cell diameters.
Warning! The default implementation returns an empty array of cell diameters! ToDo: Change the default implementation to compute diameters based on calls to the node position accessors. Going through the Mesh interface in that way will be less efficient than a low-level implementation, but would be a reasonable intermediate step for mesh developers.
  • KL 5 Aug 2007.

Reimplemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Definition at line 772 of file SundanceMeshBase.hpp.

virtual void Sundance::MeshBase::getCofacets ( int  cellDim,
int  cellLID,
int  cofacetDim,
Array< int > &  cofacetLIDs 
) const [pure virtual]

Return an array of the LIDs of all of the co-facets for a given relative cell.

Parameters:
cellDim [in] Dimension of the relative cell whose co-facets are being obtained
cellLID [in] Local index of the relative cell whose co-facets are being obtained
cofacetDim [in] Dimension of the co-facets to get
cofacetLIDs [out] Array containing the LIDs of the co-facets for the given relative cell (cellDim,cellLID).
Todo:
Change name to getCofacetArray() to be consistent with getFacetArray()!

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

void MeshBase::getCurvePoints ( int  maxCellLID,
int  curveID,
Array< Point > &  points,
Array< Point > &  derivs,
Array< Point > &  normals 
) const [virtual]

Gets the points, curve derivatives and curve normals for one maxCell needed for curve/surf integral

Definition at line 288 of file SundanceMeshBase.cpp.

References curveDerivative_, curveNormal_, curvePoints_, mapCurveID_to_Index(), nrCurvesForIntegral_, and SUNDANCE_MSG3.

void MeshBase::getFacetArray ( int  cellDim,
int  cellLID,
int  facetDim,
Array< int > &  facetLIDs,
Array< int > &  facetOrientations 
) const

Return an array containing the LIDs of the facets of dimension facetDim of the single relative parent cell (optionally also returning the facet orientations).

Parameters:
cellDim [in] Dimension of the parent cell whose facets are being obtained.
cellLID [in] Local ID of the parent cell whose facets are being obtained
facetDim [in] Dimension of the desired facets
facetLIDs [out] On exit this array gives the local facet IDs for the parent cell with size = nf, where nf=numFacets(cellDim,cellLID,facetDim).
facetOrientations [out] On exist, if facetDim > 0, this array gives the integer orientation of the facet with respect to its parent cell (see above definition of "Facet Orientation"). On exist this array will be resized to size = nf, where nf=numFacets(cellDim,cellLID,facetDim)). If facetDim==0 this this array argument is ignored!
The default implementation loops over calls to facetLID(). Subclasses can provide a more efficient implementation if desired.

Todo:
Rename to something like getSingleCellFacetLIDs(...).
Todo:
Change the facetOrientation argument to an Array<int>* type so that it can be NULL and therefore ignored (which is a common use case).

Definition at line 154 of file SundanceMeshBase.cpp.

References facetLID(), and numFacets().

virtual void Sundance::MeshBase::getFacetLIDs ( int  cellDim,
const Array< int > &  cellLIDs,
int  facetDim,
Array< int > &  facetLIDs,
Array< int > &  facetOrientations 
) const [pure virtual]

Return an array containing the LIDs of facets of dimension facetDim for the given batch of relative parent cells.

Parameters:
cellDim [in] Dimension of the relative parent cells whose facets are being obtained
cellLIDs [in] Array of LIDs for the relative parent cells
facetDim [in] Dimension of the desired facets
facetLIDs [out] On exit this array gives the local facet IDs for all of the cells given in cellLIDs in one flat array with size = cellLIDs.size()*nf, where nf=numFacets(cellDim,cellLIDs[j],facetDim)) where j can be any index 0 <= j < numCells(cellDim). Specifically, the local facet IDs for cellLIDs[k], where k=0...cellLIDs.size()-1, is given by facetLIDs[k*nf+j], where j=0...nf-1.
facetOrientations [out] On exist, if facetDim > 0, this array gives the integer orientation of the facet with respect to its parent cell (see above definition of "Facet Orientation"). Oon exist this array will be resized to size = cellLIDs.size()*nf, where nf=numFacets(cellDim,cellLID,facetDim)). Specifically, the local facet orientation for the cell cellLIDs[k], where k=0...cellLIDs.size()-1, is given by facetOrientations[k*nf+j], where j=0...nf-1. If facetDim==0 then this array is ignored.
Warning! This function will only work for homogeneous cell types!

Todo:
Change the facetOrientation argument to an Array<int>* type so that it can be NULL and therefore ignored (which is a common use case).

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

virtual void Sundance::MeshBase::getJacobians ( int  cellDim,
const Array< int > &  cellLID,
CellJacobianBatch jBatch 
) const [inline, virtual]

Compute (or get) the Jacobians for a batch of cells.

Parameters:
cellDim [in] Dimension of the cells whose Jacobians are to be computed
cellLID [in] Local IDs of the cells for which Jacobians are to be computed
jBatch [out] Batch of cell Jacobians.
Warning! The default implementation returns an empty batch of cell Jacobians!

Todo:
Add a query function to tell if this feature is supported and then add a precondition based on this query function!

Reimplemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Definition at line 746 of file SundanceMeshBase.hpp.

void MeshBase::getLabels ( int  cellDim,
const Array< int > &  cellLIDs,
Array< int > &  labels 
) const

Get the labels for a batch of cells.

Parameters:
cellDim [in] Dimension of the parent cell whose facets are being obtained
cellLIDs [in] Array of cell LIDs
labels [out] On exit, contains an array (size=cellLIDs.size()) of the labels for each of the given cells.

Reimplemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Definition at line 169 of file SundanceMeshBase.cpp.

References label().

void MeshBase::getLIDsForLabel ( int  cellDim,
int  label,
Array< int > &  cellLIDs 
) const [virtual]

Get the cells associated with a specified label. The array cellLID will be filled with those cells of dimension cellDim having the given label.

Reimplemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Definition at line 201 of file SundanceMeshBase.cpp.

References label(), and numCells().

void MeshBase::getMaxCofacetLIDs ( const Array< int > &  cellLIDs,
MaximalCofacetBatch cofacets 
) const [virtual]

Get the LIDs of the maximal cofacets for a batch of codimension-one cells. The default implementation simply loops over the cells in the cellLID array, taking no advantage of any internal data structures.

Parameters:
cellLIDs [in] array of LIDs of the cells whose cofacets are being obtained
cofacets [out]
facetIndex [out] index of each calling cell into the list of its maximal cofacet's facets

Reimplemented in Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Definition at line 177 of file SundanceMeshBase.cpp.

References Sundance::MaximalCofacetBatch::addSingleCofacet(), Sundance::MaximalCofacetBatch::addTwoCofacets(), maxCofacetLID(), numMaxCofacets(), Sundance::MaximalCofacetBatch::reset(), and spatialDim().

void MeshBase::getSpecialWeight ( int  dim,
int  cellLID,
Array< double > &  w 
) const [virtual]

Returns the special weights

Definition at line 239 of file SundanceMeshBase.cpp.

References specialWeights_.

bool MeshBase::hasCurvePoints ( int  maxCellLID,
int  curveID 
) const [virtual]

verifies if the specified maxCell has already precalculated quadrature point for one curve

Definition at line 269 of file SundanceMeshBase.cpp.

References curvePoints_, and mapCurveID_to_Index().

virtual bool Sundance::MeshBase::hasGID ( int  cellDim,
int  cellGID 
) const [pure virtual]

Determine whether a given cell GID exists on this processor.

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

virtual bool Sundance::MeshBase::hasIntermediateGIDs ( int  cellDim  )  const [pure virtual]

Return if cells of dimension cellDim have been assigned global IDs or not.

Parameters:
cellDim [in] Dimension of the cell

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

bool MeshBase::hasSpecialWeight ( int  dim,
int  cellLID 
) const [virtual]

verifies if the specified cell with the given dimension has special weights

Definition at line 228 of file SundanceMeshBase.cpp.

References specialWeights_.

virtual int Sundance::MeshBase::indexInParent ( int  maxCellLID  )  const [inline, virtual]

Returns the index in the parent maxdim Cell of the refinement tree

Parameters:
maxCellLID [in] the LID of the cell

Reimplemented in Sundance::HNMesh2D, and Sundance::HNMesh3D.

Definition at line 940 of file SundanceMeshBase.hpp.

virtual bool Sundance::MeshBase::IsCurvePointsValid (  )  const [inline, virtual]

Definition at line 988 of file SundanceMeshBase.hpp.

References curvePoints_Are_Valid_.

virtual bool Sundance::MeshBase::isElementHangingNode ( int  cellDim,
int  cellLID 
) const [inline, virtual]

Function returns true if the specified element is a "hanging" element false otherwise

Parameters:
cellDim [in] should be between 0 , D-1
cellLID [in] the local ID of the element

Reimplemented in Sundance::HNMesh2D, and Sundance::HNMesh3D.

Definition at line 936 of file SundanceMeshBase.hpp.

virtual bool Sundance::MeshBase::IsSpecialWeightValid (  )  const [inline, virtual]

returns the status of the special weights if they are valid
These weights are usually computed for one setting of the curve (Adaptive Cell Integration)

Definition at line 962 of file SundanceMeshBase.hpp.

References validWeights_.

virtual int Sundance::MeshBase::label ( int  cellDim,
int  cellLID 
) const [pure virtual]

int MeshBase::mapCurveID_to_Index ( int  curveID  )  const [private, virtual]

virtual int Sundance::MeshBase::mapGIDToLID ( int  cellDim,
int  cellGID 
) const [pure virtual]

Find the LID of a cell given its GID.

Parameters:
cellDim [in] Dimension of the cell
cellGID [in] Global ID of the cell
Preconditions:
  • hasGID(cellDim,cellGID)==true

Postconditions:

  • 0 <= returnVal < numCells(cellDim)

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

virtual int Sundance::MeshBase::mapLIDToGID ( int  cellDim,
int  cellLID 
) const [pure virtual]

Find the global ID of a cell given its LID.

Parameters:
cellDim [in] Dimension of the cell
cellLID [in] Local ID of the cell
Postconditions:
  • returnVal >= 0

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

virtual int Sundance::MeshBase::maxChildren (  )  const [inline, virtual]

How many children has a refined element.
This function provides information of either we have bi or trisection

Reimplemented in Sundance::HNMesh2D, and Sundance::HNMesh3D.

Definition at line 944 of file SundanceMeshBase.hpp.

virtual int Sundance::MeshBase::maxCofacetLID ( int  cellDim,
int  cellLID,
int  cofacetIndex,
int &  facetIndex 
) const [pure virtual]

Return the LID of a maximal co-facet of a cell.

Parameters:
cellDim [in] Dimension of the cell whose co-facets are being obtained
cellLID [in] Local ID of the cell whose co-facets are being obtained
cofacetIndex [in] Index into the list of the cell's co-facets.
facetIndex [out] Returns the local index into the facet array for the relative cell (cellDim,cellLID) with respect to the maximal co-facet. In other words cellLID==facetLID(spatialDim(),returnVal,cellDim,facetIndex).
Preconditions:

Returns:
The LID of the requested maximal co-facet.
Todo:
Make the facetIndex an int* argument and give it a default value of NUL so that it can be easily ignored!

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Referenced by getMaxCofacetLIDs(), and outwardNormals().

const MeshEntityOrder& Sundance::MeshBase::meshOrder (  )  const [inline]

Get the ordering convention used by this mesh.

Definition at line 403 of file SundanceMeshBase.hpp.

References order_.

virtual Point Sundance::MeshBase::nodePosition ( int  vertexLID  )  const [pure virtual]

Return the position of a local vertex.

Parameters:
vertexLID [in] The LID of the vertex.
Preconditions:
  • 0 <= vertexLID < this->numCells(0)

Todo:
Change the name of this function to getVertexPosition(...).

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Referenced by centroid(), outwardNormals(), and tangentsToEdges().

virtual const double* Sundance::MeshBase::nodePositionView ( int  vertexLID  )  const [pure virtual]

Return a const view into an raw array for the position of a local vertex.

Parameters:
vertexLID [in] The LID of the vertex
Preconditions:
  • 0 <= vertexLID < this->numCells(0)

Returns:
a raw pointer into an array of doubles of length spatialDim.
Todo:
Return this array as a Teuchos::ArrayView<double> object which will have the dimension embedded in it and will have full range checking!
Todo:
Change this function name to getVertexPositionView().

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

virtual int Sundance::MeshBase::numCells ( int  cellDim  )  const [pure virtual]

Get the number of local cells having dimension cellDim.

Todo:
Change this to numLocalCells(cellDim).

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Referenced by Sundance::CellReordererImplemBase::end(), getAllLabelsForDimension(), and getLIDsForLabel().

virtual int Sundance::MeshBase::numFacets ( int  cellDim,
int  cellLID,
int  facetDim 
) const [pure virtual]

Return the number of facets of the given relative cell.

Parameters:
cellDim [in] The dimension of the relative cell
cellLID [in] The LID of the relative cell
facetDim [in] The dimension of the facets for the relative cell
Postconditions:
  • returnVal >= 2: Every cell has two or more facets of a given dimension.

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Referenced by centroid(), and getFacetArray().

virtual int Sundance::MeshBase::numMaxCofacets ( int  cellDim,
int  cellLID 
) const [pure virtual]

Return the number of maximal co-facets of the given cell.

Preconditions:

Note that if cellDim==spatialDim()-1 and returnVal==1 then this cell must be a boundary cell (i.e. a boundary face in 3D, a boundary edge in 1D, or a boundary node in 1D)!

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Referenced by getMaxCofacetLIDs(), and outwardNormals().

void MeshBase::outwardNormals ( const Array< int > &  cellLIDs,
Array< Point > &  outwardNormals 
) const [virtual]

Get the outward normals for the batch of cells of dimension spatialDim()-1. If any cell in the batch is not on the boundary, an exception is thrown.

Parameters:
cellLIDs [in] LIDs for the cells whose normals are to be computed.
outwardNormals [out] Outward normal unit vectors for each cell in the batch.

Definition at line 84 of file SundanceMeshBase.cpp.

References centroid(), Sundance::cross(), facetLID(), maxCofacetLID(), nodePosition(), numMaxCofacets(), and spatialDim().

virtual int Sundance::MeshBase::ownerProcID ( int  cellDim,
int  cellLID 
) const [pure virtual]

Return the rank of the processor that owns the given cell.

If returnVal==comm().getRank() then this cell is owned by this process.

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

virtual void Sundance::MeshBase::pushForward ( int  cellDim,
const Array< int > &  cellLIDs,
const Array< Point > &  refPts,
Array< Point > &  physPts 
) const [inline, virtual]

Map points from a reference cell to physical points for a batch of cells.

Parameters:
cellDim [in] Dimension of the cells
cellLIDs [in] Local IDs of a batch of cells
refPts [in] Array of points on the single reference cell with respect to the reference cell's coordinate system. Note that the interpretation of these reference points is strictly determined by the coordinate system of the cell type cellType(cellDim) and must be clearly defined by this interface.
physPts [out] Array (size = cellLIDs.size()*refPts.size()) of the physical points given in a flat array for the batch of cells. Specifically, the physical points for each cell cellLIDs[k], for k=0...cellLIDs.size()-1, is given by physPts[k*nrp+j], for j=0...nrp-1 and nrp=refPts.size().
Warning! The default implementation returns an empty array of physical points!

Todo:
Add a query function to tell if this feature is supported and then add a precondition based on this query function!

Reimplemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

Definition at line 835 of file SundanceMeshBase.hpp.

const CellReordererImplemBase* Sundance::MeshBase::reorderer (  )  const [inline]

Get the reordering strategy to be used with this mesh.

Definition at line 919 of file SundanceMeshBase.hpp.

References reorderer_.

virtual void Sundance::MeshBase::returnParentFacets ( int  childCellLID,
int  dimFacets,
Array< int > &  facetsLIDs,
int &  parentCellLIDs 
) const [inline, virtual]

Function returns the facets of the parent cell (needed for HN treatment)

Parameters:
childCellLID [in] the LID of the maxdim cell, whos parents facets we want
dimFacets [in] the dimension of the facets which we want to have
facetsLIDs [out] the LID of the parents facets (all) in the defined order
parentCellLIDs [out] the maxdim parent cell LID

Reimplemented in Sundance::HNMesh2D, and Sundance::HNMesh3D.

Definition at line 951 of file SundanceMeshBase.hpp.

void MeshBase::setCurvePoints ( int  maxCellLID,
int  curveID,
Array< Point > &  points,
Array< Point > &  derivs,
Array< Point > &  normals 
) const [virtual]

Sets the points, curve derivatives and curve normals for one maxCell needed for curve/surf integral

Definition at line 276 of file SundanceMeshBase.cpp.

References curveDerivative_, curveNormal_, curvePoints_, mapCurveID_to_Index(), nrCurvesForIntegral_, and SUNDANCE_MSG3.

virtual void Sundance::MeshBase::setCurvePointsValid ( bool  val  )  const [inline, virtual]

Definition at line 991 of file SundanceMeshBase.hpp.

References curvePoints_Are_Valid_.

virtual void Sundance::MeshBase::setLabel ( int  cellDim,
int  cellLID,
int  label 
) [pure virtual]

Set the label for the given cell.

Todo:
Move this out of this base interface and into a mesh loading interface?

Implemented in Sundance::BasicSimplicialMesh, Sundance::HNMesh2D, Sundance::HNMesh3D, Sundance::PeriodicMesh1D, and Sundance::PeriodicSingleCellMesh1D.

void Sundance::MeshBase::setReorderer ( const CellReorderer reorderer  )  [inline]

Set the reordering strategy to be used with this mesh.

Definition at line 915 of file SundanceMeshBase.hpp.

References Sundance::CellReorderer::createInstance(), and reorderer_.

void MeshBase::setSpecialWeight ( int  dim,
int  cellLID,
Array< double > &  w 
) const [virtual]

Sets the special weights

Definition at line 235 of file SundanceMeshBase.cpp.

References specialWeights_.

virtual void Sundance::MeshBase::setSpecialWeightValid ( bool  val  )  const [inline, virtual]

specifies if the special weights are valid
if this is false then usually the special weights have to be recomputed

Definition at line 966 of file SundanceMeshBase.hpp.

References validWeights_.

int Sundance::MeshBase::spatialDim (  )  const [inline]

static bool& Sundance::MeshBase::staggerOutput (  )  [inline, static]

Set whether to stagger output in parallel. Set to true for readable output in parallel debugging sessions.

This should be normally, as it causes one synchronization point per process.

Todo:
Get rid of this once we update to use Teuchos::FancyOStream since parallel outputting will be done in a readable way automatically!

Definition at line 1022 of file SundanceMeshBase.hpp.

Referenced by Sundance::BasicSimplicialMesh::assignIntermediateCellGIDs(), and Sundance::BasicSimplicialMesh::resolveEdgeOwnership().

void MeshBase::tangentsToEdges ( const Array< int > &  cellLIDs,
Array< Point > &  tangenVectors 
) const [virtual]

Get tangent vectors for a batch of edges

Parameters:
cellLIDs [in] LIDs for the cells whose tangents are to be computed.
tangentVectors [out] Unit tangents for each cell

Definition at line 132 of file SundanceMeshBase.cpp.

References facetLID(), nodePosition(), and spatialDim().


Member Data Documentation

Definition at line 1030 of file SundanceMeshBase.hpp.

Referenced by comm().

Array< Sundance::Map< int , Array<Point> > > Sundance::MeshBase::curveDerivative_ [mutable, private]

store directional derivative informations to calculate the curve integral

Definition at line 1056 of file SundanceMeshBase.hpp.

Referenced by flushCurvePoints(), getCurvePoints(), mapCurveID_to_Index(), MeshBase(), and setCurvePoints().

map the curve ID to index in the previous arrays

Definition at line 1063 of file SundanceMeshBase.hpp.

Referenced by flushCurvePoints(), and mapCurveID_to_Index().

Array< Sundance::Map< int , Array<Point> > > Sundance::MeshBase::curveNormal_ [mutable, private]

store normal directional used in the curve or in the surf integral
in case of the surf integral it is the cross product from the integral

Definition at line 1060 of file SundanceMeshBase.hpp.

Referenced by flushCurvePoints(), getCurvePoints(), mapCurveID_to_Index(), MeshBase(), and setCurvePoints().

Array< Sundance::Map< int , Array<Point> > > Sundance::MeshBase::curvePoints_ [mutable, private]

store intersection informations to calculate the curve integral

Definition at line 1053 of file SundanceMeshBase.hpp.

Referenced by flushCurvePoints(), getCurvePoints(), hasCurvePoints(), mapCurveID_to_Index(), MeshBase(), and setCurvePoints().

true if the curve did not moved, false if those points are not reusable

Definition at line 1047 of file SundanceMeshBase.hpp.

Referenced by flushCurvePoints(), IsCurvePointsValid(), and setCurvePointsValid().

int Sundance::MeshBase::dim_ [private]

Definition at line 1028 of file SundanceMeshBase.hpp.

Referenced by flushSpecialWeights(), MeshBase(), and spatialDim().

how many curves are participating in curve integrals

Definition at line 1050 of file SundanceMeshBase.hpp.

Referenced by flushCurvePoints(), getCurvePoints(), mapCurveID_to_Index(), and setCurvePoints().

Definition at line 1032 of file SundanceMeshBase.hpp.

Referenced by meshOrder().

Definition at line 1034 of file SundanceMeshBase.hpp.

Referenced by reorderer(), and setReorderer().

Array< Sundance::Map< int , Array<double> > > Sundance::MeshBase::specialWeights_ [mutable, private]

Object to store the special weights for integration

Definition at line 1042 of file SundanceMeshBase.hpp.

Referenced by flushSpecialWeights(), getSpecialWeight(), hasSpecialWeight(), MeshBase(), and setSpecialWeight().

bool Sundance::MeshBase::validWeights_ [mutable, private]

flag to indicate if the weights stored are valid

Definition at line 1039 of file SundanceMeshBase.hpp.

Referenced by flushSpecialWeights(), IsSpecialWeightValid(), and setSpecialWeightValid().

Site Contact