finley::ElementFile Class Reference

`#include <ElementFile.h>`

## Public Member Functions

| ElementFile (const_ReferenceElementSet_ptr refElementSet, escript::JMPI mpiInfo)
| ~ElementFile ()
| destructor More...
void | allocTable (dim_t NE)
| allocates the element table within an element file to hold NE elements More...
void | freeTable ()
| deallocates the element table within an element file More...
void | copyTable (index_t offset, index_t nodeOffset, index_t idOffset, const ElementFile *in)
void | distributeByRankOfDOF (const std::vector< int > &mpiRankOfDOF, index_t *nodesId)
| redistributes the elements including overlap by rank More...
void | createColoring (const IndexVector &dofMap)
| Tries to reduce the number of colours used to colour the elements. More...
void | optimizeOrdering ()
| reorders the elements so that they are stored close to the nodes More...
void | relabelNodes (const IndexVector &newNode, index_t offset)
void | markNodes (std::vector< short > &mask, int offset, bool useLinear)
void | gather (const index_t *index, const ElementFile *in)
void | scatter (index_t *index, const ElementFile *in)
void | setTags (const int newTag, const escript::Data &mask)
ElementFile_Jacobians * | borrowJacobians (const NodeFile *, bool, bool) const
std::pair< index_t, index_t > | getNodeRange () const
void | updateTagList ()

## Public Attributes

escript::JMPI | MPIInfo
const_ReferenceElementSet_ptr | referenceElementSet
| the reference element to be used More...
dim_t | numElements
| number of elements More...
index_t * | Id
int * | Tag
| Tag[i] is the tag of element i. More...
int * | Owner
| Owner[i] contains the rank that owns element i. More...
std::vector< int > | tagsInUse
| array of tags which are actually used More...
int | numNodes
| number of nodes per element More...
index_t * | Nodes
index_t * | Color
index_t | minColor
| minimum color value More...
index_t | maxColor
| maximum color value More...
ElementFile_Jacobians * | jacobians
| jacobians of the shape function used for solution approximation More...
ElementFile_Jacobians * | jacobians_reducedS
ElementFile_Jacobians * | jacobians_reducedQ
ElementFile_Jacobians * | jacobians_reducedS_reducedQ

## Private Member Functions

void | swapTable (ElementFile *other)

## Constructor & Destructor Documentation

## ElementFile()

finley::ElementFile::ElementFile | ( | const_ReferenceElementSet_ptr | refSet,
|  | escript::JMPI | mpiInfo
| ) |  |

constructor use ElementFile::allocTable to allocate the element table

References jacobians, jacobians_reducedQ, jacobians_reducedS, jacobians_reducedS_reducedQ, numNodes, and referenceElementSet.

Referenced by optimizeOrdering().

## ~ElementFile()

finley::ElementFile::~ElementFile | ( |  | ) |

destructor

References freeTable(), jacobians, jacobians_reducedQ, jacobians_reducedS, and jacobians_reducedS_reducedQ.

## Member Function Documentation

## allocTable()

void finley::ElementFile::allocTable | ( | dim_t | NE | ) |

allocates the element table within an element file to hold NE elements

allocates the element table within this element file to hold NE elements.

References Color, freeTable(), Id, INDEX2, Nodes, numElements, numNodes, Owner, and Tag.

Referenced by finley::FinleyDomain::addDiracPoints(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), distributeByRankOfDOF(), finley::FinleyDomain::glueFaces(), finley::FinleyDomain::joinFaces(), finley::FinleyDomain::load(), finley::FinleyDomain::merge(), and optimizeOrdering().

## borrowJacobians()

ElementFile_Jacobians * finley::ElementFile::borrowJacobians | ( | const NodeFile * | nodefile,
|  | bool | reducedShapefunction,
|  | bool | reducedIntegrationOrder
| ) |  | const

