ESYS13  Revision_
Public Member Functions | Private Member Functions | Private Attributes
weipa::FinleyElements Class Reference

Stores and manipulates one type of finley mesh elements (cells, faces or contacts). More...

#include <FinleyElements.h>

Inheritance diagram for weipa::FinleyElements:
weipa::ElementData

List of all members.

Public Member Functions

 FinleyElements (const std::string &elementName, FinleyNodes_ptr nodes)
 Constructor with name and accompanying NodeData object.
 FinleyElements (const FinleyElements &e)
 Copy constructor.
virtual ~FinleyElements ()
 Destructor.
bool initFromDudley (const Dudley_ElementFile *dudleyFile)
 Initialises with data from a Dudley_ElementFile instance.
bool initFromFinley (const Finley_ElementFile *finleyFile)
 Initialises with data from a Finley_ElementFile instance.
bool readFromNc (NcFile *ncfile)
 Reads element data from escript/finley NetCDF file.
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.
Finley_ElementTypeId getFinleyTypeId () const
 Returns the original type id of the Finley reference elements.
virtual const IntVecgetNodeList () const
 Returns a vector of the node IDs used by the elements.
virtual const IntVecgetIDs () const
 Returns a vector of element IDs.
virtual const IntVecgetVarDataByName (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 QuadMaskInfogetQuadMask (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

 FinleyElements ()
FinleyElementInfo getDudleyTypeInfo (Dudley_ElementTypeId typeId)
FinleyElementInfo getFinleyTypeInfo (Finley_ElementTypeId typeId)
void buildMeshes ()
void buildReducedElements (const FinleyElementInfo &f)
IntVec prepareGhostIndices (int ownIndex)
void reorderArray (IntVec &v, const IntVec &idx, int elementsPerIndex)
QuadMaskInfo buildQuadMask (const CoordArray &quadNodes, int numQNodes)

Private Attributes

FinleyElements_ptr reducedElements
FinleyNodes_ptr nodeMesh
FinleyNodes_ptr originalMesh
std::string name
int numElements
int numGhostElements
int nodesPerElement
ZoneType type
Finley_ElementTypeId finleyTypeId
IntVec nodes
IntVec color
IntVec ID
IntVec tag
IntVec owner
QuadMaskInfo quadMask
QuadMaskInfo reducedQuadMask
int elementFactor

Detailed Description

Stores and manipulates one type of finley mesh elements (cells, faces or contacts).

This class provides functionality to manipulate a finley element file. It is able to load element data from NetCDF files or retrieve it from a Finley_ElementFile instance.

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

Constructor & Destructor Documentation

weipa::FinleyElements::FinleyElements ( const std::string &  elementName,
FinleyNodes_ptr  nodes 
)

Constructor with name and accompanying NodeData object.

References name, and nodeMesh.

virtual weipa::FinleyElements::~FinleyElements ( ) [inline, virtual]

Destructor.


Member Function Documentation

QuadMaskInfo weipa::FinleyElements::buildQuadMask ( const CoordArray quadNodes,
int  numQNodes 
) [private]
virtual int weipa::FinleyElements::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.

References elementFactor.

Returns the original type id of the Finley reference elements.

References finleyTypeId.

virtual int weipa::FinleyElements::getGhostCount ( ) const [inline, virtual]

Returns the number of "ghost" elements.

Implements weipa::ElementData.

References numGhostElements.

virtual const IntVec& weipa::FinleyElements::getIDs ( ) const [inline, virtual]

Returns a vector of element IDs.

Implements weipa::ElementData.

References ID.

Returns the names of the meshes associated with the elements.

Implements weipa::ElementData.

References nodeMesh, and reducedElements.

virtual const IntVec& weipa::FinleyElements::getNodeList ( ) const [inline, virtual]

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

Implements weipa::ElementData.

References nodes.

virtual NodeData_ptr weipa::FinleyElements::getNodes ( ) const [inline, virtual]

Returns the node mesh instance used by the elements.

Implements weipa::ElementData.

References nodeMesh.

virtual int weipa::FinleyElements::getNodesPerElement ( ) const [inline, virtual]

Returns the number of nodes per element.

Implements weipa::ElementData.

References nodesPerElement.

virtual int weipa::FinleyElements::getNumElements ( ) const [inline, virtual]

Returns the number of elements.

Implements weipa::ElementData.

References numElements.

const QuadMaskInfo & weipa::FinleyElements::getQuadMask ( int  functionSpace) const [virtual]
virtual ElementData_ptr weipa::FinleyElements::getReducedElements ( ) const [inline, virtual]

Returns the reduced elements.

Implements weipa::ElementData.

References reducedElements.

Referenced by weipa::FinleyDomain::getElementsForFunctionSpace().

virtual ZoneType weipa::FinleyElements::getType ( ) const [inline, virtual]

Returns the type of the elements.

Implements weipa::ElementData.

References type.

const IntVec & weipa::FinleyElements::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 color, ID, name, owner, reducedElements, and tag.

Returns a vector with the mesh variable names.

Implements weipa::ElementData.

References name.

References numElements, numGhostElements, and owner.

Referenced by reorderGhostZones().

bool weipa::FinleyElements::readFromNc ( NcFile *  ncfile)
void weipa::FinleyElements::reorderArray ( IntVec v,
const IntVec idx,
int  elementsPerIndex 
) [private]

Referenced by reorderGhostZones().

Moves "ghost" elements (whose owner does not match ownIndex) and the corresponding data to the end of the arrays.

References color, ID, nodes, nodesPerElement, numGhostElements, owner, prepareGhostIndices(), reducedElements, reorderArray(), and tag.

Referenced by removeGhostZones().

void weipa::FinleyElements::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::FinleyElements::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 color, ID, name, nodeMesh, nodes, nodesPerElement, numElements, numGhostElements, owner, reducedElements, and tag.


Member Data Documentation

std::string weipa::FinleyElements::name [private]

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