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:

## Public Member Functions

| FinleyElements (const std::string &elementName, FinleyNodes_ptr nodes)
| Constructor with name and accompanying NodeData object. More...
| FinleyElements (const FinleyElements &e)
| Copy constructor. More...
virtual | ~FinleyElements ()
| Destructor. More...
bool | initFromDudley (const dudley::ElementFile *dudleyFile)
| Initialises with data from a Dudley ElementFile instance. More...
bool | initFromFinley (const finley::ElementFile *finleyFile)
| Initialises with data from a Finley ElementFile instance. More...
bool | readFromNc (NcFile *ncfile)
| Reads element data from escript/finley NetCDF file. 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 IntVec & | getNodeList () const
| Returns a vector of the node IDs used by the elements. More...
virtual const IntVec & | getIDs () const
| Returns a vector of element IDs. More...
virtual const IntVec & | getVarDataByName (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 QuadMaskInfo & | getQuadMask (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

| FinleyElements ()
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
IntVec | nodes
IntVec | color
IntVec | ID
IntVec | tag
IntVec | owner
QuadMaskInfo | quadMask
QuadMaskInfo | reducedQuadMask
int | elementFactor

## Additional Inherited Members

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

## 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

## FinleyElements() [1/3]

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

Constructor with name and accompanying NodeData object.

References name, and nodeMesh.

## FinleyElements() [2/3]

weipa::FinleyElements::FinleyElements | ( | const FinleyElements & | e | ) |

Copy constructor.

References color, elementFactor, FinleyElements(), ID, name, nodeMesh, nodes, nodesPerElement, numElements, numGhostElements, originalMesh, owner, reducedElements, tag, and type.

## ~FinleyElements()

virtual weipa::FinleyElements::~FinleyElements | ( |  | ) |

inline virtual

Destructor.

## FinleyElements() [3/3]

weipa::FinleyElements::FinleyElements | ( |  | ) |

inline private

Referenced by buildReducedElements(), and FinleyElements().

## Member Function Documentation

## buildMeshes()

void weipa::FinleyElements::buildMeshes | ( |  | ) |

private

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

Referenced by initFromDudley(), initFromFinley(), and readFromNc().

## buildQuadMask()

QuadMaskInfo weipa::FinleyElements::buildQuadMask | ( | const CoordArray & | quadNodes,
|  | int | numQNodes
| ) |  |

private

References elementFactor, weipa::QuadMaskInfo::factor, finley::Hex27, finley::Hex27Macro, weipa::inside1D(), weipa::inside2D(), weipa::inside3D(), finley::Line3Macro, weipa::QuadMaskInfo::mask, nodesPerElement, weipa::pointInTet(), weipa::pointInTri(), finley::Rec9, finley::Rec9Macro, finley::Tet10, tet10indices, finley::Tet10Macro, finley::Tri6, tri6indices, and finley::Tri6Macro.

Referenced by initFromFinley(), and readFromNc().

## buildReducedElements()

void weipa::FinleyElements::buildReducedElements | ( | const FinleyElementInfo & | f | ) |

private

References color, paso::util::copy(), weipa::FinleyElementInfo::elementFactor, weipa::FinleyElementInfo::elementSize, FinleyElements(), ID, weipa::FinleyElementInfo::multiCellIndices, name, nodes, nodesPerElement, numElements, originalMesh, owner, reducedElements, weipa::FinleyElementInfo::reducedElementSize, weipa::FinleyElementInfo::reducedElementType, tag, and type.

Referenced by initFromDudley(), initFromFinley(), and readFromNc().

## getElementFactor()

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.

## getGhostCount()

virtual int weipa::FinleyElements::getGhostCount | ( |  | ) | const

inline virtual

Returns the number of "ghost" elements.

Implements weipa::ElementData.

References numGhostElements.

## getIDs()

virtual const IntVec& weipa::FinleyElements::getIDs | ( |  | ) | const

inline virtual

Returns a vector of element IDs.

Implements weipa::ElementData.

References ID.

## getMeshNames()

StringVec weipa::FinleyElements::getMeshNames | ( |  | ) | const

virtual

Returns the names of the meshes associated with the elements.

Implements weipa::ElementData.

References nodeMesh, and reducedElements.

## getNodeList()

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.

## getNodes()

virtual NodeData_ptr weipa::FinleyElements::getNodes | ( |  | ) | const

inline virtual

Returns the node mesh instance used by the elements.

Implements weipa::ElementData.

References nodeMesh.

## getNodesPerElement()

virtual int weipa::FinleyElements::getNodesPerElement | ( |  | ) | const

inline virtual

Returns the number of nodes per element.

Implements weipa::ElementData.

References nodesPerElement.

## getNumElements()

virtual int weipa::FinleyElements::getNumElements | ( |  | ) | const

inline virtual

Returns the number of elements.

Implements weipa::ElementData.

References numElements.

## getQuadMask()

const QuadMaskInfo & weipa::FinleyElements::getQuadMask | ( | int | functionSpace | ) | const

virtual

Returns a QuadMaskInfo structure for given functionspace code.

Implements weipa::ElementData.

References FINLEY_REDUCED_CONTACT_ELEMENTS_1, FINLEY_REDUCED_ELEMENTS, FINLEY_REDUCED_FACE_ELEMENTS, quadMask, and reducedQuadMask.

## getReducedElements()

virtual ElementData_ptr weipa::FinleyElements::getReducedElements | ( |  | ) | const

inline virtual

Returns the reduced elements.

Implements weipa::ElementData.

References reducedElements.

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

## getType()

virtual ZoneType weipa::FinleyElements::getType | ( |  | ) | const

inline virtual

Returns the type of the elements.

Implements weipa::ElementData.

References type.

## getVarDataByName()

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.

## getVarNames()

StringVec weipa::FinleyElements::getVarNames | ( |  | ) | const

virtual

Returns a vector with the mesh variable names.

Implements weipa::ElementData.

References name.

## initFromDudley()

bool weipa::FinleyElements::initFromDudley | ( | const dudley::ElementFile * | dudleyFile | ) |

Initialises with data from a Dudley ElementFile instance.

References buildMeshes(), buildReducedElements(), dudley::ElementFile::Color, color, weipa::FinleyElementInfo::elementFactor, elementFactor, weipa::FinleyElementInfo::elementType, dudley::ElementFile::etype, dudley::ElementFile::Id, ID, dudley::ElementFile::Nodes, nodes, nodesPerElement, dudley::ElementFile::numElements, numElements, dudley::ElementFile::numNodes, dudley::ElementFile::Owner, owner, weipa::FinleyElementInfo::reducedElementSize, dudley::ElementFile::Tag, tag, and type.

## initFromFinley()

bool weipa::FinleyElements::initFromFinley | ( | const finley::ElementFile * | finleyFile | ) |

Initialises with data from a Finley ElementFile instance.

References buildMeshes(), buildQuadMask(), buildReducedElements(), finley::ElementFile::Color, color, weipa::FinleyElementInfo::elementFactor, elementFactor, weipa::FinleyElementInfo::elementType, finley::ElementFile::Id, ID, finley::ElementFile::Nodes, nodes, nodesPerElement, finley::ElementFile::numElements, numElements, finley::ElementFile::numNodes, finley::ElementFile::Owner, owner, weipa::FinleyElementInfo::quadDim, quadMask, weipa::FinleyElementInfo::reducedElementSize, reducedQuadMask, finley::ElementFile::referenceElementSet, finley::ElementFile::Tag, tag, type, and weipa::FinleyElementInfo::useQuadNodes.

## prepareGhostIndices()

IntVec weipa::FinleyElements::prepareGhostIndices | ( | int | ownIndex | ) |

private

References numElements, numGhostElements, and owner.

Referenced by reorderGhostZones().

## readFromNc()

bool weipa::FinleyElements::readFromNc | ( | NcFile * | ncfile | ) |

Reads element data from escript/finley NetCDF file.

References buildMeshes(), buildQuadMask(), buildReducedElements(), color, weipa::FinleyElementInfo::elementFactor, elementFactor, weipa::FinleyElementInfo::elementType, ID, name, nodes, nodesPerElement, numElements, owner, weipa::FinleyElementInfo::quadDim, quadMask, weipa::FinleyElementInfo::reducedElementSize, reducedQuadMask, tag, type, and weipa::FinleyElementInfo::useQuadNodes.

## removeGhostZones()

void weipa::FinleyElements::removeGhostZones | ( | int | ownIndex | ) |

Removes "ghost" elements.

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

## reorderArray()

void weipa::FinleyElements::reorderArray | ( | IntVec & | v,
|  | const IntVec & | idx,
|  | int | elementsPerIndex
| ) |  |

private

References paso::util::copy().

Referenced by reorderGhostZones().

## reorderGhostZones()

void weipa::FinleyElements::reorderGhostZones | ( | int | ownIndex | ) |

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

## writeConnectivityVTK()

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.

## writeToSilo()

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, tag, and type.

## Member Data Documentation

## color

IntVec weipa::FinleyElements::color

private

Referenced by buildReducedElements(), FinleyElements(), getVarDataByName(), initFromDudley(), initFromFinley(), readFromNc(), removeGhostZones(), reorderGhostZones(), and writeToSilo().

## elementFactor

int weipa::FinleyElements::elementFactor

private

Referenced by buildQuadMask(), FinleyElements(), getElementFactor(), initFromDudley(), initFromFinley(), and readFromNc().

## ID

IntVec weipa::FinleyElements::ID

private

Referenced by buildReducedElements(), FinleyElements(), getIDs(), getVarDataByName(), initFromDudley(), initFromFinley(), readFromNc(), removeGhostZones(), reorderGhostZones(), and writeToSilo().

## name

std::string weipa::FinleyElements::name

private

Referenced by buildMeshes(), buildReducedElements(), FinleyElements(), getVarDataByName(), getVarNames(), readFromNc(), and writeToSilo().

## nodeMesh

FinleyNodes_ptr weipa::FinleyElements::nodeMesh

private

Referenced by buildMeshes(), FinleyElements(), getMeshNames(), getNodes(), writeConnectivityVTK(), and writeToSilo().

## nodes

IntVec weipa::FinleyElements::nodes

private

Referenced by buildMeshes(), buildReducedElements(), FinleyElements(), getNodeList(), initFromDudley(), initFromFinley(), readFromNc(), removeGhostZones(), reorderGhostZones(), writeConnectivityVTK(), and writeToSilo().

## nodesPerElement

int weipa::FinleyElements::nodesPerElement

private

Referenced by buildQuadMask(), buildReducedElements(), FinleyElements(), getNodesPerElement(), initFromDudley(), initFromFinley(), readFromNc(), removeGhostZones(), reorderGhostZones(), writeConnectivityVTK(), and writeToSilo().

## numElements

int weipa::FinleyElements::numElements

private

Referenced by buildMeshes(), buildReducedElements(), FinleyElements(), getNumElements(), initFromDudley(), initFromFinley(), prepareGhostIndices(), readFromNc(), removeGhostZones(), writeConnectivityVTK(), and writeToSilo().

## numGhostElements

int weipa::FinleyElements::numGhostElements

private

Referenced by FinleyElements(), getGhostCount(), prepareGhostIndices(), removeGhostZones(), reorderGhostZones(), and writeToSilo().

## originalMesh

FinleyNodes_ptr weipa::FinleyElements::originalMesh

private

Referenced by buildMeshes(), buildReducedElements(), and FinleyElements().

## owner

IntVec weipa::FinleyElements::owner

private

Referenced by buildReducedElements(), FinleyElements(), getVarDataByName(), initFromDudley(), initFromFinley(), prepareGhostIndices(), readFromNc(), removeGhostZones(), reorderGhostZones(), and writeToSilo().

## quadMask

QuadMaskInfo weipa::FinleyElements::quadMask

private

Referenced by getQuadMask(), initFromFinley(), and readFromNc().

## reducedElements

FinleyElements_ptr weipa::FinleyElements::reducedElements

private

Referenced by buildMeshes(), buildReducedElements(), FinleyElements(), getMeshNames(), getReducedElements(), getVarDataByName(), removeGhostZones(), reorderGhostZones(), and writeToSilo().

## reducedQuadMask

QuadMaskInfo weipa::FinleyElements::reducedQuadMask

private

Referenced by getQuadMask(), initFromFinley(), and readFromNc().

## tag

IntVec weipa::FinleyElements::tag

private

Referenced by buildReducedElements(), FinleyElements(), getVarDataByName(), initFromDudley(), initFromFinley(), readFromNc(), removeGhostZones(), reorderGhostZones(), and writeToSilo().

## type

ZoneType weipa::FinleyElements::type

private

Referenced by buildReducedElements(), FinleyElements(), getType(), initFromDudley(), initFromFinley(), readFromNc(), and writeToSilo().

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

- FinleyElements.h
- FinleyElements.cpp