References finley::Assemble_jacobians_1D(), finley::Assemble_jacobians_2D(), finley::Assemble_jacobians_2D_M1D_E1D(), finley::Assemble_jacobians_2D_M1D_E1D_C(), finley::Assemble_jacobians_2D_M1D_E2D(), finley::Assemble_jacobians_2D_M1D_E2D_C(), finley::Assemble_jacobians_3D(), finley::Assemble_jacobians_3D_M2D_E2D(), finley::Assemble_jacobians_3D_M2D_E2D_C(), finley::Assemble_jacobians_3D_M2D_E3D(), finley::Assemble_jacobians_3D_M2D_E3D_C(), finley::ElementFile_Jacobians::BasisFunctions, finley::NodeFile::Coordinates, finley::ElementFile_Jacobians::DSDX, Id, jacobians, jacobians_reducedQ, jacobians_reducedS, jacobians_reducedS_reducedQ, finley::ElementFile_Jacobians::node_selection, Nodes, finley::ElementFile_Jacobians::numDim, finley::NodeFile::numDim, finley::ElementFile_Jacobians::numElements, numElements, numNodes, finley::ElementFile_Jacobians::numQuadTotal, finley::ElementFile_Jacobians::numShapesTotal, finley::ElementFile_Jacobians::numSides, finley::ElementFile_Jacobians::numSub, finley::ElementFile_Jacobians::offsets, referenceElementSet, finley::ElementFile_Jacobians::status, finley::NodeFile::status, and finley::ElementFile_Jacobians::volume.

Referenced by finley::Assemble_gradient(), finley::Assemble_integrate(), and finley::AssembleParameters::AssembleParameters().

## copyTable()

void finley::ElementFile::copyTable | ( | index_t | offset,
|  | index_t | nodeOffset,
|  | index_t | idOffset,
|  | const ElementFile * | in
| ) |  |

copies element file `in` into this element file starting from `offset`. The elements `offset` to in->numElements+offset-1 will be overwritten.

copies element file 'in' into this element file starting from 'offset'. The elements offset to in->numElements+offset-1 will be overwritten

References Id, INDEX2, Nodes, numElements, numNodes, Owner, and Tag.

Referenced by finley::FinleyDomain::joinFaces(), and finley::FinleyDomain::merge().

## createColoring()

void finley::ElementFile::createColoring | ( | const IndexVector & | dofMap | ) |

Tries to reduce the number of colours used to colour the elements.

Tries to reduce the number of colors used to color elements in this ElementFile

References Color, ESYS_ASSERT, finley::util::getMinMaxInt(), INDEX2, maxColor, minColor, Nodes, numElements, and numNodes.

Referenced by finley::FinleyDomain::createColoring().

## distributeByRankOfDOF()

void finley::ElementFile::distributeByRankOfDOF | ( | const std::vector< int > & | mpiRankOfDOF,
|  | index_t * | nodesId
| ) |  |

redistributes the elements including overlap by rank

References allocTable(), Id, INDEX2, MPI_INT, MPIInfo, Nodes, numElements, numNodes, Owner, and Tag.

Referenced by finley::FinleyDomain::distributeByRankOfDOF().

## freeTable()

void finley::ElementFile::freeTable | ( |  | ) |

deallocates the element table within an element file

deallocates the element table within this element file

References Color, Id, maxColor, minColor, Nodes, numElements, Owner, Tag, and tagsInUse.

Referenced by allocTable(), and ~ElementFile().

## gather()

void finley::ElementFile::gather | ( | const index_t * | index,
|  | const ElementFile * | in
| ) |  |

References Color, Id, INDEX2, maxColor, minColor, Nodes, numElements, numNodes, Owner, and Tag.

Referenced by finley::FinleyDomain::glueFaces(), finley::FinleyDomain::joinFaces(), and optimizeOrdering().

## getNodeRange()

std::pair< index_t, index_t > finley::ElementFile::getNodeRange | ( |  | ) | const

inline

returns the minimum and maximum reference number of nodes describing the elements

References finley::util::getMinMaxInt(), Nodes, numElements, and numNodes.

