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

ot Namespace Reference

A collection of Octree specific functions. More...


Classes

struct  ot::_p_DAMG
 The Octree-Multigrid Object. More...
class  ot::cNumEtype< 0 >
class  ot::cNumEtype< 1 >
class  ot::cNumEtype< 2 >
class  ot::cNumEtype< 3 >
class  ot::cNumEtype< 4 >
class  ot::cNumEtype< 5 >
class  ot::cNumEtype< 6 >
class  ot::cNumEtype< 7 >
class  ot::DA
 Class that manages the octree mesh. More...
class  ot::FineTouchedDummyStatus
 A class used within the dummy restriction operation. More...
class  ot::FineTouchedStatus
 A private class used inside Restriction and Prolongation. More...
struct  ot::LoopCounters
class  ot::MatRecord
 A class to be used while setting values into a Matrix. More...
class  ot::NodeAndRanks
 A small helper class that pairs an octant with a list of processors. More...
class  ot::NodeAndValues< T, ARR_LEN >
 A small helper class that pairs an octant with some values. The class is templated on the length and type of the array. This class has an MPI_Datatype associated with it and it can be communicated between processors. More...
struct  ot::PC_BlockDiag
 Context for using the Block Diagonal preconditioner. More...
struct  ot::PC_KSP_Shell
 A private preconditioner object used within DAMG at the coarsest grid when not all processors are active on the coarsest grid. More...
struct  ot::TransferOpData
 Context used for storing information required by the inter-grid transfer operators. More...
class  ot::TreeNode
 A class to manage octants. More...
struct  ot::TreeNodePointer
 A wrapper for linked list based octree representation. More...
class  ot::updateContext

Private Functions

PetscErrorCode addProlongMatVec (Mat R, Vec v1, Vec v2, Vec v3)
PetscErrorCode addRestrictMatVec (Mat R, Vec v1, Vec v2, Vec v3)
PetscErrorCode createInterpolationType1 (DAMG damgc, DAMG damgf, Mat *R)
PetscErrorCode createInterpolationType2 (DAMG damgc, DAMG damgf, Mat *R)
PetscErrorCode DAMGSetUp (DAMG *damg)
PetscErrorCode DAMGSetUpLevel (DAMG *damg, KSP ksp, int nlevels)
PetscErrorCode DAMGSolveKSP (DAMG *damg, int level)
int destroyRmatType1Stencil (double *****&lut)
int destroyRmatType2Stencil (double ****&lut)
int destroyVtxMaps (unsigned short ****&map1, unsigned short *****&map2, unsigned short *****&map3, unsigned short ******&map4)
PetscErrorCode dummyRestrictMatVecType1 (TransferOpData *data)
int IreadRmatType1Stencil (double *****&lut, int rank)
int IreadRmatType2Stencil (double ****&lut, int rank)
int IreadVtxMaps (unsigned short ****&map1, unsigned short *****&map2, unsigned short *****&map3, unsigned short ******&map4, int rank)
PetscErrorCode prolongMatVecType1 (Mat R, Vec c, Vec f)
PetscErrorCode prolongMatVecType2 (Mat R, Vec c, Vec f)
int readRmatType1Stencil (double *****&lut)
int readRmatType2Stencil (double ****&lut)
int readVtxMaps (unsigned short ****&map1, unsigned short *****&map2, unsigned short *****&map3, unsigned short ******&map4)
PetscErrorCode restrictMatVecType1 (Mat R, Vec f, Vec c)
PetscErrorCode restrictMatVecType2 (Mat R, Vec f, Vec c)
PetscErrorCode rpMatDestroy (Mat R)
int scatterValues (Vec in, Vec out, PetscInt inSz, PetscInt outSz, int *&sendSz, int *&sendOff, int *&recvSz, int *&recvOff, MPI_Comm comm)
 Redistributes the vector, preserving the relative ordering of the elements.

Global Function Handle used in PC_BlockDiag

void(* computeInvBlockDiagEntriesForPC_BlockDiag )(Mat pcMat, double **invBlockDiagEntries) = NULL
void(* getDofAndNodeSizeForPC_BlockDiag )(Mat pcMat, unsigned int &dof, unsigned int &nodeSize) = NULL

Global Function Handle for using KSP_Shell

This will be used at the coarsest grid if not all processors are active on the coarsest grid

void(* getPrivateMatricesForKSP_Shell )(Mat mat, Mat *AmatPrivate, Mat *PmatPrivate, MatStructure *pFlag) = NULL

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

double ***** RmatType1Stencil = NULL
double **** RmatType2Stencil = NULL
double **** ShapeFnCoeffs = NULL
unsigned short **** VtxMap1 = NULL
unsigned short ***** VtxMap2 = NULL
unsigned short ***** VtxMap3 = NULL
unsigned short ****** VtxMap4 = NULL

Typedefs

typedef _p_DAMG * DAMG

Functions

void addBoundaryNodesType1 (std::vector< ot::TreeNode > &in, std::vector< ot::TreeNode > &bdy, unsigned int dim, unsigned int maxDepth)
 generates psuedonodes for the positive boundary and inserts them into bdy
void addBoundaryNodesType2 (std::vector< ot::TreeNode > &in, std::vector< ot::TreeNode > &bdy, unsigned int dim, unsigned int maxDepth)
void addOctantToTreeNodePointer (ot::TreeNodePointer &ptrOct, const ot::TreeNode &octant)
int addSecondRing (const std::vector< ot::TreeNode > &nodes, const std::vector< unsigned int > &firstLayer, const std::vector< ot::TreeNode > &blocks, std::vector< unsigned int > &secondRing)
int appendCompleteRegion (TreeNode first, TreeNode second, std::vector< ot::TreeNode > &newNodes, bool includeMin, bool includeMax)
 The region between min(first,second) and max(first,second) is appended to the output vector. Both ends could be inclusive, dependng on the options. The new elements are sorted, unique and linear.
void appendOctantsAtLevel (const ot::TreeNodePointer &ptrOctree, std::vector< ot::TreeNode > &wList, unsigned int lev)
bool areComparable (TreeNode first, TreeNode second)
 checks if the dim and maxdepths are the same.
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 balanceBlocks (const std::vector< TreeNode > &inp, const std::vector< TreeNode > &blocks, std::vector< TreeNode > &nodes, std::vector< TreeNode > &allBoundaryLeaves, bool incCorner, std::vector< unsigned int > *maxBlockBndVec)
int balanceOctree (std::vector< TreeNode > &in, std::vector< TreeNode > &out, unsigned int dim, unsigned int maxDepth, bool incCorner, MPI_Comm comm, MPI_Comm *newCommPtr, bool *iAmActive)
 Parallel 2:1 hybrid balance function. It uses a combination of search free and search based approaches to balancing. It does not use parallel searches. Instead, it uses a-priori communication and the concept of insulation layers to de-couple the problem of balancing.
int blockPartStage1 (std::vector< TreeNode > &nodes, std::vector< TreeNode > &blocks, unsigned int dim, unsigned int maxDepth, MPI_Comm comm)
int blockPartStage1_p2o (std::vector< TreeNode > &nodes, std::vector< TreeNode > &blocks, unsigned int dim, unsigned int maxDepth, MPI_Comm comm)
int blockPartStage2 (std::vector< TreeNode > &nodes, std::vector< TreeNode > &globalCoarse, std::vector< ot::TreeNode > &minsAllBlocks, unsigned int dim, unsigned int maxDepth, MPI_Comm comm)
int blockPartStage2_p2o (std::vector< TreeNode > &nodes, std::vector< TreeNode > &globalCoarse, std::vector< ot::TreeNode > &minsAllBlocks, unsigned int dim, unsigned int maxDepth, MPI_Comm comm)
bool bPartComparator (TreeNode a, TreeNode b)
 criteria for picking blocks inside blockPart
int coarsenOctree (const std::vector< TreeNode > &in, std::vector< TreeNode > &out, unsigned int dim, unsigned int maxDepth, MPI_Comm comm, bool skipPartition, MPI_Comm *newCommPtr, bool *iAmActive)
 Coarsens a given octree. Replaces every set of eight siblings with their parent.
int coarsenOctree (const std::vector< TreeNode > &in, std::vector< TreeNode > &out)
 A sequential version of coarsenOctree().
int comboRipple (std::vector< TreeNode > &in, bool incCorner, const unsigned int maxNum)
int completeOctree (const std::vector< TreeNode > &inp, std::vector< TreeNode > &out, unsigned int dim, unsigned int maxDepth, bool isUnique, bool isSorted, bool assertNoEmptyProcs, MPI_Comm comm)
 Constructs the complete, linear, sorted octree containing the octants in inp.
int completeSubtree (TreeNode block, const std::vector< TreeNode > &inp, std::vector< TreeNode > &out, unsigned int dim, unsigned int maxDepth, bool isUnique, bool isSorted)
 Constructs the complete, linear, sorted subtree of the block containing the octants in inp.
void convertLinearToPointer (const std::vector< ot::TreeNode > &linOct, ot::TreeNodePointer &ptrOct)
 Converts an octree from its linear representation to a linked-list representation.
void convertPointerToLinear (std::vector< ot::TreeNode > &linOct, const ot::TreeNodePointer &ptrOct)
 Converts an octree from its linked-list representation to a linear representation.
int createRegularOctree (std::vector< ot::TreeNode > &out, unsigned int lev, unsigned int dim, unsigned int maxDepth, MPI_Comm comm)
 Creates a regular grid octree.
int createShapeFnCoeffs_Type1 (MPI_Comm comm)
int createShapeFnCoeffs_Type2 (MPI_Comm comm)
int createShapeFnCoeffs_Type3 (MPI_Comm comm)
int DA_blockPartStage2 (std::vector< TreeNode > &nodes, std::vector< TreeNode > &globalCoarse, unsigned int dim, unsigned int maxDepth, MPI_Comm commActive)
int DA_blockPartStage3 (std::vector< TreeNode > &nodes, std::vector< TreeNode > &globalCoarse, std::vector< ot::TreeNode > &minsAllBlocks, unsigned int dim, unsigned int maxDepth, MPI_Comm commActive)
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.
PetscErrorCode DAMG_Finalize ()
 Destroys the stencils used in R and P.
PetscErrorCode DAMG_Initialize (MPI_Comm comm)
 Initializes the stencils used in R and P.
void DAMG_InitPrivateType1 (MPI_Comm comm)
 Loads the stencils used in R and P. Processor 0 reads the files and broadcasts to others.
void DAMG_InitPrivateType2 (MPI_Comm comm)
 Loads the stencils used in R and P. The comm is split into many groups (each group containing a maximum of 1000 processors) and the first processor in each group reads the file and broadcasts the stencils to the other processors in the group.
void DAMG_InitPrivateType3 (MPI_Comm comm)
 Loads the stencils used in R and P. No communication. Each processor opens a unique file.
PetscErrorCode DAMGCreateAndSetDA (MPI_Comm comm, int &nlevels, void *user, DAMG **damg, std::vector< ot::TreeNode > &finestOctree, unsigned int dof, double loadFac, bool compressLut, bool incCorner)
 Constructs the Multigrid object.
PetscErrorCode DAMGCreateJMatrix (DAMG damg, PetscErrorCode(*crJ)(DAMG, Mat *J))
 This is the function used to create the J matrix. This must be called before calling DAMGSetKSP if you want to set J and B to be different. If this is not called, by default J and B will be equal.
PetscErrorCode DAMGCreateJMatrix (DAMG damg, PetscErrorCode(*crjac)(DAMG, Mat *))
int DAMGCreateSuppressedDOFs (DAMG *damg)
 Call this function to allocate memory for vectors used to mark the dirichlet nodes.
PetscErrorCode DAMGDestroy (DAMG *damg)
 Destroy the DAMG object.
PetscErrorCode DAMGInitialGuessCurrent (DAMG damg, Vec vec)
 Use the current vector as the initial guess.
PetscErrorCode DAMGSetInitialGuess (DAMG *damg, PetscErrorCode(*guess)(DAMG, Vec))
 Set a function handle that will be used to generate the initial guess.
