ESScript
Revision_4488
|
#include <ElementFile.h>
Public Member Functions | |
ElementFile (Finley_ReferenceElementSet *referenceElementSet, Esys_MPIInfo *mpiInfo) | |
~ElementFile () | |
destructor | |
void | allocTable (int numElements) |
allocates the element table within this element file to hold NE elements. | |
void | freeTable () |
deallocates the element table within this element file | |
void | distributeByRankOfDOF (int *mpiRankOfDOF, int *Id) |
redistributes the elements including overlap by rank | |
void | createColoring (int nodeCount, int *degreeOfFreedom) |
Tries to reduce the number of colours used to colour the elements. | |
void | optimizeOrdering () |
reorders the elements so that they are stored close to the nodes | |
void | relabelNodes (int *newNode, int offset) |
assigns new node reference numbers to the elements | |
void | markNodes (int *mask, int offset, bool useLinear) |
void | scatter (int *index, const ElementFile *in) |
void | gather (int *index, const ElementFile *in) |
void | copyTable (int offset, int nodeOffset, int idOffset, const ElementFile *in) |
void | markDOFsConnectedToRange (int *mask, int offset, int marker, int firstDOF, int lastDOF, int *dofIndex, bool useLinear) |
void | setTags (const int newTag, const escript::Data &mask) |
ElementFile_Jacobians * | borrowJacobians (const NodeFile *, bool, bool) const |
std::pair< int, int > | getNodeRange () const |
void | updateTagList () |
Public Attributes | |
Esys_MPIInfo * | MPIInfo |
Finley_ReferenceElementSet * | referenceElementSet |
the reference element to be used | |
int | numElements |
number of elements | |
int * | Id |
int * | Tag |
Tag[i] is the tag of element i. | |
int * | Owner |
Owner[i] contains the rank that owns element i. | |
std::vector< int > | tagsInUse |
array of tags which are actually used | |
int | numNodes |
number of nodes per element | |
int * | Nodes |
int | minColor |
minimum color | |
int | maxColor |
maximum color | |
int * | Color |
ElementFile_Jacobians * | jacobians |
jacobians of the shape function used for solution approximation | |
ElementFile_Jacobians * | jacobians_reducedS |
ElementFile_Jacobians * | jacobians_reducedQ |
ElementFile_Jacobians * | jacobians_reducedS_reducedQ |
Private Member Functions | |
void | swapTable (ElementFile *other) |
finley::ElementFile::ElementFile | ( | Finley_ReferenceElementSet * | refSet, |
Esys_MPIInfo * | mpiInfo | ||
) |
constructor use ElementFile::allocTable to allocate the element table
References Finley_ReferenceElement::BasisFunctions, Color, Esys_MPIInfo_getReference(), Finley_ReferenceElementSet_reference(), Id, jacobians, jacobians_reducedQ, jacobians_reducedS, jacobians_reducedS_reducedQ, Finley_ReferenceElement::LinearBasisFunctions, maxColor, minColor, MPIInfo, Nodes, numElements, Finley_ReferenceElementSet::numNodes, numNodes, Owner, Finley_ReferenceElementSet::referenceElement, Finley_ReferenceElementSet::referenceElementReducedQuadrature, referenceElementSet, and Tag.
Referenced by optimizeOrdering().
finley::ElementFile::~ElementFile | ( | ) |
destructor
References Esys_MPIInfo_free(), Finley_ReferenceElementSet_dealloc(), freeTable(), jacobians, jacobians_reducedQ, jacobians_reducedS, jacobians_reducedS_reducedQ, MPIInfo, and referenceElementSet.
void finley::ElementFile::allocTable | ( | int | numElements | ) |
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 distributeByRankOfDOF(), Finley_Mesh_addPoints(), Finley_Mesh_glueFaces(), Finley_Mesh_joinFaces(), Finley_Mesh_merge(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), and optimizeOrdering().
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_ReferenceElement::DBasisFunctionDv, Finley_ShapeFunction::dSdv, finley::ElementFile_Jacobians::DSDX, Finley_noError(), Finley_ReferenceElementSet_borrowParametrization(), Finley_ReferenceElementSet_borrowReferenceElement(), Finley_setError(), Id, jacobians, jacobians_reducedQ, jacobians_reducedS, jacobians_reducedS_reducedQ, Finley_ReferenceElementInfo::linearNodes, Finley_ReferenceElement::LinearType, finley::ElementFile_Jacobians::node_selection, Nodes, finley::ElementFile_Jacobians::numDim, Finley_ShapeFunctionInfo::numDim, finley::NodeFile::numDim, finley::ElementFile_Jacobians::numElements, numElements, Finley_ReferenceElement::numLocalDim, numNodes, Finley_ReferenceElement::numNodes, Finley_ShapeFunction::numQuadNodes, finley::ElementFile_Jacobians::numQuadTotal, Finley_ShapeFunctionInfo::numShapes, finley::ElementFile_Jacobians::numShapesTotal, finley::ElementFile_Jacobians::numSides, Finley_ReferenceElementInfo::numSides, finley::ElementFile_Jacobians::numSub, Finley_ReferenceElementInfo::numSubElements, finley::ElementFile_Jacobians::offsets, Finley_ReferenceElementInfo::offsets, Finley_ShapeFunction::QuadWeights, referenceElementSet, finley::ElementFile_Jacobians::status, finley::NodeFile::status, Finley_ReferenceElementInfo::subElementNodes, SYSTEM_ERROR, Finley_ShapeFunction::Type, Finley_ReferenceElement::Type, and finley::ElementFile_Jacobians::volume.
Referenced by finley::Assemble_gradient(), finley::Assemble_integrate(), and finley::AssembleParameters::AssembleParameters().
void finley::ElementFile::copyTable | ( | int | offset, |
int | nodeOffset, | ||
int | 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
References Finley_setError(), Id, INDEX2, Nodes, numElements, numNodes, Owner, Tag, and TYPE_ERROR.
Referenced by Finley_Mesh_merge().
void finley::ElementFile::createColoring | ( | int | nodeCount, |
int * | degreeOfFreedom | ||
) |
Tries to reduce the number of colours used to colour the elements.
References Color, finley::util::getMinMaxInt(), INDEX2, maxColor, minColor, Nodes, numElements, and numNodes.
Referenced by Finley_Mesh_createColoring().
void finley::ElementFile::distributeByRankOfDOF | ( | int * | mpiRankOfDOF, |
int * | Id | ||
) |
redistributes the elements including overlap by rank
References allocTable(), Esys_MPIInfo::comm, FALSE, Id, INDEX2, MPI_INT, MPIInfo, Esys_MPIInfo::msg_tag_counter, Nodes, numElements, numNodes, Owner, Esys_MPIInfo::rank, Esys_MPIInfo::size, Tag, and TRUE.
void finley::ElementFile::freeTable | ( | ) |
deallocates the element table within this element file
References Color, Id, maxColor, minColor, Nodes, numElements, Owner, Tag, and tagsInUse.
Referenced by allocTable(), and ~ElementFile().
void finley::ElementFile::gather | ( | int * | index, |
const ElementFile * | in | ||
) |
References Color, Id, INDEX2, maxColor, minColor, Nodes, numElements, numNodes, Owner, and Tag.
Referenced by Finley_Mesh_glueFaces(), Finley_Mesh_joinFaces(), and optimizeOrdering().
|
inline |
returns the minimum and maximum reference number of nodes describing the elements
References finley::util::getMinMaxInt(), Nodes, numElements, and numNodes.
Referenced by Finley_Mesh_resolveNodeIds().
void finley::ElementFile::markDOFsConnectedToRange | ( | int * | mask, |
int | offset, | ||
int | marker, | ||
int | firstDOF, | ||
int | lastDOF, | ||
int * | dofIndex, | ||
bool | useLinear | ||
) |
References Color, FALSE, Finley_ReferenceElementSet_borrowReferenceElement(), INDEX2, Finley_ReferenceElementInfo::linearNodes, maxColor, minColor, Nodes, numElements, Finley_ReferenceElement::numLinearNodes, numNodes, Finley_ReferenceElementInfo::numNodes, referenceElementSet, and Finley_ReferenceElement::Type.
Referenced by Finley_Mesh_markDOFsConnectedToRange().
void finley::ElementFile::markNodes | ( | int * | mask, |
int | offset, | ||
bool | useLinear | ||
) |
References FALSE, Finley_ReferenceElementSet_borrowReferenceElement(), INDEX2, Finley_ReferenceElementInfo::linearNodes, Nodes, numElements, Finley_ReferenceElement::numLinearNodes, numNodes, Finley_ReferenceElementInfo::numNodes, referenceElementSet, and Finley_ReferenceElement::Type.
Referenced by Finley_Mesh_markNodes().
void finley::ElementFile::optimizeOrdering | ( | ) |
reorders the elements so that they are stored close to the nodes
References allocTable(), ElementFile(), Finley_noError(), gather(), INDEX2, MPIInfo, Nodes, numElements, Finley_ReferenceElementSet::numNodes, referenceElementSet, finley::util::sortValueAndIndex(), and swapTable().
Referenced by Finley_Mesh_optimizeElementOrdering().
void finley::ElementFile::relabelNodes | ( | int * | newNode, |
int | offset | ||
) |
assigns new node reference numbers to the elements
assigns new node reference numbers to the elements. If k is the old node, the new node is newNode[k-offset].
References INDEX2, Nodes, numElements, and numNodes.
Referenced by Finley_Mesh_relableElementNodes().
void finley::ElementFile::scatter | ( | int * | 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.
void finley::ElementFile::setTags | ( | const int | newTag, |
const escript::Data & | mask | ||
) |
References escript::Data::actsExpanded(), Finley_ReferenceElementSet_borrowReferenceElement(), Finley_resetError(), Finley_setError(), escript::Data::getDataPointSize(), escript::Data::getNumDataPointsPerSample(), escript::Data::getNumSamples(), escript::Data::getSampleDataRO(), finley::util::hasReducedIntegrationOrder(), numElements, Finley_ShapeFunction::numQuadNodes, Finley_ReferenceElement::Parametrization, referenceElementSet, Tag, TYPE_ERROR, and updateTagList().
|
private |
|
inline |
References MPIInfo, numElements, finley::util::setValuesInUse(), Tag, and tagsInUse.
Referenced by Finley_Mesh_setTagsInUse(), and setTags().
int* 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 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(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_PrintMesh_Info(), freeTable(), gather(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), markDOFsConnectedToRange(), scatter(), and swapTable().
int* 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 allocTable(), borrowJacobians(), copyTable(), distributeByRankOfDOF(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_merge(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_write(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), freeTable(), gather(), weipa::FinleyElements::initFromFinley(), scatter(), and swapTable().
ElementFile_Jacobians* finley::ElementFile::jacobians |
jacobians of the shape function used for solution approximation
Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().
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().
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().
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().
int finley::ElementFile::maxColor |
maximum color
Referenced by createColoring(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), freeTable(), gather(), markDOFsConnectedToRange(), scatter(), and swapTable().
int finley::ElementFile::minColor |
minimum color
Referenced by 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(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), freeTable(), gather(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), markDOFsConnectedToRange(), scatter(), and swapTable().
Esys_MPIInfo* finley::ElementFile::MPIInfo |
int* 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 allocTable(), 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(), finley::Assemble_setNormal(), borrowJacobians(), copyTable(), createColoring(), distributeByRankOfDOF(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_findMatchingFaces(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_write(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), freeTable(), gather(), getNodeRange(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), markDOFsConnectedToRange(), markNodes(), optimizeOrdering(), relabelNodes(), scatter(), and swapTable().
int finley::ElementFile::numElements |
number of elements
Referenced by allocTable(), finley::Assemble_AverageElementData(), finley::Assemble_CopyElementData(), 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::Assemble_setNormal(), finley::AssembleParameters::AssembleParameters(), borrowJacobians(), copyTable(), createColoring(), distributeByRankOfDOF(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_findMatchingFaces(), Finley_Mesh_merge(), Finley_Mesh_print(), Finley_Mesh_setOrders(), Finley_Mesh_write(), Finley_PrintMesh_Info(), freeTable(), gather(), getNodeRange(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), markDOFsConnectedToRange(), markNodes(), optimizeOrdering(), relabelNodes(), scatter(), setTags(), swapTable(), and updateTagList().
int finley::ElementFile::numNodes |
number of nodes per element
Referenced by allocTable(), finley::Assemble_getSize(), finley::Assemble_gradient(), finley::Assemble_interpolate(), finley::Assemble_setNormal(), finley::AssembleParameters::AssembleParameters(), borrowJacobians(), copyTable(), createColoring(), distributeByRankOfDOF(), ElementFile(), Finley_Mesh_findMatchingFaces(), Finley_Mesh_print(), Finley_Mesh_write(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), gather(), getNodeRange(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), markDOFsConnectedToRange(), markNodes(), relabelNodes(), and scatter().
int* finley::ElementFile::Owner |
Owner[i] contains the rank that owns element i.
Referenced by allocTable(), finley::Assemble_integrate(), copyTable(), distributeByRankOfDOF(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), freeTable(), gather(), weipa::FinleyElements::initFromFinley(), scatter(), and swapTable().
Finley_ReferenceElementSet* finley::ElementFile::referenceElementSet |
the reference element to be used
Referenced by finley::Assemble_AverageElementData(), finley::Assemble_CopyElementData(), finley::Assemble_getSize(), finley::Assemble_gradient(), finley::Assemble_interpolate(), finley::Assemble_setNormal(), borrowJacobians(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_findMatchingFaces(), Finley_Mesh_merge(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_setOrders(), Finley_Mesh_write(), Finley_PrintMesh_Info(), finley::IndexList_insertElements(), weipa::FinleyElements::initFromFinley(), markDOFsConnectedToRange(), markNodes(), optimizeOrdering(), setTags(), and ~ElementFile().
int* finley::ElementFile::Tag |
Tag[i] is the tag of element i.
Referenced by allocTable(), copyTable(), distributeByRankOfDOF(), ElementFile(), Finley_Mesh_addPoints(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_write(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), freeTable(), gather(), weipa::FinleyElements::initFromFinley(), scatter(), setTags(), swapTable(), and updateTagList().
std::vector<int> finley::ElementFile::tagsInUse |
array of tags which are actually used
Referenced by freeTable(), swapTable(), and updateTagList().