escript Revision_
finley::NodeFile Class Reference

#include <NodeFile.h>

Public Member Functions

 NodeFile (int nDim, escript::JMPI MPIInfo)
 
 ~NodeFile ()
 destructor
 
void allocTable (dim_t numNodes)
 allocates the node table within this node file to hold numNodes nodes.
 
void freeTable ()
 empties the node table and frees all memory
 
void print () const
 
index_t getFirstNode () const
 
index_t getLastNode () const
 
dim_t getGlobalNumNodes () const
 
const index_tborrowGlobalNodesIndex () const
 
index_t getFirstReducedNode () const
 
index_t getLastReducedNode () const
 
index_t getGlobalNumReducedNodes () const
 
const index_tborrowGlobalReducedNodesIndex () const
 
dim_t getNumNodes () const
 returns the number of FEM nodes (on this rank)
 
dim_t getNumReducedNodes () const
 returns the number of reduced order FEM nodes (on this rank)
 
dim_t getNumDegreesOfFreedom () const
 returns the number of degrees of freedom (on this rank)
 
dim_t getNumReducedDegreesOfFreedom () const
 returns the number of reduced order degrees of freedom (on this rank)
 
dim_t getNumDegreesOfFreedomTargets () const
 returns the number of degrees of freedom targets (own and shared)
 
dim_t getNumReducedDegreesOfFreedomTargets () const
 returns the number of reduced degrees of freedom targets (own and shared)
 
const IndexVectorborrowReducedNodesTarget () const
 
const IndexVectorborrowDegreesOfFreedomTarget () const
 
const IndexVectorborrowNodesTarget () const
 
const IndexVectorborrowReducedDegreesOfFreedomTarget () const
 
const index_tborrowTargetReducedNodes () const
 
const index_tborrowTargetDegreesOfFreedom () const
 
const index_tborrowTargetNodes () const
 returns the mapping from local nodes to a target
 
const index_tborrowTargetReducedDegreesOfFreedom () const
 
void updateTagList ()
 
dim_t createDenseDOFLabeling ()
 
dim_t createDenseNodeLabeling (IndexVector &nodeDistribution, const IndexVector &dofDistribution)
 
dim_t createDenseReducedLabeling (const std::vector< short > &reducedMask, bool useNodes)
 
void createNodeMappings (const IndexVector &indexReducedNodes, const IndexVector &dofDistribution, const IndexVector &nodeDistribution)
 
void assignMPIRankToDOFs (std::vector< int > &mpiRankOfDOF, const IndexVector &distribution)
 
void copyTable (index_t offset, index_t idOffset, index_t dofOffset, const NodeFile *in)
 
void gather (const index_t *index, const NodeFile *in)
 
void gather_global (const index_t *index, const NodeFile *in)
 
void scatter (const index_t *index, const NodeFile *in)
 
void setCoordinates (const escript::Data &newX)
 copies the array newX into this->coordinates
 
void setTags (int newTag, const escript::Data &mask)
 set tags to newTag where mask > 0
 
std::pair< index_t, index_tgetDOFRange () const
 

Public Attributes

NodeMapping reducedNodesMapping
 
escript::JMPI MPIInfo
 MPI information.
 
int numDim
 number of spatial dimensions
 
index_tId
 Id[i] is the unique ID number of FEM node i.
 
int * Tag
 Tag[i] is the tag of node i.
 
std::vector< int > tagsInUse
 vector of tags which are actually used
 
index_tglobalDegreesOfFreedom
 
double * Coordinates
 Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i.
 
index_tglobalReducedDOFIndex
 
index_tglobalReducedNodesIndex
 
index_tglobalNodesIndex
 assigns each local node a global unique ID in a dense labeling
 
escript::Distribution_ptr nodesDistribution
 MPI distribution of nodes.
 
escript::Distribution_ptr reducedNodesDistribution
 
escript::Distribution_ptr degreesOfFreedomDistribution
 
escript::Distribution_ptr reducedDegreesOfFreedomDistribution
 
index_treducedNodesId
 
index_tdegreesOfFreedomId
 
index_treducedDegreesOfFreedomId
 
int status
 

Private Member Functions

std::pair< index_t, index_tgetGlobalIdRange () const
 
std::pair< index_t, index_tgetGlobalDOFRange () const
 
std::pair< index_t, index_tgetGlobalNodeIDIndexRange () const
 
dim_t prepareLabeling (const std::vector< short > &mask, IndexVector &buffer, IndexVector &distribution, bool useNodes)
 
void createDOFMappingAndCoupling (bool reduced)
 

