escript Revision_
dudley::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
 
dim_t getNumNodes () const
 returns the number of FEM nodes (on this rank)
 
dim_t getNumDegreesOfFreedom () const
 returns the number of degrees of freedom (on this rank)
 
dim_t getNumDegreesOfFreedomTargets () const
 returns the number of degrees of freedom targets (own and shared)
 
const index_tborrowNodesTarget () const
 returns the mapping from target to the local nodes
 
const index_tborrowDegreesOfFreedomTarget () const
 returns the mapping from target to the local degrees of freedom
 
const index_tborrowTargetDegreesOfFreedom () const
 returns the mapping from local degrees of freedom to a target
 
const index_tborrowTargetNodes () const
 returns the mapping from local nodes to a target
 
void updateTagList ()
 
dim_t createDenseDOFLabeling ()
 
dim_t createDenseNodeLabeling (IndexVector &nodeDistribution, const IndexVector &dofDistribution)
 
void createNodeMappings (const IndexVector &dofDistribution, const IndexVector &nodeDistribution)
 
void assignMPIRankToDOFs (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 setCoordinates (const escript::Data &newX)
 
void setTags (int newTag, const escript::Data &mask)
 set tags to newTag where mask > 0
 
std::pair< index_t, index_tgetDOFRange () const
 

Public Attributes

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_tglobalNodesIndex
 assigns each local node a global unique ID in a dense labeling
 
escript::Distribution_ptr nodesDistribution
 MPI distribution of nodes.
 
escript::Distribution_ptr dofDistribution
 MPI distribution of degrees of freedom.
 
index_tdegreesOfFreedomId
 
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 ()
 

Private Attributes

NodeMapping nodesMapping
 
NodeMapping degreesOfFreedomMapping
 
dim_t numNodes
 number of nodes
 

Constructor & Destructor Documentation

◆ NodeFile()

dudley::NodeFile::NodeFile ( int nDim,
escript::JMPI MPIInfo )

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

◆ ~NodeFile()

dudley::NodeFile::~NodeFile ( )

destructor

References freeTable().

Member Function Documentation

◆ allocTable()

◆ assignMPIRankToDOFs()

void dudley::NodeFile::assignMPIRankToDOFs ( int * mpiRankOfDOF,
const IndexVector & distribution )

◆ borrowDegreesOfFreedomTarget()

const index_t * dudley::NodeFile::borrowDegreesOfFreedomTarget ( ) const
inline

returns the mapping from target to the local degrees of freedom

References degreesOfFreedomMapping, and dudley::NodeMapping::map.

Referenced by dudley::Assemble_CopyNodalData().

◆ borrowGlobalNodesIndex()

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

◆ borrowNodesTarget()

const index_t * dudley::NodeFile::borrowNodesTarget ( ) const
inline

returns the mapping from target to the local nodes

References dudley::NodeMapping::map, and nodesMapping.

◆ borrowTargetDegreesOfFreedom()

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

◆ borrowTargetNodes()

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

returns the mapping from local nodes to a target

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

Referenced by dudley::Assemble_interpolate().

◆ copyTable()

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

◆ createDenseDOFLabeling()

dim_t dudley::NodeFile::createDenseDOFLabeling ( )

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

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

◆ createDenseNodeLabeling()

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

◆ createDOFMappingAndCoupling()

◆ createNodeMappings()

◆ freeTable()

void dudley::NodeFile::freeTable ( )

◆ gather()

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

References Coordinates, dudley::gatherEntries(), getGlobalIdRange(), globalDegreesOfFreedom, Id, numDim, numNodes, and Tag.

◆ gather_global()

◆ getDOFRange()

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

◆ getFirstNode()

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

◆ getGlobalDOFRange()

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

◆ getGlobalIdRange()

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

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

Referenced by gather(), and gather_global().

◆ getGlobalNodeIDIndexRange()

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

◆ getGlobalNumNodes()

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

◆ getLastNode()

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

◆ getNumDegreesOfFreedom()

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

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

References dofDistribution.

Referenced by dudley::Assemble_CopyNodalData(), dudley::Assemble_gradient(), dudley::Assemble_interpolate(), and dudley::DudleyDomain::getDataShape().

◆ getNumDegreesOfFreedomTargets()

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

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

References degreesOfFreedomMapping, and dudley::NodeMapping::numTargets.

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

◆ getNumNodes()

◆ prepareLabeling()

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

◆ print()

◆ setCoordinates()

◆ setTags()

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

◆ updateTagList()

void dudley::NodeFile::updateTagList ( )
inline

Member Data Documentation

◆ Coordinates

◆ degreesOfFreedomId

index_t* dudley::NodeFile::degreesOfFreedomId

◆ degreesOfFreedomMapping

◆ dofDistribution

escript::Distribution_ptr dudley::NodeFile::dofDistribution

◆ globalDegreesOfFreedom

◆ globalNodesIndex

◆ Id

◆ MPIInfo

◆ nodesDistribution

◆ nodesMapping

NodeMapping dudley::NodeFile::nodesMapping
private

◆ numDim

◆ numNodes

◆ status

int dudley::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 dudley::ElementFile::borrowJacobians(), createDenseDOFLabeling(), gather_global(), and setCoordinates().

◆ Tag

◆ tagsInUse

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

vector of tags which are actually used

Referenced by updateTagList().


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