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 |
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... | |
dudley::NodeFile::NodeFile | ( | int | nDim, |
escript::JMPI | MPIInfo | ||
) |
constructor - creates empty node file. Use allocTable() to allocate the node table (Id,Coordinates).
dudley::NodeFile::~NodeFile | ( | ) |
destructor
References freeTable().
void dudley::NodeFile::allocTable | ( | dim_t | numNodes | ) |
allocates the node table within this node file to hold numNodes nodes.
References Coordinates, degreesOfFreedomId, freeTable(), globalDegreesOfFreedom, globalNodesIndex, Id, INDEX2, numDim, numNodes, and Tag.
Referenced by dudley::DudleyDomain::create2D(), dudley::DudleyDomain::load(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), and dudley::DudleyDomain::resolveNodeIds().
void dudley::NodeFile::assignMPIRankToDOFs | ( | int * | mpiRankOfDOF, |
const IndexVector & | distribution | ||
) |
References getDOFRange(), globalDegreesOfFreedom, MPIInfo, and numNodes.
Referenced by dudley::DudleyDomain::distributeByRankOfDOF().
|
inline |
returns the mapping from target to the local degrees of freedom
Referenced by dudley::Assemble_CopyNodalData().
|
inline |
Referenced by dudley::DudleyDomain::ownSample().
|
inline |
returns the mapping from target to the local nodes
|
inline |
returns the mapping from local degrees of freedom to a target
Referenced by dudley::Assemble_CopyNodalData(), dudley::Assemble_gradient(), dudley::Assemble_interpolate(), dudley::AssembleParameters::AssembleParameters(), and dudley::DudleyDomain::createMappings().
|
inline |
returns the mapping from local nodes to a target
Referenced by dudley::Assemble_interpolate().
void dudley::NodeFile::copyTable | ( | index_t | offset, |
index_t | idOffset, | ||
index_t | dofOffset, | ||
const NodeFile * | in | ||
) |
References Coordinates, globalDegreesOfFreedom, Id, INDEX2, numDim, numNodes, and Tag.
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 createDenseNodeLabeling(), dofDistribution, getGlobalDOFRange(), globalDegreesOfFreedom, globalNodesIndex, Id, escript::DataTypes::index_t_max(), escript::DataTypes::index_t_min(), MPI_MAX, MPI_SUM, MPIInfo, numNodes, and status.
Referenced by dudley::DudleyDomain::prepare().
dim_t dudley::NodeFile::createDenseNodeLabeling | ( | IndexVector & | nodeDistribution, |
const IndexVector & | dofDistribution | ||
) |
Referenced by createDenseDOFLabeling(), and dudley::DudleyDomain::prepare().
|
private |
void dudley::NodeFile::createNodeMappings | ( | const IndexVector & | dofDistribution, |
const IndexVector & | nodeDistribution | ||
) |
References dudley::NodeMapping::assign(), createDOFMappingAndCoupling(), degreesOfFreedomId, degreesOfFreedomMapping, dofDistribution, Id, dudley::NodeMapping::map, MPIInfo, nodesDistribution, nodesMapping, numNodes, and dudley::NodeMapping::numTargets.
Referenced by dudley::DudleyDomain::createMappings().
void dudley::NodeFile::freeTable | ( | ) |
empties the node table and frees all memory
References dudley::NodeMapping::clear(), Coordinates, degreesOfFreedomId, degreesOfFreedomMapping, dofDistribution, globalDegreesOfFreedom, globalNodesIndex, Id, nodesDistribution, nodesMapping, numNodes, and Tag.
Referenced by allocTable(), and ~NodeFile().
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.
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.
Referenced by dudley::DudleyDomain::resolveNodeIds().
std::pair< index_t, index_t > dudley::NodeFile::getDOFRange | ( | ) | const |
References dudley::util::getMinMaxInt(), globalDegreesOfFreedom, and numNodes.
Referenced by assignMPIRankToDOFs(), and dudley::DudleyDomain::distributeByRankOfDOF().
|
inline |
Referenced by dudley::DudleyDomain::ownSample().
|
private |
References dudley::getGlobalRange(), globalDegreesOfFreedom, MPIInfo, and numNodes.
Referenced by createDenseDOFLabeling().
|
private |
References dudley::getGlobalRange(), Id, MPIInfo, and numNodes.
Referenced by gather(), and gather_global().
|
private |
References dudley::getGlobalRange(), globalNodesIndex, MPIInfo, and numNodes.
|
inline |
Referenced by dudley::DudleyDomain::getNumDataPointsGlobal().
|
inline |
Referenced by dudley::DudleyDomain::ownSample().
|
inline |
returns the number of degrees of freedom (on this rank)
Referenced by dudley::Assemble_CopyNodalData(), dudley::Assemble_gradient(), dudley::Assemble_interpolate(), dudley::AssembleParameters::AssembleParameters(), and dudley::DudleyDomain::getDataShape().
|
inline |
returns the number of degrees of freedom targets (own and shared)
Referenced by dudley::DudleyDomain::createMappings().
|
inline |
returns the number of FEM nodes (on this rank)
Referenced by dudley::Assemble_CopyNodalData(), dudley::Assemble_gradient(), dudley::Assemble_interpolate(), dudley::Assemble_NodeCoordinates(), dudley::DudleyDomain::createColoring(), dudley::DudleyDomain::distributeByRankOfDOF(), dudley::DudleyDomain::dump(), dudley::DudleyDomain::getDataShape(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::optimizeDOFDistribution(), dudley::DudleyDomain::optimizeDOFLabeling(), dudley::DudleyDomain::Print_Mesh_Info(), and dudley::DudleyDomain::write().
|
private |
void dudley::NodeFile::print | ( | void | ) | const |
References Coordinates, degreesOfFreedomMapping, globalDegreesOfFreedom, Id, INDEX2, nodesMapping, numDim, numNodes, Tag, and dudley::NodeMapping::target.
void dudley::NodeFile::setCoordinates | ( | const escript::Data & | newX | ) |
void dudley::NodeFile::setTags | ( | int | newTag, |
const escript::Data & | mask | ||
) |
set 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 dudley::DudleyDomain::setTags().
|
inline |
References dudley::util::setValuesInUse().
Referenced by setTags(), and dudley::DudleyDomain::updateTagList().
double* dudley::NodeFile::Coordinates |
Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i.
Referenced by allocTable(), dudley::Assemble_getNormal(), dudley::Assemble_getSize(), dudley::Assemble_NodeCoordinates(), dudley::ElementFile::borrowJacobians(), copyTable(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::dump(), freeTable(), gather(), gather_global(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::optimizeDOFDistribution(), print(), dudley::DudleyDomain::Print_Mesh_Info(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), setCoordinates(), and dudley::DudleyDomain::write().
index_t* dudley::NodeFile::degreesOfFreedomId |
Referenced by allocTable(), dudley::DudleyDomain::borrowSampleReferenceIDs(), createNodeMappings(), and freeTable().
|
private |
Referenced by createDOFMappingAndCoupling(), createNodeMappings(), freeTable(), and print().
escript::Distribution_ptr dudley::NodeFile::dofDistribution |
MPI distribution of degrees of freedom.
Referenced by createDenseDOFLabeling(), createDOFMappingAndCoupling(), createNodeMappings(), dudley::DudleyDomain::dump(), and freeTable().
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 allocTable(), assignMPIRankToDOFs(), copyTable(), dudley::DudleyDomain::create2D(), createDenseDOFLabeling(), createDOFMappingAndCoupling(), dudley::DudleyDomain::distributeByRankOfDOF(), dudley::DudleyDomain::dump(), freeTable(), gather(), gather_global(), getDOFRange(), getGlobalDOFRange(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::optimizeDOFDistribution(), dudley::DudleyDomain::optimizeDOFLabeling(), print(), dudley::DudleyDomain::Print_Mesh_Info(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), and dudley::DudleyDomain::write().
index_t* dudley::NodeFile::globalNodesIndex |
assigns each local node a global unique ID in a dense labeling
Referenced by allocTable(), createDenseDOFLabeling(), dudley::DudleyDomain::dump(), freeTable(), getGlobalNodeIDIndexRange(), weipa::FinleyNodes::initFromDudley(), and dudley::DudleyDomain::Print_Mesh_Info().
index_t* dudley::NodeFile::Id |
Id[i] is the unique ID number of FEM node i.
Referenced by allocTable(), dudley::DudleyDomain::borrowSampleReferenceIDs(), copyTable(), dudley::DudleyDomain::create2D(), createDenseDOFLabeling(), createNodeMappings(), dudley::DudleyDomain::distributeByRankOfDOF(), dudley::DudleyDomain::dump(), freeTable(), gather(), gather_global(), getGlobalIdRange(), weipa::FinleyNodes::initFromDudley(), print(), dudley::DudleyDomain::Print_Mesh_Info(), dudley::DudleyDomain::printElementInfo(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), dudley::DudleyDomain::write(), and dudley::DudleyDomain::writeElementInfo().
escript::JMPI dudley::NodeFile::MPIInfo |
escript::Distribution_ptr dudley::NodeFile::nodesDistribution |
MPI distribution of nodes.
Referenced by createNodeMappings(), dudley::DudleyDomain::dump(), freeTable(), and weipa::FinleyNodes::initFromDudley().
|
private |
Referenced by createNodeMappings(), freeTable(), and print().
int dudley::NodeFile::numDim |
number of spatial dimensions
Referenced by allocTable(), dudley::Assemble_getNormal(), dudley::Assemble_getSize(), dudley::Assemble_NodeCoordinates(), dudley::ElementFile::borrowJacobians(), copyTable(), dudley::DudleyDomain::dump(), gather(), gather_global(), dudley::DudleyDomain::getDim(), weipa::FinleyNodes::initFromDudley(), dudley::DudleyDomain::optimizeDOFDistribution(), print(), and setCoordinates().
|
private |
number of nodes
Referenced by allocTable(), assignMPIRankToDOFs(), copyTable(), createDenseDOFLabeling(), createDOFMappingAndCoupling(), createNodeMappings(), freeTable(), gather(), gather_global(), getDOFRange(), getGlobalDOFRange(), getGlobalIdRange(), getGlobalNodeIDIndexRange(), print(), setCoordinates(), and setTags().
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(), dudley::DudleyDomain::getStatus(), and setCoordinates().
int* dudley::NodeFile::Tag |
Tag[i] is the tag of node i.
Referenced by allocTable(), copyTable(), dudley::DudleyDomain::create2D(), dudley::DudleyDomain::dump(), freeTable(), gather(), gather_global(), dudley::DudleyDomain::getTagFromSampleNo(), weipa::FinleyNodes::initFromDudley(), print(), dudley::DudleyDomain::Print_Mesh_Info(), dudley::DudleyDomain::read(), dudley::DudleyDomain::readGmsh(), setTags(), and dudley::DudleyDomain::write().
std::vector<int> dudley::NodeFile::tagsInUse |
vector of tags which are actually used
Referenced by dudley::DudleyDomain::borrowListOfTagsInUse(), and dudley::DudleyDomain::getNumberOfTagsInUse().