Referenced by finley::FinleyDomain::resolveNodeIds().

## markNodes()

void finley::ElementFile::markNodes | ( | std::vector< short > & | mask,
|  | int | offset,
|  | bool | useLinear
| ) |  |

References INDEX2, Nodes, numElements, numNodes, and referenceElementSet.

Referenced by finley::FinleyDomain::markNodes().

## optimizeOrdering()

void finley::ElementFile::optimizeOrdering | ( |  | ) |

reorders the elements so that they are stored close to the nodes

References allocTable(), ElementFile(), gather(), INDEX2, MPIInfo, Nodes, numElements, referenceElementSet, finley::util::sortValueAndIndex(), and swapTable().

Referenced by finley::FinleyDomain::optimizeElementOrdering().

## relabelNodes()

void finley::ElementFile::relabelNodes | ( | const IndexVector & | newNode,
|  | index_t | offset
| ) |  |

assigns new node reference numbers to the elements. If k is the old node, the new node is newNode[k-offset].

Referenced by finley::FinleyDomain::relabelElementNodes().

## scatter()

void finley::ElementFile::scatter | ( | index_t * | index,
|  | const ElementFile * | in
| ) |  |

scatters the ElementFile in into this ElementFile. A conservative assumption on the coloring is made.

References Color, Id, INDEX2, maxColor, minColor, Nodes, numElements, numNodes, Owner, and Tag.

## setTags()

void finley::ElementFile::setTags | ( | const int | newTag,
|  | const escript::Data & | mask
| ) |  |

References escript::Data::actsExpanded(), escript::Data::getDataPointSize(), escript::Data::getNumDataPointsPerSample(), escript::Data::getNumSamples(), escript::Data::getSampleDataRO(), finley::util::hasReducedIntegrationOrder(), numElements, referenceElementSet, Tag, and updateTagList().

Referenced by finley::FinleyDomain::setTags().

## swapTable()

void finley::ElementFile::swapTable | ( | ElementFile * | other | ) |

private

References Color, Id, maxColor, minColor, Nodes, numElements, Owner, paso::swap(), Tag, and tagsInUse.

Referenced by optimizeOrdering().

## updateTagList()

void finley::ElementFile::updateTagList | ( |  | ) |

inline

updates the list of tags in use. This method must be called by all ranks.

References MPIInfo, numElements, finley::util::setValuesInUse(), Tag, and tagsInUse.

Referenced by finley::brick(), finley::FinleyDomain::load(), finley::rectangle(), setTags(), and finley::FinleyDomain::updateTagList().

## Member Data Documentation

## Color

index_t* finley::ElementFile::Color

assigns each element a color. Elements with the same color don't share a node so they can be processed simultaneously. At any time Color must provide a valid value. In any case one can set Color[e]=e for all e

Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), finley::Assemble_LumpedSystem(), finley::Assemble_PDE_Points(), finley::Assemble_PDE_Single_1D(), finley::Assemble_PDE_Single_2D(), finley::Assemble_PDE_Single_3D(), finley::Assemble_PDE_Single_C(), finley::Assemble_PDE_System_1D(), finley::Assemble_PDE_System_2D(), finley::Assemble_PDE_System_3D(), finley::Assemble_PDE_System_C(), createColoring(), finley::FinleyDomain::dump(), freeTable(), gather(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), finley::FinleyDomain::joinFaces(), finley::FinleyDomain::load(), finley::FinleyDomain::printElementInfo(), scatter(), and swapTable().

## Id

index_t* finley::ElementFile::Id

Id[i] is the id number of node i. This number is used when elements are resorted. In the entire code the term 'element id' refers to i and not to Id[i] unless explicitly stated otherwise.

Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), borrowJacobians(), finley::FinleyDomain::borrowSampleReferenceIDs(), copyTable(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), distributeByRankOfDOF(), finley::FinleyDomain::dump(), freeTable(), gather(), weipa::FinleyElements::initFromFinley(), finley::FinleyDomain::joinFaces(), finley::FinleyDomain::load(), finley::FinleyDomain::printElementInfo(), scatter(), swapTable(), and finley::FinleyDomain::writeElementInfo().

