dudley::NodeFile Class Reference

`#include <NodeFile.h>`

## Public Member Functions

| NodeFile (int nDim, escript::JMPI MPIInfo)
| ~NodeFile ()
| destructor More...
void | allocTable (dim_t numNodes)
| allocates the node table within this node file to hold numNodes nodes. More...
void | freeTable ()
| empties the node table and frees all memory More...
void | print () const
index_t | getFirstNode () const
index_t | getLastNode () const
dim_t | getGlobalNumNodes () const
const index_t * | borrowGlobalNodesIndex () const
dim_t | getNumNodes () const
| returns the number of FEM nodes (on this rank) More...
dim_t | getNumDegreesOfFreedom () const
| returns the number of degrees of freedom (on this rank) More...
dim_t | getNumDegreesOfFreedomTargets () const
| returns the number of degrees of freedom targets (own and shared) More...
const index_t * | borrowNodesTarget () const
| returns the mapping from target to the local nodes More...
const index_t * | borrowDegreesOfFreedomTarget () const
| returns the mapping from target to the local degrees of freedom More...
const index_t * | borrowTargetDegreesOfFreedom () const
| returns the mapping from local degrees of freedom to a target More...
const index_t * | borrowTargetNodes () const
| returns the mapping from local nodes to a target More...
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 More...
std::pair< index_t, index_t > | getDOFRange () const

## Public Attributes

escript::JMPI | MPIInfo
| MPI information. More...
int | numDim
| number of spatial dimensions More...
index_t * | Id
| Id[i] is the unique ID number of FEM node i. More...
int * | Tag
| Tag[i] is the tag of node i. More...
std::vector< int > | tagsInUse
| vector of tags which are actually used More...
index_t * | globalDegreesOfFreedom
double * | Coordinates
| Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i. More...
index_t * | globalNodesIndex
| assigns each local node a global unique ID in a dense labeling More...
escript::Distribution_ptr | nodesDistribution
| MPI distribution of nodes. More...
escript::Distribution_ptr | dofDistribution
| MPI distribution of degrees of freedom. More...
index_t * | degreesOfFreedomId
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 ()

## Private Attributes

NodeMapping | nodesMapping
NodeMapping | degreesOfFreedomMapping
dim_t | numNodes
| number of nodes More...

## 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

## Member Function Documentation

## allocTable()

void dudley::NodeFile::allocTable | ( | dim_t | numNodes | ) |

allocates the node table within this node file to hold numNodes nodes.

References INDEX2.

Referenced by dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), dudley::DudleyDomain::load(), dudley::DudleyDomain::read(), and dudley::DudleyDomain::readGmsh().

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

## borrowGlobalNodesIndex()

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

inline

References globalNodesIndex.

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

## 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

returns the mapping from local degrees of freedom to a target

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

Referenced by dudley::AssembleParameters::AssembleParameters(), and dudley::DudleyDomain::createMappings().

## borrowTargetNodes()

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

inline

returns the mapping from local nodes to a target

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

## 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 globalDegreesOfFreedom, MPIInfo, numNodes, and status.

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

## createDenseNodeLabeling()

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

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

## createDOFMappingAndCoupling()

void dudley::NodeFile::createDOFMappingAndCoupling | ( |  | ) |

private

## createNodeMappings()

void dudley::NodeFile::createNodeMappings | ( | const IndexVector & | dofDistribution,
|  | const IndexVector & | nodeDistribution
| ) |  |

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

## freeTable()

void dudley::NodeFile::freeTable | ( |  | ) |

empties the node table and frees all memory

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

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

References Coordinates, dudley::gatherEntries(), getGlobalIdRange(), globalDegreesOfFreedom, Id, MPI_DOUBLE, MPI_INT, MPIInfo, numDim, numNodes, dudley::scatterEntries(), status, and Tag.

## getDOFRange()

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

## getFirstNode()

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

inline

References nodesDistribution.

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

## 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 escript::Data::isComplex().

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

References nodesDistribution.

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

## getLastNode()

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

inline

References nodesDistribution.

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

## getNumDegreesOfFreedom()

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

inline

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

References dofDistribution.

Referenced by dudley::AssembleParameters::AssembleParameters(), 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()

dim_t dudley::NodeFile::getNumNodes | ( |  | ) | const

inline

returns the number of FEM nodes (on this rank)

References numNodes.

