Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

odaUtils.C File Reference

A collection of simple functions for supporting octree-mesh related operations. More...

#include "mpi.h"
#include "odaUtils.h"
#include "TreeNode.h"
#include "nodeAndValues.h"
#include <cstdio>
#include <iostream>
#include <cassert>
#include "oda.h"
#include "parUtils.h"
#include "seqUtils.h"

Go to the source code of this file.

Namespaces

namespace  ot

Variables for storing the various stencils used in the oda and omg module

double **** ShapeFnCoeffs = NULL

Functions

void assignBoundaryFlags (ot::DA *da, std::vector< unsigned char > &bdyFlagVec)
 Creates a nodal, non-ghosted, single dof vector and set the boundary flag for each node. The flag is one of the enumerations in BoundaryType3.
int createShapeFnCoeffs_Type1 (MPI_Comm comm)
int createShapeFnCoeffs_Type2 (MPI_Comm comm)
int createShapeFnCoeffs_Type3 (MPI_Comm comm)
void DA_Finalize ()
 Destroys the stencils used in the oda module.
void DA_Initialize (MPI_Comm comm)
 Initializes the stencils used in the oda module.
unsigned int getGlobalMaxLevel (ot::DA *da)
unsigned int getGlobalMinLevel (ot::DA *da)
unsigned int getSortOrder (unsigned int x, unsigned int y, unsigned int z, unsigned int sz)
 A function to determine the sort order, i.e. the relative orders of the indices of the 8 vertices of the current octant.
unsigned char getTouchConfig (const ot::TreeNode &curr, const ot::TreeNode &next, unsigned int maxDepth)
 A helper function required for compressing/uncompressing Pre-ghost offsets.
void includeSiblingsOfBoundary (std::vector< ot::TreeNode > &allBoundaryLeaves, const ot::TreeNode &myFirstOctant, const ot::TreeNode &myLastOctant)
void interpolateData (ot::DA *da, std::vector< double > &in, std::vector< double > &out, std::vector< double > *gradOut, unsigned int dof, std::vector< double > &pts)
 Interpolates the function and (optionally) its gradient at the specified points. The pts must be within the domain and they should not lie on the positive boundaries.
void interpolateData (ot::DA *da, Vec in, Vec out, Vec *gradOut, unsigned int dof, std::vector< double > &pts)
 Interpolates the function and (optionally) its gradient at the specified points The pts must be within the domain and they should not lie on the positive boundaries.
bool isRegularGrid (ot::DA *da)
void prepareAprioriCommMessagesInDAtype1 (const std::vector< ot::TreeNode > &in, std::vector< ot::TreeNode > &allBoundaryLeaves, std::vector< ot::TreeNode > &blocks, const std::vector< ot::TreeNode > &allBlocks, int myRank, int npes, int *sendCnt, std::vector< std::vector< unsigned int > > &sendNodes)
void prepareAprioriCommMessagesInDAtype2 (const std::vector< ot::TreeNode > &in, std::vector< ot::TreeNode > &allBoundaryLeaves, std::vector< ot::TreeNode > &blocks, const std::vector< ot::TreeNode > &minsOfBlocks, int myRank, int npes, int *sendCnt, std::vector< std::vector< unsigned int > > &sendNodes)
void writePartitionVTK (ot::DA *da, const char *outFileName)
 saves the partition in VTK format


Detailed Description

A collection of simple functions for supporting octree-mesh related operations.

Author:
Rahul S. Sampath, rahul.sampath@gmail.com

Definition in file odaUtils.C.


Function Documentation

void ot::assignBoundaryFlags ot::DA da,
std::vector< unsigned char > &  bdyFlagVec
 

Creates a nodal, non-ghosted, single dof vector and set the boundary flag for each node. The flag is one of the enumerations in BoundaryType3.

Author:
Rahul Sampath
See also:
TreeNode::BoundaryType3

Definition at line 894 of file odaUtils.C.

References ot::DA::createVector(), ot::DA::curr(), ot::DA::end(), ot::DA::getHangingNodeIndex(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::isBoundaryOctant(), ot::DA::isLUTcompressed(), ot::DA::next(), ot::DA::updateQuotientCounter(), ot::DA::vecGetBuffer(), and ot::DA::vecRestoreBuffer().

Referenced by SetDirichletJacContexts(), and SetElasticityContexts().

int ot::createShapeFnCoeffs_Type1 MPI_Comm  comm  ) 
 

Definition at line 1759 of file odaUtils.C.

References ot::ShapeFnCoeffs.

Referenced by ot::DA_Initialize().

int ot::createShapeFnCoeffs_Type2 MPI_Comm  comm  ) 
 

