escript  Revision_
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions
finley::Mesh Class Reference

#include <Mesh.h>

List of all members.

Public Member Functions

 Mesh (const std::string name, int numDim, Esys_MPIInfo *mpi_info)
 ~Mesh ()
 destructor
void write (const std::string fname) const
 writes the mesh to the external file fname using the Finley file format
int getDim () const
int getStatus () const
void addPoints (int numPoints, const double *points_ptr, const int *tags_ptr)
void addTagMap (const char *name, int tag_key)
int getTag (const char *name) const
bool isValidTagName (const char *name) const
paso::SystemMatrixPattern_ptr getPattern (bool reduce_row_order, bool reduce_col_order)
 returns a reference to the matrix pattern
paso::SystemMatrixPattern_ptr makePattern (bool reduce_row_order, bool reduce_col_order)
void printInfo (bool)
void setCoordinates (const escript::Data &newX)
 sets new coordinates for the nodes
void setElements (ElementFile *elements)
void setFaceElements (ElementFile *elements)
void setContactElements (ElementFile *elements)
void setPoints (ElementFile *elements)
void prepare (bool optimize)
 prepares the mesh for further use
void resolveNodeIds ()
void createMappings (const std::vector< int > &dofDistribution, const std::vector< int > &nodeDistribution)
 creates node mappings without (re-)distributing anything
void markDOFsConnectedToRange (int *mask, int offset, int marker, int firstDOF, int lastDOF, bool useLinear)
void relabelElementNodes (const std::vector< int > &, int offset)
 assigns new node reference numbers to all element files
void glueFaces (double safetyFactor, double tolerance, bool)
void joinFaces (double safetyFactor, double tolerance, bool)
void findMatchingFaces (double, double, int *, int *, int *, int *)
void print ()
 prints the mesh details to standard output

Static Public Member Functions

static Meshload (const std::string fname)
static Meshread (const std::string fname, int order, int reducedOrder, bool optimize)
static MeshreadGmsh (const std::string fname, int numDim, int order, int reducedOrder, bool optimize, bool useMacroElements)

Public Attributes

std::string m_name
int approximationOrder
int reducedApproximationOrder
int integrationOrder
int reducedIntegrationOrder
NodeFileNodes
ElementFileElements
ElementFileFaceElements
ElementFileContactElements
ElementFilePoints
TagMap tagMap
paso::SystemMatrixPattern_ptr FullFullPattern
paso::SystemMatrixPattern_ptr FullReducedPattern
paso::SystemMatrixPattern_ptr ReducedFullPattern
paso::SystemMatrixPattern_ptr ReducedReducedPattern
Esys_MPIInfoMPIInfo

Private Member Functions

void createColoring (const std::vector< int > &dofMap)
 tries to reduce the number of colours for all element files
void distributeByRankOfDOF (const std::vector< int > &distribution)
void markNodes (std::vector< short > &mask, int offset, bool useLinear)
void optimizeDOFDistribution (std::vector< int > &distribution)
void optimizeDOFLabeling (const std::vector< int > &distribution)
 optimizes the labeling of the DOFs on each processor
void optimizeElementOrdering ()
 redistributes elements to minimize communication during assemblage
void setOrders ()
void updateTagList ()
 regenerates list of tags in use for node file and element files

Constructor & Destructor Documentation

finley::Mesh::Mesh ( const std::string  name,
int  numDim,
Esys_MPIInfo mpi_info 
)

Constructor. Allocates a Mesh with given name and dimensionality

References Esys_MPIInfo_getReference(), MPIInfo, and Nodes.

Referenced by read(), and readGmsh().


Member Function Documentation

void finley::Mesh::addPoints ( int  numPoints,
const double *  points_ptr,
const int *  tags_ptr 
)
void finley::Mesh::addTagMap ( const char *  name,
int  tag_key 
)
void finley::Mesh::createColoring ( const std::vector< int > &  dofMap) [private]

tries to reduce the number of colours for all element files

References ContactElements, finley::ElementFile::createColoring(), Elements, FaceElements, finley::noError(), and Points.

Referenced by distributeByRankOfDOF().

void finley::Mesh::createMappings ( const std::vector< int > &  dofDistribution,
const std::vector< int > &  nodeDistribution 
)

