escript  Revision_
Public Member Functions | Private Member Functions | Private Attributes | List of all members
weipa::RipleyElements Class Reference

Stores and manipulates one type of ripley mesh elements (cells, faces). More...

#include <RipleyElements.h>

Inheritance diagram for weipa::RipleyElements:
weipa::ElementData

Public Member Functions

 RipleyElements (const std::string &elementName, RipleyNodes_ptr nodes)
 Constructor with name and accompanying NodeData object. More...
 
 RipleyElements (const RipleyElements &e)
 Copy constructor. More...
 
virtual ~RipleyElements ()
 Destructor. More...
 
bool initFromRipley (const ripley::RipleyDomain *ripleyDomain, int fsType)
 Initialises with data from a RipleyDomain instance. More...
 
void reorderGhostZones (int ownIndex)
 Moves "ghost" elements (whose owner does not match ownIndex) and the corresponding data to the end of the arrays. More...
 
void removeGhostZones (int ownIndex)
 Removes "ghost" elements. More...
 
virtual void writeConnectivityVTK (std::ostream &os)
 Writes connectivity data to a stream in VTK text format. More...
 
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. More...
 
virtual StringVec getMeshNames () const
 Returns the names of the meshes associated with the elements. More...
 
virtual StringVec getVarNames () const
 Returns a vector with the mesh variable names. More...
 
virtual int getNumElements () const
 Returns the number of elements. More...
 
virtual int getNodesPerElement () const
 Returns the number of nodes per element. More...
 
virtual int getGhostCount () const
 Returns the number of "ghost" elements. More...
 
virtual ZoneType getType () const
 Returns the type of the elements. More...
 
virtual const IntVecgetNodeList () const
 Returns a vector of the node IDs used by the elements. More...
 
virtual const IntVecgetIDs () const
 Returns a vector of element IDs. More...
 
virtual const IntVecgetVarDataByName (const std::string varName) const
 Returns an array of data values for the name provided. More...
 
virtual NodeData_ptr getNodes () const
 Returns the node mesh instance used by the elements. More...
 
virtual ElementData_ptr getReducedElements () const
 Returns the reduced elements. More...
 
virtual const QuadMaskInfogetQuadMask (int functionSpace) const
 Returns a QuadMaskInfo structure for given functionspace code. More...
 
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. More...
 

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
 

Additional Inherited Members

- Protected Member Functions inherited from weipa::ElementData
virtual ~ElementData ()
 

Detailed Description

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.

Note
The corresponding mesh nodes are not part of this class but are stored in a NodeData instance.

Constructor & Destructor Documentation

◆ RipleyElements() [1/3]

weipa::RipleyElements::RipleyElements ( const std::string &  elementName,
RipleyNodes_ptr  nodes 
)

Constructor with name and accompanying NodeData object.

References name, and nodeMesh.

◆ RipleyElements() [2/3]

weipa::RipleyElements::RipleyElements ( const RipleyElements e)

◆ ~RipleyElements()

virtual weipa::RipleyElements::~RipleyElements ( )
inlinevirtual

Destructor.

◆ RipleyElements() [3/3]

weipa::RipleyElements::RipleyElements ( )
inlineprivate

Member Function Documentation

◆ buildMeshes()

void weipa::RipleyElements::buildMeshes ( )
private

References name, nodeMesh, nodes, numElements, and originalMesh.

Referenced by initFromRipley().

◆ getElementFactor()

virtual int weipa::RipleyElements::getElementFactor ( ) const
inlinevirtual

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.

◆ getGhostCount()

virtual int weipa::RipleyElements::getGhostCount ( ) const
inlinevirtual

Returns the number of "ghost" elements.

Implements weipa::ElementData.

◆ getIDs()

virtual const IntVec& weipa::RipleyElements::getIDs ( ) const
inlinevirtual

Returns a vector of element IDs.

Implements weipa::ElementData.

◆ getMeshNames()