Definition at line 1654 of file odaUtils.C.

References ot::ShapeFnCoeffs, and par::splitComm2way().

Referenced by ot::DA_Initialize().

int ot::createShapeFnCoeffs_Type3 MPI_Comm  comm  ) 
 

Definition at line 1620 of file odaUtils.C.

References ot::ShapeFnCoeffs.

Referenced by ot::DA_Initialize().

void ot::DA_Finalize  ) 
 

Destroys the stencils used in the oda module.

Definition at line 1598 of file odaUtils.C.

References PROF_DA_FINAL_BEGIN, PROF_DA_FINAL_END, and ot::ShapeFnCoeffs.

Referenced by ot::DAMG_Finalize(), and main().

void ot::DA_Initialize MPI_Comm  comm  ) 
 

Initializes the stencils used in the oda module.

Definition at line 1582 of file odaUtils.C.

References ot::createShapeFnCoeffs_Type1(), ot::createShapeFnCoeffs_Type2(), ot::createShapeFnCoeffs_Type3(), PROF_DA_INIT_BEGIN, and PROF_DA_INIT_END.

Referenced by ot::DAMG_Initialize(), and main().

unsigned int ot::getGlobalMaxLevel ot::DA da  ) 
 

Author:
Rahul Sampath
Returns:
the maximum level in the octree

Definition at line 727 of file odaUtils.C.

References ot::DA::curr(), ot::DA::end(), ot::DA::getComm(), ot::DA::getLevel(), ot::DA::iAmActive(), ot::DA::init(), and ot::DA::next().

Referenced by ot::PrintDAMG().

unsigned int ot::getGlobalMinLevel ot::DA da  ) 
 

Author:
Rahul Sampath
Returns:
the minimum level in the octree

Definition at line 700 of file odaUtils.C.

References ot::DA::curr(), ot::DA::end(), ot::DA::getComm(), ot::DA::getLevel(), ot::DA::iAmActive(), ot::DA::init(), and ot::DA::next().

Referenced by ot::PrintDAMG().

unsigned int ot::getSortOrder unsigned int  x,
unsigned int  y,
unsigned int  z,
unsigned int  sz
 

A function to determine the sort order, i.e. the relative orders of the indices of the 8 vertices of the current octant.

Author:
Rahul Sampath

Hari Sundar

Definition at line 758 of file odaUtils.C.

unsigned char ot::getTouchConfig const ot::TreeNode curr,
const ot::TreeNode next,
unsigned int  maxDepth
 

A helper function required for compressing/uncompressing Pre-ghost offsets.

Author:
Rahul Sampath
Parameters:
curr The current pre-ghost octant
next The next pre-ghost octant
Returns:
a flag describing how the two octants touch each other (if at all they touch)

Definition at line 786 of file odaUtils.C.

References ot::TreeNode::getLevel(), ot::TreeNode::minX(), ot::TreeNode::minY(), and ot::TreeNode::minZ().

Referenced by ot::DA::DA_FactoryPart3().

void ot::includeSiblingsOfBoundary std::vector< ot::TreeNode > &  allBoundaryLeaves,
const ot::TreeNode myFirstOctant,
const ot::TreeNode myLastOctant
 

Definition at line 1125 of file odaUtils.C.

References ot::TreeNode::addChildren(), ot::TreeNode::getChildNumber(), ot::TreeNode::getParent(), PROF_ADD_BDY_SIBLINGS_BEGIN, and PROF_ADD_BDY_SIBLINGS_END.

Referenced by ot::DA::DA_FactoryPart3().

void ot::interpolateData ot::DA da,
std::vector< double > &  in,
std::vector< double > &  out,
std::vector< double > *  gradOut,
unsigned int  dof,
std::vector< double > &  pts
 

Interpolates the function and (optionally) its gradient at the specified points. The pts must be within the domain and they should not lie on the positive boundaries.

Parameters:
da The octree mesh
in input values (nodal, non-ghosted vector)
out output values
gradOut Pass NULL if gradient is not required, otherwise pass the address of the desired Vec object. gradOut will be stored such that all the components of a node are contiguous. gradOut will be multidimensional with dof_of_gradOut = dof_of_in*3. The first 3 components of gradOut correspond to the gradient of the first component of in, the next 3 correspond to the gradient of the next component of in and so on.
dof Degrees of freedom per node
pts Points to evaluate the field
Author:
Rahul Sampath

Definition at line 324 of file odaUtils.C.

