ESScript
Revision_4488
|
#include <NodeFile.h>
Public Member Functions | |
NodeFile (int nDim, Esys_MPIInfo *mpiInfo) | |
~NodeFile () | |
destructor | |
void | allocTable (int numNodes) |
allocates the node table within this node file to hold NN nodes. | |
void | freeTable () |
frees the node table within this node file | |
int | getFirstReducedNode () |
int | getLastReducedNode () |
int | getGlobalNumReducedNodes () |
int * | borrowGlobalReducedNodesIndex () |
int | getFirstNode () |
int | getLastNode () |
int | getGlobalNumNodes () |
int * | borrowGlobalNodesIndex () |
int | getNumReducedNodes () |
int | getNumDegreesOfFreedom () |
int | getNumNodes () |
int | getNumReducedDegreesOfFreedom () |
int * | borrowTargetReducedNodes () |
int * | borrowTargetDegreesOfFreedom () |
int * | borrowTargetNodes () |
int * | borrowTargetReducedDegreesOfFreedom () |
int * | borrowReducedNodesTarget () |
int * | borrowDegreesOfFreedomTarget () |
int * | borrowNodesTarget () |
int * | borrowReducedDegreesOfFreedomTarget () |
int | createDenseDOFLabeling () |
int | createDenseNodeLabeling (int *node_distribution, const int *dof_distribution) |
int | createDenseReducedLabeling (int *reducedMask, bool useNodes) |
void | assignMPIRankToDOFs (int *mpiRankOfDOF, int *distribution) |
void | copyTable (int offset, int idOffset, int dofOffset, const NodeFile *in) |
void | gather (int *index, const NodeFile *in) |
void | gather_global (int *index, const NodeFile *in) |
void | scatter (int *index, const NodeFile *in) |
void | setCoordinates (const escript::Data &newX) |
copies the array newX into this->coordinates | |
void | setTags (const int newTag, const escript::Data &mask) |
sets tags to newTag where mask>0 | |
void | updateTagList () |
std::pair< int, int > | getDOFRange () const |
Private Member Functions | |
std::pair< int, int > | getGlobalIdRange () const |
std::pair< int, int > | getGlobalDOFRange () const |
std::pair< int, int > | getGlobalNodeIDIndexRange () const |
int | prepareLabeling (int *mask, std::vector< int > &buffer, std::vector< int > &distribution, bool useNodes) |
finley::NodeFile::NodeFile | ( | int | nDim, |
Esys_MPIInfo * | mpiInfo | ||
) |
constructor use NodeFile::allocTable to allocate the node table (Id,Coordinates)
References Esys_MPIInfo_getReference(), and MPIInfo.
finley::NodeFile::~NodeFile | ( | ) |
destructor
References Esys_MPIInfo_free(), freeTable(), and MPIInfo.
void finley::NodeFile::allocTable | ( | int | numNodes | ) |
allocates the node table within this node file to hold NN nodes.
References Coordinates, degreesOfFreedomId, freeTable(), globalDegreesOfFreedom, globalNodesIndex, globalReducedDOFIndex, globalReducedNodesIndex, Id, INDEX2, numDim, numNodes, reducedDegreesOfFreedomId, reducedNodesId, and Tag.
Referenced by Finley_Mesh_glueFaces(), Finley_Mesh_merge(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_resolveNodeIds(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), and Finley_RectangularMesh_Rec8().
void finley::NodeFile::assignMPIRankToDOFs | ( | int * | mpiRankOfDOF, |
int * | distribution | ||
) |
References getDOFRange(), globalDegreesOfFreedom, MPIInfo, numNodes, and Esys_MPIInfo::size.
|
inline |
References degreesOfFreedomMapping, and Finley_NodeMapping::map.
|
inline |
References globalNodesIndex.
|
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::Assemble_interpolate().
|
inline |
References nodesMapping, and Finley_NodeMapping::target.
Referenced by finley::Assemble_interpolate().
|
inline |
References reducedDegreesOfFreedomMapping, and Finley_NodeMapping::target.
Referenced by finley::Assemble_interpolate().
|
inline |
References reducedNodesMapping, and Finley_NodeMapping::target.
Referenced by finley::Assemble_interpolate().
void finley::NodeFile::copyTable | ( | int | offset, |
int | idOffset, | ||
int | dofOffset, | ||
const NodeFile * | in | ||
) |
References Coordinates, Finley_setError(), globalDegreesOfFreedom, Id, INDEX2, MEMORY_ERROR, numDim, numNodes, Tag, and TYPE_ERROR.
Referenced by Finley_Mesh_merge().
int finley::NodeFile::createDenseDOFLabeling | ( | ) |
References Esys_MPIInfo::comm, Esys_MPIInfo_mod(), FALSE, globalDegreesOfFreedom, MPI_INT, MPIInfo, Esys_MPIInfo::msg_tag_counter, numNodes, prepareLabeling(), Esys_MPIInfo::rank, Esys_MPIInfo::size, status, and TRUE.
Referenced by Finley_Mesh_prepare().
int finley::NodeFile::createDenseNodeLabeling | ( | int * | node_distribution, |
const int * | dof_distribution | ||
) |
References Esys_MPIInfo::comm, Esys_MPIInfo_mod(), globalDegreesOfFreedom, globalNodesIndex, Id, MPI_INT, MPIInfo, Esys_MPIInfo::msg_tag_counter, numNodes, Esys_MPIInfo::rank, Esys_MPIInfo::size, and status.
Referenced by Finley_Mesh_prepare().
int finley::NodeFile::createDenseReducedLabeling | ( | int * | reducedMask, |
bool | useNodes | ||
) |
References Esys_MPIInfo::comm, Esys_MPIInfo_mod(), globalDegreesOfFreedom, globalNodesIndex, globalReducedDOFIndex, globalReducedNodesIndex, MPI_INT, MPIInfo, Esys_MPIInfo::msg_tag_counter, numNodes, prepareLabeling(), Esys_MPIInfo::rank, Esys_MPIInfo::size, and status.
Referenced by Finley_Mesh_prepare().
void finley::NodeFile::freeTable | ( | ) |
frees the node table within this node file
References Coordinates, degreesOfFreedomConnector, degreesOfFreedomDistribution, degreesOfFreedomId, degreesOfFreedomMapping, Finley_NodeMapping_free(), globalDegreesOfFreedom, globalNodesIndex, globalReducedDOFIndex, globalReducedNodesIndex, Id, nodesDistribution, nodesMapping, numNodes, Paso_Connector_free(), Paso_Distribution_free(), reducedDegreesOfFreedomConnector, reducedDegreesOfFreedomDistribution, reducedDegreesOfFreedomId, reducedDegreesOfFreedomMapping, reducedNodesDistribution, reducedNodesId, reducedNodesMapping, Tag, and tagsInUse.
Referenced by allocTable(), and ~NodeFile().
void finley::NodeFile::gather | ( | int * | index, |
const NodeFile * | in | ||
) |
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_Mesh_glueFaces().
void finley::NodeFile::gather_global | ( | int * | index, |
const NodeFile * | in | ||
) |
References Esys_MPIInfo::comm, Coordinates, Esys_MPIInfo_mod(), Esys_MPIInfo_noError(), Esys_MPIInfo_setDistribution(), Finley_setError(), finley::gatherEntries(), getGlobalIdRange(), globalDegreesOfFreedom, Id, MPI_DOUBLE, MPI_INT, MPIInfo, Esys_MPIInfo::msg_tag_counter, numDim, numNodes, Esys_MPIInfo::rank, finley::scatterEntries(), Esys_MPIInfo::size, status, Tag, and VALUE_ERROR.
Referenced by Finley_Mesh_resolveNodeIds().
std::pair< int, int > finley::NodeFile::getDOFRange | ( | ) | const |
References finley::util::getMinMaxInt(), globalDegreesOfFreedom, and numNodes.
Referenced by assignMPIRankToDOFs().
|
inline |
References nodesDistribution, and Paso_Distribution_getFirstComponent().
|
inline |
References Paso_Distribution_getFirstComponent(), and reducedNodesDistribution.
|
private |
References Esys_MPIInfo::comm, finley::util::getMinMaxInt(), globalDegreesOfFreedom, MPI_INT, MPIInfo, and numNodes.
Referenced by prepareLabeling().
|
private |
References Esys_MPIInfo::comm, finley::util::getMinMaxInt(), Id, MPI_INT, MPIInfo, and numNodes.
Referenced by gather(), and gather_global().
|
private |
References Esys_MPIInfo::comm, finley::util::getMinMaxInt(), globalNodesIndex, MPI_INT, MPIInfo, and numNodes.
Referenced by prepareLabeling().
|
inline |
References nodesDistribution, and Paso_Distribution_getGlobalNumComponents().
|
inline |
References Paso_Distribution_getGlobalNumComponents(), and reducedNodesDistribution.
|
inline |
References nodesDistribution, and Paso_Distribution_getLastComponent().
|
inline |
References Paso_Distribution_getLastComponent(), and reducedNodesDistribution.
|
inline |
References degreesOfFreedomDistribution, and Paso_Distribution_getMyNumComponents().
Referenced by finley::Assemble_CopyNodalData(), and finley::Assemble_interpolate().
|
inline |
References nodesMapping, and Finley_NodeMapping::numNodes.
Referenced by finley::Assemble_CopyNodalData(), and finley::Assemble_interpolate().
|
inline |
References Paso_Distribution_getMyNumComponents(), and reducedDegreesOfFreedomDistribution.
Referenced by finley::Assemble_CopyNodalData(), and finley::Assemble_interpolate().
|
inline |
References Finley_NodeMapping::numTargets, and reducedNodesMapping.
Referenced by finley::Assemble_CopyNodalData(), and finley::Assemble_interpolate().
|
private |
References Esys_MPIInfo::comm, Esys_MPIInfo_mod(), Esys_MPIInfo_setDistribution(), getGlobalDOFRange(), getGlobalNodeIDIndexRange(), globalDegreesOfFreedom, globalNodesIndex, MPI_INT, MPIInfo, Esys_MPIInfo::msg_tag_counter, numNodes, Esys_MPIInfo::rank, Esys_MPIInfo::size, and status.
Referenced by createDenseDOFLabeling(), and createDenseReducedLabeling().
void finley::NodeFile::scatter | ( | int * | 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, Finley_increaseStatus, Finley_setError(), escript::Data::getDataPointSize(), escript::Data::getNumDataPointsPerSample(), escript::Data::getNumSamples(), escript::Data::getSampleDataRO(), INDEX2, numDim, numNodes, and VALUE_ERROR.
void finley::NodeFile::setTags | ( | const int | newTag, |
const escript::Data & | mask | ||
) |
sets tags to newTag where mask>0
References Finley_resetError(), Finley_setError(), escript::Data::getDataPointSize(), escript::Data::getNumDataPointsPerSample(), escript::Data::getNumSamples(), escript::Data::getSampleDataRO(), numNodes, Tag, TYPE_ERROR, and updateTagList().
|
inline |
References MPIInfo, numNodes, finley::util::setValuesInUse(), Tag, and tagsInUse.
Referenced by Finley_Mesh_setTagsInUse(), and setTags().
double* finley::NodeFile::Coordinates |
Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of node i.
Referenced by allocTable(), finley::Assemble_getSize(), finley::Assemble_NodeCoordinates(), finley::Assemble_setNormal(), finley::ElementFile::borrowJacobians(), copyTable(), Finley_Mesh_addPoints(), Finley_Mesh_findMatchingFaces(), Finley_Mesh_optimizeDOFDistribution(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_write(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), freeTable(), gather(), gather_global(), weipa::FinleyNodes::initFromFinley(), scatter(), and setCoordinates().
Paso_Connector* finley::NodeFile::degreesOfFreedomConnector |
Paso_Distribution* finley::NodeFile::degreesOfFreedomDistribution |
int* finley::NodeFile::degreesOfFreedomId |
Referenced by allocTable(), Finley_Mesh_createNodeFileMappings(), and freeTable().
Finley_NodeMapping* finley::NodeFile::degreesOfFreedomMapping |
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::AssembleParameters::AssembleParameters(), borrowDegreesOfFreedomTarget(), borrowTargetDegreesOfFreedom(), Finley_makePattern(), Finley_Mesh_createDOFMappingAndCoupling(), Finley_Mesh_createNodeFileMappings(), Finley_Mesh_print(), and freeTable().
int* 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 degreesOfFreedom to the same node.
Referenced by allocTable(), assignMPIRankToDOFs(), copyTable(), createDenseDOFLabeling(), createDenseNodeLabeling(), createDenseReducedLabeling(), Finley_Mesh_addPoints(), Finley_Mesh_createDOFMappingAndCoupling(), Finley_Mesh_createNodeFileMappings(), Finley_Mesh_markDOFsConnectedToRange(), Finley_Mesh_merge(), Finley_Mesh_optimizeDOFDistribution(), Finley_Mesh_optimizeDOFLabeling(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_write(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), freeTable(), gather(), gather_global(), getDOFRange(), getGlobalDOFRange(), weipa::FinleyNodes::initFromFinley(), prepareLabeling(), and scatter().
int* finley::NodeFile::globalNodesIndex |
assigns each local reduced node a global unique Id in a dense labeling
Referenced by allocTable(), borrowGlobalNodesIndex(), createDenseNodeLabeling(), createDenseReducedLabeling(), Finley_Mesh_createNodeFileMappings(), Finley_PrintMesh_Info(), freeTable(), getGlobalNodeIDIndexRange(), weipa::FinleyNodes::initFromFinley(), and prepareLabeling().
int* 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 allocTable(), createDenseReducedLabeling(), Finley_Mesh_addPoints(), Finley_Mesh_createDOFMappingAndCoupling(), Finley_Mesh_markDOFsConnectedToRange(), Finley_PrintMesh_Info(), freeTable(), and weipa::FinleyNodes::initFromFinley().
int* finley::NodeFile::globalReducedNodesIndex |
assigns each local node a global unique Id in a dense labeling. Value <0 indicates that the DOF is not used
Referenced by allocTable(), borrowGlobalReducedNodesIndex(), createDenseReducedLabeling(), Finley_PrintMesh_Info(), freeTable(), and weipa::FinleyNodes::initFromFinley().
int* finley::NodeFile::Id |
Id[i] is the id number of node i. It needs to be unique.
Referenced by allocTable(), copyTable(), createDenseNodeLabeling(), Finley_Mesh_addPoints(), Finley_Mesh_createNodeFileMappings(), Finley_Mesh_merge(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_write(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), freeTable(), gather(), gather_global(), getGlobalIdRange(), weipa::FinleyNodes::initFromFinley(), and scatter().
Esys_MPIInfo* finley::NodeFile::MPIInfo |
MPI information.
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_integrate(), assignMPIRankToDOFs(), createDenseDOFLabeling(), createDenseNodeLabeling(), createDenseReducedLabeling(), Finley_Mesh_createNodeFileMappings(), gather_global(), getGlobalDOFRange(), getGlobalIdRange(), getGlobalNodeIDIndexRange(), weipa::FinleyNodes::initFromFinley(), NodeFile(), prepareLabeling(), updateTagList(), and ~NodeFile().
Paso_Distribution* finley::NodeFile::nodesDistribution |
Finley_NodeMapping* finley::NodeFile::nodesMapping |
int finley::NodeFile::numDim |
number of spatial dimensions
Referenced by allocTable(), finley::Assemble_getSize(), finley::Assemble_NodeCoordinates(), finley::Assemble_setNormal(), finley::ElementFile::borrowJacobians(), copyTable(), Finley_Mesh_addPoints(), Finley_Mesh_findMatchingFaces(), Finley_Mesh_getDim(), Finley_Mesh_merge(), Finley_Mesh_optimizeDOFDistribution(), Finley_Mesh_print(), gather(), gather_global(), weipa::FinleyNodes::initFromFinley(), scatter(), and setCoordinates().
int finley::NodeFile::numNodes |
number of nodes
Referenced by allocTable(), finley::Assemble_CopyNodalData(), finley::Assemble_NodeCoordinates(), assignMPIRankToDOFs(), copyTable(), createDenseDOFLabeling(), createDenseNodeLabeling(), createDenseReducedLabeling(), Finley_Mesh_addPoints(), Finley_Mesh_createColoring(), Finley_Mesh_createDOFMappingAndCoupling(), Finley_Mesh_createMappings(), Finley_Mesh_createNodeFileMappings(), Finley_Mesh_merge(), Finley_Mesh_optimizeDOFDistribution(), Finley_Mesh_optimizeDOFLabeling(), Finley_Mesh_prepare(), Finley_Mesh_print(), Finley_Mesh_write(), Finley_PrintMesh_Info(), freeTable(), gather(), gather_global(), getDOFRange(), getGlobalDOFRange(), getGlobalIdRange(), getGlobalNodeIDIndexRange(), weipa::FinleyNodes::initFromFinley(), prepareLabeling(), scatter(), setCoordinates(), setTags(), and updateTagList().
Paso_Connector* finley::NodeFile::reducedDegreesOfFreedomConnector |
Paso_Distribution* finley::NodeFile::reducedDegreesOfFreedomDistribution |
int* finley::NodeFile::reducedDegreesOfFreedomId |
Referenced by allocTable(), Finley_Mesh_createNodeFileMappings(), and freeTable().
Finley_NodeMapping* finley::NodeFile::reducedDegreesOfFreedomMapping |
Referenced by finley::Assemble_CopyNodalData(), finley::Assemble_gradient(), finley::AssembleParameters::AssembleParameters(), borrowReducedDegreesOfFreedomTarget(), borrowTargetReducedDegreesOfFreedom(), Finley_makePattern(), Finley_Mesh_createDOFMappingAndCoupling(), Finley_Mesh_createNodeFileMappings(), Finley_Mesh_print(), and freeTable().
Paso_Distribution* finley::NodeFile::reducedNodesDistribution |
int* finley::NodeFile::reducedNodesId |
these are the packed versions of Id
Referenced by allocTable(), Finley_Mesh_createNodeFileMappings(), and freeTable().
Finley_NodeMapping* finley::NodeFile::reducedNodesMapping |
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(), Finley_Mesh_getStatus(), gather_global(), and prepareLabeling().
int* finley::NodeFile::Tag |
Tag[i] is the tag of node i.
Referenced by allocTable(), copyTable(), Finley_Mesh_print(), Finley_Mesh_read(), Finley_Mesh_readGmsh(), Finley_Mesh_write(), Finley_PrintMesh_Info(), Finley_RectangularMesh_Hex20(), Finley_RectangularMesh_Hex8(), Finley_RectangularMesh_Rec4(), Finley_RectangularMesh_Rec8(), freeTable(), gather(), gather_global(), weipa::FinleyNodes::initFromFinley(), scatter(), setTags(), and updateTagList().
std::vector<int> finley::NodeFile::tagsInUse |
vector of tags which are actually used
Referenced by freeTable(), and updateTagList().