escript
Revision_
|
Stores and manipulates one type of ripley mesh elements (cells, faces). More...
#include <RipleyElements.h>
Public Member Functions | |
RipleyElements (const std::string &elementName, RipleyNodes_ptr nodes) | |
Constructor with name and accompanying NodeData object. | |
RipleyElements (const RipleyElements &e) | |
Copy constructor. | |
virtual | ~RipleyElements () |
Destructor. | |
bool | initFromRipley (const ripley::RipleyDomain *ripleyDomain, int fsType) |
Initialises with data from a RipleyDomain instance. | |
void | reorderGhostZones (int ownIndex) |
Moves "ghost" elements (whose owner does not match ownIndex) and the corresponding data to the end of the arrays. | |
void | removeGhostZones (int ownIndex) |
Removes "ghost" elements. | |
virtual void | writeConnectivityVTK (std::ostream &os) |
Writes connectivity data to a stream in VTK text format. | |
bool | writeToSilo (DBfile *dbfile, const std::string &siloPath, const StringVec &labels, const StringVec &units, bool writeMeshData) |
Writes element data into given directory in given Silo file. | |
virtual StringVec | getMeshNames () const |
Returns the names of the meshes associated with the elements. | |
virtual StringVec | getVarNames () const |
Returns a vector with the mesh variable names. | |
virtual int | getNumElements () const |
Returns the number of elements. | |
virtual int | getNodesPerElement () const |
Returns the number of nodes per element. | |
virtual int | getGhostCount () const |
Returns the number of "ghost" elements. | |
virtual ZoneType | getType () const |
Returns the type of the elements. | |
virtual const IntVec & | getNodeList () const |
Returns a vector of the node IDs used by the elements. | |
virtual const IntVec & | getIDs () const |
Returns a vector of element IDs. | |
virtual const IntVec & | getVarDataByName (const std::string varName) const |
Returns an array of data values for the name provided. | |
virtual NodeData_ptr | getNodes () const |
Returns the node mesh instance used by the elements. | |
virtual ElementData_ptr | getReducedElements () const |
Returns the reduced elements. | |
virtual const QuadMaskInfo & | getQuadMask (int functionSpace) const |
Returns a QuadMaskInfo structure for given functionspace code. | |
virtual int | getElementFactor () const |
If the original element type is not supported they are subdivided into N smaller elements (e.g. one Rec9 -> four Rec4) and this method returns the multiplication factor N. | |
Private Member Functions | |
RipleyElements () | |
void | buildMeshes () |
IntVec | prepareGhostIndices (int ownIndex) |
void | reorderArray (IntVec &v, const IntVec &idx, int elementsPerIndex) |
Private Attributes | |
RipleyNodes_ptr | nodeMesh |
RipleyNodes_ptr | originalMesh |
std::string | name |
int | numElements |
int | numGhostElements |
int | nodesPerElement |
ZoneType | type |
IntVec | nodes |
IntVec | ID |
IntVec | tag |
IntVec | owner |
QuadMaskInfo | quadMask |
Stores and manipulates one type of ripley mesh elements (cells, faces).
This class provides functionality to manipulate a ripley domain. It is able to load element data from NetCDF files or retrieve it from a RipleyDomain instance.
weipa::RipleyElements::RipleyElements | ( | const std::string & | elementName, |
RipleyNodes_ptr | nodes | ||
) |
weipa::RipleyElements::RipleyElements | ( | const RipleyElements & | e | ) |
Copy constructor.
References ID, name, nodeMesh, nodes, nodesPerElement, numElements, numGhostElements, originalMesh, owner, and type.
virtual weipa::RipleyElements::~RipleyElements | ( | ) | [inline, virtual] |
Destructor.
weipa::RipleyElements::RipleyElements | ( | ) | [inline, private] |
void weipa::RipleyElements::buildMeshes | ( | ) | [private] |
References name, nodeMesh, nodes, numElements, and originalMesh.
Referenced by initFromRipley().
virtual int weipa::RipleyElements::getElementFactor | ( | ) | const [inline, virtual] |
If the original element type is not supported they are subdivided into N smaller elements (e.g. one Rec9 -> four Rec4) and this method returns the multiplication factor N.
Implements weipa::ElementData.
virtual int weipa::RipleyElements::getGhostCount | ( | ) | const [inline, virtual] |
virtual const IntVec& weipa::RipleyElements::getIDs | ( | ) | const [inline, virtual] |
StringVec weipa::RipleyElements::getMeshNames | ( | ) | const [virtual] |
Returns the names of the meshes associated with the elements.
Implements weipa::ElementData.
References nodeMesh.
virtual const IntVec& weipa::RipleyElements::getNodeList | ( | ) | const [inline, virtual] |
Returns a vector of the node IDs used by the elements.
Implements weipa::ElementData.
References nodes.
virtual NodeData_ptr weipa::RipleyElements::getNodes | ( | ) | const [inline, virtual] |
Returns the node mesh instance used by the elements.
Implements weipa::ElementData.
References nodeMesh.
virtual int weipa::RipleyElements::getNodesPerElement | ( | ) | const [inline, virtual] |
virtual int weipa::RipleyElements::getNumElements | ( | ) | const [inline, virtual] |
virtual const QuadMaskInfo& weipa::RipleyElements::getQuadMask | ( | int | functionSpace | ) | const [inline, virtual] |
Returns a QuadMaskInfo structure for given functionspace code.
Implements weipa::ElementData.
References quadMask.
virtual ElementData_ptr weipa::RipleyElements::getReducedElements | ( | ) | const [inline, virtual] |
Returns the reduced elements.
Implements weipa::ElementData.
virtual ZoneType weipa::RipleyElements::getType | ( | ) | const [inline, virtual] |
const IntVec & weipa::RipleyElements::getVarDataByName | ( | const std::string | varName | ) | const [virtual] |
Returns an array of data values for the name provided.
The name must be one of the names returned from getVarNames().
StringVec weipa::RipleyElements::getVarNames | ( | ) | const [virtual] |
bool weipa::RipleyElements::initFromRipley | ( | const ripley::RipleyDomain * | ripleyDomain, |
int | fsType | ||
) |
Initialises with data from a RipleyDomain instance.
References ripley::RipleyDomain::borrowSampleReferenceIDs(), buildMeshes(), ripley::Elements, ripley::FaceElements, ripley::RipleyDomain::getDataShape(), ripley::RipleyDomain::getDim(), ripley::RipleyDomain::getMPIRank(), ripley::RipleyDomain::getNumElementsPerDim(), ripley::RipleyDomain::getNumFacesPerBoundary(), ripley::RipleyDomain::getNumNodesPerDim(), ripley::RipleyDomain::getNumSubdivisionsPerDim(), ID, nodes, nodesPerElement, numElements, owner, type, weipa::ZONETYPE_BEAM, weipa::ZONETYPE_HEX, and weipa::ZONETYPE_QUAD.
IntVec weipa::RipleyElements::prepareGhostIndices | ( | int | ownIndex | ) | [private] |
References numElements, numGhostElements, and owner.
Referenced by reorderGhostZones().
void weipa::RipleyElements::removeGhostZones | ( | int | ownIndex | ) |
Removes "ghost" elements.
References ID, nodes, nodesPerElement, numElements, numGhostElements, owner, and reorderGhostZones().
void weipa::RipleyElements::reorderArray | ( | IntVec & | v, |
const IntVec & | idx, | ||
int | elementsPerIndex | ||
) | [private] |
References paso::util::copy().
Referenced by reorderGhostZones().
void weipa::RipleyElements::reorderGhostZones | ( | int | ownIndex | ) |
Moves "ghost" elements (whose owner does not match ownIndex) and the corresponding data to the end of the arrays.
References ID, nodes, nodesPerElement, numGhostElements, owner, prepareGhostIndices(), and reorderArray().
Referenced by removeGhostZones().
void weipa::RipleyElements::writeConnectivityVTK | ( | std::ostream & | os | ) | [virtual] |
Writes connectivity data to a stream in VTK text format.
Implements weipa::ElementData.
References nodeMesh, nodes, nodesPerElement, and numElements.
bool weipa::RipleyElements::writeToSilo | ( | DBfile * | dbfile, |
const std::string & | siloPath, | ||
const StringVec & | labels, | ||
const StringVec & | units, | ||
bool | writeMeshData | ||
) |
Writes element data into given directory in given Silo file.
Since the mesh depends on element information this method also writes the node mesh itself. If Silo was not available at compile time or if a Silo function fails this method returns false.
References ID, name, nodeMesh, nodes, nodesPerElement, numElements, numGhostElements, and owner.
IntVec weipa::RipleyElements::ID [private] |
Referenced by getIDs(), getVarDataByName(), initFromRipley(), removeGhostZones(), reorderGhostZones(), RipleyElements(), and writeToSilo().
std::string weipa::RipleyElements::name [private] |
Referenced by buildMeshes(), getVarDataByName(), getVarNames(), RipleyElements(), and writeToSilo().
Referenced by buildMeshes(), getMeshNames(), getNodes(), RipleyElements(), writeConnectivityVTK(), and writeToSilo().
IntVec weipa::RipleyElements::nodes [private] |
Referenced by buildMeshes(), getNodeList(), initFromRipley(), removeGhostZones(), reorderGhostZones(), RipleyElements(), writeConnectivityVTK(), and writeToSilo().
int weipa::RipleyElements::nodesPerElement [private] |
Referenced by getNodesPerElement(), initFromRipley(), removeGhostZones(), reorderGhostZones(), RipleyElements(), writeConnectivityVTK(), and writeToSilo().
int weipa::RipleyElements::numElements [private] |
int weipa::RipleyElements::numGhostElements [private] |
Referenced by getGhostCount(), prepareGhostIndices(), removeGhostZones(), reorderGhostZones(), RipleyElements(), and writeToSilo().
Referenced by buildMeshes(), and RipleyElements().
IntVec weipa::RipleyElements::owner [private] |
Referenced by getVarDataByName(), initFromRipley(), prepareGhostIndices(), removeGhostZones(), reorderGhostZones(), RipleyElements(), and writeToSilo().
QuadMaskInfo weipa::RipleyElements::quadMask [private] |
Referenced by getQuadMask().
IntVec weipa::RipleyElements::tag [private] |
ZoneType weipa::RipleyElements::type [private] |
Referenced by getType(), initFromRipley(), and RipleyElements().