PetscErrorCode DAMGSetKSP (DAMG *damg, PetscErrorCode(*crjac)(DAMG, Mat *B), PetscErrorCode(*computeJac)(DAMG, Mat J, Mat B), PetscErrorCode(*rhs)(DAMG, Vec))
 Set function handles to create and set values in the matrices and compute the RHS.
PetscErrorCode DAMGSetKSP (DAMG *damg, PetscErrorCode(*crjac)(DAMG, Mat *), PetscErrorCode(*compJac)(DAMG, Mat, Mat), PetscErrorCode(*rhs)(DAMG, Vec))
PetscErrorCode DAMGSetNullSpace (DAMG *damg, PetscTruth, int, PetscErrorCode(*)(DAMG, Vec[]))
PetscErrorCode DAMGSetNullSpace (DAMG *damg, PetscTruth has_cnst, PetscInt n, PetscErrorCode(*func)(DAMG, Vec[]))
PetscErrorCode DAMGSolve (DAMG *damg)
 Solves the problem.
void deleteTreeNodePointer (ot::TreeNodePointer &ptrOct)
void discardExtraBoundaryOctants (std::vector< ot::TreeNode > &in, unsigned int dim, unsigned int maxDepth)
int finalMergeInBal (std::vector< ot::TreeNode > &out, std::vector< ot::TreeNode > &allBoundaryLeaves)
void findOctantOrFinestAncestor (ot::TreeNodePointer &octree, const ot::TreeNode &key, ot::TreeNodePointer *&result)
void flagNodesType1 (std::vector< ot::TreeNode > &in, MPI_Comm comm)
 Identifies hanging nodes. Uses two all2allv communications. No overlap of comm and comp.
void flagNodesType2 (std::vector< ot::TreeNode > &in, MPI_Comm comm)
 Identifies hanging nodes. It just uses 1 communication by sending apriori results. Overlaps comm and comp.
void flagNodesType3 (std::vector< ot::TreeNode > &in, MPI_Comm comm)
 Identifies hanging nodes. 2 step communication, overlapping comm and comp.
template<unsigned char cNum>
unsigned char getElemType (unsigned char hnMask)
 A function that maps a given child number and hanging mask to one of the 18 standard hanging configurations.
unsigned int getGlobalMaxLevel (ot::DA *da)
unsigned int getGlobalMinLevel (ot::DA *da)
TreeNode getNCA (TreeNode first, TreeNode second)
unsigned int getNodeWeight (const TreeNode *t)
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)
template<typename T>
void injectNodalVector (ot::DA *dac, ot::DA *daf, unsigned int dof, std::vector< T > &fVec, std::vector< T > &cVec, void(*setZero)(T &))
char int2char (int d)
int int2str (int n, char *s)
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)
bool lessThanUsingWts (TreeNode const &a, TreeNode const &b)
 A comparator that uses the weights of the octants instead of the Morton ordering.
int lineariseList (std::vector< ot::TreeNode > &list, MPI_Comm comm)
 Makes the input linear. Removes duplicates and ancestors.
int lineariseList (std::vector< ot::TreeNode > &list, bool skipLast)
 Makes the input linear. Removes duplicates and ancestors.
void markBoundaryNodesAtAllLevels (std::vector< ot::TreeNode > &finestOctree, unsigned int nlevels, std::vector< ot::TreeNode > *coarserOctrees, unsigned int maxDepth)
void markHangingNodesAtAllLevels (std::vector< ot::TreeNode > &finestOctree, unsigned int nlevels, std::vector< ot::TreeNode > *coarserOctrees, MPI_Comm *activeComms, unsigned int dim, unsigned int maxDepth)
int mergeComboBalAndPickBoundary (std::vector< ot::TreeNode > &out, std::vector< ot::TreeNode > &allBoundaryLeaves, const ot::TreeNode &firstBlock, const ot::TreeNode &lastBlock)
 Merge the input of ConBal and intra-processor ripple bal and pick the inter-processor boundaries from the result.
int mergeOctrees (std::vector< TreeNode > &inOct1, std::vector< TreeNode > &inOct2, std::vector< TreeNode > &outOct, MPI_Comm comm)
 Merges the 2 input octrees and linearizes the result.
int mergeRecvKeysInBal (const std::vector< ot::TreeNode > &recvK1, const int *recvOffsets1, const std::vector< ot::TreeNode > &recvK2, const int *recvOffsets2, int npes, std::vector< ot::TreeNode > &recvK)
std::ostream & operator<< (std::ostream &os, TreeNode const &other)
int p2oLocal (std::vector< TreeNode > &nodes, std::vector< TreeNode > &leaves, unsigned int maxNumPts, unsigned int dim, unsigned int maxDepth)
 Sequential top-down loop inside points2Octree.
int parallelRippleType1 (std::vector< TreeNode > &nodes, bool incCorners, bool checkBailOut, bool rePart, unsigned int dim, unsigned int maxDepth, MPI_Comm comm)
 An implementation of 2:1 balancing using parallel prioritized ripple propagation algorithm.
int parallelRippleType2 (std::vector< TreeNode > &nodes, bool incCorners, bool checkBailOut, bool rePart, unsigned int dim, unsigned int maxDepth, MPI_Comm comm)
 An implementation of 2:1 balancing using parallel prioritized ripple propagation algorithm.
int parallelRippleType3 (std::vector< TreeNode > &nodes, bool incCorners, bool checkBailOut, bool rePart, unsigned int dim, unsigned int maxDepth, MPI_Comm comm)
 An implementation of 2:1 balancing using parallel prioritized ripple propagation algorithm.
PetscErrorCode PC_KSP_Shell_Apply (void *ctx, Vec rhs, Vec sol)
PetscErrorCode PC_KSP_Shell_Destroy (void *ctx)
PetscErrorCode PC_KSP_Shell_SetUp (void *ctx)
PetscErrorCode PCApply_BlockDiag (PC pc, Vec x, Vec y)
PetscErrorCode PCCreate_BlockDiag (PC pc)
PetscErrorCode PCDestroy_BlockDiag (PC pc)
PetscErrorCode PCSetFromOptions_BlockDiag (PC pc)
PetscErrorCode PCSetUp_BlockDiag (PC pc)
void pickGhostCandidates (const std::vector< ot::TreeNode > &blocks, const std::vector< ot::TreeNode > &nodes, std::vector< ot::TreeNode > &res, unsigned int dim, unsigned int maxDepth)
int pickInterProcessorBoundaryNodes (const std::vector< ot::TreeNode > &nodes, std::vector< ot::TreeNode > &res, const ot::TreeNode &firstBlock, const ot::TreeNode &lastBlock)
int pickInterProcessorBoundaryNodes (const std::vector< ot::TreeNode > &nodes, std::vector< unsigned int > &res, const ot::TreeNode &firstBlock, const ot::TreeNode &lastBlock)
int pointerBasedRipple (std::vector< ot::TreeNode > &nodes, bool incCorners)
 Sequential ripple propagation algorithm using pointer based octree representation (internally). The input (linear) octree need not be complete. It can have holes.
int points2Octree (std::vector< double > &pts, double *gLens, std::vector< TreeNode > &nodes, unsigned int dim, unsigned int maxDepth, unsigned int maxNumPts, MPI_Comm comm)
 A function to construct a complete, sorted, linear octree from a set of points.
int points2OctreeSeq (std::vector< double > &pts, double *gLens, std::vector< TreeNode > &nodes, unsigned int dim, unsigned int maxDepth, unsigned int maxNumPts)
 Sequential version of points2Octree.
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)
int prepareBalComm1MessagesType1 (const std::vector< ot::TreeNode > &allBoundaryLeaves, const std::vector< ot::TreeNode > &myNhBlocks, int npes, unsigned int maxDepth, std::vector< TreeNode > *sendNodes, std::vector< unsigned int > *sentToPid, int *sendCnt)
int prepareBalComm1MessagesType2 (const std::vector< ot::TreeNode > &allBoundaryLeaves, const std::vector< ot::TreeNode > &minsAllBlocks, int rank, unsigned int dim, unsigned int maxDepth, std::vector< TreeNode > *sendNodes, std::vector< unsigned int > *sentToPid, int *sendCnt)
int prepareBalComm2Messages (const std::vector< ot::TreeNode > &allBoundaryLeaves, const std::vector< ot::TreeNode > &wList, const std::vector< std::vector< unsigned int > > &wListRanks, std::vector< TreeNode > *sendNodes, std::vector< unsigned int > *sentToPid, int *sendCnt)
int prepareWlistInBal (const std::vector< ot::TreeNode > &recvK1, const int *recvCnt, int npes, const ot::TreeNode &myFirstBlock, const ot::TreeNode &myLastBlock, std::vector< TreeNode > &wList, std::vector< std::vector< unsigned int > > &wListRanks)
void PrintDAMG (DAMG *damg)
 Prints detailed information about the meshes for each level.
int readDataPtsFromFile (char *filename, std::vector< double > &pts, std::vector< double > &ptVals)
 Reads a list of points and corresponding values from a file.
int readNodesFromFile (char *filename, std::vector< TreeNode > &nodes)
 Reads a list of octants from a file.
int readPtsFromFile (char *filename, std::vector< double > &pts)
 Reads a list of points from a file.
int refineAndPartitionOctree (const std::vector< ot::TreeNode > &inp, std::vector< ot::TreeNode > &out, MPI_Comm comm)
 Replaces every octant with its eight children and partitions the result uniformly across the processors.
int refineOctree (const std::vector< ot::TreeNode > &inp, std::vector< ot::TreeNode > &out)
 Replaces every octant with its eight children.
PetscErrorCode RegisterEvents ()
 Call this function at the beginning of the main program, just after calling PetscInitialize().
int regularGrid2Octree (const std::vector< double > &elementValues, unsigned int N, unsigned int nx, unsigned int ny, unsigned int nz, unsigned int xs, unsigned int ys, unsigned int zs, std::vector< TreeNode > &linOct, unsigned int dim, unsigned int maxDepth, double thresholdFac, MPI_Comm comm)
 A function to construct a complete, sorted, linear octree from a regular grid by coarsening the regular grid elements based on some threshold.
int ripple (std::vector< TreeNode > &nodes, bool incCorners)
 Sequential ripple propagation algorithm on linear octrees. The octree need not be complete. It can have holes.
int selectNeighboringBlocks (const std::vector< TreeNode > &allBlocks, const std::vector< TreeNode > &blocks, const std::vector< unsigned int > &maxBlockBndVec, int myRank, std::vector< TreeNode > &myNhBlocks)
int simpleCoarsen (const std::vector< TreeNode > &in, std::vector< TreeNode > &out, MPI_Comm comm)
 A naive implementation of coarsenOctree.
int writeDataPtsToFile (char *filename, std::vector< double > &pts, std::vector< double > &data)
 Writes a list of points and corresponding values from a file.
int writeNodesToFile (char *filename, const std::vector< TreeNode > &nodes)
 Writes a list of octants to a file.
void writePartitionVTK (ot::DA *da, const char *outFileName)
 saves the partition in VTK format
int writePtsToFile (char *filename, std::vector< double > &pts)
 Writes a list of points to a file.


Detailed Description

A collection of Octree specific functions.

Author:
Rahul Sampath

Hari Sundar


Typedef Documentation

typedef struct _p_DAMG* ot::DAMG
 

The multigrid object

Definition at line 453 of file omg.h.

