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
void finley::NodeFile::allocTable | ( | dim_t | numNodes | ) |
allocates the node table within this node file to hold numNodes nodes.
References Coordinates, degreesOfFreedomId, globalDegreesOfFreedom, globalNodesIndex, globalReducedDOFIndex, globalReducedNodesIndex, Id, INDEX2, numDim, reducedDegreesOfFreedomId, reducedNodesId, and Tag.
Referenced by finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), 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 globalDegreesOfFreedom.
Referenced by finley::FinleyDomain::distributeByRankOfDOF().
|
inline |
References degreesOfFreedomMapping, and finley::NodeMapping::map.
|
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.
|
inline |
References finley::NodeMapping::map, and reducedNodesMapping.
|
inline |
References degreesOfFreedomMapping, and finley::NodeMapping::target.
Referenced by finley::AssembleParameters::AssembleParameters().
|
inline |
returns the mapping from local nodes to a target
References nodesMapping, and finley::NodeMapping::target.
|
inline |
References reducedDegreesOfFreedomMapping, and finley::NodeMapping::target.
Referenced by finley::AssembleParameters::AssembleParameters().
|
inline |
References reducedNodesMapping, and finley::NodeMapping::target.
void finley::NodeFile::copyTable | ( | index_t | offset, |
index_t | idOffset, | ||
index_t | dofOffset, | ||
const NodeFile * | in | ||
) |
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
Referenced by finley::FinleyDomain::prepare().
dim_t finley::NodeFile::createDenseNodeLabeling | ( | IndexVector & | nodeDistribution, |
const IndexVector & | dofDistribution | ||
) |
References globalDegreesOfFreedom, and Id.
Referenced by finley::FinleyDomain::prepare().
dim_t finley::NodeFile::createDenseReducedLabeling | ( | const std::vector< short > & | reducedMask, |
bool | useNodes | ||
) |
Referenced by finley::FinleyDomain::prepare().
|
private |
void finley::NodeFile::createNodeMappings | ( | const IndexVector & | indexReducedNodes, |
const IndexVector & | dofDistribution, | ||
const IndexVector & | nodeDistribution | ||
) |
Referenced by finley::FinleyDomain::createMappings(), and finley::FinleyDomain::prepare().
void finley::NodeFile::freeTable | ( | ) |
empties the node table and frees all memory
void finley::NodeFile::gather | ( | const index_t * | index, |
const NodeFile * | in | ||
) |
void finley::NodeFile::gather_global | ( | const index_t * | index, |
const NodeFile * | in | ||
) |
References Coordinates, 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 |
Referenced by finley::FinleyDomain::distributeByRankOfDOF().
|
inline |
References nodesDistribution.
Referenced by finley::FinleyDomain::ownSample().
|
inline |
References reducedNodesDistribution.
|
private |
|
private |
References escript::Data::getDataPointSize(), and numDim.
|
private |
References numNodes.
|
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::AssembleParameters::AssembleParameters(), 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::FinleyDomain::createMappings(), finley::FinleyDomain::distributeByRankOfDOF(), finley::FinleyDomain::dump(), finley::FinleyDomain::getDataShape(), weipa::FinleyNodes::initFromFinley(), 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)
References reducedDegreesOfFreedomDistribution.
Referenced by finley::AssembleParameters::AssembleParameters(), 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::FinleyDomain::getDataShape().
|
private |
void finley::NodeFile::print | ( | ) | const |
void finley::NodeFile::scatter | ( | const index_t * | index, |
const NodeFile * | in | ||
) |
void finley::NodeFile::setCoordinates | ( | const escript::Data & | newX | ) |
copies the array newX into this->coordinates
References Coordinates, escript::Data::getSampleDataRO(), INDEX2, and numDim.
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
Referenced by finley::FinleyDomain::setTags().
|
inline |
References MPIInfo, numNodes, finley::util::setValuesInUse(), Tag, and tagsInUse.
Referenced by finley::FinleyDomain::load(), 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::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::dump(), gather_global(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), finley::FinleyDomain::optimizeDOFDistribution(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::read(), setCoordinates(), and finley::FinleyDomain::write().
escript::Distribution_ptr finley::NodeFile::degreesOfFreedomDistribution |
Referenced by finley::FinleyDomain::addDiracPoints(), finley::FinleyDomain::dump(), and getNumDegreesOfFreedom().
index_t* finley::NodeFile::degreesOfFreedomId |
Referenced by allocTable(), and finley::FinleyDomain::borrowSampleReferenceIDs().
|
private |
Referenced by borrowDegreesOfFreedomTarget(), borrowTargetDegreesOfFreedom(), and getNumDegreesOfFreedomTargets().
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(), createDenseNodeLabeling(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::distributeByRankOfDOF(), finley::FinleyDomain::dump(), gather_global(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), finley::FinleyDomain::optimizeDOFDistribution(), finley::FinleyDomain::optimizeDOFLabeling(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::read(), 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(), finley::FinleyDomain::dump(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), 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(), finley::FinleyDomain::dump(), 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(), finley::FinleyDomain::dump(), 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(), finley::FinleyDomain::borrowSampleReferenceIDs(), createDenseNodeLabeling(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::distributeByRankOfDOF(), finley::FinleyDomain::dump(), gather_global(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::printElementInfo(), finley::FinleyDomain::read(), finley::FinleyDomain::write(), and finley::FinleyDomain::writeElementInfo().
escript::JMPI finley::NodeFile::MPIInfo |
MPI information.
Referenced by gather_global(), prepareLabeling(), and updateTagList().
escript::Distribution_ptr finley::NodeFile::nodesDistribution |
MPI distribution of nodes.
Referenced by finley::FinleyDomain::dump(), getFirstNode(), getGlobalNumNodes(), getLastNode(), and weipa::FinleyNodes::initFromFinley().
|
private |
Referenced by borrowNodesTarget(), and borrowTargetNodes().
int finley::NodeFile::numDim |
number of spatial dimensions
Referenced by allocTable(), finley::FinleyDomain::dump(), gather_global(), getGlobalIdRange(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::optimizeDOFDistribution(), and setCoordinates().
|
private |
number of nodes
Referenced by gather_global(), getGlobalNodeIDIndexRange(), getNumNodes(), prepareLabeling(), and updateTagList().
escript::Distribution_ptr finley::NodeFile::reducedDegreesOfFreedomDistribution |
Referenced by getNumReducedDegreesOfFreedom().
index_t* finley::NodeFile::reducedDegreesOfFreedomId |
Referenced by allocTable(), and finley::FinleyDomain::borrowSampleReferenceIDs().
|
private |
escript::Distribution_ptr finley::NodeFile::reducedNodesDistribution |
Referenced by getFirstReducedNode(), getGlobalNumReducedNodes(), and getLastReducedNode().
index_t* finley::NodeFile::reducedNodesId |
Referenced by allocTable(), and finley::FinleyDomain::borrowSampleReferenceIDs().
NodeMapping finley::NodeFile::reducedNodesMapping |
Referenced by borrowReducedNodesTarget(), borrowTargetReducedNodes(), and getNumReducedNodes().
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 gather_global(), finley::FinleyDomain::getStatus(), and prepareLabeling().
int* finley::NodeFile::Tag |
Tag[i] is the tag of node i.
Referenced by allocTable(), finley::FinleyDomain::createHex20(), finley::FinleyDomain::createHex8(), finley::FinleyDomain::createRec4(), finley::FinleyDomain::createRec8(), finley::FinleyDomain::dump(), gather_global(), finley::FinleyDomain::getTagFromSampleNo(), weipa::FinleyNodes::initFromFinley(), finley::FinleyDomain::load(), finley::FinleyDomain::Print_Mesh_Info(), finley::FinleyDomain::read(), updateTagList(), and finley::FinleyDomain::write().
std::vector<int> finley::NodeFile::tagsInUse |
vector of tags which are actually used
Referenced by finley::FinleyDomain::borrowListOfTagsInUse(), finley::FinleyDomain::getNumberOfTagsInUse(), and updateTagList().