Public Member Functions | Private Member Functions | Private Attributes
Sundance::BasicSimplicialMesh Class Reference

A no-frills parallel simplicial mesh. More...

Inheritance diagram for Sundance::BasicSimplicialMesh:
Sundance::IncrementallyCreatableMesh Sundance::MeshBase Sundance::ObjectWithClassVerbosity< MeshBase > Sundance::ObjectWithInstanceID< MeshBase > Sundance::DefaultObjectWithVerbosity Sundance::ObjectWithVerbosityBase

List of all members.

Public Member Functions

 BasicSimplicialMesh (int dim, const MPIComm &comm, const MeshEntityOrder &order)
virtual ~BasicSimplicialMesh ()
virtual int numCells (int dim) const
 Get the number of cells having dimension dim.
virtual Point nodePosition (int i) const
 Return the position of the i-th node.
const double * nodePositionView (int i) const
 Return a view of the i-th node's position.
virtual void getJacobians (int cellDim, const Array< int > &cellLID, CellJacobianBatch &jBatch) const
 Compute the jacobians of a batch of cells, returning the result via reference argument.
virtual void getCellDiameters (int cellDim, const Array< int > &cellLID, Array< double > &diameters) const
 Compute the diameters of a batch of cells, result via reference argument.
virtual void pushForward (int cellDim, const Array< int > &cellLID, const Array< Point > &refQuadPts, Array< Point > &physQuadPts) const
 Map reference quadrature points to physical points on the given cells.
virtual int ownerProcID (int cellDim, int cellLID) const
 Return the rank of the processor that owns the given cell.
virtual int numFacets (int cellDim, int cellLID, int facetDim) const
 Return the number of facets of the given cell.
virtual int facetLID (int cellDim, int cellLID, int facetDim, int facetIndex, int &facetOrientation) const
 Return the local ID of a facet cell.
virtual void getFacetLIDs (int cellDim, const Array< int > &cellLID, int facetDim, Array< int > &facetLID, Array< int > &facetOrientations) const
 Return by reference argument an array containing the LIDs of the facetDim-dimensional facets of the given batch of cells.
const int * elemZeroFacetView (int cellLID) const
 Return a view of an element's zero-dimensional facets.
virtual int numMaxCofacets (int cellDim, int cellLID) const
 Return the number of maximal cofacets of the given cell.
virtual int maxCofacetLID (int cellDim, int cellLID, int cofacetIndex, int &facetIndex) const
 Return the local ID of a maximal cofacet cell.
virtual void getMaxCofacetLIDs (const Array< int > &cellLIDs, MaximalCofacetBatch &cofacets) const
 Get the LIDs of the maximal cofacets for a batch of codimension-one cells.
void getCofacets (int cellDim, int cellLID, int cofacetDim, Array< int > &cofacetLIDs) const
 Find the cofacets of the given cell.
virtual int mapGIDToLID (int cellDim, int globalIndex) const
 Find the local ID of a cell given its global index.
virtual bool hasGID (int cellDim, int globalIndex) const
 Determine whether a given cell GID exists on this processor.
virtual int mapLIDToGID (int cellDim, int localIndex) const
 Find the global ID of a cell given its local index.
virtual CellType cellType (int cellDim) const
 Get the type of the given cell.
virtual int label (int cellDim, int cellLID) const
 Get the label of the given cell.
virtual void getLabels (int cellDim, const Array< int > &cellLID, Array< int > &labels) const
 Get the labels for a batch of cells.
virtual Set< int > getAllLabelsForDimension (int cellDim) const
 Get the list of all labels defined for cells of the given dimension.
virtual void getLIDsForLabel (int cellDim, int label, Array< int > &cellLIDs) const
 Get the cells associated with a specified label.
Incremental creation methods
virtual int addVertex (int globalIndex, const Point &x, int ownerProcID, int label)
 Add new new vertex to the mesh.
virtual int addElement (int globalIndex, const Array< int > &vertexGIDs, int ownerProcID, int label)
 Add a new element to the mesh.
virtual void setLabel (int cellDim, int cellLID, int label)
 Set the label of the given cell.
virtual void estimateNumVertices (int numVertices)
 Optional preallocation of space for an estimated number of vertices.
virtual void estimateNumElements (int numElements)
 Optional preallocation of space for an estimated number of elements.
virtual void assignIntermediateCellGIDs (int cellDim)
 Coordinate intermediate cell definitions across processors.
virtual bool hasIntermediateGIDs (int dim) const
 Return if cells of dimension cellDim have been assigned global IDs or not.

Private Member Functions

int addFace (int vertLID1, int vertLID2, int vertLID3, int edgeLID1, int edgeLID2, int edgeLID3, int elemLID, int elemGID, int &rotation)
 Add a new face, first checking to see if it already exists.