Referenced by ComputeConstVecMass(), ComputeDirichletJacobian(), ComputeDirichletLaplacian(), ComputeElasticityMat(), ComputeElasticityRHS(), ComputeFBM2_RHS(), ComputeFBM2_RHS_Part1(), ComputeFBM2_RHS_Part2(), ComputeFBM_RHS(), ComputeFBM_RHS_Part1(), ComputeFBM_RHS_Part2(), ComputeFBM_RHS_Part3(), computeInvBlockDiagEntriesForElasticityMat(), ComputeJacobian1(), ComputeJacobian2(), ComputeJacobian3(), ComputeRandomRHS(), ComputeRHS0(), ComputeRHS1(), ComputeRHS2(), ComputeRHS3(), ComputeRHS4(), ComputeRHS5(), ComputeRHS6(), ComputeRHS7(), ComputeRHS8(), ComputeRHS9(), ComputeRHS_omgNeumann(), ComputeSol(), ComputeTestFBM_RHS(), ConstVecMassMatGetDiagonal(), ConstVecMassMatMult(), CreateAndComputeFullActiveJacobian1(), CreateAndComputeFullJacobian1(), CreateAndComputeMassMatrix(), CreateConstVecMass(), CreateDirichletJacobian(), CreateDirichletLaplacian(), CreateElasticityMat(), CreateJacobian1(), CreateJacobian2(), CreateJacobian3(), CreateTmpDirichletJacobian(), CreateTmpDirichletLaplacian(), DAMGCreateAndSetDA(), DAMGCreateJMatrix(), DAMGCreateSuppressedDOFs(), DAMGDestroy(), DAMGSetKSP(), DestroyDirichletJacContexts(), DestroyElasticityContexts(), DestroyUserContexts(), DirichletJacobianMatGetDiagonal(), DirichletJacobianMatMult(), DirichletJacobianShellMatMult(), DirichletLaplacianMatGetDiagonal(), DirichletLaplacianMatMult(), DirichletLaplacianShellMatMult(), ElasticityMatGetDiagonal(), ElasticityMatMult(), ElasticityShellMatMult(), EnforceZeroFBM(), EnforceZeroFBM2(), getActiveStateAndActiveCommForKSP_Shell_DirichletJac(), getActiveStateAndActiveCommForKSP_Shell_Elas(), getActiveStateAndActiveCommForKSP_Shell_Jac2or3(), getDofAndNodeSizeForElasticityMat(), getPrivateMatricesForKSP_Shell_DirichletJac(), getPrivateMatricesForKSP_Shell_Elas(), getPrivateMatricesForKSP_Shell_Jac2(), getPrivateMatricesForKSP_Shell_Jac3(), Jacobian2MatGetDiagonal(), Jacobian2MatMult(), Jacobian2ShellMatMult(), Jacobian3MatGetDiagonal(), Jacobian3MatMult(), Jacobian3ShellMatMult(), main(), SetCoarseToFineFromPts(), SetDirichletJacContexts(), SetElasticityContexts(), SetPDECoefFromPts(), SetSolutionFBM(), SetSolutionFBM2(), SetUserContexts(), SetUserContextsCoarsestToFinest(), SetUserContextsFromPts(), solve_neumann(), solve_neumann_oct(), TmpDirichletJacobianMatMult(), and TmpDirichletLaplacianMatMult().


Function Documentation

void ot::addBoundaryNodesType1 (  std::vector< ot::TreeNode > &  in,
std::vector< ot::TreeNode > &  bdy,
unsigned int  dim,
unsigned int  maxDepth
) 
 

generates psuedonodes for the positive boundary and inserts them into bdy

Author:
Hari Sundar

Rahul Sampath

Parameters:
in The input octree. This will be modified so that the original octree is embedded into a larger octree.
bdy A list to store the pseudo-octants for the positive boundary

Definition at line 626 of file OctFunctions.C.

References ot::TreeNode::getLevel(), ot::TreeNode::getX(), ot::TreeNode::getY(), ot::TreeNode::getZ(), PROF_ADD_BDY_BEGIN, and PROF_ADD_BDY_END.

Referenced by ot::DA::DA_FactoryPart1(), and DAMGCreateAndSetDA().

void ot::addBoundaryNodesType2 (  std::vector< ot::TreeNode > &  in,
std::vector< ot::TreeNode > &  bdy,
unsigned int  dim,
unsigned int  maxDepth
) 
 

Definition at line 473 of file OctFunctions.C.

References ot::TreeNode::getLevel(), ot::TreeNode::getX(), ot::TreeNode::getY(), ot::TreeNode::getZ(), PROF_ADD_BDY_BEGIN, and PROF_ADD_BDY_END.

void ot::addOctantToTreeNodePointer (  ot::TreeNodePointer &  ptrOct,
const ot::TreeNode &  octant
) 
 

Definition at line 44 of file TreeNodePointer.C.

References ot::TreeNode::addChildren(), ot::TreeNode::isAncestor(), ot::TreeNodePointer::m_tnMe, and ot::TreeNodePointer::m_tnpMyChildren.

Referenced by convertLinearToPointer(), and pointerBasedRipple().

PetscErrorCode ot::addProlongMatVec (  Mat  R,
Vec  v1,
Vec  v2,
Vec  v3
) 
 

Definition at line 32 of file ProlongMatVec.C.

References iC.

Referenced by createInterpolationType1(), and createInterpolationType2().

PetscErrorCode ot::addRestrictMatVec (  Mat  R,
Vec  v1,
Vec  v2,
Vec  v3
) 
 

Definition at line 32 of file RestrictMatVec.C.

References iC.

Referenced by createInterpolationType1(), and createInterpolationType2().

int ot::addSecondRing (  const std::vector< ot::TreeNode > &  nodes,
const std::vector< unsigned int > &  firstLayer,
const std::vector< ot::TreeNode > &  blocks,
std::vector< unsigned int > &  secondRing
) 
 

Definition at line 748 of file odaPartition.C.

References ot::TreeNode::isBoundaryOctant().

Referenced by pickGhostCandidates().

int ot::appendCompleteRegion (  TreeNode  first,
TreeNode  second,
std::vector< ot::TreeNode > &  out,
bool  includeMin,
bool  includeMax
) 
 

The region between min(first,second) and max(first,second) is appended to the output vector. Both ends could be inclusive, dependng on the options. The new elements are sorted, unique and linear.

Author:
Rahul Sampath

Parameters:
includeMin include min(first,second)
includeMax include max(first,second)

Definition at line 1032 of file Construct.C.

References ot::TreeNode::addChildren(), areComparable(), ot::TreeNode::getDim(), ot::TreeNode::getMaxDepth(), getNCA(), ot::TreeNode::getParent(), PROF_COMPLETE_REGION_BEGIN, and PROF_COMPLETE_REGION_END.

Referenced by blockPartStage1(), blockPartStage1_p2o(), completeOctree(), and completeSubtree().

void ot::appendOctantsAtLevel (  const ot::TreeNodePointer &  ptrOctree,
std::vector< ot::TreeNode > &  wList,
unsigned int  lev
) 
 

Definition at line 13 of file TreeNodePointer.C.

References ot::TreeNode::getLevel(), ot::TreeNodePointer::m_tnMe, and ot::TreeNodePointer::m_tnpMyChildren.

Referenced by pointerBasedRipple().

bool ot::areComparable (  TreeNode  first,
TreeNode  second
) 
 

checks if the dim and maxdepths are the same.

Returns:
true if first and second are comparable

Definition at line 431 of file OctFunctions.C.

References ot::TreeNode::getDim(), and ot::TreeNode::getMaxDepth().

Referenced by ot::TreeNode::addBalancingDescendants(), appendCompleteRegion(), balanceBlocks(), balanceOctree(), ot::TreeNode::balanceSubtree(), blockPartStage1(), blockPartStage2(), blockPartStage2_p2o(), comboRipple(), completeOctree(), ot::TreeNode::completeSubtree(), completeSubtree(), finalMergeInBal(), getNCA(), lineariseList(), mergeComboBalAndPickBoundary(), p2oLocal(), parallelRippleType1(), parallelRippleType2(), parallelRippleType3(), ot::TreeNode::pickInternalBoundaryCells(), prepareBalComm2Messages(), prepareWlistInBal(), ripple(), and ot::TreeNode::splitInternalAndBoundaryCells().

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::balanceBlocks (  const std::vector< TreeNode > &  inp,
const std::vector< TreeNode > &  blocks,
std::vector< TreeNode > &  nodes,
std::vector< TreeNode > &  allBoundaryLeaves,
bool  incCorners,
std::vector< unsigned int > *  maxBlockBndVec = NULL
) 
 

Definition at line 912 of file Balance.C.

References areComparable(), ot::TreeNode::balanceSubtree(), ot::TreeNode::getMaxDepth(), ot::TreeNode::pickInternalBoundaryCells(), PROF_CON_BAL_BEGIN, and PROF_CON_BAL_END.

Referenced by balanceOctree(), and comboRipple().

int ot::balanceOctree (  std::vector< TreeNode > &  in,
std::vector< TreeNode > &  out,
unsigned int  dim,
unsigned int  maxDepth,
bool  incCorner,
MPI_Comm  comm,
MPI_Comm *  newCommPtr = NULL,
bool *  iAmActive = NULL
) 
 

Parallel 2:1 hybrid balance function. It uses a combination of search free and search based approaches to balancing. It does not use parallel searches. Instead, it uses a-priori communication and the concept of insulation layers to de-couple the problem of balancing.

Author:
Rahul Sampath

Hari Sundar

Parameters:
in a sorted, complete, linear octree
out a sorted, complete, linear, balanced octree
dim the dimension of the tree (1 for binary trees, 2 for quadtrees and 3 for octrees)
maxDepth the maximum depth of the octree must be <= _MAX_LEVEL_
incCorner 'true' to balance across corners as well and 'false' otherwise. in is cleared inside the function
See also:
_MAX_LEVEL_

Definition at line 31 of file Balance.C.

References areComparable(), balanceBlocks(), blockPartStage1(), blockPartStage2(), comboRipple(), DendroIntL, finalMergeInBal(), ot::TreeNode::getDLD(), ot::TreeNode::isAncestor(), mergeComboBalAndPickBoundary(), mergeRecvKeysInBal(), prepareBalComm1MessagesType2(), prepareBalComm2Messages(), prepareWlistInBal(), PROF_BAL_BEGIN, PROF_BAL_BPART1_BEGIN, PROF_BAL_BPART1_END, PROF_BAL_BPART2_BEGIN, PROF_BAL_BPART2_END, PROF_BAL_COMM_BEGIN, PROF_BAL_COMM_END, PROF_BAL_END, PROF_BAL_SCATTER_BEGIN, PROF_BAL_SCATTER_END, PROF_BAL_SPLIT_COMM_BEGIN, PROF_BAL_SPLIT_COMM_END, ripple(), selectNeighboringBlocks(), and par::splitCommUsingSplittingRank().

Referenced by DAMGCreateAndSetDA(), main(), solve_neumann(), and solve_neumann_oct().

int ot::blockPartStage1 (  std::vector< TreeNode > &  nodes,
std::vector< TreeNode > &  blocks,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm
) 
 

Definition at line 507 of file BlockPart.C.

References ot::TreeNode::addWeight(), appendCompleteRegion(), areComparable(), completeOctree(), PROF_BLKPART1_BEGIN, PROF_BLKPART1_END, ot::TreeNode::setWeight(), and sort().

Referenced by balanceOctree(), and ot::DA::DA_FactoryPart3().

int ot::blockPartStage1_p2o (  std::vector< TreeNode > &  nodes,
std::vector< TreeNode > &  blocks,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm
) 
 

Definition at line 28 of file BlockPart.C.

References appendCompleteRegion(), completeOctree(), PROF_BLKPART1_BEGIN, and PROF_BLKPART1_END.

Referenced by points2Octree().

int ot::blockPartStage2 (  std::vector< TreeNode > &  nodes,
std::vector< TreeNode > &  blocks,
std::vector< ot::TreeNode > &  minsAllBlocks,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm
) 
 

Definition at line 608 of file BlockPart.C.

References ot::TreeNode::addWeight(), areComparable(), PROF_BLKPART2_BEGIN, PROF_BLKPART2_END, and ot::TreeNode::setWeight().

Referenced by balanceOctree().

int ot::blockPartStage2_p2o (  std::vector< TreeNode > &  nodes,
std::vector< TreeNode > &  blocks,
std::vector< ot::TreeNode > &  minsAllBlocks,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm
) 
 

Definition at line 88 of file BlockPart.C.

References ot::TreeNode::addWeight(), areComparable(), PROF_BLKPART2_BEGIN, PROF_BLKPART2_END, and ot::TreeNode::setWeight().

Referenced by points2Octree().

bool ot::bPartComparator (  TreeNode  a,
TreeNode  b
) 
 

criteria for picking blocks inside blockPart

