escript Revision_
|
#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 | |
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)
finley::NodeFile::~NodeFile | ( | ) |
destructor
References freeTable().
void finley::NodeFile::allocTable | ( | dim_t | numNodes | ) |
allocates the node table within this node file to hold numNodes nodes.
References Coordinates, degreesOfFreedomId, freeTable(), globalDegreesOfFreedom, globalNodesIndex, globalReducedDOFIndex, globalReducedNodesIndex, Id, INDEX2, numDim, numNodes, reducedDegreesOfFreedomId, reducedNodesId, and Tag.
Referenced by finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::glueFaces(), finley::FinleyDomain::load(), finley::FinleyDomain::merge(), finley::FinleyDomain::read(), and finley::FinleyDomain::resolveNodeIds().
void finley::NodeFile::assignMPIRankToDOFs | ( | std::vector< int > & | mpiRankOfDOF, |
const IndexVector & | distribution ) |
References getDOFRange(), globalDegreesOfFreedom, MPIInfo, and numNodes.
|
inline |
References degreesOfFreedomMapping, and finley::NodeMapping::map.
Referenced by finley::Assemble_CopyNodalData().
|
inline |
References globalNodesIndex.
Referenced by finley::FinleyDomain::ownSample().
|
inline |
References globalReducedNodesIndex.
|
inline |
References finley::NodeMapping::map, and nodesMapping.
|
inline |
References finley::NodeMapping::map, and reducedDegreesOfFreedomMapping.
Referenced by finley::Assemble_CopyNodalData().
|
inline |
References finley::NodeMapping::map, and reducedNodesMapping.
Referenced by finley::Assemble_CopyNodalData().
|
inline |
References degreesOfFreedomMapping, and finley::NodeMapping::target.
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), and finley::Assemble_interpolate().
|
inline |
returns the mapping from local nodes to a target
References nodesMapping, and finley::NodeMapping::target.
Referenced by finley::Assemble_interpolate().
|
inline |
References reducedDegreesOfFreedomMapping, and finley::NodeMapping::target.
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), and finley::Assemble_interpolate().
|
inline |
References reducedNodesMapping, and finley::NodeMapping::target.
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), and finley::Assemble_interpolate().
void finley::NodeFile::copyTable | ( | index_t | offset, |
index_t | idOffset, | ||
index_t | dofOffset, | ||
const NodeFile * | in ) |
References Coordinates, globalDegreesOfFreedom, Id, INDEX2, numDim, numNodes, and Tag.
Referenced by finley::FinleyDomain::merge().
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.
dim_t finley::NodeFile::createDenseNodeLabeling | ( | IndexVector & | nodeDistribution, |
const IndexVector & | dofDistribution ) |
References globalDegreesOfFreedom, globalNodesIndex, Id, MPI_MAX, MPIInfo, numNodes, and status.
dim_t finley::NodeFile::createDenseReducedLabeling | ( | const std::vector< short > & | reducedMask, |
bool | useNodes ) |
References globalDegreesOfFreedom, globalNodesIndex, globalReducedDOFIndex, globalReducedNodesIndex, MPI_SUM, MPIInfo, numNodes, prepareLabeling(), and status.
|
private |
References finley::NodeMapping::assign(), escript::checkResult(), degreesOfFreedomDistribution, degreesOfFreedomMapping, ESYS_ASSERT, finley::util::getFlaggedMinMaxInt(), finley::NodeMapping::getNumTargets(), globalDegreesOfFreedom, globalReducedDOFIndex, finley::NodeMapping::map, MPIInfo, numNodes, reducedDegreesOfFreedomDistribution, reducedDegreesOfFreedomMapping, and escript::shipString().
Referenced by createNodeMappings().
void finley::NodeFile::createNodeMappings | ( | const IndexVector & | indexReducedNodes, |
const IndexVector & | dofDistribution, | ||
const IndexVector & | nodeDistribution ) |
References finley::NodeMapping::assign(), createDOFMappingAndCoupling(), degreesOfFreedomDistribution, degreesOfFreedomId, degreesOfFreedomMapping, finley::NodeMapping::getNumTargets(), globalDegreesOfFreedom, globalNodesIndex, Id, finley::NodeMapping::map, MPIInfo, nodesDistribution, nodesMapping, numNodes, finley::util::packMask(), reducedDegreesOfFreedomDistribution, reducedDegreesOfFreedomId, reducedDegreesOfFreedomMapping, reducedNodesDistribution, reducedNodesId, and reducedNodesMapping.
Referenced by finley::FinleyDomain::createMappings().
void finley::NodeFile::freeTable | ( | ) |
empties the node table and frees all memory
References finley::NodeMapping::clear(), Coordinates, degreesOfFreedomDistribution, degreesOfFreedomId, degreesOfFreedomMapping, globalDegreesOfFreedom, globalNodesIndex, globalReducedDOFIndex, globalReducedNodesIndex, Id, nodesDistribution, nodesMapping, numNodes, reducedDegreesOfFreedomDistribution, reducedDegreesOfFreedomId, reducedDegreesOfFreedomMapping, reducedNodesDistribution, reducedNodesId, reducedNodesMapping, Tag, and tagsInUse.
Referenced by allocTable(), and ~NodeFile().
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().
References Coordinates, finley::gatherEntries(), getGlobalIdRange(), globalDegreesOfFreedom, Id, MPI_DOUBLE, MPI_INT, MPIInfo, numDim, numNodes, finley::scatterEntries(), status, and Tag.
Referenced by finley::FinleyDomain::resolveNodeIds().
References finley::util::getMinMaxInt(), globalDegreesOfFreedom, and numNodes.
Referenced by assignMPIRankToDOFs().
|
inline |
References nodesDistribution.
Referenced by finley::FinleyDomain::ownSample().
|
inline |
References reducedNodesDistribution.
References finley::getGlobalRange(), globalDegreesOfFreedom, MPIInfo, and numNodes.
Referenced by prepareLabeling().
References finley::getGlobalRange(), Id, MPIInfo, and numNodes.
Referenced by gather_global().
References finley::getGlobalRange(), globalNodesIndex, MPIInfo, and numNodes.
Referenced by prepareLabeling().
|
inline |
References nodesDistribution.
Referenced by finley::FinleyDomain::getNumDataPointsGlobal().
|
inline |
References reducedNodesDistribution.
|
inline |
References nodesDistribution.
Referenced by finley::FinleyDomain::ownSample().
|
inline |
References reducedNodesDistribution.
|
inline |
returns the number of degrees of freedom (on this rank)
References degreesOfFreedomDistribution.
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::Assemble_interpolate(), and finley::FinleyDomain::getDataShape().
|
inline |
returns the number of degrees of freedom targets (own and shared)
References degreesOfFreedomMapping, and finley::NodeMapping::getNumTargets().
|
inline |
returns the number of FEM nodes (on this rank)
References numNodes.
Referenced by finley::FinleyDomain::addDiracPoints(), finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::Assemble_interpolate(), finley::Assemble_NodeCoordinates(), finley::FinleyDomain::createMappings(), finley::FinleyDomain::dump(), gather(), finley::FinleyDomain::getDataShape(), finley::FinleyDomain::glueFaces(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::optimizeDOFDistribution(), finley::FinleyDomain::Print_Mesh_Info(), and finley::FinleyDomain::write().
|
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().
|
inline |
returns the number of reduced degrees of freedom targets (own and shared)
References finley::NodeMapping::getNumTargets(), and reducedDegreesOfFreedomMapping.
|
inline |
returns the number of reduced order FEM nodes (on this rank)
References finley::NodeMapping::getNumTargets(), and reducedNodesMapping.
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::Assemble_interpolate(), and finley::FinleyDomain::getDataShape().
|
private |
References getGlobalDOFRange(), getGlobalNodeIDIndexRange(), globalDegreesOfFreedom, globalNodesIndex, MPIInfo, numNodes, and status.
Referenced by createDenseDOFLabeling(), and createDenseReducedLabeling().
void finley::NodeFile::print | ( | ) | const |
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.
void finley::NodeFile::setCoordinates | ( | const escript::Data & | newX | ) |
copies the array newX into this->coordinates
References Coordinates, escript::Data::getDataPointSize(), escript::Data::getNumDataPointsPerSample(), escript::Data::getNumSamples(), escript::Data::getSampleDataRO(), INDEX2, numDim, numNodes, and status.
Referenced by finley::FinleyDomain::setNewX().
void finley::NodeFile::setTags | ( | int | newTag, |
const escript::Data & | mask ) |
set tags to newTag where mask > 0
sets tags to newTag where mask>0
References escript::Data::getDataPointSize(), escript::Data::getNumDataPointsPerSample(), escript::Data::getNumSamples(), escript::Data::getSampleDataRO(), numNodes, Tag, and updateTagList().
|
inline |
References MPIInfo, numNodes, finley::util::setValuesInUse(), Tag, and tagsInUse.
Referenced by finley::FinleyDomain::load(), and setTags().
double* finley::NodeFile::Coordinates |
Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i.
Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::Assemble_NodeCoordinates(), finley::ElementFile::borrowJacobians(), copyTable(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::dump(), finley::FinleyDomain::findMatchingFaces(), freeTable(), gather(), gather_global(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), finley::FinleyDomain::optimizeDOFDistribution(), print(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::read(), scatter(), setCoordinates(), and finley::FinleyDomain::write().
escript::Distribution_ptr finley::NodeFile::degreesOfFreedomDistribution |
index_t* finley::NodeFile::degreesOfFreedomId |
Referenced by allocTable(), createNodeMappings(), and freeTable().
|
private |
index_t* finley::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 finley::FinleyDomain::addDiracPoints(), allocTable(), assignMPIRankToDOFs(), copyTable(), createDenseDOFLabeling(), createDenseNodeLabeling(), createDenseReducedLabeling(), createDOFMappingAndCoupling(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), createNodeMappings(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::dump(), freeTable(), gather(), gather_global(), getDOFRange(), getGlobalDOFRange(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), finley::FinleyDomain::optimizeDOFDistribution(), prepareLabeling(), print(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::read(), scatter(), and finley::FinleyDomain::write().
index_t* finley::NodeFile::globalNodesIndex |
assigns each local node a global unique ID in a dense labeling
Referenced by allocTable(), borrowGlobalNodesIndex(), createDenseNodeLabeling(), createDenseReducedLabeling(), createNodeMappings(), finley::FinleyDomain::dump(), freeTable(), getGlobalNodeIDIndexRange(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), prepareLabeling(), and finley::FinleyDomain::Print_Mesh_Info().
index_t* finley::NodeFile::globalReducedDOFIndex |
assigns each local node a global unique ID in a dense labeling of reduced DOF. Value <0 indicates that the DOF is not used.
Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), createDenseReducedLabeling(), createDOFMappingAndCoupling(), finley::FinleyDomain::dump(), freeTable(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), and finley::FinleyDomain::Print_Mesh_Info().
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().
index_t* finley::NodeFile::Id |
Id[i] is the unique ID number of FEM node i.
Referenced by finley::FinleyDomain::addDiracPoints(), allocTable(), copyTable(), createDenseNodeLabeling(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), createNodeMappings(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::dump(), freeTable(), gather(), gather_global(), getGlobalIdRange(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), print(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::printElementInfo(), finley::FinleyDomain::read(), scatter(), finley::FinleyDomain::write(), and finley::FinleyDomain::writeElementInfo().
escript::JMPI finley::NodeFile::MPIInfo |
MPI information.
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_integrate(), assignMPIRankToDOFs(), createDenseDOFLabeling(), createDenseNodeLabeling(), createDenseReducedLabeling(), createDOFMappingAndCoupling(), createNodeMappings(), gather_global(), getGlobalDOFRange(), getGlobalIdRange(), getGlobalNodeIDIndexRange(), prepareLabeling(), and updateTagList().
escript::Distribution_ptr finley::NodeFile::nodesDistribution |
MPI distribution of nodes.
Referenced by createNodeMappings(), finley::FinleyDomain::dump(), freeTable(), getFirstNode(), getGlobalNumNodes(), getLastNode(), and weipa::FinleyNodes::initFromFinley().
|
private |
Referenced by borrowNodesTarget(), borrowTargetNodes(), createNodeMappings(), freeTable(), and print().
int finley::NodeFile::numDim |
number of spatial dimensions
Referenced by allocTable(), finley::Assemble_getNormal(), finley::Assemble_getSize(), finley::Assemble_NodeCoordinates(), finley::ElementFile::borrowJacobians(), copyTable(), finley::FinleyDomain::dump(), finley::FinleyDomain::findMatchingFaces(), gather(), gather_global(), finley::FinleyDomain::glueFaces(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::optimizeDOFDistribution(), print(), scatter(), and setCoordinates().
|
private |
number of nodes
Referenced by allocTable(), assignMPIRankToDOFs(), copyTable(), createDenseDOFLabeling(), createDenseNodeLabeling(), createDenseReducedLabeling(), createDOFMappingAndCoupling(), createNodeMappings(), freeTable(), gather(), gather_global(), getDOFRange(), getGlobalDOFRange(), getGlobalIdRange(), getGlobalNodeIDIndexRange(), getNumNodes(), prepareLabeling(), print(), scatter(), setCoordinates(), setTags(), and updateTagList().
escript::Distribution_ptr finley::NodeFile::reducedDegreesOfFreedomDistribution |
Referenced by createDOFMappingAndCoupling(), createNodeMappings(), freeTable(), and getNumReducedDegreesOfFreedom().
index_t* finley::NodeFile::reducedDegreesOfFreedomId |
Referenced by allocTable(), createNodeMappings(), and freeTable().
|
private |
escript::Distribution_ptr finley::NodeFile::reducedNodesDistribution |
Referenced by createNodeMappings(), freeTable(), getFirstReducedNode(), getGlobalNumReducedNodes(), and getLastReducedNode().
index_t* finley::NodeFile::reducedNodesId |
Referenced by allocTable(), createNodeMappings(), and freeTable().
NodeMapping finley::NodeFile::reducedNodesMapping |
Referenced by borrowReducedNodesTarget(), borrowTargetReducedNodes(), createNodeMappings(), freeTable(), getNumReducedNodes(), and print().
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().
int* finley::NodeFile::Tag |
Tag[i] is the tag of node i.
Referenced by allocTable(), copyTable(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::dump(), freeTable(), gather(), gather_global(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), print(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::read(), scatter(), setTags(), updateTagList(), and finley::FinleyDomain::write().
std::vector<int> finley::NodeFile::tagsInUse |
vector of tags which are actually used
Referenced by freeTable(), and updateTagList().