References ot::DA::curr(), ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getComm(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getMinAllBlocks(), ot::DA::getNodeIndices(), ot::DA::getNpesActive(), ot::DA::getNpesAll(), ot::DA::getRankAll(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::NodeAndValues< T, ARR_LEN >::node, ot::DA::ReadFromGhostsBegin(), ot::DA::ReadFromGhostsEnd(), ot::ShapeFnCoeffs, sort(), ot::NodeAndValues< T, ARR_LEN >::values, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::x(), Point::xint(), Point::y(), Point::yint(), Point::z(), and Point::zint().

void ot::interpolateData ot::DA da,
Vec  in,
Vec  out,
Vec *  gradOut,
unsigned int  dof,
std::vector< double > &  pts
 

Interpolates the function and (optionally) its gradient at the specified points The pts must be within the domain and they should not lie on the positive boundaries.

Parameters:
da The octree mesh
in input values (nodal, non-ghosted vector)
out output values
gradOut Pass NULL if gradient is not required, otherwise pass the address of the desired Vec object. gradOut will be stored such that all the components of a node are contiguous. gradOut will be multidimensional with dof_of_gradOut = dof_of_in*3. The first 3 components of gradOut correspond to the gradient of the first component of in, the next 3 correspond to the gradient of the next component of in and so on.
dof Degrees of freedom per node
pts Points to evaluate the field
Author:
Rahul Sampath

Definition at line 35 of file odaUtils.C.

References ot::DA::curr(), ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getComm(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getMinAllBlocks(), ot::DA::getNodeIndices(), ot::DA::getNpesActive(), ot::DA::getNpesAll(), ot::DA::getRankAll(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::NodeAndValues< T, ARR_LEN >::node, ot::DA::ReadFromGhostsBegin(), ot::DA::ReadFromGhostsEnd(), ot::ShapeFnCoeffs, sort(), ot::NodeAndValues< T, ARR_LEN >::values, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::x(), Point::xint(), Point::y(), Point::yint(), Point::z(), and Point::zint().

bool ot::isRegularGrid ot::DA da  ) 
 

Author:
Rahul Sampath
Returns:
'true' if the octree is a regular grid

Definition at line 871 of file odaUtils.C.

References ot::DA::curr(), ot::DA::end(), ot::DA::getComm(), ot::DA::getRankActive(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::isHanging(), and ot::DA::next().

Referenced by main().

void ot::prepareAprioriCommMessagesInDAtype1 const std::vector< ot::TreeNode > &  in,
std::vector< ot::TreeNode > &  allBoundaryLeaves,
std::vector< ot::TreeNode > &  blocks,
const std::vector< ot::TreeNode > &  allBlocks,
int  myRank,
int  npes,
int *  sendCnt,
std::vector< std::vector< unsigned int > > &  sendNodes
 

Definition at line 1190 of file odaUtils.C.

References ot::TreeNode::getParent(), ot::TreeNode::maxX(), ot::TreeNode::maxY(), ot::TreeNode::maxZ(), ot::TreeNode::minX(), ot::TreeNode::minY(), ot::TreeNode::minZ(), PROF_DA_APRIORI_COMM_BEGIN, PROF_DA_APRIORI_COMM_END, and ot::TreeNode::setWeight().

void ot::prepareAprioriCommMessagesInDAtype2 const std::vector< ot::TreeNode > &  in,
std::vector< ot::TreeNode > &  allBoundaryLeaves,
std::vector< ot::TreeNode > &  blocks,
const std::vector< ot::TreeNode > &  minsOfBlocks,
int  myRank,
int  npes,
int *  sendCnt,
std::vector< std::vector< unsigned int > > &  sendNodes
 

Definition at line 1383 of file odaUtils.C.

References ot::TreeNode::getChildNumber(), ot::TreeNode::getDim(), ot::TreeNode::getLevel(), ot::TreeNode::getMaxDepth(), ot::TreeNode::getParent(), ot::TreeNode::getX(), ot::TreeNode::getY(), ot::TreeNode::getZ(), PROF_DA_APRIORI_COMM_BEGIN, and PROF_DA_APRIORI_COMM_END.

Referenced by ot::DA::DA_FactoryPart3().

void ot::writePartitionVTK ot::DA da,
const char *  outFilename
 

saves the partition in VTK format

Author:
Rahul Sampath

Definition at line 605 of file odaUtils.C.

References ot::completeSubtree(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getMinAllBlocks(), and ot::DA::getRankAll().

Referenced by main().


Variable Documentation

double **** ot::ShapeFnCoeffs = NULL
 

Definition at line 173 of file externVars.h.

Referenced by ot::createShapeFnCoeffs_Type1(), ot::createShapeFnCoeffs_Type2(), ot::createShapeFnCoeffs_Type3(), ot::DA_Finalize(), and ot::interpolateData().


Generated on Tue Mar 24 16:14:15 2009 for DENDRO by  doxygen 1.3.9.1