Returns:
true if a < b according to the criteria

Definition at line 267 of file OctFunctions.C.

References ot::TreeNode::getLevel(), and ot::TreeNode::getWeight().

int ot::coarsenOctree (  const std::vector< TreeNode > &  in,
std::vector< TreeNode > &  out,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm,
bool  skipPartition = false,
MPI_Comm *  newCommPtr = NULL,
bool *  iAmActive = NULL
) 
 

Coarsens a given octree. Replaces every set of eight siblings with their parent.

Author:
Rahul Sampath
Parameters:
in the input vector. This must be sorted, complete and linear. Need not be 2:1 balanced.
out the output vector. This will be sorted, complete and linear.
dim the dimension of the tree (1 for binary trees, 2 for quadtrees and 3 for octrees)
maxDepth the maximum depth of the octree must be <= _MAX_LEVEL_

Definition at line 106 of file Coarsen.C.

References DendroIntL, PROF_COARSE_BEGIN, PROF_COARSE_END, and par::splitCommUsingSplittingRank().

int ot::coarsenOctree (  const std::vector< TreeNode > &  in,
std::vector< TreeNode > &  out
) 
 

A sequential version of coarsenOctree().

Author:
Rahul Sampath
See also:
coarsenOctree()

Definition at line 53 of file Coarsen.C.

References PROF_COARSE_SEQ_BEGIN, and PROF_COARSE_SEQ_END.

Referenced by DAMGCreateAndSetDA(), and main().

int ot::comboRipple (  std::vector< TreeNode > &  in,
bool  incCorner,
const unsigned int  maxNum = _COMBO_RIPPLE_FACTOR_
) 
 

Definition at line 767 of file Balance.C.

References ot::TreeNode::addChildren(), areComparable(), balanceBlocks(), getNCA(), ot::TreeNode::pickInternalBoundaryCells(), PROF_COMBO_RIPPLE_BEGIN, PROF_COMBO_RIPPLE_END, and ripple().

Referenced by balanceOctree().

int ot::completeOctree (  const std::vector< TreeNode > &  in,
std::vector< TreeNode > &  out,
unsigned int  dim,
unsigned int  maxDepth,
bool  isUnique,
bool  isSorted,
bool  assertNoEmptyProcs,
MPI_Comm  comm
) 
 

Constructs the complete, linear, sorted octree containing the octants in inp.

Author:
Rahul Sampath
Parameters:
inp a set of octants
out the result
isSorted 'true' if the input is sorted
isUnique 'true' if the input is free from duplicates
assertNoEmptyProcs 'true' if the input will be non-empty on every processor even after removing duplicates across processors.
dim the dimension of the tree (1 for binary trees, 2 for quadtrees and 3 for octrees)
maxDepth the maximum depth of the octree must be <= _MAX_LEVEL_
See also:
completeSubtree()

Definition at line 518 of file Construct.C.

References ot::TreeNode::addChildren(), appendCompleteRegion(), areComparable(), completeSubtree(), getNCA(), ot::TreeNode::isAncestor(), PROF_N2O_BEGIN, PROF_N2O_END, and par::splitComm2way().

Referenced by blockPartStage1(), blockPartStage1_p2o(), main(), simpleCoarsen(), and solve_neumann_oct().

int ot::completeSubtree (  TreeNode  block,
const std::vector< TreeNode > &  inp,
std::vector< TreeNode > &  out,
unsigned int  dim,
unsigned int  maxDepth,
bool  isUnique,
bool  isSorted
) 
 

Constructs the complete, linear, sorted subtree of the block containing the octants in inp.

Author:
Rahul Sampath
Parameters:
block the root of the subtree
inp a set of decendants of block
out the result
isSorted 'true' if the input is sorted
isUnique 'true' if the input is free from duplicates
dim the dimension of the tree (1 for binary trees, 2 for quadtrees and 3 for octrees)
maxDepth the maximum depth of the octree must be <= _MAX_LEVEL_

Definition at line 667 of file Construct.C.

References ot::TreeNode::addChildren(), appendCompleteRegion(), areComparable(), ot::TreeNode::getDFD(), ot::TreeNode::getDLD(), getNCA(), PROF_N2O_SEQ_BEGIN, PROF_N2O_SEQ_END, and sort().

Referenced by completeOctree(), main(), and writePartitionVTK().

void ot::convertLinearToPointer (  const std::vector< ot::TreeNode > &  linOct,
ot::TreeNodePointer &  ptrOct
) 
 

Converts an octree from its linear representation to a linked-list representation.

Author:
Rahul Sampath
Parameters:
linOct linear octree
ptrOct linked list octree

Definition at line 26 of file TreeNodePointer.C.

References addOctantToTreeNodePointer(), ot::TreeNodePointer::m_tnMe, and ot::TreeNodePointer::m_tnpMyChildren.

Referenced by pointerBasedRipple().

void ot::convertPointerToLinear (  std::vector< ot::TreeNode > &  linOct,
const ot::TreeNodePointer &  ptrOct
) 
 

Converts an octree from its linked-list representation to a linear representation.

Author:
Rahul Sampath
Parameters:
linOct linear octree
ptrOct linked list octree

Definition at line 86 of file TreeNodePointer.C.

References ot::TreeNodePointer::m_tnMe, and ot::TreeNodePointer::m_tnpMyChildren.

Referenced by pointerBasedRipple().

PetscErrorCode ot::createInterpolationType1 (  DAMG  damgc,
DAMG  damgf,
Mat *  R
) 
 

Definition at line 2206 of file omg.C.

References addProlongMatVec(), ot::TransferOpData::addPtmp, addRestrictMatVec(), ot::TransferOpData::addRtmp, ot::TransferOpData::comm, ot::_p_DAMG::comm, ot::DA::createVector(), ot::_p_DAMG::da, ot::TransferOpData::dac, ot::TransferOpData::daf, ot::TransferOpData::dof, ot::_p_DAMG::dof, dummyRestrictMatVecType1(), ot::TransferOpData::fineTouchedFlags, ot::DA::getIndependentSize(), ot::DA::getNodeSize(), iC, ot::TransferOpData::minIndependentSize, PROF_MG_CREATE_RP1_BEGIN, PROF_MG_CREATE_RP1_END, prolongMatVecType1(), ot::TransferOpData::recvOffP, ot::TransferOpData::recvOffR, ot::TransferOpData::recvSzP, ot::TransferOpData::recvSzR, restrictMatVecType1(), rpMatDestroy(), ot::TransferOpData::sendOffP, ot::TransferOpData::sendOffR, ot::TransferOpData::sendSzP, ot::TransferOpData::sendSzR, ot::_p_DAMG::suppressedDOF, ot::TransferOpData::suppressedDOFc, ot::TransferOpData::suppressedDOFf, and ot::TransferOpData::tmp.

Referenced by DAMGSetUp().

PetscErrorCode ot::createInterpolationType2 (  DAMG  damgc,
DAMG  damgf,
Mat *  R
) 
 

Definition at line 2264 of file omg.C.

References addProlongMatVec(), ot::TransferOpData::addPtmp, addRestrictMatVec(), ot::TransferOpData::addRtmp, ot::TransferOpData::comm, ot::_p_DAMG::comm, ot::DA::createVector(), ot::_p_DAMG::da, ot::_p_DAMG::da_aux, ot::TransferOpData::dac, ot::TransferOpData::daf, ot::TransferOpData::dof, ot::_p_DAMG::dof, dummyRestrictMatVecType1(), ot::TransferOpData::fineTouchedFlags, ot::DA::getIndependentSize(), ot::DA::getNodeSize(), iC, ot::TransferOpData::minIndependentSize, PROF_MG_CREATE_RP2_BEGIN, PROF_MG_CREATE_RP2_END, prolongMatVecType2(), ot::TransferOpData::recvOffP, ot::TransferOpData::recvOffR, ot::TransferOpData::recvSzP, ot::TransferOpData::recvSzR, restrictMatVecType2(), rpMatDestroy(), ot::TransferOpData::sendOffP, ot::TransferOpData::sendOffR, ot::TransferOpData::sendSzP, ot::TransferOpData::sendSzR, ot::_p_DAMG::suppressedDOF, ot::_p_DAMG::suppressedDOFaux, ot::TransferOpData::suppressedDOFc, ot::TransferOpData::suppressedDOFf, and ot::TransferOpData::tmp.

Referenced by DAMGSetUp().

int ot::createRegularOctree (  std::vector< ot::TreeNode > &  out,
unsigned int  lev,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm
) 
 

Creates a regular grid octree.

Author:
Rahul Sampath
Parameters:
out the result
lev the level of each octant
dim the dimension of the tree (1 for binary trees, 2 for quadtrees and 3 for octrees)
maxDepth the maximum depth of the octree must be <= _MAX_LEVEL_

Definition at line 153 of file OctFunctions.C.

References refineAndPartitionOctree().

Referenced by main().

int ot::createShapeFnCoeffs_Type1 (  MPI_Comm  comm  ) 
 

Definition at line 1759 of file odaUtils.C.

References ShapeFnCoeffs.

Referenced by DA_Initialize().

int ot::createShapeFnCoeffs_Type2 (  MPI_Comm  comm  ) 
 

Definition at line 1654 of file odaUtils.C.

References ShapeFnCoeffs, and par::splitComm2way().

Referenced by DA_Initialize().

int ot::createShapeFnCoeffs_Type3 (  MPI_Comm  comm  ) 
 

Definition at line 1620 of file odaUtils.C.

References ShapeFnCoeffs.

Referenced by DA_Initialize().

int ot::DA_blockPartStage2 (  std::vector< TreeNode > &  nodes,
std::vector< TreeNode > &  globalCoarse,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  commActive
) 
 

Definition at line 158 of file odaPartition.C.

References ot::TreeNode::addWeight(), ot::TreeNode::getDFD(), ot::TreeNode::getParent(), PROF_BLKPART2_BEGIN, PROF_BLKPART2_END, and ot::TreeNode::setWeight().

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

int ot::DA_blockPartStage3 (  std::vector< TreeNode > &  nodes,
std::vector< TreeNode > &  globalCoarse,
std::vector< ot::TreeNode > &  minsAllBlocks,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  commActive
) 
 

Definition at line 500 of file odaPartition.C.

References PROF_BLKPART3_BEGIN, and PROF_BLKPART3_END.

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

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 ShapeFnCoeffs.

Referenced by 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 createShapeFnCoeffs_Type1(), createShapeFnCoeffs_Type2(), createShapeFnCoeffs_Type3(), PROF_DA_INIT_BEGIN, and PROF_DA_INIT_END.

Referenced by DAMG_Initialize(), and main().

PetscErrorCode ot::DAMG_Finalize (   ) 
 

Destroys the stencils used in R and P.

Definition at line 664 of file omg.C.

References DA_Finalize(), destroyRmatType1Stencil(), destroyRmatType2Stencil(), destroyVtxMaps(), PROF_MG_FINAL_BEGIN, PROF_MG_FINAL_END, RmatType1Stencil, RmatType2Stencil, VtxMap1, VtxMap2, VtxMap3, and VtxMap4.

Referenced by main().

PetscErrorCode ot::DAMG_Initialize (  MPI_Comm  comm  ) 
 

Initializes the stencils used in R and P.

Definition at line 62 of file omg.C.

References DA_Initialize(), DAMG_InitPrivateType1(), DAMG_InitPrivateType2(), DAMG_InitPrivateType3(), PROF_MG_INIT_BEGIN, and PROF_MG_INIT_END.

Referenced by main().

void ot::DAMG_InitPrivateType1 (  MPI_Comm  comm  ) 
 

Loads the stencils used in R and P. Processor 0 reads the files and broadcasts to others.

Definition at line 391 of file omg.C.

References readRmatType1Stencil(), readRmatType2Stencil(), readVtxMaps(), RmatType1Stencil, RmatType2Stencil, VtxMap1, VtxMap2, VtxMap3, and VtxMap4.

Referenced by DAMG_Initialize().

void ot::DAMG_InitPrivateType2 (  MPI_Comm  comm  ) 
 

