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

Construct.C File Reference

A set of functions for Octree Construction. More...

#include "parUtils.h"
#include "TreeNode.h"
#include <cassert>
#include "nodeAndValues.h"
#include "binUtils.h"
#include "dendro.h"

Go to the source code of this file.

Namespaces

namespace  ot

Functions

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


Detailed Description

A set of functions for Octree Construction.

Author:
Hari Sundar, hsundar@gmail.com

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

Definition in file Construct.C.


Function Documentation

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(), ot::areComparable(), ot::TreeNode::getDim(), ot::TreeNode::getMaxDepth(), ot::getNCA(), ot::TreeNode::getParent(), PROF_COMPLETE_REGION_BEGIN, and PROF_COMPLETE_REGION_END.

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

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(), ot::appendCompleteRegion(), ot::areComparable(), ot::completeSubtree(), ot::getNCA(), ot::TreeNode::isAncestor(), PROF_N2O_BEGIN, PROF_N2O_END, and par::splitComm2way().

Referenced by ot::blockPartStage1(), ot::blockPartStage1_p2o(), main(), ot::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(), ot::appendCompleteRegion(), ot::areComparable(), ot::TreeNode::getDFD(), ot::TreeNode::getDLD(), ot::getNCA(), PROF_N2O_SEQ_BEGIN, PROF_N2O_SEQ_END, and sort().

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

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(), ot::areComparable(), PROF_P2O_LOCAL_BEGIN, PROF_P2O_LOCAL_END, and ot::TreeNode::setWeight().

Referenced by ot::points2Octree(), and ot::points2OctreeSeq().

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 ot::blockPartStage1_p2o(), ot::blockPartStage2_p2o(), DendroIntL, ot::p2oLocal(), ot::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 ot::p2oLocal(), PROF_P2O_SEQ_BEGIN, PROF_P2O_SEQ_END, and sort().

Referenced by ot::points2Octree().

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.


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