Referenced by dudley::DudleyDomain::createColoring(), dudley::DudleyDomain::dump(), dudley::DudleyDomain::getDataShape(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::Print_Mesh_Info(), and dudley::DudleyDomain::write().

## prepareLabeling()

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

private

## print()

void dudley::NodeFile::print | ( |  | ) | const

## setCoordinates()

void dudley::NodeFile::setCoordinates | ( | const escript::Data & | newX | ) |

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

## setTags()

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

set tags to newTag where mask > 0

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

## updateTagList()

void dudley::NodeFile::updateTagList | ( |  | ) |

inline

References MPIInfo, numNodes, dudley::util::setValuesInUse(), Tag, and tagsInUse.

Referenced by dudley::DudleyDomain::load(), and dudley::DudleyDomain::updateTagList().

## Member Data Documentation

## Coordinates

double* dudley::NodeFile::Coordinates

Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i.

Referenced by dudley::ElementFile::borrowJacobians(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), dudley::DudleyDomain::dump(), gather(), gather_global(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::load(), dudley::DudleyDomain::optimizeDOFDistribution(), dudley::DudleyDomain::Print_Mesh_Info(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), and dudley::DudleyDomain::write().

## degreesOfFreedomId

index_t* dudley::NodeFile::degreesOfFreedomId

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

## degreesOfFreedomMapping

NodeMapping dudley::NodeFile::degreesOfFreedomMapping

private

Referenced by borrowDegreesOfFreedomTarget(), borrowTargetDegreesOfFreedom(), and getNumDegreesOfFreedomTargets().

## dofDistribution

escript::Distribution_ptr dudley::NodeFile::dofDistribution

MPI distribution of degrees of freedom.

Referenced by dudley::DudleyDomain::dump(), and getNumDegreesOfFreedom().

## globalDegreesOfFreedom

index_t* dudley::NodeFile::globalDegreesOfFreedom

globalDegreesOfFreedom[i] is the global degree of freedom assigned to node i. This index is used to consider periodic boundary conditions by assigning the same degree of freedom to different nodes.

Referenced by dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), createDenseDOFLabeling(), dudley::DudleyDomain::dump(), gather(), gather_global(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::load(), dudley::DudleyDomain::optimizeDOFDistribution(), dudley::DudleyDomain::Print_Mesh_Info(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), and dudley::DudleyDomain::write().

## globalNodesIndex

index_t* dudley::NodeFile::globalNodesIndex

assigns each local node a global unique ID in a dense labeling

Referenced by borrowGlobalNodesIndex(), dudley::DudleyDomain::dump(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::load(), and dudley::DudleyDomain::Print_Mesh_Info().

## Id

index_t* dudley::NodeFile::Id

Id[i] is the unique ID number of FEM node i.

Referenced by dudley::DudleyDomain::borrowSampleReferenceIDs(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), dudley::DudleyDomain::dump(), gather(), gather_global(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::load(), dudley::DudleyDomain::Print_Mesh_Info(), dudley::DudleyDomain::printElementInfo(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), dudley::DudleyDomain::write(), and dudley::DudleyDomain::writeElementInfo().

## MPIInfo

escript::JMPI dudley::NodeFile::MPIInfo

MPI information.

Referenced by createDenseDOFLabeling(), gather_global(), and updateTagList().

## nodesDistribution

escript::Distribution_ptr dudley::NodeFile::nodesDistribution

MPI distribution of nodes.

Referenced by dudley::DudleyDomain::dump(), getFirstNode(), getGlobalNumNodes(), getLastNode(), and weipa::FinleyNodes::initFromDudley().

## nodesMapping

NodeMapping dudley::NodeFile::nodesMapping

private

Referenced by borrowNodesTarget(), and borrowTargetNodes().

## numDim

int dudley::NodeFile::numDim

number of spatial dimensions

Referenced by dudley::DudleyDomain::dump(), gather(), gather_global(), weipa::FinleyNodes::initFromDudley(), and dudley::DudleyDomain::optimizeDOFDistribution().

## numNodes

dim_t dudley::NodeFile::numNodes

private

number of nodes

Referenced by createDenseDOFLabeling(), gather(), gather_global(), getNumNodes(), and updateTagList().

## 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 createDenseDOFLabeling(), gather_global(), and dudley::DudleyDomain::getStatus().

## Tag

int* dudley::NodeFile::Tag

Tag[i] is the tag of node i.

Referenced by dudley::DudleyDomain::create2D(), dudley::DudleyDomain::create3D(), dudley::DudleyDomain::dump(), gather(), gather_global(), dudley::DudleyDomain::getTagFromSampleNo(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::load(), dudley::DudleyDomain::Print_Mesh_Info(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), updateTagList(), and dudley::DudleyDomain::write().

## tagsInUse

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

vector of tags which are actually used

Referenced by dudley::DudleyDomain::borrowListOfTagsInUse(), dudley::DudleyDomain::getNumberOfTagsInUse(), and updateTagList().

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

- dudley/src/NodeFile.h
- dudley/src/NodeFile.cpp
- NodeFile_createDenseLabelings.cpp
- NodeFile_createMappings.cpp
- NodeFile_gather.cpp