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

#include <ElementFile.h>

Public Member Functions

 ElementFile (const_ReferenceElementSet_ptr refElementSet, escript::JMPI mpiInfo)
 
 ~ElementFile ()
 destructor
 
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 distributeByRankOfDOF (const std::vector< int > &mpiRankOfDOF, index_t *nodesId)
 redistributes the elements including overlap by rank
 
void createColoring (const IndexVector &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 IndexVector &newNode, index_t offset)
 
void markNodes (std::vector< short > &mask, int offset, bool useLinear)
 
void gather (const index_t *index, const ElementFile *in)
 
void scatter (index_t *index, const ElementFile *in)
 
void setTags (const int newTag, const escript::Data &mask)
 
ElementFile_JacobiansborrowJacobians (const NodeFile *, bool, bool) const
 
std::pair< index_t, index_t > getNodeRange () const
 
void updateTagList ()
 

Public Attributes

escript::JMPI MPIInfo
 
const_ReferenceElementSet_ptr referenceElementSet
 the reference element to be used
 
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
 
index_t * Color
 
index_t minColor
 minimum color value
 
index_t maxColor
 maximum color value
 
ElementFile_Jacobiansjacobians
 jacobians of the shape function used for solution approximation
 
ElementFile_Jacobiansjacobians_reducedS
 
ElementFile_Jacobiansjacobians_reducedQ
 
ElementFile_Jacobiansjacobians_reducedS_reducedQ
 

Private Member Functions

void swapTable (ElementFile *other)
 

Constructor & Destructor Documentation

◆ ElementFile()

finley::ElementFile::ElementFile ( const_ReferenceElementSet_ptr  refSet,
escript::JMPI  mpiInfo 
)

◆ ~ElementFile()

finley::ElementFile::~ElementFile ( )

Member Function Documentation

◆ allocTable()

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

◆ borrowJacobians()

ElementFile_Jacobians * finley::ElementFile::borrowJacobians ( const NodeFile nodefile,
bool  reducedShapefunction,
bool  reducedIntegrationOrder 
) const

◆ copyTable()

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

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, and Tag.

Referenced by finley::FinleyDomain::joinFaces(), and finley::FinleyDomain::merge().

◆ createColoring()

void finley::ElementFile::createColoring ( const IndexVector &  dofMap)

Tries to reduce the number of colours used to colour the elements.

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

References Color, ESYS_ASSERT, finley::util::getMinMaxInt(), INDEX2, maxColor, minColor, Nodes, numElements, and numNodes.

◆ distributeByRankOfDOF()

void finley::ElementFile::distributeByRankOfDOF ( const std::vector< int > &  mpiRankOfDOF,
index_t *  nodesId 
)

redistributes the elements including overlap by rank

References allocTable(), Id, INDEX2, MPI_INT, MPIInfo, Nodes, numElements, numNodes, Owner, and Tag.

◆ freeTable()

void finley::ElementFile::freeTable ( )

deallocates the element table within an element file

deallocates the element table within this element file

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

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

◆ gather()

void finley::ElementFile::gather ( const index_t *  index,
const ElementFile in 
)

◆ getNodeRange()

std::pair< index_t, index_t > 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.

◆ markNodes()

void finley::ElementFile::markNodes ( std::vector< short > &  mask,
int  offset,
bool  useLinear 
)

◆ optimizeOrdering()

void finley::ElementFile::optimizeOrdering ( )

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

References allocTable(), gather(), INDEX2, MPIInfo, Nodes, numElements, referenceElementSet, finley::util::sortValueAndIndex(), and swapTable().

◆ relabelNodes()

void finley::ElementFile::relabelNodes ( const IndexVector &  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 finley::FinleyDomain::relabelElementNodes().

◆ scatter()

void finley::ElementFile::scatter ( index_t *  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.

◆ setTags()

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

◆ swapTable()

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

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

Referenced by optimizeOrdering().

◆ updateTagList()

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::FinleyDomain::load(), finley::rectangle(), and setTags().

Member Data Documentation

◆ Color

index_t* finley::ElementFile::Color

◆ Id

index_t* finley::ElementFile::Id

◆ jacobians

ElementFile_Jacobians* finley::ElementFile::jacobians

jacobians of the shape function used for solution approximation

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

◆ jacobians_reducedQ

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

◆ jacobians_reducedS

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

◆ jacobians_reducedS_reducedQ

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

◆ maxColor

index_t finley::ElementFile::maxColor

◆ minColor

index_t finley::ElementFile::minColor

◆ MPIInfo

escript::JMPI finley::ElementFile::MPIInfo

◆ Nodes

index_t* finley::ElementFile::Nodes

◆ numElements

dim_t finley::ElementFile::numElements

◆ numNodes

int finley::ElementFile::numNodes

◆ Owner

int* finley::ElementFile::Owner

◆ referenceElementSet

const_ReferenceElementSet_ptr finley::ElementFile::referenceElementSet

◆ Tag

int* finley::ElementFile::Tag

◆ tagsInUse

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

array of tags which are actually used

Referenced by freeTable(), swapTable(), and updateTagList().


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