creates node mappings without (re-)distributing anything

References finley::NodeFile::createNodeMappings(), markNodes(), Nodes, finley::noError(), finley::NodeFile::numNodes, and finley::util::packMask().

Referenced by finley::loadMesh().

void finley::Mesh::distributeByRankOfDOF ( const std::vector< int > &  dof_distribution) [private]

redistributes the Nodes and Elements including overlap according to the DOF distribution. It will create an element colouring but will not create any mappings.

References finley::NodeFile::assignMPIRankToDOFs(), ContactElements, createColoring(), finley::ElementFile::distributeByRankOfDOF(), Elements, FaceElements, finley::NodeFile::getDOFRange(), finley::NodeFile::globalDegreesOfFreedom, finley::NodeFile::Id, Nodes, finley::noError(), finley::NodeFile::numNodes, Points, and resolveNodeIds().

Referenced by prepare().

void finley::Mesh::findMatchingFaces ( double  safety_factor,
double  tolerance,
int *  numPairs,
int *  elem0,
int *  elem1,
int *  matching_nodes_in_elem1 
)
int finley::Mesh::getDim ( ) const [inline]
paso::SystemMatrixPattern_ptr finley::Mesh::getPattern ( bool  reduce_row_order,
bool  reduce_col_order 
)
int finley::Mesh::getStatus ( ) const [inline]
int finley::Mesh::getTag ( const char *  name) const
void finley::Mesh::glueFaces ( double  safetyFactor,
double  tolerance,
bool  optimize 
)
bool finley::Mesh::isValidTagName ( const char *  name) const

References tagMap.

Referenced by finley::MeshAdapter::isValidTagName().

void finley::Mesh::joinFaces ( double  safetyFactor,
double  tolerance,
bool  optimize 
)
static Mesh* finley::Mesh::load ( const std::string  fname) [static]
paso::SystemMatrixPattern_ptr finley::Mesh::makePattern ( bool  reduce_row_order,
bool  reduce_col_order 
)
void finley::Mesh::markDOFsConnectedToRange ( int *  mask,
int  offset,
int  marker,
int  firstDOF,
int  lastDOF,
bool  useLinear 
)
void finley::Mesh::markNodes ( std::vector< short > &  mask,
int  offset,
bool  useLinear 
) [private]
void finley::Mesh::optimizeDOFDistribution ( std::vector< int > &  distribution) [private]
void finley::Mesh::optimizeDOFLabeling ( const std::vector< int > &  distribution) [private]

redistributes elements to minimize communication during assemblage

References ContactElements, Elements, FaceElements, finley::noError(), finley::ElementFile::optimizeOrdering(), and Points.

Referenced by prepare().

void finley::Mesh::prepare ( bool  optimize)
void finley::Mesh::print ( void  )
void finley::Mesh::printInfo ( bool  full)
Mesh * finley::Mesh::read ( const std::string  fname,
int  order,
int  reducedOrder,
bool  optimize 
) [static]
Mesh * finley::Mesh::readGmsh ( const std::string  fname,
int  numDim,
int  order,
int  reducedOrder,
bool  optimize,
bool  useMacroElements 
) [static]
void finley::Mesh::relabelElementNodes ( const std::vector< int > &  newNode,
int  offset 
)

assigns new node reference numbers to all element files

References ContactElements, Elements, FaceElements, Points, and finley::ElementFile::relabelNodes().

Referenced by glueFaces(), and resolveNodeIds().

sets new coordinates for the nodes

References Nodes, and finley::NodeFile::setCoordinates().

Referenced by finley::MeshAdapter::setNewX().

void finley::Mesh::setElements ( ElementFile elements)
void finley::Mesh::setOrders ( ) [private]
void finley::Mesh::setPoints ( ElementFile elements)
void finley::Mesh::updateTagList ( ) [private]

regenerates list of tags in use for node file and element files

References ContactElements, Elements, FaceElements, Nodes, finley::noError(), Points, finley::NodeFile::updateTagList(), and finley::ElementFile::updateTagList().

Referenced by prepare().

void finley::Mesh::write ( const std::string  fname) const

Member Data Documentation

Referenced by getPattern().

Referenced by getPattern().

std::string finley::Mesh::m_name

Referenced by getPattern().

Referenced by getPattern().


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