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)

◆ 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, MPIInfo, Nodes, numElements, numNodes, 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, dudley::util::getMinMaxInt(), INDEX2, maxColor, minColor, Nodes, numElements, and numNodes.

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

◆ distributeByRankOfDOF()

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().

◆ freeTable()

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().

◆ 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.

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

Referenced by optimizeOrdering().

◆ getNodeRange()

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

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

References dudley::util::getMinMaxInt(), dudley::Nodes, and dudley::ElementFile_Jacobians::numElements.

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

◆ markNodes()

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

◆ optimizeOrdering()

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().

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

◆ print()

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

prints information about this element file to stdout

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

◆ 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].

References INDEX2, Nodes, numElements, and numNodes.

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

◆ setTags()

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

◆ swapTable()

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

◆ updateTagList()

void dudley::ElementFile::updateTagList ( )
inline

Member Data Documentation

◆ Color

index_t* dudley::ElementFile::Color

◆ ename

const char* dudley::ElementFile::ename

◆ etype

ElementTypeId dudley::ElementFile::etype

◆ Id

index_t* dudley::ElementFile::Id

◆ jacobians

ElementFile_Jacobians* dudley::ElementFile::jacobians
private

jacobians of the shape function used for solution approximation

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

◆ jacobians_reducedQ

ElementFile_Jacobians* dudley::ElementFile::jacobians_reducedQ
private

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

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

◆ maxColor

index_t dudley::ElementFile::maxColor

◆ minColor

index_t dudley::ElementFile::minColor

◆ MPIInfo

escript::JMPI dudley::ElementFile::MPIInfo

◆ Nodes

index_t* dudley::ElementFile::Nodes

◆ numDim

int dudley::ElementFile::numDim

◆ 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 dudley::Assemble_getNormal(), ElementFile(), and dudley::DudleyDomain::getDataShape().

◆ numNodes

int dudley::ElementFile::numNodes

◆ numShapes

int dudley::ElementFile::numShapes

number of shape functions

Referenced by ElementFile(), and dudley::IndexList_insertElements().

◆ Owner

int* dudley::ElementFile::Owner

◆ Tag

int* dudley::ElementFile::Tag

◆ tagsInUse

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

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