## jacobians

ElementFile_Jacobians* finley::ElementFile::jacobians

jacobians of the shape function used for solution approximation

Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().

## jacobians_reducedQ

ElementFile_Jacobians* finley::ElementFile::jacobians_reducedQ

jacobians of the shape function used for solution approximation for reduced integration order

Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().

## jacobians_reducedS

ElementFile_Jacobians* finley::ElementFile::jacobians_reducedS

jacobians of the shape function used for solution approximation for reduced order of shape function

Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().

## jacobians_reducedS_reducedQ

ElementFile_Jacobians* finley::ElementFile::jacobians_reducedS_reducedQ

jacobians of the shape function used for solution approximation for reduced integration order and reduced order of shape function

Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().

## maxColor

index_t finley::ElementFile::maxColor

maximum color value

Referenced by finley::FinleyDomain::addDiracPoints(), createColoring(), freeTable(), gather(), finley::FinleyDomain::joinFaces(), finley::FinleyDomain::load(), scatter(), and swapTable().

## minColor

index_t finley::ElementFile::minColor

minimum color value

Referenced by finley::FinleyDomain::addDiracPoints(), finley::Assemble_LumpedSystem(), finley::Assemble_PDE_Points(), finley::Assemble_PDE_Single_1D(), finley::Assemble_PDE_Single_2D(), finley::Assemble_PDE_Single_3D(), finley::Assemble_PDE_Single_C(), finley::Assemble_PDE_System_1D(), finley::Assemble_PDE_System_2D(), finley::Assemble_PDE_System_3D(), finley::Assemble_PDE_System_C(), createColoring(), freeTable(), gather(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), finley::FinleyDomain::joinFaces(), finley::FinleyDomain::load(), scatter(), and swapTable().

## MPIInfo

escript::JMPI finley::ElementFile::MPIInfo

Referenced by finley::Assemble_gradient(), finley::Assemble_interpolate(), distributeByRankOfDOF(), optimizeOrdering(), and updateTagList().

## Nodes

index_t* finley::ElementFile::Nodes

Nodes[INDEX(k, i, numNodes)] is the k-th node in the i-th element. Note that in the way the nodes are ordered Nodes[INDEX(k, i, numNodes) is the k-th node of element i when referring to the linear version of the mesh.

Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::Assemble_gradient(), finley::Assemble_interpolate(), finley::Assemble_LumpedSystem(), finley::Assemble_PDE_Points(), finley::Assemble_PDE_Single_1D(), finley::Assemble_PDE_Single_2D(), finley::Assemble_PDE_Single_3D(), finley::Assemble_PDE_Single_C(), finley::Assemble_PDE_System_1D(), finley::Assemble_PDE_System_2D(), finley::Assemble_PDE_System_3D(), finley::Assemble_PDE_System_C(), borrowJacobians(), copyTable(), createColoring(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), distributeByRankOfDOF(), finley::FinleyDomain::dump(), finley::FinleyDomain::findMatchingFaces(), freeTable(), gather(), getNodeRange(), finley::FinleyDomain::glueFaces(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), finley::FinleyDomain::joinFaces(), finley::FinleyDomain::load(), markNodes(), optimizeOrdering(), finley::FinleyDomain::printElementInfo(), scatter(), swapTable(), and finley::FinleyDomain::writeElementInfo().

## numElements

dim_t finley::ElementFile::numElements

number of elements

Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), finley::Assemble_AverageElementData(), finley::Assemble_CopyElementData(), finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::Assemble_gradient(), finley::Assemble_integrate(), finley::Assemble_interpolate(), finley::Assemble_LumpedSystem(), finley::Assemble_PDE(), finley::Assemble_PDE_Points(), finley::Assemble_PDE_Single_1D(), finley::Assemble_PDE_Single_2D(), finley::Assemble_PDE_Single_3D(), finley::Assemble_PDE_Single_C(), finley::Assemble_PDE_System_1D(), finley::Assemble_PDE_System_2D(), finley::Assemble_PDE_System_3D(), finley::Assemble_PDE_System_C(), finley::AssembleParameters::AssembleParameters(), borrowJacobians(), copyTable(), createColoring(), distributeByRankOfDOF(), finley::FinleyDomain::dump(), finley::FinleyDomain::findMatchingFaces(), freeTable(), gather(), finley::FinleyDomain::getDataShape(), getNodeRange(), finley::FinleyDomain::glueFaces(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), finley::FinleyDomain::joinFaces(), markNodes(), optimizeOrdering(), finley::FinleyDomain::printElementInfo(), scatter(), finley::FinleyDomain::setOrders(), setTags(), swapTable(), updateTagList(), and finley::FinleyDomain::writeElementInfo().