int addEdge (int vertLID1, int vertLID2, int elemLID, int elemGID, int myFacetNumber)
 Add a new edge, first checking to see if it already exists.
int checkForExistingEdge (int vertLID1, int vertLID2)
 Check for the presence of the edge (vertLID1, vertLID2) in the mesh.
int checkForExistingFace (int vertLID1, int vertLID2, int vertLID3, int edgeLID1, int edgeLID2, int edgeLID3, int *sortedVertGIDs, int *reorderedVertLIDs, int *reorderedEdgeLIDs, int &rotation)
 Check for the presence of the face (vertLID1, int vertLID2, int vertLID3), returning information on orientation of the face as defined by the calling element.
int lookupFace (int vertGID1, int vertGID2, int vertGID3)
 Check whether the face defined by the given vertices exists in the mesh.
void synchronizeGIDNumbering (int dim, int localCount)
void resolveEdgeOwnership (int cellDim)
std::string cellStr (int dim, const int *verts) const
std::string cellToStr (int dim, int cellLID) const
std::string printCells (int dim) const
void synchronizeNeighborLists ()
void getSortedFaceVertices (int vertGID1, int vertGID2, int vertGID3, int *sortedVertGIDs) const
 Sort the 3 vertices of a face in order of increasing GID.
void getSortedFaceVertices (int a, int b, int c, int la, int lb, int lc, int eAB, int eBC, int eCA, int *sortedVertGIDs, int *reorderedVertLIDs, int *reorderedEdgeLIDs, int &rotation) const
 Sort the the vertices of a face in order or increasing GID, reordering the LIDs of the vertices and associated edges following the GID ordering.
void fillSortedArray (int a, int b, int c, int *s) const
 Helper function to stuff three numbers into an array.

Private Attributes

Array< int > numCells_
 Number of cells of each dimension.
Array< Pointpoints_
 coordinates of vertices.
ArrayOfTuples< int > edgeVerts_
 pairs of local vertex indices for the edges, each pair ordered from lower to higher global vertex index in order to define an absolute edge orientation.
ArrayOfTuples< int > faceVertLIDs_
 Tuples of local vertex indices for the faces, with each tuple ordered from lowest to highest global index in order to define an absolute edge orientation.
ArrayOfTuples< int > faceVertGIDs_
 Tuples of global vertex indices for the faces, with each tuple ordered from lowest to highest global index in order to define an absolute edge orientation.
ArrayOfTuples< int > faceEdges_
 Tuples of local indices for the edges of all faces.
ArrayOfTuples< int > faceEdgeSigns_
 Tuples of edge signs for the faces.
ArrayOfTuples< int > elemVerts_
 tuples of local vertex indices for the elements.
ArrayOfTuples< int > elemEdges_
 tuples of local edge indices for the elements.
ArrayOfTuples< int > elemEdgeSigns_
 tuples of edge orientations for the elements, indicating whether the orientation of the edge as given by moving around the element is parallel or antiparallel to the absolute orientation of the edge.
ArrayOfTuples< int > elemFaces_
 tuples of face LIDs for the elements.
ArrayOfTuples< int > elemFaceRotations_
 tuples of face rotations for the elements, defined relative to the absolute orientation of the face.
Hashtable< VertexView, int > vertexSetToFaceIndexMap_
 table for mapping vertex set -> face index
Array< Array< int > > edgeFaces_
 array of face cofacets for the edges.
Array< Array< int > > edgeCofacets_
 array of element cofacets for the edges.
Array< Array< int > > faceCofacets_
 array of element cofacets for the faces.
Array< Array< int > > vertEdges_
 array of edge cofacets for the vertices.
Array< Array< int > > vertFaces_
 array of face cofacet LIDs for the vertices.
Array< Array< int > > vertCofacets_
 array of maximal cofacets for the vertices.
Array< Array< int > > vertEdgePartners_
 array of edge partners for the vertices.
Array< Array< int > > LIDToGIDMap_
 map from local to global cell indices.
Array< Hashtable< int, int > > GIDToLIDMap_
 map from global to local cell indices.
Array< Array< int > > labels_
 Array of labels for the cells.
Array< Array< int > > ownerProcID_
 Array of owning processor IDs for the cells.
Array< int * > faceVertGIDBase_
 Pointer to the pointer at the base of the face vertex GID array.
bool hasEdgeGIDs_
 flag indicating whether the edge GIDs have been synchronized
bool hasFaceGIDs_
 flag indicating whether the face GIDs have been synchronized
Set< int > neighbors_
 Set of all neighbor processors sharing data with this one.
bool neighborsAreSynchronized_
 Whether the neighbor lists have been synchronized across processors.

Detailed Description

A no-frills parallel simplicial mesh.

Definition at line 51 of file SundanceBasicSimplicialMesh.hpp.


Constructor & Destructor Documentation