Loads the stencils used in R and P. The comm is split into many groups (each group containing a maximum of 1000 processors) and the first processor in each group reads the file and broadcasts the stencils to the other processors in the group.

Definition at line 91 of file omg.C.

References IreadRmatType1Stencil(), IreadRmatType2Stencil(), IreadVtxMaps(), RmatType1Stencil, RmatType2Stencil, par::splitComm2way(), VtxMap1, VtxMap2, VtxMap3, and VtxMap4.

Referenced by DAMG_Initialize().

void ot::DAMG_InitPrivateType3 (  MPI_Comm  comm  ) 
 

Loads the stencils used in R and P. No communication. Each processor opens a unique file.

Definition at line 80 of file omg.C.

References IreadRmatType1Stencil(), IreadRmatType2Stencil(), IreadVtxMaps(), RmatType1Stencil, RmatType2Stencil, VtxMap1, VtxMap2, VtxMap3, and VtxMap4.

Referenced by DAMG_Initialize().

PetscErrorCode ot::DAMGCreateAndSetDA (  MPI_Comm  comm,
int &  nlevels,
void *  user,
DAMG **  damg,
std::vector< ot::TreeNode > &  finestOctree,
unsigned int  dof = 1,
double  loadFac = 1.5,
bool  compressLut = true,
bool  incCorner = true
) 
 

Constructs the Multigrid object.

Parameters:
comm The communicator
nlevels maximum number of multigrid levels. This may be reset to something smaller within the function.
user User context
damg The multigrid object
finestOctree A 2:1 balanced octree for the finest level. This will be destroyed within the function
dof Degrees of freedom per node
loadFac Tolerance on load imbalance at each level
compressLut Option to compress the element-to-node mappings at each level
incCorner Option to balance across corners as well
Returns:
error flag

Definition at line 1291 of file omg.C.

References addBoundaryNodesType1(), ot::_p_DAMG::B, ot::_p_DAMG::b, balanceOctree(), coarsenOctree(), ot::_p_DAMG::comm, ot::_p_DAMG::da, ot::_p_DAMG::da_aux, DAMG, DAMGSetUp(), DendroIntL, ot::_p_DAMG::dof, ot::DA::getBlocks(), ot::DA::getCommActive(), ot::DA::getElementSize(), ot::DA::getIdxElementBegin(), ot::DA::getIndependentSize(), ot::DA::getNpesActive(), ot::DA::iAmActive(), ot::_p_DAMG::initialguess, ot::_p_DAMG::J, ot::_p_DAMG::ksp, markHangingNodesAtAllLevels(), ot::_p_DAMG::nlevels, PROF_MG_SET_DA_BEGIN, PROF_MG_SET_DA_END, PROF_SET_DA_STAGE1_BEGIN, PROF_SET_DA_STAGE1_END, PROF_SET_DA_STAGE2_BEGIN, PROF_SET_DA_STAGE2_END, PROF_SET_DA_STAGE3_BEGIN, PROF_SET_DA_STAGE3_END, PROF_SET_DA_STAGE4_BEGIN, PROF_SET_DA_STAGE4_END, PROF_SET_DA_STAGE5_BEGIN, PROF_SET_DA_STAGE5_END, PROF_SET_DA_STAGE6_BEGIN, PROF_SET_DA_STAGE6_END, ot::_p_DAMG::R, ot::_p_DAMG::r, ot::_p_DAMG::rhs, ot::_p_DAMG::solve, par::splitComm2way(), par::splitCommUsingSplittingRank(), ot::_p_DAMG::suppressedDOF, ot::_p_DAMG::suppressedDOFaux, ot::_p_DAMG::totalLevels, ot::_p_DAMG::user, writeNodesToFile(), and ot::_p_DAMG::x.

Referenced by main(), solve_neumann(), and solve_neumann_oct().

PetscErrorCode DAMGCreateJMatrix (  DAMG  damg,
PetscErrorCode(*)(DAMG, Mat *J)  crJ
) 
 

This is the function used to create the J matrix. This must be called before calling DAMGSetKSP if you want to set J and B to be different. If this is not called, by default J and B will be equal.

PetscErrorCode DAMGCreateJMatrix (  DAMG  damg,
PetscErrorCode(*)(DAMG, Mat *)  crjac
) 
 

Definition at line 755 of file omg.C.

References DAMG.

Referenced by main().

int ot::DAMGCreateSuppressedDOFs (  DAMG *  damg  ) 
 

Call this function to allocate memory for vectors used to mark the dirichlet nodes.

Definition at line 43 of file omg.C.

References ot::_p_DAMG::da, ot::_p_DAMG::da_aux, DAMG, ot::_p_DAMG::dof, ot::DA::getLocalBufferSize(), ot::_p_DAMG::nlevels, ot::_p_DAMG::suppressedDOF, and ot::_p_DAMG::suppressedDOFaux.

Referenced by main().

PetscErrorCode ot::DAMGDestroy (  DAMG *  damg  ) 
 

Destroy the DAMG object.

Definition at line 676 of file omg.C.

References ot::_p_DAMG::B, ot::_p_DAMG::b, ot::_p_DAMG::da, ot::_p_DAMG::da_aux, DAMG, ot::_p_DAMG::J, ot::_p_DAMG::ksp, ot::_p_DAMG::nlevels, ot::_p_DAMG::r, ot::_p_DAMG::R, ot::_p_DAMG::suppressedDOF, ot::_p_DAMG::suppressedDOFaux, and ot::_p_DAMG::x.

Referenced by main().

PetscErrorCode ot::DAMGInitialGuessCurrent (  DAMG  ,
Vec 
) 
 

Use the current vector as the initial guess.

Definition at line 1102 of file omg.C.

PetscErrorCode ot::DAMGSetInitialGuess (  DAMG *  ,
PetscErrorCode(*)(DAMG, Vec) 
) 
 

Set a function handle that will be used to generate the initial guess.

Definition at line 1094 of file omg.C.

References ot::_p_DAMG::initialguess, and ot::_p_DAMG::nlevels.

Referenced by main().

PetscErrorCode DAMGSetKSP (  DAMG *  damg,
PetscErrorCode(*)(DAMG, Mat *B)  crjac,
PetscErrorCode(*)(DAMG, Mat J, Mat B)  computeJac,
PetscErrorCode(*)(DAMG, Vec)  rhs
) 
 

Set function handles to create and set values in the matrices and compute the RHS.

Parameters:
damg the multigrid object
crjac function handle to the function that allocates memory for the precondition matrix at each level
computeJac function handle to the function that sets matrix entries/ setups the matrices at each level.
rhs function handle to compute the RHS vector

Referenced by main().

PetscErrorCode DAMGSetKSP (  DAMG *  damg,
PetscErrorCode(*)(DAMG, Mat *)  crjac,
PetscErrorCode(*)(DAMG, Mat, Mat)  compJac,
PetscErrorCode(*)(DAMG, Vec)  rhs
) 
 

Definition at line 770 of file omg.C.

References ot::_p_DAMG::B, ot::PC_KSP_Shell::commActive, ot::_p_DAMG::da, DAMG, DAMGSetUpLevel(), ot::DA::getCommActive(), ot::DA::getNpesActive(), ot::DA::getNpesAll(), ot::DA::iAmActive(), ot::PC_KSP_Shell::iAmActive, ot::_p_DAMG::J, ot::_p_DAMG::ksp, ot::PC_KSP_Shell::ksp_private, ot::_p_DAMG::nlevels, ot::PC_KSP_Shell::pc, PC_KSP_Shell_Apply(), PC_KSP_Shell_Destroy(), PC_KSP_Shell_SetUp(), PROF_MG_SET_KSP_BEGIN, PROF_MG_SET_KSP_END, ot::_p_DAMG::rhs, ot::PC_KSP_Shell::rhs_private, ot::PC_KSP_Shell::sol_private, and ot::_p_DAMG::solve.

Referenced by main(), solve_neumann(), and solve_neumann_oct().

PetscErrorCode DAMGSetNullSpace (  DAMG *  damg,
PetscTruth  ,
int  ,
PetscErrorCode(*)(DAMG, Vec[]) 
) 
 

PetscErrorCode DAMGSetNullSpace (  DAMG *  damg,
PetscTruth  has_cnst,
PetscInt  n,
PetscErrorCode(*)(DAMG, Vec[])  func
) 
 

Definition at line 1038 of file omg.C.

References ot::_p_DAMG::ksp, and ot::_p_DAMG::nlevels.

PetscErrorCode ot::DAMGSetUp (  DAMG *  damg  ) 
 

Definition at line 2145 of file omg.C.

References createInterpolationType1(), createInterpolationType2(), ot::DA::createVector(), ot::_p_DAMG::da, ot::_p_DAMG::da_aux, ot::_p_DAMG::nlevels, PROF_MG_SETUP_BEGIN, and PROF_MG_SETUP_END.

Referenced by DAMGCreateAndSetDA().

PetscErrorCode ot::DAMGSetUpLevel (  DAMG *  damg,
KSP  ksp,
int  nlevels
) 
 

Definition at line 1156 of file omg.C.

References ot::_p_DAMG::comm.

Referenced by DAMGSetKSP().

PetscErrorCode ot::DAMGSolve (  DAMG *  damg  ) 
 

Solves the problem.

Definition at line 1106 of file omg.C.

References DAMGGetFine, ot::_p_DAMG::initialguess, ot::_p_DAMG::nlevels, ot::_p_DAMG::solve, and ot::_p_DAMG::x.

Referenced by main(), solve_neumann(), and solve_neumann_oct().

PetscErrorCode ot::DAMGSolveKSP (  DAMG *  damg,
int  level
) 
 

Definition at line 1141 of file omg.C.

References ot::_p_DAMG::b, and ot::_p_DAMG::rhs.

void ot::deleteTreeNodePointer (  ot::TreeNodePointer &  ptrOct  ) 
 

Definition at line 97 of file TreeNodePointer.C.

References ot::TreeNodePointer::m_tnpMyChildren.

Referenced by pointerBasedRipple().

int ot::destroyRmatType1Stencil (  double *****&  lut  ) 
 

Definition at line 83 of file RmatType1StencilsAux.C.

Referenced by DAMG_Finalize().

int ot::destroyRmatType2Stencil (  double ****&  lut  ) 
 

Definition at line 75 of file RmatType2StencilsAux.C.

Referenced by DAMG_Finalize().

int ot::destroyVtxMaps (  unsigned short ****&  map1,
unsigned short *****&  map2,
unsigned short *****&  map3,
unsigned short ******&  map4
) 
 

Definition at line 186 of file VtxMaps.C.

Referenced by DAMG_Finalize().

void ot::discardExtraBoundaryOctants (  std::vector< ot::TreeNode > &  in,
unsigned int  dim,
unsigned int  maxDepth
) 
 

Definition at line 584 of file OctFunctions.C.

References ot::TreeNode::getX(), ot::TreeNode::getY(), and ot::TreeNode::getZ().

PetscErrorCode ot::dummyRestrictMatVecType1 (  TransferOpData *  data  ) 
 

Definition at line 410 of file RestrictMatVec.C.

References ot::DA::createVector(), ot::DA::curr(), ot::TransferOpData::dac, ot::TransferOpData::daf, ot::DA::end(), ot::TransferOpData::fineTouchedFlags, ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), PROF_MG_RESTRICT_DUMMY_BEGIN, PROF_MG_RESTRICT_DUMMY_END, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), ot::DA::WriteToGhostsBegin(), and ot::DA::WriteToGhostsEnd().

Referenced by createInterpolationType1(), and createInterpolationType2().

int ot::finalMergeInBal (  std::vector< ot::TreeNode > &  out,
std::vector< ot::TreeNode > &  allBoundaryLeaves
) 
 

Author:
Rahul Sampath

Definition at line 2672 of file Balance.C.

References areComparable(), PROF_FINAL_MERGE_IN_BAL_BEGIN, and PROF_FINAL_MERGE_IN_BAL_END.

Referenced by balanceOctree().

void ot::findOctantOrFinestAncestor (  ot::TreeNodePointer &  octree,
const ot::TreeNode &  key,
ot::TreeNodePointer *&  result
) 
 

Definition at line 62 of file TreeNodePointer.C.