Private Attributes

NodeMapping nodesMapping
 
NodeMapping degreesOfFreedomMapping
 
NodeMapping reducedDegreesOfFreedomMapping
 
dim_t numNodes
 number of nodes
 

Constructor & Destructor Documentation

◆ NodeFile()

finley::NodeFile::NodeFile ( int nDim,
escript::JMPI mpiInfo )

constructor - creates empty node file. Use allocTable() to allocate the node table (Id,Coordinates).

constructor use NodeFile::allocTable to allocate the node table (Id,Coordinates)

◆ ~NodeFile()

finley::NodeFile::~NodeFile ( )

destructor

References freeTable().

Member Function Documentation

◆ allocTable()

◆ assignMPIRankToDOFs()

void finley::NodeFile::assignMPIRankToDOFs ( std::vector< int > & mpiRankOfDOF,
const IndexVector & distribution )

◆ borrowDegreesOfFreedomTarget()

const IndexVector & finley::NodeFile::borrowDegreesOfFreedomTarget ( ) const
inline

◆ borrowGlobalNodesIndex()

const index_t * finley::NodeFile::borrowGlobalNodesIndex ( ) const
inline

◆ borrowGlobalReducedNodesIndex()

const index_t * finley::NodeFile::borrowGlobalReducedNodesIndex ( ) const
inline

◆ borrowNodesTarget()

const IndexVector & finley::NodeFile::borrowNodesTarget ( ) const
inline

◆ borrowReducedDegreesOfFreedomTarget()

const IndexVector & finley::NodeFile::borrowReducedDegreesOfFreedomTarget ( ) const
inline

◆ borrowReducedNodesTarget()

const IndexVector & finley::NodeFile::borrowReducedNodesTarget ( ) const
inline

◆ borrowTargetDegreesOfFreedom()

const index_t * finley::NodeFile::borrowTargetDegreesOfFreedom ( ) const
inline

◆ borrowTargetNodes()

const index_t * finley::NodeFile::borrowTargetNodes ( ) const
inline

returns the mapping from local nodes to a target

References nodesMapping, and finley::NodeMapping::target.

Referenced by finley::Assemble_interpolate().

◆ borrowTargetReducedDegreesOfFreedom()

const index_t * finley::NodeFile::borrowTargetReducedDegreesOfFreedom ( ) const
inline

◆ borrowTargetReducedNodes()

const index_t * finley::NodeFile::borrowTargetReducedNodes ( ) const
inline

◆ copyTable()

void finley::NodeFile::copyTable ( index_t offset,
index_t idOffset,
index_t dofOffset,
const NodeFile * in )

◆ createDenseDOFLabeling()

dim_t finley::NodeFile::createDenseDOFLabeling ( )

creates a dense labeling of the global degrees of freedom and returns the new number of global degrees of freedom

References globalDegreesOfFreedom, MPI_SUM, MPIInfo, numNodes, prepareLabeling(), and status.

◆ createDenseNodeLabeling()

dim_t finley::NodeFile::createDenseNodeLabeling ( IndexVector & nodeDistribution,
const IndexVector & dofDistribution )

◆ createDenseReducedLabeling()

dim_t finley::NodeFile::createDenseReducedLabeling ( const std::vector< short > & reducedMask,
bool useNodes )

◆ createDOFMappingAndCoupling()

◆ createNodeMappings()

◆ freeTable()

◆ gather()

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

gathers nodes from the NodeFile in using the entries in index[0:numNodes-1] which are between min_index and max_index (exclusive)

gathers this NodeFile from the NodeFile 'in' using the entries in index[0:out->numNodes-1] which are between 0 (and in->numNodes) (exclusive)

References Coordinates, finley::gatherEntries(), getNumNodes(), globalDegreesOfFreedom, Id, numDim, numNodes, and Tag.

Referenced by finley::FinleyDomain::glueFaces().

◆ gather_global()

◆ getDOFRange()

std::pair< index_t, index_t > finley::NodeFile::getDOFRange ( ) const

◆ getFirstNode()

index_t finley::NodeFile::getFirstNode ( ) const
inline

◆ getFirstReducedNode()

index_t finley::NodeFile::getFirstReducedNode ( ) const
inline

◆ getGlobalDOFRange()

std::pair< index_t, index_t > finley::NodeFile::getGlobalDOFRange ( ) const
private

◆ getGlobalIdRange()

std::pair< index_t, index_t > finley::NodeFile::getGlobalIdRange ( ) const
private

References finley::getGlobalRange(), Id, MPIInfo, and numNodes.

Referenced by gather_global().