BasicSimplicialMesh::BasicSimplicialMesh ( int  dim,
const MPIComm &  comm,
const MeshEntityOrder order 
)
virtual Sundance::BasicSimplicialMesh::~BasicSimplicialMesh ( ) [inline, virtual]

Definition at line 59 of file SundanceBasicSimplicialMesh.hpp.


Member Function Documentation

int BasicSimplicialMesh::addEdge ( int  vertLID1,
int  vertLID2,
int  elemLID,
int  elemGID,
int  myFacetNumber 
) [private]

Add a new edge, first checking to see if it already exists.

This function is called from within addElement(), not by the user, and is therefore private.

Parameters:
vertLID{1,2}
elemLIDLID of the element that is adding the edge
elemGIDGID of the element that is adding the edge
myFacetNumberfacet number of the edge within the element
Returns:
LID of this edge

Definition at line 1379 of file SundanceBasicSimplicialMesh.cpp.

References Sundance::ArrayOfTuples< T >::append(), checkForExistingEdge(), Sundance::MeshBase::comm(), edgeCofacets_, edgeFaces_, edgeVerts_, elemEdgeSigns_, labels_, Sundance::ArrayOfTuples< T >::length(), LIDToGIDMap_, numCells_, ownerProcID_, Sundance::MeshBase::spatialDim(), Sundance::ArrayOfTuples< T >::value(), vertEdgePartners_, and vertEdges_.

Referenced by addElement().

int BasicSimplicialMesh::addElement ( int  globalIndex,
const Array< int > &  vertexGIDs,
int  ownerProcID,
int  label 
) [virtual]

Add a new element to the mesh.

Parameters:
globalIndexthe GID of the new element
vertexGIDstuple of GIDs for the vertices defining this element.
ownerProcIDthe processor that "owns" this element
labela label for this element (optionally used in setting loads, material properties, etc)
Returns:
the LID of the element

Implements Sundance::IncrementallyCreatableMesh.

Definition at line 986 of file SundanceBasicSimplicialMesh.cpp.

References addEdge(), addFace(), Sundance::ArrayOfTuples< T >::append(), Sundance::MeshBase::comm(), edgeCofacets_, elemEdges_, elemEdgeSigns_, elemFaceRotations_, elemFaces_, elemVerts_, faceCofacets_, GIDToLIDMap_, labels_, Sundance::ArrayOfTuples< T >::length(), LIDToGIDMap_, neighbors_, numCells_, ownerProcID_, Sundance::Set< Key, Compare >::put(), Sundance::ArrayOfTuples< T >::resize(), Sundance::MeshBase::spatialDim(), SUNDANCE_VERB_HIGH, and vertCofacets_.

int BasicSimplicialMesh::addFace ( int  vertLID1,
int  vertLID2,
int  vertLID3,
int  edgeLID1,
int  edgeLID2,
int  edgeLID3,
int  elemLID,
int  elemGID,
int &  rotation 
) [private]

Add a new face, first checking to see if it already exists.

This function is called from within addElement(), not by the user, and is therefore private.

Parameters:
vertLID{1,2,3}The LIDs for the three vertices of the face
edgeLID{1,2,3}The LIDs for the three edges of the face
rotationAn integer specifying the permutation that transforms the sorted ordering of vertGID{1,2,3} to the order given by the element definition. Initial value is not used; value is returned by reference argument.
Returns:
LID of this face

Definition at line 1111 of file SundanceBasicSimplicialMesh.cpp.

References Sundance::ArrayOfTuples< T >::append(), cellStr(), checkForExistingFace(), Sundance::MeshBase::comm(), edgeFaces_, faceCofacets_, faceEdges_, faceVertGIDBase_, faceVertGIDs_, faceVertLIDs_, labels_, Sundance::ArrayOfTuples< T >::length(), numCells_, ownerProcID_, Sundance::MeshBase::spatialDim(), SUNDANCE_VERB_EXTREME, Sundance::ArrayOfTuples< T >::value(), vertexSetToFaceIndexMap_, and vertFaces_.

Referenced by addElement().

int BasicSimplicialMesh::addVertex ( int  globalIndex,
const Point x,
int  ownerProcID,
int  label 
) [virtual]

Add new new vertex to the mesh.

Parameters:
globalIndexthe GID of the new vertex
xthe spatial position of the new vertex
ownerProcIDthe processor that "owns" this vertex
labela label for this vertex (optionally used in setting loads, boundary conditions, etc)
Returns:
the LID of the vertex.

Implements Sundance::IncrementallyCreatableMesh.

Definition at line 959 of file SundanceBasicSimplicialMesh.cpp.

References Sundance::MeshBase::comm(), GIDToLIDMap_, labels_, LIDToGIDMap_, neighbors_, numCells_, ownerProcID_, points_, Sundance::Set< Key, Compare >::put(), Sundance::MeshBase::spatialDim(), SUNDANCE_OUT, Sundance::DefaultObjectWithVerbosity::verb(), vertCofacets_, vertEdgePartners_, vertEdges_, and vertFaces_.