References ot::TreeNode::isAncestor(), ot::TreeNodePointer::m_tnMe, and ot::TreeNodePointer::m_tnpMyChildren.

Referenced by pointerBasedRipple().

void ot::flagNodesType1 (  std::vector< ot::TreeNode > &  in,
MPI_Comm  comm
) 
 

Identifies hanging nodes. Uses two all2allv communications. No overlap of comm and comp.

Author:
Rahul Sampath
Parameters:
in The octree including pseudo-octants for the positive boundaries

Definition at line 708 of file OctFunctions.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(), ot::TreeNode::orFlag(), PROF_FLN_STAGE1_BEGIN, PROF_FLN_STAGE1_END, PROF_FLN_STAGE2_BEGIN, PROF_FLN_STAGE2_END, PROF_FLN_STAGE3_BEGIN, PROF_FLN_STAGE3_END, PROF_FLN_STAGE4_BEGIN, PROF_FLN_STAGE4_END, PROF_FLN_STAGE5_BEGIN, PROF_FLN_STAGE5_END, PROF_MARK_HANGING_BEGIN, and PROF_MARK_HANGING_END.

void ot::flagNodesType2 (  std::vector< ot::TreeNode > &  in,
MPI_Comm  comm
) 
 

Identifies hanging nodes. It just uses 1 communication by sending apriori results. Overlaps comm and comp.

Author:
Rahul Sampath
Parameters:
in the Octree including pseudo-octants for positive boundaries

Definition at line 1062 of file OctFunctions.C.

References seq::BinarySearch(), ot::TreeNode::getChildNumber(), ot::TreeNode::getDim(), ot::TreeNode::getLevel(), ot::TreeNode::getMaxDepth(), ot::TreeNode::getX(), ot::TreeNode::getY(), ot::TreeNode::getZ(), par::Mpi_Alltoall(), ot::TreeNode::orFlag(), PROF_FLN_STAGE1_BEGIN, PROF_FLN_STAGE1_END, PROF_FLN_STAGE2_BEGIN, PROF_FLN_STAGE2_END, PROF_FLN_STAGE3_BEGIN, PROF_FLN_STAGE3_END, PROF_FLN_STAGE4_BEGIN, PROF_FLN_STAGE4_END, PROF_FLN_STAGE5_BEGIN, PROF_FLN_STAGE5_END, PROF_FLN_STAGE6_BEGIN, PROF_FLN_STAGE6_END, PROF_FLN_STAGE7_BEGIN, PROF_FLN_STAGE7_END, PROF_MARK_HANGING_BEGIN, and PROF_MARK_HANGING_END.

void ot::flagNodesType3 (  std::vector< ot::TreeNode > &  in,
MPI_Comm  comm
) 
 

Identifies hanging nodes. 2 step communication, overlapping comm and comp.

Author:
Rahul Sampath
Parameters:
in the Octree including pseudo-octants for positive boundaries

Definition at line 1463 of file OctFunctions.C.

References ot::TreeNode::getChildNumber(), ot::TreeNode::getDim(), ot::TreeNode::getLevel(), ot::TreeNode::getMaxDepth(), ot::TreeNode::getParent(), ot::TreeNode::getWeight(), ot::TreeNode::getX(), ot::TreeNode::getY(), ot::TreeNode::getZ(), ot::TreeNode::orFlag(), PROF_FLN_STAGE10_BEGIN, PROF_FLN_STAGE10_END, PROF_FLN_STAGE11_BEGIN, PROF_FLN_STAGE11_END, PROF_FLN_STAGE1_BEGIN, PROF_FLN_STAGE1_END, PROF_FLN_STAGE2_BEGIN, PROF_FLN_STAGE2_END, PROF_FLN_STAGE3_BEGIN, PROF_FLN_STAGE3_END, PROF_FLN_STAGE4_BEGIN, PROF_FLN_STAGE4_END, PROF_FLN_STAGE5_BEGIN, PROF_FLN_STAGE5_END, PROF_FLN_STAGE6_BEGIN, PROF_FLN_STAGE6_END, PROF_FLN_STAGE7_BEGIN, PROF_FLN_STAGE7_END, PROF_FLN_STAGE8_BEGIN, PROF_FLN_STAGE8_END, PROF_FLN_STAGE9_BEGIN, PROF_FLN_STAGE9_END, PROF_MARK_HANGING_BEGIN, PROF_MARK_HANGING_END, and ot::TreeNode::setWeight().

Referenced by ot::DA::DA_FactoryPart2(), and markHangingNodesAtAllLevels().

template<unsigned char cNum>
unsigned char ot::getElemType (  unsigned char  hnMask  ) 
 

A function that maps a given child number and hanging mask to one of the 18 standard hanging configurations.

Parameters:
hnMask The hanging mask returned using the function getHangingNodeIndex()
Author:
Rahul Sampath
See also:
getHangingNodeIndex

getChildNumber

Definition at line 14 of file odaUtils.txx.

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 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 PrintDAMG().

TreeNode ot::getNCA (  TreeNode  first,
TreeNode  second
) 
 

Author:
Rahul Sampath
Returns:
the nearest common ancestor of first and second. If one of them is the ancestor of the other it is returned. Note: first must be different from second.

Definition at line 281 of file OctFunctions.C.

References areComparable(), binOp::binLength(), ot::TreeNode::getDim(), ot::TreeNode::getMaxDepth(), ot::TreeNode::getX(), ot::TreeNode::getY(), and ot::TreeNode::getZ().

Referenced by appendCompleteRegion(), comboRipple(), completeOctree(), and completeSubtree().

unsigned int ot::getNodeWeight (  const TreeNode *  t  ) 
 

Definition at line 263 of file OctFunctions.C.

References ot::TreeNode::getWeight().

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().

template<typename T>
void ot::injectNodalVector (  ot::DA *  dac,
ot::DA *  daf,
unsigned int  dof,
std::vector< T > &  fVec,
std::vector< T > &  cVec,
void(*)(T &)  setZero
) 
 

Definition at line 3752 of file oda.txx.

