weipa::SpeckleyElements Class Reference

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

`#include <SpeckleyElements.h>`

Inheritance diagram for weipa::SpeckleyElements:

## Public Member Functions

| SpeckleyElements (const std::string &elementName, SpeckleyNodes_ptr nodes)
| Constructor with name and accompanying NodeData object. More...
| SpeckleyElements (const SpeckleyElements &e)
| Copy constructor. More...
virtual | ~SpeckleyElements ()
| Destructor. More...
bool | initFromSpeckley (const speckley::SpeckleyDomain *speckleyDomain, int fsType)
| Initialises with data from a SpeckleyDomain 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 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

| SpeckleyElements ()
void | buildMeshes ()
IntVec | prepareGhostIndices (int ownIndex)
void | reorderArray (IntVec &v, const IntVec &idx, int elementsPerIndex)

## Private Attributes

SpeckleyNodes_ptr | nodeMesh
SpeckleyNodes_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 speckley mesh elements (cells, faces).

This class provides functionality to manipulate a speckley domain. It is able to load element data from NetCDF files or retrieve it from a SpeckleyDomain instance.

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

## Constructor & Destructor Documentation

## SpeckleyElements() [1/3]

weipa::SpeckleyElements::SpeckleyElements | ( | const std::string & | elementName,
|  | SpeckleyNodes_ptr | nodes
| ) |  |

Constructor with name and accompanying NodeData object.

References name, nodeMesh, and numGhostElements.

## SpeckleyElements() [2/3]

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

Copy constructor.

References ID, name, nodeMesh, nodes, nodesPerElement, numElements, numGhostElements, originalMesh, owner, and type.

## ~SpeckleyElements()

virtual weipa::SpeckleyElements::~SpeckleyElements | ( |  | ) |

inline virtual

Destructor.

## SpeckleyElements() [3/3]

weipa::SpeckleyElements::SpeckleyElements | ( |  | ) |

inline private

## Member Function Documentation

## buildMeshes()

void weipa::SpeckleyElements::buildMeshes | ( |  | ) |

private

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

Referenced by initFromSpeckley().

## getElementFactor()

virtual int weipa::SpeckleyElements::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.

## getGhostCount()

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

inline virtual

Returns the number of "ghost" elements.

Implements weipa::ElementData.

## getIDs()

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

inline virtual

Returns a vector of element IDs.

Implements weipa::ElementData.

## getMeshNames()

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

virtual

Returns the names of the meshes associated with the elements.

Implements weipa::ElementData.

References nodeMesh.

## getNodeList()

virtual const IntVec& weipa::SpeckleyElements::getNodeList | ( |  | ) | const

inline virtual

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

Implements weipa::ElementData.

## getNodes()

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

inline virtual

Returns the node mesh instance used by the elements.

Implements weipa::ElementData.

## getNodesPerElement()

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

inline virtual

Returns the number of nodes per element.

Implements weipa::ElementData.

## getNumElements()

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

inline virtual

Returns the number of elements.

Implements weipa::ElementData.

## getQuadMask()

virtual const QuadMaskInfo& weipa::SpeckleyElements::getQuadMask | ( | int | functionSpace | ) | const

inline virtual

Returns a QuadMaskInfo structure for given functionspace code.

Implements weipa::ElementData.

## getReducedElements()

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

inline virtual

Returns the reduced elements.

Implements weipa::ElementData.

## getType()

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

inline virtual

Returns the type of the elements.

Implements weipa::ElementData.

## getVarDataByName()

const IntVec & weipa::SpeckleyElements::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::SpeckleyElements::getVarNames | ( |  | ) | const

virtual

Returns a vector with the mesh variable names.

Implements weipa::ElementData.

References name.

## initFromSpeckley()

bool weipa::SpeckleyElements::initFromSpeckley | ( | const speckley::SpeckleyDomain * | speckleyDomain,
|  | int | fsType
| ) |  |

Initialises with data from a SpeckleyDomain instance.

References speckley::SpeckleyDomain::borrowSampleReferenceIDs(), buildMeshes(), speckley::Elements, speckley::SpeckleyDomain::getDataShape(), speckley::SpeckleyDomain::getDim(), speckley::SpeckleyDomain::getMPIRank(), speckley::SpeckleyDomain::getNumElementsPerDim(), speckley::SpeckleyDomain::getNumFacesPerBoundary(), speckley::SpeckleyDomain::getNumNodesPerDim(), speckley::SpeckleyDomain::getNumSubdivisionsPerDim(), speckley::SpeckleyDomain::getOrder(), ID, nodes, nodesPerElement, numElements, owner, type, weipa::ZONETYPE_HEX, and weipa::ZONETYPE_QUAD.

## prepareGhostIndices()

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

private

References numElements, and numGhostElements.

## removeGhostZones()

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

Removes "ghost" elements.

## reorderArray()

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

private

References paso::util::copy().

## reorderGhostZones()

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

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

## writeConnectivityVTK()

void weipa::SpeckleyElements::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::SpeckleyElements::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::SpeckleyElements::ID

private

Referenced by getVarDataByName(), initFromSpeckley(), SpeckleyElements(), and writeToSilo().

## name

std::string weipa::SpeckleyElements::name

private

Referenced by buildMeshes(), getVarDataByName(), getVarNames(), SpeckleyElements(), and writeToSilo().

## nodeMesh

SpeckleyNodes_ptr weipa::SpeckleyElements::nodeMesh

private

Referenced by buildMeshes(), getMeshNames(), SpeckleyElements(), writeConnectivityVTK(), and writeToSilo().

## nodes

IntVec weipa::SpeckleyElements::nodes

private

Referenced by buildMeshes(), initFromSpeckley(), SpeckleyElements(), writeConnectivityVTK(), and writeToSilo().

## nodesPerElement

int weipa::SpeckleyElements::nodesPerElement

private

Referenced by initFromSpeckley(), SpeckleyElements(), writeConnectivityVTK(), and writeToSilo().

## numElements

int weipa::SpeckleyElements::numElements

private

Referenced by buildMeshes(), initFromSpeckley(), prepareGhostIndices(), SpeckleyElements(), writeConnectivityVTK(), and writeToSilo().

## numGhostElements

int weipa::SpeckleyElements::numGhostElements

private

Referenced by prepareGhostIndices(), SpeckleyElements(), and writeToSilo().

## originalMesh

SpeckleyNodes_ptr weipa::SpeckleyElements::originalMesh

private

Referenced by buildMeshes(), and SpeckleyElements().

## owner

IntVec weipa::SpeckleyElements::owner

private

Referenced by getVarDataByName(), initFromSpeckley(), SpeckleyElements(), and writeToSilo().

## quadMask

QuadMaskInfo weipa::SpeckleyElements::quadMask

private

## tag

IntVec weipa::SpeckleyElements::tag

private

## type

ZoneType weipa::SpeckleyElements::type

private

Referenced by initFromSpeckley(), SpeckleyElements(), and writeConnectivityVTK().

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

- SpeckleyElements.h
- SpeckleyElements.cpp