void BasicSimplicialMesh::assignIntermediateCellGIDs ( int  cellDim) [virtual]
string BasicSimplicialMesh::cellStr ( int  dim,
const int *  verts 
) const [private]
string BasicSimplicialMesh::cellToStr ( int  dim,
int  cellLID 
) const [private]
CellType BasicSimplicialMesh::cellType ( int  cellDim) const [virtual]

Get the type of the given cell.

Implements Sundance::MeshBase.

Definition at line 897 of file SundanceBasicSimplicialMesh.cpp.

References Sundance::LineCell, Sundance::NullCell, Sundance::PointCell, Sundance::TetCell, and Sundance::TriangleCell.

int BasicSimplicialMesh::checkForExistingEdge ( int  vertLID1,
int  vertLID2 
) [private]

Check for the presence of the edge (vertLID1, vertLID2) in the mesh.

Returns:
the edge LID if the edge exists, -1 otherwise

Definition at line 1309 of file SundanceBasicSimplicialMesh.cpp.

References vertEdgePartners_, and vertEdges_.

Referenced by addEdge(), assignIntermediateCellGIDs(), and resolveEdgeOwnership().

int BasicSimplicialMesh::checkForExistingFace ( int  vertLID1,
int  vertLID2,
int  vertLID3,
int  edgeLID1,
int  edgeLID2,
int  edgeLID3,
int *  sortedVertGIDs,
int *  reorderedVertLIDs,
int *  reorderedEdgeLIDs,
int &  rotation 
) [private]

Check for the presence of the face (vertLID1, int vertLID2, int vertLID3), returning information on orientation of the face as defined by the calling element.

Definition at line 1322 of file SundanceBasicSimplicialMesh.cpp.

References getSortedFaceVertices(), LIDToGIDMap_, and vertexSetToFaceIndexMap_.

Referenced by addFace().

const int* Sundance::BasicSimplicialMesh::elemZeroFacetView ( int  cellLID) const [inline, virtual]

Return a view of an element's zero-dimensional facets.

Implements Sundance::MeshBase.

Definition at line 157 of file SundanceBasicSimplicialMesh.hpp.

References elemVerts_, and Sundance::ArrayOfTuples< T >::value().

void BasicSimplicialMesh::estimateNumElements ( int  numElements) [virtual]
void BasicSimplicialMesh::estimateNumVertices ( int  numVertices) [virtual]

Optional preallocation of space for an estimated number of vertices.

Reimplemented from Sundance::IncrementallyCreatableMesh.

Definition at line 538 of file SundanceBasicSimplicialMesh.cpp.

References GIDToLIDMap_, labels_, LIDToGIDMap_, ownerProcID_, points_, vertCofacets_, vertEdgePartners_, and vertEdges_.

Referenced by BasicSimplicialMesh().

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

Return the local ID of a facet cell.

Parameters:
cellDimdimension of the cell whose facets are being obtained
cellLIDlocal index of the cell whose facets are being obtained
facetDimdimension of the desired facet
facetIndexindex into the list of the cell's facets
facetOrientationorientation of the facet as seen from the given cell (returned via reference)

Implements Sundance::MeshBase.

Definition at line 722 of file SundanceBasicSimplicialMesh.cpp.

References edgeVerts_, elemEdges_, elemEdgeSigns_, elemFaceRotations_, elemFaces_, elemVerts_, faceEdges_, faceVertLIDs_, Sundance::MeshBase::spatialDim(), and Sundance::ArrayOfTuples< T >::value().

Referenced by maxCofacetLID().

void Sundance::BasicSimplicialMesh::fillSortedArray ( int  a,
int  b,
int  c,
int *  s 
) const [inline, private]

Helper function to stuff three numbers into an array.

Definition at line 552 of file SundanceBasicSimplicialMesh.hpp.

Referenced by getSortedFaceVertices().

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

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

Implements Sundance::MeshBase.

Definition at line 933 of file SundanceBasicSimplicialMesh.cpp.

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

void BasicSimplicialMesh::getCellDiameters ( int  cellDim,
const Array< int > &  cellLID,
Array< double > &  diameters 
) const [virtual]

Compute the diameters of a batch of cells, result via reference argument.

Parameters:
cellDimdimension of the cells whose diameters are to be computed
cellLIDlocal indices of the cells for which diameters are to be computed
diametersreference to the array of cell diameters

Reimplemented from Sundance::MeshBase.

Definition at line 272 of file SundanceBasicSimplicialMesh.cpp.

References Sundance::cross(), Sundance::Point::distance(), edgeVerts_, elemVerts_, faceVertLIDs_, points_, Sundance::MeshBase::spatialDim(), and Sundance::ArrayOfTuples< T >::value().

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