◆ getGlobalNodeIDIndexRange()

std::pair< index_t, index_t > finley::NodeFile::getGlobalNodeIDIndexRange ( ) const
private

◆ getGlobalNumNodes()

dim_t finley::NodeFile::getGlobalNumNodes ( ) const
inline

◆ getGlobalNumReducedNodes()

dim_t finley::NodeFile::getGlobalNumReducedNodes ( ) const
inline

◆ getLastNode()

index_t finley::NodeFile::getLastNode ( ) const
inline

◆ getLastReducedNode()

index_t finley::NodeFile::getLastReducedNode ( ) const
inline

◆ getNumDegreesOfFreedom()

dim_t finley::NodeFile::getNumDegreesOfFreedom ( ) const
inline

◆ getNumDegreesOfFreedomTargets()

dim_t finley::NodeFile::getNumDegreesOfFreedomTargets ( ) const
inline

returns the number of degrees of freedom targets (own and shared)

References degreesOfFreedomMapping, and finley::NodeMapping::getNumTargets().

◆ getNumNodes()

◆ getNumReducedDegreesOfFreedom()

dim_t finley::NodeFile::getNumReducedDegreesOfFreedom ( ) const
inline

returns the number of reduced order degrees of freedom (on this rank)

References reducedDegreesOfFreedomDistribution.

Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::Assemble_interpolate(), and finley::FinleyDomain::getDataShape().

◆ getNumReducedDegreesOfFreedomTargets()

dim_t finley::NodeFile::getNumReducedDegreesOfFreedomTargets ( ) const
inline

returns the number of reduced degrees of freedom targets (own and shared)

References finley::NodeMapping::getNumTargets(), and reducedDegreesOfFreedomMapping.

◆ getNumReducedNodes()

dim_t finley::NodeFile::getNumReducedNodes ( ) const
inline

◆ prepareLabeling()

dim_t finley::NodeFile::prepareLabeling ( const std::vector< short > & mask,
IndexVector & buffer,
IndexVector & distribution,
bool useNodes )
private

◆ print()

◆ scatter()

void finley::NodeFile::scatter ( const index_t * index,
const NodeFile * in )

scatters the NodeFile in into this NodeFile using index[0:in->numNodes-1]. index has to be between 0 and numNodes-1. colouring is chosen for the worst case

References Coordinates, globalDegreesOfFreedom, Id, numDim, numNodes, finley::scatterEntries(), and Tag.

◆ setCoordinates()

void finley::NodeFile::setCoordinates ( const escript::Data & newX)

◆ setTags()

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

◆ updateTagList()

void finley::NodeFile::updateTagList ( )
inline

Member Data Documentation

◆ Coordinates

◆ degreesOfFreedomDistribution

◆ degreesOfFreedomId

index_t* finley::NodeFile::degreesOfFreedomId

◆ degreesOfFreedomMapping

◆ globalDegreesOfFreedom

◆ globalNodesIndex

◆ globalReducedDOFIndex

index_t* finley::NodeFile::globalReducedDOFIndex

◆ globalReducedNodesIndex

index_t* finley::NodeFile::globalReducedNodesIndex

assigns each local reduced node a global unique ID in a dense labeling Value <0 indicates that the DOF is not used

Referenced by allocTable(), borrowGlobalReducedNodesIndex(), createDenseReducedLabeling(), finley::FinleyDomain::dump(), freeTable(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), and finley::FinleyDomain::Print_Mesh_Info().

◆ Id

◆ MPIInfo

◆ nodesDistribution

◆ nodesMapping

NodeMapping finley::NodeFile::nodesMapping
private

◆ numDim

◆ numNodes

◆ reducedDegreesOfFreedomDistribution

escript::Distribution_ptr finley::NodeFile::reducedDegreesOfFreedomDistribution

◆ reducedDegreesOfFreedomId

index_t* finley::NodeFile::reducedDegreesOfFreedomId

◆ reducedDegreesOfFreedomMapping

◆ reducedNodesDistribution

◆ reducedNodesId

index_t* finley::NodeFile::reducedNodesId

◆ reducedNodesMapping

◆ status

int finley::NodeFile::status

the status counts the updates done on the node coordinates. The value is increased by 1 when the node coordinates are updated.

Referenced by finley::ElementFile::borrowJacobians(), createDenseDOFLabeling(), createDenseNodeLabeling(), createDenseReducedLabeling(), gather_global(), prepareLabeling(), and setCoordinates().

◆ Tag

◆ tagsInUse

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

vector of tags which are actually used

Referenced by freeTable(), and updateTagList().


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