Sundance::MeshSource Class Reference

Inheritance diagram for Sundance::MeshSource:

Playa::Handle< MeshSourceBase >

List of all members.

Public Member Functions

 MeshSource ()
 MeshSource (Playa::Handleable< MeshSourceBase > *rawPtr)
 MeshSource (const RCP< MeshSourceBase > &smartPtr)
Mesh getMesh () const
void getAttributes (RCP< Array< Array< double > > > &nodeAttributes, RCP< Array< Array< double > > > &elemAttributes) const
const MPICommcomm () const

Static Public Member Functions

static MeshTypedefaultMeshType ()
static bool & staggerOutput ()

Detailed Description

MeshSource is the user-level interface for objects such as mesh generators and mesh file readers. A MeshSource can create a mesh object with the getMesh() method, and if node and element attributes are available, it can access them with the getAttributes() method.

Example: read input from a file celled "meshFile" in Shewchuk's Triangle format, and create a mesh of type BasicSimplicialMesh distributed over the MPI communicator MPI_COMM_WORLD.

 MeshType meshType = new BasicSimplicialMeshType();
 MeshSource meshSrc = new TriangleMeshReader("meshFile", meshType, MPIComm::world());

Definition at line 57 of file SundanceMeshSource.hpp.

Constructor & Destructor Documentation

MeshSource::MeshSource (  ) 

Construct an empty mesh source object

Definition at line 22 of file SundanceMeshSource.cpp.

MeshSource::MeshSource ( Playa::Handleable< MeshSourceBase > *  rawPtr  ) 

Construct from a raw pointer to a mesh source subtype

Definition at line 26 of file SundanceMeshSource.cpp.

MeshSource::MeshSource ( const RCP< MeshSourceBase > &  smartPtr  ) 

Construct from a smart pointer to a mesh source subtype

Definition at line 31 of file SundanceMeshSource.cpp.

Member Function Documentation

const MPIComm & MeshSource::comm (  )  const

access to the MPI communicator

Definition at line 88 of file SundanceMeshSource.cpp.

References Playa::Handle< MeshSourceBase >::ptr().

Referenced by Sundance::serialPartition().

MeshType & MeshSource::defaultMeshType (  )  [static]

Return the mesh type to be used by default if no MeshType is given in a MeshSource subtype ctor. The default mesh type can be set by including a specifer such as

 <DefaultMesh type="BasicSimplicial">
as a child in the XML configuration file.

Definition at line 82 of file SundanceMeshSource.cpp.

void MeshSource::getAttributes ( RCP< Array< Array< double > > > &  nodeAttributes,
RCP< Array< Array< double > > > &  elemAttributes 
) const

Get any attributes associated with the nodes and elements in the mesh. If no attributes exist, the arrays are empty. If the mesh does not exist, it will be created with a cell to getMesh().

Definition at line 74 of file SundanceMeshSource.cpp.

References getMesh(), and Playa::Handle< MeshSourceBase >::ptr().

Referenced by Sundance::readNodalFields(), and Sundance::serialPartition().

Mesh MeshSource::getMesh (  )  const

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

Definition at line 91 of file SundanceMeshSource.hpp.

Referenced by getMesh().

Site Contact