Find the cofacets of the given cell.

Parameters:
cellDimdimension of the cell whose cofacets are being obtained
cellLIDlocal index of the cell whose cofacets are being obtained
cofacetDimdimension of the cofacets to get
cofacetLIDsLIDs of the cofacet

Implements Sundance::MeshBase.

Definition at line 838 of file SundanceBasicSimplicialMesh.cpp.

References edgeFaces_, maxCofacetLID(), numMaxCofacets(), Sundance::MeshBase::spatialDim(), vertEdges_, and vertFaces_.

void BasicSimplicialMesh::getFacetLIDs ( int  cellDim,
const Array< int > &  cellLID,
int  facetDim,
Array< int > &  facetLID,
Array< int > &  facetOrientations 
) const [virtual]

Return by reference argument an array containing the LIDs of the facetDim-dimensional facets of the given batch of cells.

Implements Sundance::MeshBase.

Definition at line 624 of file SundanceBasicSimplicialMesh.cpp.

References batchedFacetGrabTimer(), edgeVerts_, elemEdges_, elemEdgeSigns_, elemFaceRotations_, elemFaces_, elemVerts_, faceEdges_, faceVertLIDs_, numFacets(), Sundance::MeshBase::spatialDim(), and Sundance::ArrayOfTuples< T >::value().

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

Compute the jacobians of a batch of cells, returning the result via reference argument.

Parameters:
cellDimdimension of the cells whose Jacobians are to be computed
cellLIDlocal indices of the cells for which Jacobians are to be computed
jBatchreference to the resulting Jacobian batch

Reimplemented from Sundance::MeshBase.

Definition at line 132 of file SundanceBasicSimplicialMesh.cpp.

References Sundance::CellJacobianBatch::addFlops(), Sundance::cross(), Sundance::CellJacobianBatch::detJ(), edgeVerts_, elemVerts_, faceVertLIDs_, getJacobianTimer(), Sundance::CellJacobianBatch::jVals(), points_, Sundance::CellJacobianBatch::resize(), Sundance::MeshBase::spatialDim(), and Sundance::ArrayOfTuples< T >::value().

void BasicSimplicialMesh::getLabels ( int  cellDim,
const Array< int > &  cellLID,
Array< int > &  labels 
) const [virtual]

Get the labels for a batch of cells.

Implements Sundance::MeshBase.

Definition at line 921 of file SundanceBasicSimplicialMesh.cpp.

References labels_.

void BasicSimplicialMesh::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.

Implements Sundance::MeshBase.

Definition at line 946 of file SundanceBasicSimplicialMesh.cpp.

References labels_.

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

Get the LIDs of the maximal cofacets for a batch of codimension-one cells.

Parameters:
cellLIDs[in] array of LIDs of the cells whose cofacets are being obtained
cofacets[out] the batch of cofacets

Implements Sundance::MeshBase.

Definition at line 814 of file SundanceBasicSimplicialMesh.cpp.

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

void BasicSimplicialMesh::getSortedFaceVertices ( int  vertGID1,
int  vertGID2,
int  vertGID3,
int *  sortedVertGIDs 
) const [private]

Sort the 3 vertices of a face in order of increasing GID.

Parameters:
vertGID{1,2,3}the three vertices
sortedVertGIDsarray in which the sorted vertices are to be returned

Definition at line 1270 of file SundanceBasicSimplicialMesh.cpp.

References fillSortedArray().

Referenced by checkForExistingFace(), and lookupFace().

void BasicSimplicialMesh::getSortedFaceVertices ( int  a,
int  b,
int  c,
int  la,
int  lb,
int  lc,
int  eAB,
int  eBC,
int  eCA,
int *  sortedVertGIDs,
int *  reorderedVertLIDs,
int *  reorderedEdgeLIDs,
int &  rotation 
) const [private]

Sort the the vertices of a face in order or increasing GID, reordering the LIDs of the vertices and associated edges following the GID ordering.

Also, return a rotation flag describing the permutation between the unsorted and sorted arrays.

Definition at line 1207 of file SundanceBasicSimplicialMesh.cpp.

References fillSortedArray().

bool BasicSimplicialMesh::hasGID ( int  cellDim,
int  globalIndex 
) const [virtual]

Determine whether a given cell GID exists on this processor.

Implements Sundance::MeshBase.

Definition at line 887 of file SundanceBasicSimplicialMesh.cpp.

References GIDToLIDMap_.

virtual bool Sundance::BasicSimplicialMesh::hasIntermediateGIDs ( int  cellDim) const [inline, virtual]

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

Parameters:
cellDim[in] Dimension of the cell

Implements Sundance::MeshBase.

Definition at line 284 of file SundanceBasicSimplicialMesh.hpp.

References hasEdgeGIDs_, and hasFaceGIDs_.