## numNodes

int finley::ElementFile::numNodes

number of nodes per element

Referenced by allocTable(), finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::Assemble_gradient(), finley::Assemble_interpolate(), finley::AssembleParameters::AssembleParameters(), borrowJacobians(), copyTable(), createColoring(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), distributeByRankOfDOF(), finley::FinleyDomain::dump(), ElementFile(), finley::FinleyDomain::findMatchingFaces(), gather(), getNodeRange(), finley::FinleyDomain::glueFaces(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), finley::FinleyDomain::joinFaces(), markNodes(), finley::FinleyDomain::printElementInfo(), scatter(), and finley::FinleyDomain::writeElementInfo().

## Owner

int* finley::ElementFile::Owner

Owner[i] contains the rank that owns element i.

Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), finley::Assemble_integrate(), copyTable(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), distributeByRankOfDOF(), finley::FinleyDomain::dump(), freeTable(), gather(), weipa::FinleyElements::initFromFinley(), finley::FinleyDomain::load(), finley::FinleyDomain::printElementInfo(), scatter(), and swapTable().

## referenceElementSet

const_ReferenceElementSet_ptr finley::ElementFile::referenceElementSet

the reference element to be used

Referenced by finley::FinleyDomain::addDiracPoints(), finley::Assemble_AverageElementData(), finley::Assemble_CopyElementData(), finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::Assemble_gradient(), finley::Assemble_interpolate(), borrowJacobians(), finley::FinleyDomain::dump(), ElementFile(), finley::FinleyDomain::findMatchingFaces(), finley::FinleyDomain::getDataShape(), finley::FinleyDomain::getVTKElementType(), finley::FinleyDomain::glueFaces(), finley::IndexList_insertElements(), weipa::FinleyElements::initFromFinley(), finley::FinleyDomain::joinFaces(), markNodes(), optimizeOrdering(), finley::FinleyDomain::printElementInfo(), finley::FinleyDomain::setOrders(), setTags(), and finley::FinleyDomain::writeElementInfo().

## Tag

int* finley::ElementFile::Tag

Tag[i] is the tag of element i.

Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), copyTable(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), distributeByRankOfDOF(), finley::FinleyDomain::dump(), freeTable(), gather(), finley::FinleyDomain::getTagFromSampleNo(), weipa::FinleyElements::initFromFinley(), finley::FinleyDomain::joinFaces(), finley::FinleyDomain::load(), finley::FinleyDomain::printElementInfo(), scatter(), setTags(), swapTable(), updateTagList(), and finley::FinleyDomain::writeElementInfo().

## tagsInUse

std::vector<int> finley::ElementFile::tagsInUse

array of tags which are actually used

Referenced by finley::FinleyDomain::borrowListOfTagsInUse(), freeTable(), finley::FinleyDomain::getNumberOfTagsInUse(), swapTable(), and updateTagList().

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

- finley/src/ElementFile.h
- finley/src/ElementFile.cpp
- finley/src/ElementFile_jacobians.cpp