escript Revision_
|
#include <ElementFile.h>
Public Member Functions | |
ElementFile (ElementTypeId etype, escript::JMPI mpiInfo) | |
~ElementFile () | |
void | allocTable (dim_t NE) |
allocates the element table within an element file to hold NE elements | |
void | freeTable () |
deallocates the element table within an element file | |
void | copyTable (index_t offset, index_t nodeOffset, index_t idOffset, const ElementFile *in) |
void | print (const index_t *nodesId) const |
prints information about this element file to stdout | |
void | distributeByRankOfDOF (const int *mpiRankOfDOF, const index_t *nodesId) |
redistributes the elements including overlap by rank | |
void | createColoring (dim_t numNodes, const index_t *degreeOfFreedom) |
void | optimizeOrdering () |
reorders the elements so that they are stored close to the nodes | |
void | relabelNodes (const index_t *newNode, index_t offset) |
void | markNodes (std::vector< short > &mask, index_t offset) const |
void | gather (const index_t *index, const ElementFile *in) |
void | setTags (int newTag, const escript::Data &mask) |
sets element tags to newTag where mask > 0 | |
ElementFile_Jacobians * | borrowJacobians (const NodeFile *nodes, bool reducedOrder) const |
std::pair< index_t, index_t > | getNodeRange () const |
void | updateTagList () |
Public Attributes | |
escript::JMPI | MPIInfo |
dim_t | numElements |
number of elements | |
index_t * | 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 | |
index_t * | Nodes |
Nodes[INDEX(k, i, numNodes)] is the k-th node in the i-th element. | |
index_t * | Color |
index_t | minColor |
minimum color value | |
index_t | maxColor |
maximum color value | |
int | numDim |
number of spatial dimensions of the domain | |
int | numLocalDim |
dimension of the element e.g. 2 for a line in 2D or 3D | |
ElementTypeId | etype |
element type ID | |
const char * | ename |
name of element type | |
int | numShapes |
number of shape functions | |
Private Member Functions | |
void | swapTable (ElementFile *other) |
Private Attributes | |
ElementFile_Jacobians * | jacobians |
jacobians of the shape function used for solution approximation | |
ElementFile_Jacobians * | jacobians_reducedQ |
dudley::ElementFile::ElementFile | ( | ElementTypeId | etype, |
escript::JMPI | mpiInfo ) |
References dudley::Dims, ename, dudley::getElementName(), jacobians, jacobians_reducedQ, dudley::localDims, numDim, numLocalDim, numNodes, and numShapes.
Referenced by optimizeOrdering().
dudley::ElementFile::~ElementFile | ( | ) |
References freeTable(), jacobians, and jacobians_reducedQ.
void dudley::ElementFile::allocTable | ( | dim_t | NE | ) |
allocates the element table within an element file to hold NE elements
References Color, freeTable(), Id, INDEX2, maxColor, minColor, Nodes, numElements, numNodes, Owner, and Tag.
Referenced by dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), distributeByRankOfDOF(), dudley::DudleyDomain::load(), optimizeOrdering(), and dudley::DudleyDomain::readGmsh().
ElementFile_Jacobians * dudley::ElementFile::borrowJacobians | ( | const NodeFile * | nodes, |
bool | reducedOrder ) const |
References dudley::ElementFile_Jacobians::absD, dudley::Assemble_jacobians_2D(), dudley::Assemble_jacobians_2D_M1D_E1D(), dudley::Assemble_jacobians_3D(), dudley::Assemble_jacobians_3D_M2D_E2D(), dudley::NodeFile::Coordinates, dudley::ElementFile_Jacobians::DSDX, Id, jacobians, jacobians_reducedQ, Nodes, numDim, dudley::ElementFile_Jacobians::numDim, dudley::NodeFile::numDim, numElements, dudley::ElementFile_Jacobians::numElements, numLocalDim, numNodes, dudley::ElementFile_Jacobians::numQuad, dudley::ElementFile_Jacobians::numShapes, dudley::QuadNums, dudley::ElementFile_Jacobians::quadweight, dudley::ElementFile_Jacobians::status, and dudley::NodeFile::status.
Referenced by dudley::Assemble_gradient(), and dudley::Assemble_integrate().
void dudley::ElementFile::copyTable | ( | index_t | offset, |
index_t | nodeOffset, | ||
index_t | idOffset, | ||
const ElementFile * | in ) |
Tries to reduce the number of colors used to color elements in this ElementFile
References Color, ESYS_ASSERT, dudley::util::getMinMaxInt(), INDEX2, maxColor, minColor, Nodes, numElements, and numNodes.
void dudley::ElementFile::distributeByRankOfDOF | ( | const int * | mpiRankOfDOF, |
const 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 dudley::DudleyDomain::distributeByRankOfDOF().
void dudley::ElementFile::freeTable | ( | ) |
deallocates the element table within an element file
References Color, Id, maxColor, minColor, Nodes, numElements, Owner, Tag, and tagsInUse.
Referenced by allocTable(), and ~ElementFile().
void dudley::ElementFile::gather | ( | const index_t * | index, |
const ElementFile * | in ) |
gathers the elements from the element file in
using index[0:out->elements-1]. index
has to be between 0 and in->numElements-1. A conservative assumption on the colouring is made.
References Color, Id, INDEX2, maxColor, minColor, Nodes, numElements, numNodes, Owner, and Tag.
Referenced by optimizeOrdering().
returns the minimum and maximum reference number of nodes describing the elements
References dudley::util::getMinMaxInt(), Nodes, numElements, and numNodes.
Referenced by dudley::DudleyDomain::resolveNodeIds().
void dudley::ElementFile::markNodes | ( | std::vector< short > & | mask, |
index_t | offset ) const |
References INDEX2, Nodes, numElements, and numNodes.
Referenced by dudley::DudleyDomain::markNodes().
void dudley::ElementFile::optimizeOrdering | ( | ) |
reorders the elements so that they are stored close to the nodes
References allocTable(), ElementFile(), etype, gather(), INDEX2, MPIInfo, Nodes, numElements, numNodes, dudley::util::sortValueAndIndex(), and swapTable().
void dudley::ElementFile::print | ( | const index_t * | nodesId | ) | const |
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 dudley::DudleyDomain::relabelElementNodes().
void dudley::ElementFile::setTags | ( | int | newTag, |
const escript::Data & | mask ) |
sets element tags to newTag where mask > 0
References escript::Data::actsExpanded(), escript::Data::getDataPointSize(), escript::Data::getSampleDataRO(), dudley::hasReducedIntegrationOrder(), escript::Data::isComplex(), numElements, numNodes, escript::Data::numSamplesEqual(), Tag, and updateTagList().
|
private |
References Color, Id, maxColor, minColor, Nodes, numElements, Owner, Tag, and tagsInUse.
Referenced by optimizeOrdering().
|
inline |
References MPIInfo, numElements, dudley::util::setValuesInUse(), Tag, and tagsInUse.
Referenced by dudley::DudleyDomain::load(), and setTags().
index_t* dudley::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(), dudley::Assemble_LumpedSystem(), dudley::Assemble_PDE_Points(), dudley::Assemble_PDE_Single_2D(), dudley::Assemble_PDE_Single_3D(), dudley::Assemble_PDE_System_2D(), dudley::Assemble_PDE_System_3D(), createColoring(), dudley::DudleyDomain::dump(), freeTable(), gather(), dudley::IndexList_insertElements(), dudley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromDudley(), dudley::DudleyDomain::load(), print(), dudley::DudleyDomain::printElementInfo(), dudley::DudleyDomain::readGmsh(), and swapTable().
const char* dudley::ElementFile::ename |
name of element type
Referenced by ElementFile(), print(), dudley::DudleyDomain::printElementInfo(), and dudley::DudleyDomain::writeElementInfo().
ElementTypeId dudley::ElementFile::etype |
element type ID
Referenced by dudley::DudleyDomain::dump(), weipa::FinleyElements::initFromDudley(), optimizeOrdering(), and dudley::DudleyDomain::printElementInfo().
index_t* dudley::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(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), distributeByRankOfDOF(), dudley::DudleyDomain::dump(), freeTable(), gather(), weipa::FinleyElements::initFromDudley(), dudley::DudleyDomain::load(), print(), dudley::DudleyDomain::printElementInfo(), dudley::DudleyDomain::readGmsh(), swapTable(), and dudley::DudleyDomain::writeElementInfo().
|
private |
jacobians of the shape function used for solution approximation
Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().
|
private |
jacobians of the shape function used for solution approximation for reduced integration order
Referenced by borrowJacobians(), ElementFile(), and ~ElementFile().
index_t dudley::ElementFile::maxColor |
maximum color value
Referenced by allocTable(), createColoring(), freeTable(), gather(), dudley::DudleyDomain::load(), print(), dudley::DudleyDomain::readGmsh(), and swapTable().
index_t dudley::ElementFile::minColor |
minimum color value
Referenced by allocTable(), dudley::Assemble_LumpedSystem(), dudley::Assemble_PDE_Points(), dudley::Assemble_PDE_Single_2D(), dudley::Assemble_PDE_Single_3D(), dudley::Assemble_PDE_System_2D(), dudley::Assemble_PDE_System_3D(), createColoring(), freeTable(), gather(), dudley::IndexList_insertElements(), dudley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), dudley::DudleyDomain::load(), print(), dudley::DudleyDomain::readGmsh(), and swapTable().
escript::JMPI dudley::ElementFile::MPIInfo |
index_t* dudley::ElementFile::Nodes |
Nodes[INDEX(k, i, numNodes)] is the k-th node in the i-th element.
Referenced by allocTable(), dudley::Assemble_getNormal(), dudley::Assemble_getSize(), dudley::Assemble_gradient(), dudley::Assemble_interpolate(), dudley::Assemble_LumpedSystem(), dudley::Assemble_PDE_Points(), dudley::Assemble_PDE_Single_2D(), dudley::Assemble_PDE_Single_3D(), dudley::Assemble_PDE_System_2D(), dudley::Assemble_PDE_System_3D(), borrowJacobians(), copyTable(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), createColoring(), distributeByRankOfDOF(), dudley::DudleyDomain::dump(), freeTable(), gather(), getNodeRange(), dudley::IndexList_insertElements(), dudley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromDudley(), dudley::DudleyDomain::load(), markNodes(), optimizeOrdering(), print(), dudley::DudleyDomain::printElementInfo(), dudley::DudleyDomain::readGmsh(), relabelNodes(), swapTable(), and dudley::DudleyDomain::writeElementInfo().
int dudley::ElementFile::numDim |
number of spatial dimensions of the domain
Referenced by dudley::Assemble_AverageElementData(), dudley::Assemble_CopyElementData(), dudley::Assemble_getNormal(), dudley::Assemble_getSize(), dudley::Assemble_interpolate(), dudley::Assemble_LumpedSystem(), dudley::AssembleParameters::AssembleParameters(), borrowJacobians(), and ElementFile().
dim_t dudley::ElementFile::numElements |
number of elements
Referenced by allocTable(), dudley::Assemble_AverageElementData(), dudley::Assemble_CopyElementData(), dudley::Assemble_getNormal(), dudley::Assemble_getSize(), dudley::Assemble_gradient(), dudley::Assemble_integrate(), dudley::Assemble_interpolate(), dudley::Assemble_LumpedSystem(), dudley::Assemble_PDE(), dudley::Assemble_PDE_Points(), dudley::Assemble_PDE_Single_2D(), dudley::Assemble_PDE_Single_3D(), dudley::Assemble_PDE_System_2D(), dudley::Assemble_PDE_System_3D(), borrowJacobians(), copyTable(), createColoring(), distributeByRankOfDOF(), dudley::DudleyDomain::dump(), freeTable(), gather(), dudley::DudleyDomain::getDataShape(), getNodeRange(), dudley::IndexList_insertElements(), dudley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromDudley(), markNodes(), optimizeOrdering(), print(), dudley::DudleyDomain::printElementInfo(), relabelNodes(), setTags(), swapTable(), updateTagList(), and dudley::DudleyDomain::writeElementInfo().
int dudley::ElementFile::numLocalDim |
dimension of the element e.g. 2 for a line in 2D or 3D
Referenced by dudley::Assemble_getNormal(), borrowJacobians(), ElementFile(), and dudley::DudleyDomain::getDataShape().
int dudley::ElementFile::numNodes |
number of nodes per element
Referenced by allocTable(), dudley::Assemble_getNormal(), dudley::Assemble_getSize(), dudley::Assemble_gradient(), dudley::Assemble_interpolate(), borrowJacobians(), copyTable(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), createColoring(), distributeByRankOfDOF(), dudley::DudleyDomain::dump(), ElementFile(), gather(), getNodeRange(), dudley::IndexList_insertElements(), dudley::IndexList_insertElementsWithRowRangeNoMainDiagonal(), weipa::FinleyElements::initFromDudley(), markNodes(), optimizeOrdering(), print(), dudley::DudleyDomain::printElementInfo(), dudley::DudleyDomain::readGmsh(), relabelNodes(), setTags(), and dudley::DudleyDomain::writeElementInfo().
int dudley::ElementFile::numShapes |
number of shape functions
Referenced by ElementFile(), and dudley::IndexList_insertElements().
int* dudley::ElementFile::Owner |
Owner[i] contains the rank that owns element i.
Referenced by allocTable(), dudley::Assemble_integrate(), copyTable(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), distributeByRankOfDOF(), dudley::DudleyDomain::dump(), freeTable(), gather(), weipa::FinleyElements::initFromDudley(), dudley::DudleyDomain::load(), print(), dudley::DudleyDomain::printElementInfo(), dudley::DudleyDomain::readGmsh(), and swapTable().
int* dudley::ElementFile::Tag |
Tag[i] is the tag of element i.
Referenced by allocTable(), copyTable(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), distributeByRankOfDOF(), dudley::DudleyDomain::dump(), freeTable(), gather(), weipa::FinleyElements::initFromDudley(), dudley::DudleyDomain::load(), print(), dudley::DudleyDomain::printElementInfo(), dudley::DudleyDomain::readGmsh(), setTags(), swapTable(), updateTagList(), and dudley::DudleyDomain::writeElementInfo().
std::vector<int> dudley::ElementFile::tagsInUse |
array of tags which are actually used
Referenced by freeTable(), swapTable(), and updateTagList().