int BasicSimplicialMesh::label ( int  cellDim,
int  cellLID 
) const [virtual]

Get the label of the given cell.

Implements Sundance::MeshBase.

Definition at line 915 of file SundanceBasicSimplicialMesh.cpp.

References labels_.

Referenced by setLabel().

int BasicSimplicialMesh::lookupFace ( int  vertGID1,
int  vertGID2,
int  vertGID3 
) [private]

Check whether the face defined by the given vertices exists in the mesh.

Returns -1 if the face does not exist. Called during the synchronization of intermediate cell GIDs.

Parameters:
vertGID{1,2,3}the global indices of the vertices defining the face
Returns:
the LID of the face

Definition at line 1355 of file SundanceBasicSimplicialMesh.cpp.

References getSortedFaceVertices(), and vertexSetToFaceIndexMap_.

Referenced by assignIntermediateCellGIDs(), and resolveEdgeOwnership().

int BasicSimplicialMesh::mapGIDToLID ( int  cellDim,
int  globalIndex 
) const [virtual]

Find the local ID of a cell given its global index.

Implements Sundance::MeshBase.

Definition at line 882 of file SundanceBasicSimplicialMesh.cpp.

References GIDToLIDMap_.

Referenced by assignIntermediateCellGIDs().

int BasicSimplicialMesh::mapLIDToGID ( int  cellDim,
int  localIndex 
) const [virtual]

Find the global ID of a cell given its local index.

Implements Sundance::MeshBase.

Definition at line 892 of file SundanceBasicSimplicialMesh.cpp.

References LIDToGIDMap_.

Referenced by assignIntermediateCellGIDs(), cellToStr(), and printCells().

int BasicSimplicialMesh::maxCofacetLID ( int  cellDim,
int  cellLID,
int  cofacetIndex,
int &  facetIndex 
) const [virtual]

Return the local ID of a maximal cofacet cell.

Parameters:
cellDimdimension of the cell whose cofacets are being obtained
cellLIDlocal index of the cell whose cofacets are being obtained
cofacetIndexwhich maximal cofacet to get
cofacetIndexindex of the cell cellLID into the list of the maximal cell's facets

Implements Sundance::MeshBase.

Definition at line 776 of file SundanceBasicSimplicialMesh.cpp.

References edgeCofacets_, faceCofacets_, facetLID(), numFacets(), Sundance::MeshBase::spatialDim(), and vertCofacets_.

Referenced by getCofacets(), and getMaxCofacetLIDs().

virtual Point Sundance::BasicSimplicialMesh::nodePosition ( int  i) const [inline, virtual]

Return the position of the i-th node.

Implements Sundance::MeshBase.

Definition at line 69 of file SundanceBasicSimplicialMesh.hpp.

References points_.

const double* Sundance::BasicSimplicialMesh::nodePositionView ( int  i) const [inline, virtual]

Return a view of the i-th node's position.

Implements Sundance::MeshBase.

Definition at line 74 of file SundanceBasicSimplicialMesh.hpp.

References points_.

int BasicSimplicialMesh::numCells ( int  dim) const [virtual]

Get the number of cells having dimension dim.

Implements Sundance::MeshBase.

Definition at line 595 of file SundanceBasicSimplicialMesh.cpp.

References numCells_.

Referenced by assignIntermediateCellGIDs(), resolveEdgeOwnership(), and synchronizeGIDNumbering().

int BasicSimplicialMesh::numFacets ( int  cellDim,
int  cellLID,
int  facetDim 
) const [virtual]

Return the number of facets of the given cell.

Implements Sundance::MeshBase.

Definition at line 605 of file SundanceBasicSimplicialMesh.cpp.

Referenced by getFacetLIDs(), and maxCofacetLID().

int BasicSimplicialMesh::numMaxCofacets ( int  cellDim,
int  cellLID 
) const [virtual]

Return the number of maximal cofacets of the given cell.

Implements Sundance::MeshBase.

Definition at line 756 of file SundanceBasicSimplicialMesh.cpp.

References edgeCofacets_, faceCofacets_, and vertCofacets_.

Referenced by getCofacets(), and getMaxCofacetLIDs().

int BasicSimplicialMesh::ownerProcID ( int  cellDim,
int  cellLID 
) const [virtual]

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

Implements Sundance::MeshBase.

Definition at line 600 of file SundanceBasicSimplicialMesh.cpp.

References ownerProcID_.

string BasicSimplicialMesh::printCells ( int  dim) const [private]
void BasicSimplicialMesh::pushForward ( int  cellDim,
const Array< int > &  cellLID,
const Array< Point > &  refQuadPts,
Array< Point > &  physQuadPts 
) const [virtual]

Map reference quadrature points to physical points on the given cells.

Reimplemented from Sundance::MeshBase.

Definition at line 379 of file SundanceBasicSimplicialMesh.cpp.

