escript
Revision_
|
#include <ElementFile.h>
Public Member Functions | |
ElementFile (const_ReferenceElementSet_ptr refElementSet, 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 (const std::vector< int > &mpiRankOfDOF, int *Id) |
redistributes the elements including overlap by rank | |
void | createColoring (const std::vector< int > &dofMap) |
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 (const std::vector< int > &newNode, int offset) |
assigns new node reference numbers to the elements | |
void | markNodes (std::vector< short > &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, const 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 |
const_ReferenceElementSet_ptr | 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 * | Color |
int | minColor |
minimum color | |
int | maxColor |
maximum 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 | ( | const_ReferenceElementSet_ptr | refSet, |
Esys_MPIInfo * | mpiInfo | ||
) |
constructor use ElementFile::allocTable to allocate the element table
References Esys_MPIInfo_getReference(), jacobians, jacobians_reducedQ, jacobians_reducedS, jacobians_reducedS_reducedQ, MPIInfo, numNodes, and referenceElementSet.
Referenced by optimizeOrdering().
destructor
References Esys_MPIInfo_free(), freeTable(), jacobians, jacobians_reducedQ, jacobians_reducedS, jacobians_reducedS_reducedQ, and MPIInfo.
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 finley::Mesh::addPoints(), distributeByRankOfDOF(), finley::Mesh::glueFaces(), finley::Mesh::joinFaces(), finley::loadMesh(), finley::Mesh_merge(), optimizeOrdering(), finley::Mesh::read(), finley::Mesh::readGmsh(), finley::RectangularMesh_Hex20(), finley::RectangularMesh_Hex8(), finley::RectangularMesh_Rec4(), and finley::RectangularMesh_Rec8().
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::noError(), 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::setError(), finley::ElementFile_Jacobians::status, finley::NodeFile::status, SYSTEM_ERROR, 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 Id, INDEX2, Nodes, numElements, numNodes, Owner, finley::setError(), Tag, and TYPE_ERROR.
Referenced by finley::Mesh::joinFaces(), and finley::Mesh_merge().
void finley::ElementFile::createColoring | ( | const std::vector< int > & | dofMap | ) |
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 | ( | const std::vector< int > & | mpiRankOfDOF, |
int * | Id | ||
) |
redistributes the elements including overlap by rank
References allocTable(), Esys_MPIInfo::comm, ESYS_MPI_INC_COUNTER, FALSE, Id, INDEX2, MPI_INT, MPIInfo, Esys_MPIInfo::msg_tag_counter, Nodes, numElements, numNodes, Owner, Esys_MPIInfo::rank, Esys_MPIInfo::size, Tag, and TRUE.
Referenced by finley::Mesh::distributeByRankOfDOF().
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().
std::pair< int, int > 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::Mesh::resolveNodeIds().
void finley::ElementFile::markDOFsConnectedToRange | ( | int * | mask, |
int | offset, | ||
int | marker, | ||
int | firstDOF, | ||
int | lastDOF, | ||
const int * | dofIndex, | ||
bool | useLinear | ||
) |
References Color, INDEX2, maxColor, minColor, Nodes, numElements, numNodes, and referenceElementSet.
Referenced by finley::Mesh::markDOFsConnectedToRange().
void finley::ElementFile::markNodes | ( | std::vector< short > & | mask, |
int | offset, | ||
bool | useLinear | ||
) |
References INDEX2, Nodes, numElements, numNodes, and referenceElementSet.
Referenced by finley::Mesh::markNodes().
reorders the elements so that they are stored close to the nodes
References allocTable(), ElementFile(), gather(), INDEX2, MPIInfo, Nodes, finley::noError(), numElements, referenceElementSet, finley::util::sortValueAndIndex(), and swapTable().
Referenced by finley::Mesh::optimizeElementOrdering().
void finley::ElementFile::relabelNodes | ( | const std::vector< 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::relabelElementNodes().
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(), escript::Data::getDataPointSize(), escript::Data::getNumDataPointsPerSample(), escript::Data::getNumSamples(), escript::Data::getSampleDataRO(), finley::util::hasReducedIntegrationOrder(), numElements, referenceElementSet, finley::resetError(), finley::setError(), Tag, TYPE_ERROR, and updateTagList().
Referenced by finley::MeshAdapter::setTags().
void finley::ElementFile::swapTable | ( | ElementFile * | other | ) | [private] |
References Color, Id, maxColor, minColor, Nodes, numElements, Owner, paso::swap(), Tag, and tagsInUse.
Referenced by optimizeOrdering().
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::loadMesh(), finley::rectangle(), setTags(), and finley::Mesh::updateTagList().
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::Mesh::addPoints(), 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::MeshAdapter::dump(), freeTable(), gather(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), finley::Mesh::joinFaces(), finley::loadMesh(), markDOFsConnectedToRange(), finley::Mesh::print(), finley::Mesh::printInfo(), finley::Mesh::read(), finley::Mesh::readGmsh(), scatter(), and swapTable().
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::Mesh::addPoints(), allocTable(), borrowJacobians(), finley::MeshAdapter::borrowSampleReferenceIDs(), copyTable(), distributeByRankOfDOF(), finley::MeshAdapter::dump(), freeTable(), gather(), weipa::FinleyElements::initFromFinley(), finley::Mesh::joinFaces(), finley::loadMesh(), finley::Mesh::print(), finley::Mesh::printInfo(), finley::Mesh::read(), finley::Mesh::readGmsh(), finley::RectangularMesh_Hex20(), finley::RectangularMesh_Hex8(), finley::RectangularMesh_Rec4(), finley::RectangularMesh_Rec8(), scatter(), swapTable(), and finley::Mesh::write().
jacobians of the shape function used for solution approximation
Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().
jacobians of the shape function used for solution approximation for reduced integration order
Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().
jacobians of the shape function used for solution approximation for reduced order of shape function
Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().
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().
maximum color
Referenced by finley::Mesh::addPoints(), createColoring(), freeTable(), gather(), finley::Mesh::joinFaces(), finley::loadMesh(), markDOFsConnectedToRange(), finley::Mesh::print(), finley::Mesh::read(), finley::Mesh::readGmsh(), scatter(), and swapTable().
minimum color
Referenced by finley::Mesh::addPoints(), 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::Mesh::joinFaces(), finley::loadMesh(), markDOFsConnectedToRange(), finley::Mesh::print(), finley::Mesh::read(), finley::Mesh::readGmsh(), scatter(), and swapTable().
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::Mesh::addPoints(), 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(), distributeByRankOfDOF(), finley::MeshAdapter::dump(), finley::Mesh::findMatchingFaces(), freeTable(), gather(), getNodeRange(), finley::Mesh::glueFaces(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), finley::Mesh::joinFaces(), finley::loadMesh(), markDOFsConnectedToRange(), markNodes(), optimizeOrdering(), finley::Mesh::print(), finley::Mesh::printInfo(), finley::Mesh::read(), finley::Mesh::readGmsh(), finley::RectangularMesh_Hex20(), finley::RectangularMesh_Hex8(), finley::RectangularMesh_Rec4(), finley::RectangularMesh_Rec8(), relabelNodes(), scatter(), swapTable(), and finley::Mesh::write().
number of elements
Referenced by finley::Mesh::addPoints(), 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::MeshAdapter::dump(), finley::Mesh::findMatchingFaces(), freeTable(), gather(), finley::MeshAdapter::getDataShape(), getNodeRange(), finley::Mesh::glueFaces(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), finley::Mesh::joinFaces(), markDOFsConnectedToRange(), markNodes(), optimizeOrdering(), finley::Mesh::print(), finley::Mesh::printInfo(), relabelNodes(), scatter(), finley::Mesh::setOrders(), setTags(), swapTable(), updateTagList(), and finley::Mesh::write().
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(), distributeByRankOfDOF(), finley::MeshAdapter::dump(), ElementFile(), finley::Mesh::findMatchingFaces(), gather(), getNodeRange(), finley::Mesh::glueFaces(), finley::IndexList_insertElements(), finley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromFinley(), finley::Mesh::joinFaces(), markDOFsConnectedToRange(), markNodes(), finley::Mesh::print(), finley::Mesh::printInfo(), finley::Mesh::read(), finley::Mesh::readGmsh(), finley::RectangularMesh_Hex20(), finley::RectangularMesh_Hex8(), finley::RectangularMesh_Rec4(), finley::RectangularMesh_Rec8(), relabelNodes(), scatter(), and finley::Mesh::write().
Owner[i] contains the rank that owns element i.
Referenced by finley::Mesh::addPoints(), allocTable(), finley::Assemble_integrate(), copyTable(), distributeByRankOfDOF(), finley::MeshAdapter::dump(), freeTable(), gather(), weipa::FinleyElements::initFromFinley(), finley::loadMesh(), finley::Mesh::print(), finley::Mesh::printInfo(), finley::Mesh::read(), finley::Mesh::readGmsh(), finley::RectangularMesh_Hex20(), finley::RectangularMesh_Hex8(), finley::RectangularMesh_Rec4(), finley::RectangularMesh_Rec8(), scatter(), and swapTable().
the reference element to be used
Referenced by finley::Mesh::addPoints(), finley::Assemble_AverageElementData(), finley::Assemble_CopyElementData(), finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::Assemble_gradient(), finley::Assemble_interpolate(), borrowJacobians(), finley::MeshAdapter::dump(), ElementFile(), finley::Mesh::findMatchingFaces(), finley::MeshAdapter::getDataShape(), finley::Mesh::glueFaces(), finley::IndexList_insertElements(), weipa::FinleyElements::initFromFinley(), finley::Mesh::joinFaces(), markDOFsConnectedToRange(), markNodes(), optimizeOrdering(), finley::Mesh::print(), finley::Mesh::printInfo(), finley::Mesh::setOrders(), setTags(), and finley::Mesh::write().
Tag[i] is the tag of element i.
Referenced by finley::Mesh::addPoints(), allocTable(), copyTable(), distributeByRankOfDOF(), finley::MeshAdapter::dump(), freeTable(), gather(), finley::MeshAdapter::getTagFromSampleNo(), weipa::FinleyElements::initFromFinley(), finley::Mesh::joinFaces(), finley::loadMesh(), finley::Mesh::print(), finley::Mesh::printInfo(), finley::Mesh::read(), finley::Mesh::readGmsh(), finley::RectangularMesh_Hex20(), finley::RectangularMesh_Hex8(), finley::RectangularMesh_Rec4(), finley::RectangularMesh_Rec8(), scatter(), setTags(), swapTable(), updateTagList(), and finley::Mesh::write().
std::vector<int> finley::ElementFile::tagsInUse |
array of tags which are actually used
Referenced by finley::MeshAdapter::borrowListOfTagsInUse(), freeTable(), finley::MeshAdapter::getNumberOfTagsInUse(), swapTable(), and updateTagList().