escript
Revision_
|
#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 |
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) More... | |
dim_t | getNumReducedNodes () const |
returns the number of reduced order FEM nodes (on this rank) More... | |
dim_t | getNumDegreesOfFreedom () const |
returns the number of degrees of freedom (on this rank) More... | |
dim_t | getNumReducedDegreesOfFreedom () const |
returns the number of reduced order degrees of freedom (on this rank) More... | |
dim_t | getNumDegreesOfFreedomTargets () const |
returns the number of degrees of freedom targets (own and shared) More... | |
dim_t | getNumReducedDegreesOfFreedomTargets () const |
returns the number of reduced degrees of freedom targets (own and shared) More... | |
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 More... | |
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 More... | |
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 | |
NodeMapping | reducedNodesMapping |
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 * | globalReducedDOFIndex |
index_t * | globalReducedNodesIndex |
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 | 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 More... | |
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.
Referenced by finley::FinleyDomain::distributeByRankOfDOF().
|
inline |
Referenced by finley::Assemble_CopyNodalData().
|
inline |
Referenced by finley::FinleyDomain::ownSample().
|
inline |
|
inline |
|
inline |
Referenced by finley::Assemble_CopyNodalData().
|
inline |
Referenced by finley::Assemble_CopyNodalData().
|
inline |
|
inline |
returns the mapping from local nodes to a target
Referenced by finley::Assemble_interpolate().
|
inline |
|
inline |
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.
Referenced by finley::FinleyDomain::prepare().
dim_t finley::NodeFile::createDenseNodeLabeling | ( | IndexVector & | nodeDistribution, |
const IndexVector & | dofDistribution | ||
) |
References globalDegreesOfFreedom, globalNodesIndex, Id, MPI_MAX, MPIInfo, numNodes, and status.
Referenced by finley::FinleyDomain::prepare().
dim_t finley::NodeFile::createDenseReducedLabeling | ( | const std::vector< short > & | reducedMask, |
bool | useNodes | ||
) |
References globalDegreesOfFreedom, globalNodesIndex, globalReducedDOFIndex, globalReducedNodesIndex, MPI_SUM, MPIInfo, numNodes, prepareLabeling(), and status.
Referenced by finley::FinleyDomain::prepare().
|
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(), and finley::FinleyDomain::prepare().
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().
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 min_index and max_index (exclusive)
References Coordinates, finley::gatherEntries(), getGlobalIdRange(), globalDegreesOfFreedom, Id, numDim, numNodes, and Tag.
Referenced by finley::FinleyDomain::glueFaces().
void finley::NodeFile::gather_global | ( | const index_t * | index, |
const NodeFile * | in | ||
) |
References Coordinates, finley::gatherEntries(), getGlobalIdRange(), globalDegreesOfFreedom, Id, MPI_DOUBLE, MPI_INT, MPIInfo, numDim, numNodes, finley::scatterEntries(), status, and Tag.
Referenced by finley::FinleyDomain::resolveNodeIds().
std::pair< index_t, index_t > finley::NodeFile::getDOFRange | ( | ) | const |
References finley::util::getMinMaxInt(), globalDegreesOfFreedom, and numNodes.
Referenced by assignMPIRankToDOFs(), and finley::FinleyDomain::distributeByRankOfDOF().
|
inline |
Referenced by finley::FinleyDomain::ownSample().
|
inline |
|
private |
References finley::getGlobalRange(), globalDegreesOfFreedom, MPIInfo, and numNodes.
Referenced by prepareLabeling().
|
private |
References finley::getGlobalRange(), Id, MPIInfo, and numNodes.
Referenced by gather(), and gather_global().
|
private |
References finley::getGlobalRange(), globalNodesIndex, MPIInfo, and numNodes.
Referenced by prepareLabeling().
|
inline |
Referenced by finley::FinleyDomain::getNumDataPointsGlobal().
|
inline |
|
inline |
Referenced by finley::FinleyDomain::ownSample().
|
inline |
|
inline |
returns the number of degrees of freedom (on this rank)
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::Assemble_interpolate(), finley::AssembleParameters::AssembleParameters(), and finley::FinleyDomain::getDataShape().
|
inline |
returns the number of degrees of freedom targets (own and shared)
|
inline |
returns the number of FEM nodes (on this rank)
Referenced by finley::FinleyDomain::addDiracPoints(), finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::Assemble_interpolate(), finley::Assemble_NodeCoordinates(), finley::FinleyDomain::createMappings(), finley::FinleyDomain::distributeByRankOfDOF(), finley::FinleyDomain::dump(), finley::FinleyDomain::getDataShape(), finley::FinleyDomain::glueFaces(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::optimizeDOFDistribution(), finley::FinleyDomain::optimizeDOFLabeling(), finley::FinleyDomain::prepare(), finley::FinleyDomain::Print_Mesh_Info(), and finley::FinleyDomain::write().
|
inline |
returns the number of reduced order degrees of freedom (on this rank)
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::Assemble_interpolate(), finley::AssembleParameters::AssembleParameters(), and finley::FinleyDomain::getDataShape().
|
inline |
returns the number of reduced degrees of freedom targets (own and shared)
|
inline |
returns the number of reduced order FEM nodes (on this rank)
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 | ( | void | ) | const |
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.
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().
Referenced by finley::FinleyDomain::setTags().
|
inline |
References dudley::util::setValuesInUse().
Referenced by setTags(), and finley::FinleyDomain::updateTagList().
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(), freeTable(), gather(), gather_global(), weipa::FinleyNodes::initFromFinley(), 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(), finley::FinleyDomain::borrowSampleReferenceIDs(), createNodeMappings(), and freeTable().
|
private |
Referenced by createDOFMappingAndCoupling(), createNodeMappings(), freeTable(), and print().
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::distributeByRankOfDOF(), finley::FinleyDomain::dump(), freeTable(), gather(), gather_global(), getDOFRange(), getGlobalDOFRange(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::optimizeDOFDistribution(), finley::FinleyDomain::optimizeDOFLabeling(), 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(), createDenseNodeLabeling(), createDenseReducedLabeling(), createNodeMappings(), finley::FinleyDomain::dump(), freeTable(), getGlobalNodeIDIndexRange(), weipa::FinleyNodes::initFromFinley(), 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(), 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(), createDenseReducedLabeling(), finley::FinleyDomain::dump(), freeTable(), weipa::FinleyNodes::initFromFinley(), 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(), finley::FinleyDomain::borrowSampleReferenceIDs(), copyTable(), createDenseNodeLabeling(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), createNodeMappings(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::distributeByRankOfDOF(), finley::FinleyDomain::dump(), freeTable(), gather(), gather_global(), getGlobalIdRange(), weipa::FinleyNodes::initFromFinley(), 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(), and prepareLabeling().
escript::Distribution_ptr finley::NodeFile::nodesDistribution |
MPI distribution of nodes.
Referenced by createNodeMappings(), finley::FinleyDomain::dump(), freeTable(), and weipa::FinleyNodes::initFromFinley().
|
private |
Referenced by 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(), gather(), gather_global(), finley::FinleyDomain::getDim(), 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(), prepareLabeling(), print(), scatter(), setCoordinates(), and setTags().
escript::Distribution_ptr finley::NodeFile::reducedDegreesOfFreedomDistribution |
Referenced by createDOFMappingAndCoupling(), createNodeMappings(), and freeTable().
index_t* finley::NodeFile::reducedDegreesOfFreedomId |
Referenced by allocTable(), finley::FinleyDomain::borrowSampleReferenceIDs(), createNodeMappings(), and freeTable().
|
private |
Referenced by createDOFMappingAndCoupling(), createNodeMappings(), freeTable(), and print().
escript::Distribution_ptr finley::NodeFile::reducedNodesDistribution |
Referenced by createNodeMappings(), and freeTable().
index_t* finley::NodeFile::reducedNodesId |
Referenced by allocTable(), finley::FinleyDomain::borrowSampleReferenceIDs(), createNodeMappings(), and freeTable().
NodeMapping finley::NodeFile::reducedNodesMapping |
Referenced by createNodeMappings(), freeTable(), 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(), finley::FinleyDomain::getStatus(), 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(), finley::FinleyDomain::getTagFromSampleNo(), weipa::FinleyNodes::initFromFinley(), print(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::read(), scatter(), setTags(), and finley::FinleyDomain::write().
std::vector<int> finley::NodeFile::tagsInUse |
vector of tags which are actually used
Referenced by finley::FinleyDomain::borrowListOfTagsInUse(), freeTable(), and finley::FinleyDomain::getNumberOfTagsInUse().