References ot::DA::createVector(), ot::DA::curr(), ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getLocalBufferSize(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::isBoundaryOctant(), ot::DA::isLUTcompressed(), ot::DA::next(), ot::DA::ReadFromGhostsBegin(), ot::DA::ReadFromGhostsEnd(), ot::DA::updateQuotientCounter(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), ot::DA::WriteToGhostsBegin(), and ot::DA::WriteToGhostsEnd().

char ot::int2char (  int  dec  ) 
 

Definition at line 455 of file OctFunctions.C.

Referenced by int2str().

int ot::int2str (  int  dec,
char *  numStr
) 
 

Definition at line 435 of file OctFunctions.C.

References int2char().

Referenced by main().

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(), 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(), 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().

int ot::IreadRmatType1Stencil (  double *****&  lut,
int  rank
) 
 

Definition at line 48 of file RmatType1StencilsAux.C.

Referenced by DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().

int ot::IreadRmatType2Stencil (  double ****&  lut,
int  rank
) 
 

Definition at line 45 of file RmatType2StencilsAux.C.

Referenced by DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().

int ot::IreadVtxMaps (  unsigned short ****&  map1,
unsigned short *****&  map2,
unsigned short *****&  map3,
unsigned short ******&  map4,
int  rank
) 
 

Definition at line 100 of file VtxMaps.C.

Referenced by DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().

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().

bool ot::lessThanUsingWts (  TreeNode const &  a,
TreeNode const &  b
) 
 

A comparator that uses the weights of the octants instead of the Morton ordering.

Returns:
a < b based on their respective weigths.

Definition at line 255 of file OctFunctions.C.

References ot::TreeNode::getWeight().

int ot::lineariseList (  std::vector< ot::TreeNode > &  list,
MPI_Comm  comm
) 
 

Makes the input linear. Removes duplicates and ancestors.

Parameters:
list the input vector (must be sorted)
Author:
Rahul Sampath

Definition at line 194 of file OctFunctions.C.

References par::splitComm2way().

Referenced by mergeOctrees().

int ot::lineariseList (  std::vector< ot::TreeNode > &  list,
bool  skipLast = false
) 
 

Makes the input linear. Removes duplicates and ancestors.

Parameters:
list the input vector (must be sorted)
skipLast Pass 'true' if you do not wish to include the last element in the output and 'false' otherwise
Author:
Rahul Sampath

Definition at line 172 of file OctFunctions.C.

References areComparable().

void ot::markBoundaryNodesAtAllLevels (  std::vector< ot::TreeNode > &  finestOctree,
unsigned int  nlevels,
std::vector< ot::TreeNode > *  coarserOctrees,
unsigned int  maxDepth
) 
 

Definition at line 554 of file OctFunctions.C.

References ot::TreeNode::getX(), ot::TreeNode::getY(), ot::TreeNode::getZ(), and ot::TreeNode::orFlag().

void ot::markHangingNodesAtAllLevels (  std::vector< ot::TreeNode > &  finestOctree,
unsigned int  nlevels,
std::vector< ot::TreeNode > *  coarserOctrees,
MPI_Comm *  activeComms,
unsigned int  dim,
unsigned int  maxDepth
) 
 

Definition at line 607 of file OctFunctions.C.

References flagNodesType3().

Referenced by DAMGCreateAndSetDA().

int ot::mergeComboBalAndPickBoundary (  std::vector< ot::TreeNode > &  out,
std::vector< ot::TreeNode > &  allBoundaryLeaves,
const ot::TreeNode &  firstBlock,
const ot::TreeNode &  lastBlock
) 
 

Merge the input of ConBal and intra-processor ripple bal and pick the inter-processor boundaries from the result.

Author:
Rahul Sampath

Definition at line 2610 of file Balance.C.

References areComparable(), pickInterProcessorBoundaryNodes(), PROF_MERGE_COMBO_BAL_BEGIN, and PROF_MERGE_COMBO_BAL_END.

Referenced by balanceOctree().

int ot::mergeOctrees (  std::vector< TreeNode > &  inOct1,
std::vector< TreeNode > &  inOct2,
std::vector< TreeNode > &  outOct,
MPI_Comm  comm
) 
 

Merges the 2 input octrees and linearizes the result.

Author:
Rahul Sampath
Parameters:
inOct1,inOct2 input octrees
outOct output octree

Definition at line 31 of file OctFunctions.C.

References lineariseList(), PROF_MERGE_OCTREES_BEGIN, and PROF_MERGE_OCTREES_END.

int ot::mergeRecvKeysInBal (  const std::vector< ot::TreeNode > &  recvK1,
const int *  recvOffsets1,
const std::vector< ot::TreeNode > &  recvK2,
const int *  recvOffsets2,
int  npes,
std::vector< ot::TreeNode > &  recvK
) 
 

Author:
Rahul Sampath

Definition at line 2954 of file Balance.C.

References PROF_MERGE_RECV_KEYS_BAL_BEGIN, and PROF_MERGE_RECV_KEYS_BAL_END.

Referenced by balanceOctree().

std::ostream& operator<< (  std::ostream &  os,
TreeNode const &  other
) 
 

Author:
Rahul Sampath

Definition at line 569 of file TreeNode.C.

References ot::TreeNode::getLevel(), ot::TreeNode::getX(), ot::TreeNode::getY(), and ot::TreeNode::getZ().

int ot::p2oLocal (  std::vector< TreeNode > &  nodes,
std::vector< TreeNode > &  leaves,
unsigned int  maxNumPts,
unsigned int  dim,
unsigned int  maxDepth
) 
 

Sequential top-down loop inside points2Octree.

Author:
Rahul Sampath

Hari Sundar

See also:
points2Octree

Definition at line 915 of file Construct.C.

References ot::TreeNode::addChildren(), ot::TreeNode::addWeight(), areComparable(), PROF_P2O_LOCAL_BEGIN, PROF_P2O_LOCAL_END, and ot::TreeNode::setWeight().

Referenced by points2Octree(), and points2OctreeSeq().

int ot::parallelRippleType1 (  std::vector< TreeNode > &  nodes,
bool  incCorners,
bool  checkBailOut,
bool  rePart,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm
) 
 

An implementation of 2:1 balancing using parallel prioritized ripple propagation algorithm.

Author:
Rahul Sampath
See also:
balanceOctree()

Definition at line 2160 of file Balance.C.

References areComparable(), ot::TreeNode::completeSubtree(), ot::TreeNode::getLevel(), ot::TreeNode::getSearchKeys(), PROF_PAR_RIPPLE_TYPE1_BEGIN, and PROF_PAR_RIPPLE_TYPE1_END.

Referenced by main().

int ot::parallelRippleType2 (  std::vector< TreeNode > &  nodes,
bool  incCorners,
bool  checkBailOut,
bool  rePart,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm
) 
 

An implementation of 2:1 balancing using parallel prioritized ripple propagation algorithm.

Author:
Rahul Sampath
See also:
balanceOctree()

Definition at line 1766 of file Balance.C.

References areComparable(), ot::TreeNode::completeSubtree(), ot::TreeNode::getLevel(), ot::TreeNode::getSearchKeys(), PROF_PAR_RIPPLE_TYPE2_BEGIN, and PROF_PAR_RIPPLE_TYPE2_END.

Referenced by main().

int ot::parallelRippleType3 (  std::vector< TreeNode > &  nodes,
bool  incCorners,
bool  checkBailOut,
bool  rePart,
unsigned int  dim,
unsigned int  maxDepth,
MPI_Comm  comm
) 
 

An implementation of 2:1 balancing using parallel prioritized ripple propagation algorithm.

Author:
Rahul Sampath
See also:
balanceOctree()

Definition at line 1365 of file Balance.C.

References areComparable(), ot::TreeNode::completeSubtree(), ot::TreeNode::getLevel(), ot::TreeNode::getSearchKeys(), PROF_PAR_RIPPLE_TYPE3_BEGIN, and PROF_PAR_RIPPLE_TYPE3_END.

Referenced by main().

PetscErrorCode ot::PC_KSP_Shell_Apply (  void *  ctx,
Vec  in,
Vec  out
) 
 

Definition at line 2710 of file omg.C.

References PROF_PC_KSP_SHELL_APPLY_BEGIN, and PROF_PC_KSP_SHELL_APPLY_END.

Referenced by DAMGSetKSP().

PetscErrorCode ot::PC_KSP_Shell_Destroy (  void *  ctx  ) 
 

Definition at line 2681 of file omg.C.

References PROF_PC_KSP_SHELL_DESTROY_BEGIN, and PROF_PC_KSP_SHELL_DESTROY_END.

Referenced by DAMGSetKSP().

PetscErrorCode ot::PC_KSP_Shell_SetUp (  void *  ctx  ) 
 

Definition at line 2562 of file omg.C.

References ot::DA::iAmActive(), PROF_PC_KSP_SHELL_SETUP_BEGIN, and PROF_PC_KSP_SHELL_SETUP_END.

Referenced by DAMGSetKSP().

PetscErrorCode ot::PCApply_BlockDiag (  PC  pc,
Vec  x,
Vec  y
) 
 

Definition at line 67 of file blockDiag.C.

References ot::PC_BlockDiag::dof, ot::PC_BlockDiag::invBlockDiagEntries, and ot::PC_BlockDiag::nodeSize.

PetscErrorCode ot::PCCreate_BlockDiag (  PC  pc  ) 
 

Definition at line 93 of file blockDiag.C.

References ot::PC_BlockDiag::dof, ot::PC_BlockDiag::invBlockDiagEntries, and ot::PC_BlockDiag::nodeSize.

PetscErrorCode ot::PCDestroy_BlockDiag (  PC  pc  ) 
 

Definition at line 120 of file blockDiag.C.

References ot::PC_BlockDiag::dof, ot::PC_BlockDiag::invBlockDiagEntries, and ot::PC_BlockDiag::nodeSize.

PetscErrorCode ot::PCSetFromOptions_BlockDiag (  PC  pc  ) 
 

Definition at line 144 of file blockDiag.C.

PetscErrorCode ot::PCSetUp_BlockDiag (  PC  pc  ) 
 

Definition at line 22 of file blockDiag.C.

References ot::PC_BlockDiag::dof, ot::PC_BlockDiag::invBlockDiagEntries, and ot::PC_BlockDiag::nodeSize.

void ot::pickGhostCandidates (  const std::vector< ot::TreeNode > &  blocks,
const std::vector< ot::TreeNode > &  nodes,
std::vector< ot::TreeNode > &  res,
unsigned int  dim,
unsigned int  maxDepth
) 
 

Definition at line 672 of file odaPartition.C.

References addSecondRing(), ot::TreeNode::getAllNeighbours(), pickInterProcessorBoundaryNodes(), PROF_PICK_GHOSTS_BEGIN, and PROF_PICK_GHOSTS_END.

int ot::pickInterProcessorBoundaryNodes (  const std::vector< ot::TreeNode > &  nodes,
std::vector< ot::TreeNode > &  bndLeaves,
const ot::TreeNode &  firstBlock,
const ot::TreeNode &  lastBlock
) 
 

Definition at line 81 of file pickBdy.C.

References PICK_INTER_PROCESSOR_BOUNDARY_BLOCK, PICK_IPBB_SET_TN_VALUE, PROF_PICK_BND_BEGIN, and PROF_PICK_BND_END.

Referenced by mergeComboBalAndPickBoundary(), and pickGhostCandidates().

int ot::pickInterProcessorBoundaryNodes (  const std::vector< ot::TreeNode > &  nodes,
std::vector< unsigned int > &  res,
const ot::TreeNode &  firstBlock,
const ot::TreeNode &  lastBlock
) 
 

Definition at line 71 of file pickBdy.C.

References PICK_INTER_PROCESSOR_BOUNDARY_BLOCK, PICK_IPBB_SET_UI_VALUE, PROF_PICK_BND_BEGIN, and PROF_PICK_BND_END.

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

int ot::pointerBasedRipple (  std::vector< ot::TreeNode > &  nodes,
bool  incCorners
) 
 

Sequential ripple propagation algorithm using pointer based octree representation (internally). The input (linear) octree need not be complete. It can have holes.

Author:
Rahul Sampath
Parameters:
nodes a sorted, linear octree. The octree need not be complete. It can have holes.
incCorners 'true' if you want to balance across corners as well.

Definition at line 1269 of file Balance.C.

References addOctantToTreeNodePointer(), appendOctantsAtLevel(), convertLinearToPointer(), convertPointerToLinear(), deleteTreeNodePointer(), findOctantOrFinestAncestor(), ot::TreeNode::getDim(), ot::TreeNode::getLevel(), ot::TreeNode::getMaxDepth(), ot::TreeNode::getSearchKeys(), ot::TreeNodePointer::m_tnMe, ot::TreeNodePointer::m_tnpMyChildren, PROF_PTR_RIPPLE_BAL_BEGIN, and PROF_PTR_RIPPLE_BAL_END.

Referenced by main().

int ot::points2Octree (  std::vector< double > &  points,
double *  gLens,
std::vector< TreeNode > &  nodes,
unsigned int  dim,
unsigned int  maxDepth,
unsigned int  maxNumPtsPerOctant,
MPI_Comm  comm
) 
 

A function to construct a complete, sorted, linear octree from a set of points.

Author:
Rahul Sampath

Hari Sundar

Parameters:
points the input points, (x,y,z) must be >=0.0 and < (gLens[0], gLens[1], gLens[2]) respectively
gLens the global dimensions
nodes the output octree
dim the dimension of the tree (1 for binary trees, 2 for quadtrees and 3 for octrees)
maxDepth the maximum depth of the octree must be <= _MAX_LEVEL_
maxNumPtsPerOctant the maximum number of points per octant.
Returns:
an error flag
See also:
_MAX_LEVEL_ Points are cleared inside the function.

Definition at line 730 of file Construct.C.

References blockPartStage1_p2o(), blockPartStage2_p2o(), DendroIntL, p2oLocal(), points2OctreeSeq(), PROF_P2O_BEGIN, PROF_P2O_END, and par::splitCommUsingSplittingRank().

Referenced by main(), and solve_neumann().

int ot::points2OctreeSeq (  std::vector< double > &  pts,
double *  gLens,
std::vector< TreeNode > &  nodes,
unsigned int  dim,
unsigned int  maxDepth,
unsigned int  maxNumPts
) 
 

Sequential version of points2Octree.

Author:
Rahul Sampath
See also:
points2Octree

Definition at line 860 of file Construct.C.

References p2oLocal(), PROF_P2O_SEQ_BEGIN, PROF_P2O_SEQ_END, and sort().

Referenced by points2Octree().

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().

int ot::prepareBalComm1MessagesType1 (  const std::vector< ot::TreeNode > &  allBoundaryLeaves,
const std::vector< ot::TreeNode > &  myNhBlocks,
int  npes,
unsigned int  maxDepth,
std::vector< TreeNode > *  sendNodes,
std::vector< unsigned int > *  sentToPid,
int *  sendCnt
) 
 

Author:
Rahul Sampath

Definition at line 2718 of file Balance.C.

References ot::TreeNode::getWeight(), ot::TreeNode::maxX(), ot::TreeNode::maxY(), ot::TreeNode::maxZ(), ot::TreeNode::minX(), ot::TreeNode::minY(), ot::TreeNode::minZ(), PROF_PREP_BAL_COMM1_MSSG_BEGIN, and PROF_PREP_BAL_COMM1_MSSG_END.

int ot::prepareBalComm1MessagesType2 (  const std::vector< ot::TreeNode > &  allBoundaryLeaves,
const std::vector< ot::TreeNode > &  minsAllBlocks,
int  rank,
unsigned int  dim,
unsigned int  maxDepth,
std::vector< TreeNode > *  sendNodes,
std::vector< unsigned int > *  sentToPid,
int *  sendCnt
) 
 

Author:
Rahul Sampath

Definition at line 3014 of file Balance.C.

References ot::TreeNode::getAllNeighbours(), PROF_PREP_BAL_COMM1_MSSG_BEGIN, and PROF_PREP_BAL_COMM1_MSSG_END.

Referenced by balanceOctree().

int ot::prepareBalComm2Messages (  const std::vector< ot::TreeNode > &  allBoundaryLeaves,
const std::vector< ot::TreeNode > &  wList,
const std::vector< std::vector< unsigned int > > &  wListRanks,
std::vector< TreeNode > *  sendNodes,
std::vector< unsigned int > *  sentToPid,
int *  sendCnt
) 
 

Author:
Rahul Sampath

Definition at line 2869 of file Balance.C.

References areComparable(), PROF_PREP_BAL_COMM2_MSSG_BEGIN, and PROF_PREP_BAL_COMM2_MSSG_END.

Referenced by balanceOctree().

int ot::prepareWlistInBal (  const std::vector< ot::TreeNode > &  recvK1,
const int *  recvCnt,
int  npes,
const ot::TreeNode &  myFirstBlock,
const ot::TreeNode &  myLastBlock,
std::vector< TreeNode > &  wList,
std::vector< std::vector< unsigned int > > &  wListRanks
) 
 

Author:
Rahul Sampath

Definition at line 2768 of file Balance.C.

References areComparable(), ot::TreeNode::getAllNeighbours(), ot::TreeNode::getDLD(), PROF_PREP_BAL_WLIST_BEGIN, PROF_PREP_BAL_WLIST_END, ot::TreeNode::setWeight(), and sort().

Referenced by balanceOctree().

void ot::PrintDAMG (  DAMG *   ) 
 

Prints detailed information about the meshes for each level.

Definition at line 2386 of file omg.C.

References ot::_p_DAMG::da, ot::_p_DAMG::da_aux, DendroIntL, ot::DA::getCommActive(), ot::DA::getElementSize(), ot::DA::getGhostedElementSize(), getGlobalMaxLevel(), getGlobalMinLevel(), ot::DA::getNodeSize(), ot::DA::getNpesActive(), ot::DA::getNumBlocks(), ot::DA::iAmActive(), and ot::_p_DAMG::nlevels.

Referenced by main().

PetscErrorCode ot::prolongMatVecType1 (  Mat  R,
Vec  c,
Vec  f
) 
 

Definition at line 154 of file ProlongMatVec.C.

References ot::DA::curr(), ot::DA::currWithInfo(), ot::DA::end(), ot::DA::getElementSize(), ot::DA::iAmActive(), iC, ot::DA::init(), INTERGRID_TRANSFER_LOOP_BLOCK, ITLB_SET_VALUE_NO_SUPPRESSED_DOFS, ITLB_SET_VALUE_SUPPRESSED_DOFS, ot::DA::next(), PROF_MG_PROLONG_BEGIN, PROF_MG_PROLONG_END, ot::DA::ReadFromGhostsBegin(), ot::DA::ReadFromGhostsEnd(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), ot::DA::WriteToGhostsBegin(), and ot::DA::WriteToGhostsEnd().

Referenced by createInterpolationType1(), and prolongMatVecType2().

PetscErrorCode ot::prolongMatVecType2 (  Mat  R,
Vec  c,
Vec  f
) 
 

Definition at line 56 of file ProlongMatVec.C.

References iC, prolongMatVecType1(), and par::scatterValues().

Referenced by createInterpolationType2().

int ot::readDataPtsFromFile (  char *  filename,
std::vector< double > &  pts,
std::vector< double > &  ptVals
) 
 

Reads a list of points and corresponding values from a file.

Author:
Ilya Lashuk
Parameters:
filename the file name
pts the points
data the values

Definition at line 333 of file OctFunctions.C.

int ot::readNodesFromFile (  char *  filename,
std::vector< TreeNode > &  nodes
) 
 

Reads a list of octants from a file.

Author:
Rahul Sampath
Parameters:
filename the file name
nodes the octants

Definition at line 393 of file OctFunctions.C.

Referenced by main().

int ot::readPtsFromFile (  char *  filename,
std::vector< double > &  pts
) 
 

Reads a list of points from a file.

Author:
Rahul Sampath
Parameters:
filename the file name
pts the points

Definition at line 305 of file OctFunctions.C.

Referenced by ComputeFBM_RHS_Part2(), and main().

int ot::readRmatType1Stencil (  double *****&  lut  ) 
 

Definition at line 14 of file RmatType1StencilsAux.C.

Referenced by DAMG_InitPrivateType1().

int ot::readRmatType2Stencil (  double ****&  lut  ) 
 

Definition at line 15 of file RmatType2StencilsAux.C.

Referenced by DAMG_InitPrivateType1().

int ot::readVtxMaps (  unsigned short ****&  map1,
unsigned short *****&  map2,
unsigned short *****&  map3,
unsigned short ******&  map4
) 
 

Definition at line 14 of file VtxMaps.C.

Referenced by DAMG_InitPrivateType1().

int ot::refineAndPartitionOctree (  const std::vector< TreeNode > &  in,
std::vector< TreeNode > &  out,
MPI_Comm  comm
) 
 

Replaces every octant with its eight children and partitions the result uniformly across the processors.

Author:
Rahul Sampath
Parameters:
in the input vector
out the output vector
See also:
refineOctre

Definition at line 146 of file OctFunctions.C.

References refineOctree().

Referenced by createRegularOctree().

int ot::refineOctree (  const std::vector< TreeNode > &  in,
std::vector< TreeNode > &  out
) 
 

Replaces every octant with its eight children.

Author:
Rahul Sampath
Parameters:
in the input vector
out the output vector

Definition at line 133 of file OctFunctions.C.

References ot::TreeNode::addChildren().

Referenced by main(), and refineAndPartitionOctree().

PetscErrorCode ot::RegisterEvents (   ) 
 

Call this function at the beginning of the main program, just after calling PetscInitialize().

Returns:
an error flag

Definition at line 19 of file sys.C.

Referenced by main().

int ot::regularGrid2Octree (  const std::vector< double > &  elementValues,
unsigned int  N,
unsigned int  nx,
unsigned int  ny,
unsigned int  nz,
unsigned int  xs,
unsigned int  ys,
unsigned int  zs,
std::vector< TreeNode > &  linOct,
unsigned int  dim,
unsigned int  maxDepth,
double  threshold,
MPI_Comm  comm
) 
 

A function to construct a complete, sorted, linear octree from a regular grid by coarsening the regular grid elements based on some threshold.

Author:
Rahul Sampath

Parameters:
elementValues a value at each element ordered in the X,Y,Z order, i.e. X grows first length of elementValues must be equal to (nx*ny*nz)
nx,ny,nz number of elements in each direction on the calling processor
N number of elements in each direction in the entire regular grid. N must be a power of 2. The total number of elements in the regular grid will be N^3.
xs,ys,zs the global index of the first coordinate on this processor
maxDepth the maximum depth of the octree must be <= _MAX_LEVEL_
See also:
_MAX_LEVEL_

Definition at line 24 of file Construct.C.

References DendroIntL, binOp::fastLog2(), ot::TreeNode::getChildNumber(), ot::TreeNode::getParent(), binOp::isPowerOfTwo(), ot::NodeAndValues< T, ARR_LEN >::node, PROF_RG2O_BEGIN, PROF_RG2O_END, par::splitCommUsingSplittingRank(), and ot::NodeAndValues< T, ARR_LEN >::values.

PetscErrorCode ot::restrictMatVecType1 (  Mat  R,
Vec  f,
Vec  c
) 
 

Definition at line 486 of file RestrictMatVec.C.

References ot::DA::curr(), ot::DA::currWithInfo(), ot::DA::end(), ot::DA::getElementSize(), ot::DA::iAmActive(), iC, ot::DA::init(), INTERGRID_TRANSFER_LOOP_BLOCK, ITLB_SET_VALUE_NO_SUPPRESSED_DOFS, ITLB_SET_VALUE_SUPPRESSED_DOFS, ot::DA::next(), PROF_MG_RESTRICT_BEGIN, PROF_MG_RESTRICT_END, ot::DA::ReadFromGhostsBegin(), ot::DA::ReadFromGhostsEnd(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), ot::DA::WriteToGhostsBegin(), and ot::DA::WriteToGhostsEnd().

Referenced by createInterpolationType1(), and restrictMatVecType2().

PetscErrorCode ot::restrictMatVecType2 (  Mat  R,
Vec  f,
Vec  c
) 
 

Definition at line 55 of file RestrictMatVec.C.

References iC, restrictMatVecType1(), and par::scatterValues().

Referenced by createInterpolationType2().

int ot::ripple (  std::vector< TreeNode > &  nodes,
bool  incCorners
) 
 

Sequential ripple propagation algorithm on linear octrees. The octree need not be complete. It can have holes.

Author:
Rahul Sampath
Parameters:
nodes a sorted, linear octree. The octree need not be complete. It can have holes.
incCorners 'true' if you want to balance across corners as well.

Definition at line 1162 of file Balance.C.

References ot::TreeNode::addBalancingDescendants(), areComparable(), ot::TreeNode::completeSubtree(), ot::TreeNode::getDim(), ot::TreeNode::getLevel(), ot::TreeNode::getMaxDepth(), ot::TreeNode::getSearchKeys(), PROF_RIPPLE_BAL_BEGIN, and PROF_RIPPLE_BAL_END.

Referenced by balanceOctree(), comboRipple(), and main().

PetscErrorCode ot::rpMatDestroy (  Mat  R  ) 
 

Definition at line 2325 of file omg.C.

References iC.

Referenced by createInterpolationType1(), and createInterpolationType2().

int ot::scatterValues (  Vec  in,
Vec  out,
PetscInt  inSz,
PetscInt  outSz,
int *&  sendSz,
int *&  sendOff,
int *&  recvSz,
int *&  recvOff,
MPI_Comm  comm
) 
 

Redistributes the vector, preserving the relative ordering of the elements.

Author:
Rahul Sampath
Parameters:
in the input vector
out the output vector
inSz local size of in
outSz local size of out Memory for out will not be allocated within the function.

Definition at line 2740 of file omg.C.

References PROF_MG_SCATTER_BEGIN, and PROF_MG_SCATTER_END.

Referenced by main().

int ot::selectNeighboringBlocks (  const std::vector< TreeNode > &  allBlocks,
const std::vector< TreeNode > &  blocks,
const std::vector< unsigned int > &  maxBlockBndVec,
int  myRank,
std::vector< TreeNode > &  myNhBlocks
) 
 

Author:
Rahul Sampath

Definition at line 2564 of file Balance.C.

References ot::TreeNode::maxX(), ot::TreeNode::maxY(), ot::TreeNode::maxZ(), ot::TreeNode::minX(), ot::TreeNode::minY(), ot::TreeNode::minZ(), PROF_PICK_NH_BLOCKS_BEGIN, and PROF_PICK_NH_BLOCKS_END.

Referenced by balanceOctree().

int ot::simpleCoarsen (  const std::vector< TreeNode > &  in,
std::vector< TreeNode > &  out,
MPI_Comm  comm
) 
 

A naive implementation of coarsenOctree.

Author:
Rahul Sampath
See also:
coarsenOctree

Definition at line 20 of file Coarsen.C.

References completeOctree(), PROF_SIMPLE_COARSE_BEGIN, PROF_SIMPLE_COARSE_END, and par::splitComm2way().

Referenced by main().

int ot::writeDataPtsToFile (  char *  filename,
std::vector< double > &  pts,
std::vector< double > &  data
) 
 

Writes a list of points and corresponding values from a file.

Author:
Ilya Lashuk
Parameters:
filename the file name
pts the points
data the values

Definition at line 377 of file OctFunctions.C.

int ot::writeNodesToFile (  char *  filename,
const std::vector< TreeNode > &  nodes
) 
 

Writes a list of octants to a file.

Author:
Rahul Sampath
Parameters:
filename the file name
nodes the octants

Definition at line 414 of file OctFunctions.C.

References ot::TreeNode::getDim(), and ot::TreeNode::getMaxDepth().

Referenced by DAMGCreateAndSetDA(), ot::test::isBalancedInternal(), and main().

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 completeSubtree(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getMinAllBlocks(), and ot::DA::getRankAll().

Referenced by main().

int ot::writePtsToFile (  char *  filename,
std::vector< double > &  pts
) 
 

Writes a list of points to a file.

Author:
Rahul Sampath
Parameters:
filename the file name
pts the points

Definition at line 360 of file OctFunctions.C.

Referenced by main().


Variable Documentation

void(* ot::computeInvBlockDiagEntriesForPC_BlockDiag)(Mat pcMat, double **invBlockDiagEntries) = NULL
 

Definition at line 181 of file externVars.h.

void(* ot::getDofAndNodeSizeForPC_BlockDiag)(Mat pcMat, unsigned int &dof, unsigned int &nodeSize) = NULL
 

Definition at line 178 of file externVars.h.

void(* ot::getPrivateMatricesForKSP_Shell)(Mat mat, Mat *AmatPrivate, Mat *PmatPrivate, MatStructure *pFlag) = NULL
 

Definition at line 190 of file externVars.h.

double ***** ot::RmatType1Stencil = NULL
 

Definition at line 168 of file externVars.h.

Referenced by DAMG_Finalize(), DAMG_InitPrivateType1(), DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().

double **** ot::RmatType2Stencil = NULL
 

Definition at line 167 of file externVars.h.

Referenced by DAMG_Finalize(), DAMG_InitPrivateType1(), DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().

double **** ot::ShapeFnCoeffs = NULL
 

Definition at line 173 of file externVars.h.

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

unsigned short **** ot::VtxMap1 = NULL
 

Definition at line 169 of file externVars.h.

Referenced by DAMG_Finalize(), DAMG_InitPrivateType1(), DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().

unsigned short ***** ot::VtxMap2 = NULL
 

Definition at line 170 of file externVars.h.

Referenced by DAMG_Finalize(), DAMG_InitPrivateType1(), DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().

unsigned short ***** ot::VtxMap3 = NULL
 

Definition at line 171 of file externVars.h.

Referenced by DAMG_Finalize(), DAMG_InitPrivateType1(), DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().

unsigned short ****** ot::VtxMap4 = NULL
 

Definition at line 172 of file externVars.h.

Referenced by DAMG_Finalize(), DAMG_InitPrivateType1(), DAMG_InitPrivateType2(), and DAMG_InitPrivateType3().


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