escript  Revision_Unversioneddirectory
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
finley::Mesh Class Reference

#include <Mesh.h>

Public Member Functions

 Mesh (const std::string name, int numDim, esysUtils::JMPI &mpi_info)
 
 ~Mesh ()
 destructor More...
 
void write (const std::string fname) const
 writes the mesh to an external file using the 'fly' file format More...
 
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 More...
 
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 More...
 
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 More...
 
void resolveNodeIds ()
 
void createMappings (const std::vector< index_t > &dofDistribution, const std::vector< index_t > &nodeDistribution)
 creates node mappings without (re-)distributing anything More...
 
void markDOFsConnectedToRange (int *mask, int offset, int marker, index_t firstDOF, index_t lastDOF, bool useLinear)
 
void relabelElementNodes (const std::vector< index_t > &, index_t offset)
 assigns new node reference numbers to all element files More...
 
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 More...
 

Static Public Member Functions

static Meshload (esysUtils::JMPI &mpi_info, const std::string fname)
 
static Meshread (esysUtils::JMPI &mpi_info, const std::string fname, int order, int reducedOrder, bool optimize)
 
static MeshreadGmsh (esysUtils::JMPI &mpi_info, 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
 
esysUtils::JMPI MPIInfo
 

Private Member Functions

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

Static Private Member Functions

static MeshreadGmshSlave (esysUtils::JMPI &mpi_info, const std::string fname, int numDim, int order, int reducedOrder, bool optimize, bool useMacroElements)
 
static MeshreadGmshMaster (esysUtils::JMPI &mpi_info, const std::string fname, int numDim, int order, int reducedOrder, bool optimize, bool useMacroElements)
 

Constructor & Destructor Documentation

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

Constructor. Allocates a Mesh with given name and dimensionality

References MPIInfo, and Nodes.

Referenced by read().

finley::Mesh::~Mesh ( )

destructor

References ContactElements, Elements, FaceElements, Nodes, Points, and tagMap.

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< index_t > &  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< index_t > &  dofDistribution,
const std::vector< index_t > &  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< index_t > &  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 ( esysUtils::JMPI mpi_info,
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,
index_t  firstDOF,
index_t  lastDOF,
bool  useLinear 
)
void finley::Mesh::markNodes ( std::vector< short > &  mask,
int  offset,
bool  useLinear 
)
private
void finley::Mesh::optimizeDOFDistribution ( std::vector< index_t > &  distribution)
private
void finley::Mesh::optimizeDOFLabeling ( const std::vector< index_t > &  distribution)
private
void finley::Mesh::optimizeElementOrdering ( )
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::printElementInfo ( const ElementFile e,
const std::string  title,
const std::string  defaultType,
bool  full 
) const
private
void finley::Mesh::printInfo ( bool  full)
Mesh * finley::Mesh::read ( esysUtils::JMPI mpi_info,
const std::string  fname,
int  order,
int  reducedOrder,
bool  optimize 
)
static
Mesh * finley::Mesh::readGmsh ( esysUtils::JMPI mpi_info,
const std::string  fname,
int  numDim,
int  order,
int  reducedOrder,
bool  optimize,
bool  useMacroElements 
)
static
Mesh * finley::Mesh::readGmshMaster ( esysUtils::JMPI mpi_info,
const std::string  fname,
int  numDim,
int  order,
int  reducedOrder,
bool  optimize,
bool  useMacroElements 
)
staticprivate
Mesh * finley::Mesh::readGmshSlave ( esysUtils::JMPI mpi_info,
const std::string  fname,
int  numDim,
int  order,
int  reducedOrder,
bool  optimize,
bool  useMacroElements 
)
staticprivate
void finley::Mesh::relabelElementNodes ( const std::vector< index_t > &  newNode,
index_t  offset 
)

assigns new node reference numbers to all element files

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

Referenced by glueFaces(), and resolveNodeIds().

void finley::Mesh::resolveNodeIds ( )
void finley::Mesh::setContactElements ( ElementFile elements)
void finley::Mesh::setCoordinates ( const escript::Data newX)

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::setFaceElements ( 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
void finley::Mesh::writeElementInfo ( std::ostream &  stream,
const ElementFile e,
const std::string  defaultType 
) const
private

Member Data Documentation

int finley::Mesh::approximationOrder
ElementFile* finley::Mesh::ContactElements
ElementFile* finley::Mesh::Elements
ElementFile* finley::Mesh::FaceElements
paso::SystemMatrixPattern_ptr finley::Mesh::FullFullPattern

Referenced by getPattern().

paso::SystemMatrixPattern_ptr finley::Mesh::FullReducedPattern

Referenced by getPattern().

int finley::Mesh::integrationOrder
std::string finley::Mesh::m_name
esysUtils::JMPI finley::Mesh::MPIInfo
NodeFile* finley::Mesh::Nodes
ElementFile* finley::Mesh::Points
int finley::Mesh::reducedApproximationOrder
paso::SystemMatrixPattern_ptr finley::Mesh::ReducedFullPattern

Referenced by getPattern().

int finley::Mesh::reducedIntegrationOrder
paso::SystemMatrixPattern_ptr finley::Mesh::ReducedReducedPattern

Referenced by getPattern().

TagMap finley::Mesh::tagMap

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