References Sundance::CellJacobianBatch::addFlops(), edgeVerts_, elemVerts_, faceVertLIDs_, points_, Sundance::MeshBase::spatialDim(), and Sundance::ArrayOfTuples< T >::value().

void BasicSimplicialMesh::resolveEdgeOwnership ( int  cellDim) [private]
virtual void Sundance::BasicSimplicialMesh::setLabel ( int  cellDim,
int  cellLID,
int  label 
) [inline, virtual]

Set the label of the given cell.

Implements Sundance::MeshBase.

Definition at line 269 of file SundanceBasicSimplicialMesh.hpp.

References label(), and labels_.

void BasicSimplicialMesh::synchronizeGIDNumbering ( int  dim,
int  localCount 
) [private]
void BasicSimplicialMesh::synchronizeNeighborLists ( ) [private]

Member Data Documentation

Array<Array<int> > Sundance::BasicSimplicialMesh::edgeCofacets_ [private]

array of element cofacets for the edges.

The first index is the edge LID, the second the cofacet number.

Definition at line 457 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), addElement(), estimateNumElements(), maxCofacetLID(), and numMaxCofacets().

Array<Array<int> > Sundance::BasicSimplicialMesh::edgeFaces_ [private]

array of face cofacets for the edges.

The first index is the edge LID, the second the cofacet number.

Definition at line 453 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), addFace(), and getCofacets().

pairs of local vertex indices for the edges, each pair ordered from lower to higher global vertex index in order to define an absolute edge orientation.

Because global vertex indices are used, all processors will agree on this orientation, regardless of the orientation of the edge as seen by the element first defining it. The first index into this 2D array is the edge LID, the second the vertex number within the edge.

Definition at line 387 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), assignIntermediateCellGIDs(), cellToStr(), estimateNumElements(), facetLID(), getCellDiameters(), getFacetLIDs(), getJacobians(), printCells(), pushForward(), and resolveEdgeOwnership().

tuples of local edge indices for the elements.

The first index into this 2D array is the element LID, the second is the edge number.

Definition at line 430 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addElement(), BasicSimplicialMesh(), estimateNumElements(), facetLID(), and getFacetLIDs().

tuples of edge orientations for the elements, indicating whether the orientation of the edge as given by moving around the element is parallel or antiparallel to the absolute orientation of the edge.

The first index into this 2D array is the element LID, the second the edge number.

Definition at line 438 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), addElement(), BasicSimplicialMesh(), estimateNumElements(), facetLID(), and getFacetLIDs().

tuples of face rotations for the elements, defined relative to the absolute orientation of the face.

Definition at line 446 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addElement(), facetLID(), and getFacetLIDs().

tuples of face LIDs for the elements.

The first index is the element LID, the second the face number.

Definition at line 442 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addElement(), estimateNumElements(), facetLID(), and getFacetLIDs().

tuples of local vertex indices for the elements.

The first index into this 2D array is the element LID, the second is the vertex number.

Definition at line 426 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addElement(), cellToStr(), elemZeroFacetView(), estimateNumElements(), facetLID(), getCellDiameters(), getFacetLIDs(), getJacobians(), printCells(), and pushForward().

Array<Array<int> > Sundance::BasicSimplicialMesh::faceCofacets_ [private]

array of element cofacets for the faces.

The first index is the face LID, the second the cofacet number.

Definition at line 461 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addElement(), addFace(), estimateNumElements(), maxCofacetLID(), and numMaxCofacets().

Tuples of local indices for the edges of all faces.

The first index into this 2D array is the face LID, the second the edge number.

Definition at line 417 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addFace(), estimateNumElements(), facetLID(), and getFacetLIDs().

Tuples of edge signs for the faces.

The edge sign indicates whether the orientation of the edge as given by moving around the face is parallel or antiparallel to the absolute orientation of the edge.

Definition at line 422 of file SundanceBasicSimplicialMesh.hpp.

Pointer to the pointer at the base of the face vertex GID array.

This is used to get small-array "views" of the face vertex GID array without making copies, resulting in a significant performance improvement in the vertex set hashtable lookups to identify pre-existing faces.

We use double rather than single indirection here because as elements are added, the face vertex GID array will often be resized, thus changing the base pointer. Each vertex set "view" keeps a pointer to the base pointer, so that it always remains synchronized with the array of face vertices.

IMPORTANT: any time faceVertGIDs_ is resized, faceVertGIDBase_[0] must be reset to the base of the faceVertGIDs_ array so that the vertex sets are pointing to the right place.

Definition at line 511 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addFace(), BasicSimplicialMesh(), and estimateNumElements().

Tuples of global vertex indices for the faces, with each tuple ordered from lowest to highest global index in order to define an absolute edge orientation.

Because global vertex indices are used, all processors will agree on this orientation, regardless of the orientation of the face as seen by the element first defining it. The first index into this 2D array is the face LID, the second the vertex number within the face.

