escript Revision_
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
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_t * borrowGlobalNodesIndex () const
 
index_t getFirstReducedNode () const
 
index_t getLastReducedNode () const
 
index_t getGlobalNumReducedNodes () const
 
const index_t * borrowGlobalReducedNodesIndex () 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 IndexVector & borrowReducedNodesTarget () const
 
const IndexVector & borrowDegreesOfFreedomTarget () const
 
const IndexVector & borrowNodesTarget () const
 
const IndexVector & borrowReducedDegreesOfFreedomTarget () const
 
const index_t * borrowTargetReducedNodes () const
 
const index_t * borrowTargetDegreesOfFreedom () const
 
const index_t * borrowTargetNodes () const
 returns the mapping from local nodes to a target
 
const index_t * borrowTargetReducedDegreesOfFreedom () 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_t > getDOFRange () const
 

Public Attributes

NodeMapping reducedNodesMapping
 
escript::JMPI MPIInfo
 MPI information.
 
int numDim
 number of spatial dimensions
 
index_t * Id
 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_t * globalDegreesOfFreedom
 
double * Coordinates
 Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i.
 
index_t * globalReducedDOFIndex
 
index_t * globalReducedNodesIndex
 
index_t * globalNodesIndex
 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_t * reducedNodesId
 
index_t * degreesOfFreedomId
 
index_t * reducedDegreesOfFreedomId
 
int status
 

Private Member Functions

std::pair< index_t, index_t > getGlobalIdRange () const
 
std::pair< index_t, index_t > getGlobalDOFRange () const
 
std::pair< index_t, index_t > getGlobalNodeIDIndexRange () 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()

void finley::NodeFile::allocTable ( dim_t  numNodes)

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

void finley::NodeFile::createDOFMappingAndCoupling ( bool  reduced)
private

◆ createNodeMappings()

void finley::NodeFile::createNodeMappings ( const IndexVector &  indexReducedNodes,
const IndexVector &  dofDistribution,
const IndexVector &  nodeDistribution 
)

◆ freeTable()

void finley::NodeFile::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()

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

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

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

◆ getNumReducedDegreesOfFreedom()

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

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

void finley::NodeFile::print ( ) const

◆ 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

double* finley::NodeFile::Coordinates

◆ degreesOfFreedomDistribution

escript::Distribution_ptr finley::NodeFile::degreesOfFreedomDistribution

◆ degreesOfFreedomId

index_t* finley::NodeFile::degreesOfFreedomId

◆ degreesOfFreedomMapping

NodeMapping finley::NodeFile::degreesOfFreedomMapping
private

◆ globalDegreesOfFreedom

index_t* finley::NodeFile::globalDegreesOfFreedom

◆ globalNodesIndex

index_t* finley::NodeFile::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

index_t* finley::NodeFile::Id

◆ MPIInfo

escript::JMPI finley::NodeFile::MPIInfo

◆ nodesDistribution

escript::Distribution_ptr finley::NodeFile::nodesDistribution

◆ nodesMapping

NodeMapping finley::NodeFile::nodesMapping
private

◆ numDim

int finley::NodeFile::numDim

◆ numNodes

dim_t finley::NodeFile::numNodes
private

◆ reducedDegreesOfFreedomDistribution

escript::Distribution_ptr finley::NodeFile::reducedDegreesOfFreedomDistribution

◆ reducedDegreesOfFreedomId

index_t* finley::NodeFile::reducedDegreesOfFreedomId

◆ reducedDegreesOfFreedomMapping

NodeMapping finley::NodeFile::reducedDegreesOfFreedomMapping
private

◆ reducedNodesDistribution

escript::Distribution_ptr finley::NodeFile::reducedNodesDistribution

◆ reducedNodesId

index_t* finley::NodeFile::reducedNodesId

◆ reducedNodesMapping

NodeMapping finley::NodeFile::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

int* finley::NodeFile::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: