escript  Revision_
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
dudley::ElementFile Class Reference

#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 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 print (const index_t *nodesId) const
 prints information about this element file to stdout More...
 
void distributeByRankOfDOF (const int *mpiRankOfDOF, const index_t *nodesId)
 redistributes the elements including overlap by rank More...
 
void createColoring (dim_t numNodes, const index_t *degreeOfFreedom)
 
void optimizeOrdering ()
 reorders the elements so that they are stored close to the nodes More...
 
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 More...
 
ElementFile_JacobiansborrowJacobians (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 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
 Nodes[INDEX(k, i, numNodes)] is the k-th node in the i-th element. More...
 
index_t * Color
 
index_t minColor
 minimum color value More...
 
index_t maxColor
 maximum color value More...
 
int numDim
 number of spatial dimensions of the domain More...
 
int numLocalDim
 dimension of the element e.g. 2 for a line in 2D or 3D More...
 
ElementTypeId etype
 element type ID More...
 
const char * ename
 name of element type More...
 
int numShapes
 number of shape functions More...
 

Private Member Functions

void swapTable (ElementFile *other)
 

Private Attributes

ElementFile_Jacobiansjacobians
 jacobians of the shape function used for solution approximation More...
 
ElementFile_Jacobiansjacobians_reducedQ
 

Constructor & Destructor Documentation

◆ ElementFile()

dudley::ElementFile::ElementFile ( ElementTypeId  etype,
escript::JMPI  mpiInfo 
)

◆ ~ElementFile()

dudley::ElementFile::~ElementFile ( )

Member Function Documentation

◆ allocTable()

void dudley::ElementFile::allocTable ( dim_t  NE)

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

References INDEX2, and dudley::Nodes.

Referenced by dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), dudley::DudleyDomain::load(), and swapTable().

◆ borrowJacobians()

ElementFile_Jacobians * dudley::ElementFile::borrowJacobians ( const NodeFile nodes,
bool  reducedOrder 
) const

◆ copyTable()

void dudley::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.

References Id, INDEX2, dudley::Nodes, Nodes, Owner, and Tag.

◆ createColoring()

void dudley::ElementFile::createColoring ( dim_t  numNodes,
const index_t *  degreeOfFreedom 
)

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

References Color, ESYS_ASSERT, INDEX2, maxColor, Nodes, and numElements.

◆ distributeByRankOfDOF()

void dudley::ElementFile::distributeByRankOfDOF ( const int *  mpiRankOfDOF,
const index_t *  nodesId 
)

redistributes the elements including overlap by rank

◆ freeTable()

void dudley::ElementFile::freeTable ( )

deallocates the element table within an element file

References MPIInfo, and numNodes.

◆ gather()

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.

◆ getNodeRange()

std::pair< index_t, index_t > dudley::ElementFile::getNodeRange ( ) const
inline

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

◆ markNodes()

void dudley::ElementFile::markNodes ( std::vector< short > &  mask,
index_t  offset 
) const

References INDEX2, and dudley::Nodes.

Referenced by dudley::DudleyDomain::markNodes().

◆ optimizeOrdering()

void dudley::ElementFile::optimizeOrdering ( )

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

◆ print()

void dudley::ElementFile::print ( const index_t *  nodesId) const

prints information about this element file to stdout

◆ relabelNodes()

void dudley::ElementFile::relabelNodes ( const index_t *  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 dudley::DudleyDomain::relabelElementNodes().

◆ setTags()

void dudley::ElementFile::setTags ( int  newTag,
const escript::Data mask 
)

sets element tags to newTag where mask > 0

Referenced by dudley::DudleyDomain::setTags().

◆ swapTable()

void dudley::ElementFile::swapTable ( ElementFile other)
private

References allocTable().

◆ updateTagList()

void dudley::ElementFile::updateTagList ( )
inline

Member Data Documentation

◆ Color

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 createColoring(), dudley::DudleyDomain::dump(), weipa::FinleyElements::initFromDudley(), dudley::DudleyDomain::load(), and dudley::DudleyDomain::printElementInfo().

◆ ename

const char* dudley::ElementFile::ename

◆ etype

ElementTypeId dudley::ElementFile::etype

◆ Id

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 borrowJacobians(), dudley::DudleyDomain::borrowSampleReferenceIDs(), copyTable(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), dudley::DudleyDomain::dump(), weipa::FinleyElements::initFromDudley(), dudley::DudleyDomain::load(), dudley::DudleyDomain::printElementInfo(), and dudley::DudleyDomain::writeElementInfo().

◆ jacobians

ElementFile_Jacobians* dudley::ElementFile::jacobians
private

jacobians of the shape function used for solution approximation

◆ jacobians_reducedQ

ElementFile_Jacobians* dudley::ElementFile::jacobians_reducedQ
private

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

Referenced by finley::ElementFile::borrowJacobians().

◆ maxColor

index_t dudley::ElementFile::maxColor

maximum color value

Referenced by createColoring(), and dudley::DudleyDomain::load().

◆ minColor

index_t dudley::ElementFile::minColor

minimum color value

Referenced by dudley::DudleyDomain::load().

◆ MPIInfo

escript::JMPI dudley::ElementFile::MPIInfo

Referenced by freeTable().

◆ Nodes

index_t* dudley::ElementFile::Nodes

◆ numDim

int dudley::ElementFile::numDim

number of spatial dimensions of the domain

Referenced by dudley::ElementFile_Jacobians::~ElementFile_Jacobians().

◆ numElements

dim_t dudley::ElementFile::numElements

◆ numLocalDim

int dudley::ElementFile::numLocalDim

dimension of the element e.g. 2 for a line in 2D or 3D

Referenced by borrowJacobians(), and dudley::DudleyDomain::getDataShape().

◆ numNodes

int dudley::ElementFile::numNodes

◆ numShapes

int dudley::ElementFile::numShapes

number of shape functions

◆ Owner

int* dudley::ElementFile::Owner

◆ Tag

int* dudley::ElementFile::Tag

◆ tagsInUse

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

array of tags which are actually used

Referenced by dudley::DudleyDomain::borrowListOfTagsInUse(), and dudley::DudleyDomain::getNumberOfTagsInUse().


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