StringVec weipa::RipleyElements::getMeshNames ( ) const
virtual

Returns the names of the meshes associated with the elements.

Implements weipa::ElementData.

References nodeMesh.

◆ getNodeList()

virtual const IntVec& weipa::RipleyElements::getNodeList ( ) const
inlinevirtual

Returns a vector of the node IDs used by the elements.

Implements weipa::ElementData.

◆ getNodes()

virtual NodeData_ptr weipa::RipleyElements::getNodes ( ) const
inlinevirtual

Returns the node mesh instance used by the elements.

Implements weipa::ElementData.

◆ getNodesPerElement()

virtual int weipa::RipleyElements::getNodesPerElement ( ) const
inlinevirtual

Returns the number of nodes per element.

Implements weipa::ElementData.

◆ getNumElements()

virtual int weipa::RipleyElements::getNumElements ( ) const
inlinevirtual

Returns the number of elements.

Implements weipa::ElementData.

◆ getQuadMask()

virtual const QuadMaskInfo& weipa::RipleyElements::getQuadMask ( int  functionSpace) const
inlinevirtual

Returns a QuadMaskInfo structure for given functionspace code.

Implements weipa::ElementData.

◆ getReducedElements()

virtual ElementData_ptr weipa::RipleyElements::getReducedElements ( ) const
inlinevirtual

Returns the reduced elements.

Implements weipa::ElementData.

◆ getType()

virtual ZoneType weipa::RipleyElements::getType ( ) const
inlinevirtual

Returns the type of the elements.

Implements weipa::ElementData.

◆ getVarDataByName()

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().

References ID, name, and owner.

◆ getVarNames()

StringVec weipa::RipleyElements::getVarNames ( ) const
virtual

Returns a vector with the mesh variable names.

Implements weipa::ElementData.

References name.

◆ initFromRipley()

bool weipa::RipleyElements::initFromRipley ( const ripley::RipleyDomain ripleyDomain,
int  fsType 
)

◆ prepareGhostIndices()

IntVec weipa::RipleyElements::prepareGhostIndices ( int  ownIndex)
private

References numElements, numGhostElements, and owner.

Referenced by reorderGhostZones().

◆ removeGhostZones()

void weipa::RipleyElements::removeGhostZones ( int  ownIndex)

Removes "ghost" elements.

References ID, nodes, nodesPerElement, numElements, numGhostElements, owner, and reorderGhostZones().

◆ reorderArray()

void weipa::RipleyElements::reorderArray ( IntVec v,
const IntVec idx,
int  elementsPerIndex 
)
private

References paso::util::copy().

Referenced by reorderGhostZones().

◆ 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().

◆ writeConnectivityVTK()

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, numElements, type, weipa::ZONETYPE_BEAM, weipa::ZONETYPE_HEX, weipa::ZONETYPE_POLYGON, and weipa::ZONETYPE_QUAD.

◆ writeToSilo()

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.

Member Data Documentation

◆ ID

IntVec weipa::RipleyElements::ID
private

◆ name

std::string weipa::RipleyElements::name
private

◆ nodeMesh

RipleyNodes_ptr weipa::RipleyElements::nodeMesh
private

◆ nodes

IntVec weipa::RipleyElements::nodes
private

◆ nodesPerElement

int weipa::RipleyElements::nodesPerElement
private

◆ numElements

int weipa::RipleyElements::numElements
private

◆ numGhostElements

int weipa::RipleyElements::numGhostElements
private

◆ originalMesh

RipleyNodes_ptr weipa::RipleyElements::originalMesh
private

Referenced by buildMeshes(), and RipleyElements().

◆ owner

IntVec weipa::RipleyElements::owner
private

◆ quadMask

QuadMaskInfo weipa::RipleyElements::quadMask
private

◆ tag

IntVec weipa::RipleyElements::tag
private

◆ type

ZoneType weipa::RipleyElements::type
private

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