Notice that we duplicate the face vertex storage, storing both the vertex LIDs and vertex GIDs for each face. This lets us do quick comparison with the sorted GID array in order to identify pre-existing faces, while also making it possible to retrieve face vertex LID information without doing hashtable lookups.

Definition at line 413 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addFace(), BasicSimplicialMesh(), and estimateNumElements().

Tuples of local vertex indices for the faces, with each tuple ordered from lowest to highest global index in order to define an absolute edge orientation.

Because global vertex indices are used, all processors will agree on this orientation, regardless of the orientation of the face as seen by the element first defining it. The first index into this 2D array is the face LID, the second the vertex number within the face.

Definition at line 396 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addFace(), assignIntermediateCellGIDs(), cellToStr(), estimateNumElements(), facetLID(), getCellDiameters(), getFacetLIDs(), getJacobians(), printCells(), pushForward(), and resolveEdgeOwnership().

Array<Hashtable<int, int> > Sundance::BasicSimplicialMesh::GIDToLIDMap_ [private]

map from global to local cell indices.

The array index is the cell dimension. The hashtable key is the cell GID, the value the cell LID.

Definition at line 486 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addElement(), addVertex(), assignIntermediateCellGIDs(), estimateNumElements(), estimateNumVertices(), hasGID(), mapGIDToLID(), resolveEdgeOwnership(), and synchronizeGIDNumbering().

flag indicating whether the edge GIDs have been synchronized

Definition at line 515 of file SundanceBasicSimplicialMesh.hpp.

Referenced by assignIntermediateCellGIDs(), and hasIntermediateGIDs().

flag indicating whether the face GIDs have been synchronized

Definition at line 518 of file SundanceBasicSimplicialMesh.hpp.

Referenced by assignIntermediateCellGIDs(), and hasIntermediateGIDs().

Array<Array<int> > Sundance::BasicSimplicialMesh::labels_ [private]
Array<Array<int> > Sundance::BasicSimplicialMesh::LIDToGIDMap_ [private]

map from local to global cell indices.

The first index into this 2D array is the cell dimension, the second the cell LID.

Definition at line 481 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), addElement(), addVertex(), assignIntermediateCellGIDs(), cellToStr(), checkForExistingFace(), estimateNumElements(), estimateNumVertices(), mapLIDToGID(), printCells(), resolveEdgeOwnership(), and synchronizeGIDNumbering().

Set of all neighbor processors sharing data with this one.

Definition at line 521 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addElement(), addVertex(), BasicSimplicialMesh(), resolveEdgeOwnership(), and synchronizeNeighborLists().

Whether the neighbor lists have been synchronized across processors.

Definition at line 525 of file SundanceBasicSimplicialMesh.hpp.

Referenced by synchronizeNeighborLists().

Number of cells of each dimension.

Definition at line 374 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), addElement(), addFace(), addVertex(), and numCells().

Array<Array<int> > Sundance::BasicSimplicialMesh::ownerProcID_ [private]

Array of owning processor IDs for the cells.

Each cell is owned by a single processor that is responsible for assigning global indices, DOF numbers, and so on.

Definition at line 494 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), addElement(), addFace(), addVertex(), assignIntermediateCellGIDs(), estimateNumElements(), estimateNumVertices(), ownerProcID(), and resolveEdgeOwnership().

coordinates of vertices.

The index into the array is the vertex LID .

Definition at line 377 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addVertex(), estimateNumVertices(), getCellDiameters(), getJacobians(), nodePosition(), nodePositionView(), and pushForward().

Array<Array<int> > Sundance::BasicSimplicialMesh::vertCofacets_ [private]

array of maximal cofacets for the vertices.

The first index is the vertex LID, the second the cafacet number.

Definition at line 473 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addElement(), addVertex(), estimateNumVertices(), maxCofacetLID(), and numMaxCofacets().

array of edge partners for the vertices.

The partners are other vertices sharing an edge with the specified vertex.

Definition at line 477 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), addVertex(), checkForExistingEdge(), and estimateNumVertices().

Array<Array<int> > Sundance::BasicSimplicialMesh::vertEdges_ [private]

array of edge cofacets for the vertices.

The first index is the vertex LID, the second the edge cofacet number.

Definition at line 465 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addEdge(), addVertex(), checkForExistingEdge(), estimateNumVertices(), and getCofacets().

table for mapping vertex set -> face index

Definition at line 449 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addFace(), checkForExistingFace(), estimateNumElements(), and lookupFace().

Array<Array<int> > Sundance::BasicSimplicialMesh::vertFaces_ [private]

array of face cofacet LIDs for the vertices.

The first index is the vertex LID, the second the cofacet number.

Definition at line 469 of file SundanceBasicSimplicialMesh.hpp.

Referenced by addFace(), addVertex(), and getCofacets().

Site Contact