changa 3.5
Loading...
Searching...
No Matches
Tree::GenericTreeNode Class Referenceabstract

Base class for tree nodes. More...

#include <GenericTreeNode.h>

Inheritance diagram for Tree::GenericTreeNode:
Tree::BinaryTreeNode Tree::OctTreeNode

Public Member Functions

 GenericTreeNode (NodeKey k, NodeType type, int first, int last, GenericTreeNode *p)
 Construct GenericTreeNode.
 
virtual void fullyDelete ()=0
 Recursively delete all nodes beneath this node.
 
NodeType getType () const
 return Tree::NodeType of node
 
void setType (NodeType t)
 set Tree::NodeType of node
 
NodeKey getKey () const
 return unique Tree::NodeKey
 
virtual unsigned int numChildren () const =0
 return the number of children this node has
 
virtual GenericTreeNodegetChildren (int)=0
 return the pointers to the specified child of this node
 
virtual void setChildren (int, GenericTreeNode *)=0
 set the specified child of this node to the passed pointer
 
virtual NodeKey getChildKey (int)=0
 return the keys for the specified child
 
virtual NodeKey getParentKey ()=0
 return the key for the parent
 
virtual int whichChild (NodeKey childkey)=0
 return an integer with the number of the child reflecting the key
 
virtual bool contains (NodeKey nodekey)=0
 Is nodekey contained by this node.
 
bool isValid ()
 Is the NodeType valid.
 
bool isCached ()
 Is this a node in the cache.
 
bool isBucket ()
 Is this a node a bucket.
 
virtual void makeOctChildren (GravityParticle *part, int totalPart, int level, NodePool *pool=NULL)=0
 construct the children of the "this" node following the given logical criteria (Oct/Orb)
 
virtual void makeOrbChildren (GravityParticle *part, int totalPart, int level, int rootsLevel, bool(*compFnPtr[])(GravityParticle, GravityParticle), bool spatial, NodePool *pool=NULL)=0
 
virtual void getChunks (int num, NodeKey *&ret)=0
 
void makeBucket (GravityParticle *part)
 transform an internal node into a bucket
 
void makeEmpty ()
 initialize an empty node
 
void getGraphViz (std::ostream &out)
 print out a visualization of the tree for diagnostics
 
virtual NodeKey getLongestCommonPrefix (NodeKey k1, NodeKey k2)
 return the NodeKey of the lowest common ancestor.
 
virtual int getLevel (NodeKey k)=0
 depth of node corresponding to NodeKey
 
virtual GenericTreeNodeclone () const =0
 make a copy of the node
 
virtual void pup (PUP::er &p, int depth)=0
 PUP node and children down to depth.
 
virtual void pup (PUP::er &p)
 PUP just this node.
 

Public Attributes

MultipoleMoments moments
 The moments for the gravity computation.
 
GenericTreeNodeparent
 The parent of this node, or null if none.
 
OrientedBox< cosmoType > boundingBox
 The axis-aligned bounding box of this node.
 
OrientedBox< double > bndBoxBall
 The bounding box including search balls of this node.
 
unsigned int iParticleTypes
 Mask of particle types contatained in this node.
 
int64_t nSPH
 The number of SPH particles this node contains.
 
int firstParticle
 An index for the first particle contained by this node, 0 means outside the node.
 
int lastParticle
 An index to the last particle contained by this node, myNumParticles+1 means outside the node.
 
int remoteIndex
 
unsigned int particleCount
 Total number of particles contained (across all chares)
 
GravityParticleparticlePointer
 Pointer to the first particle in this node.
 
int rungs
 
int numBucketsBeneath
 Number of buckets in this node.
 
int startBucket
 index of first bucket in this node
 
Vector3D< double > centerSm
 center of smoothActive particles during smooth operation
 
double sizeSm
 Radius of bounding sphere of smoothActive particles.
 
double fKeyMax
 Maximum smoothing radius of smoothActive particles.
 
int iRank
 SMP rank of node owner.
 

Protected Attributes

NodeType myType
 
NodeKey key
 

Detailed Description

Base class for tree nodes.

Constructor & Destructor Documentation

◆ GenericTreeNode()

Tree::GenericTreeNode::GenericTreeNode ( NodeKey k,
NodeType type,
int first,
int last,
GenericTreeNode * p )
inline

Construct GenericTreeNode.

Parameters
kNodeKey
typeNodeType
firstFirst particle index
lastLast particle index
pParent node

Member Function Documentation

◆ clone()

virtual GenericTreeNode * Tree::GenericTreeNode::clone ( ) const
pure virtual

make a copy of the node

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ contains()

virtual bool Tree::GenericTreeNode::contains ( NodeKey nodekey)
pure virtual

Is nodekey contained by this node.

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ fullyDelete()

virtual void Tree::GenericTreeNode::fullyDelete ( )
pure virtual

Recursively delete all nodes beneath this node.

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ getChildKey()

virtual NodeKey Tree::GenericTreeNode::getChildKey ( int )
pure virtual

return the keys for the specified child

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ getChildren()

virtual GenericTreeNode * Tree::GenericTreeNode::getChildren ( int )
pure virtual

return the pointers to the specified child of this node

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ getChunks()

virtual void Tree::GenericTreeNode::getChunks ( int num,
NodeKey *& ret )
pure virtual

get the top nodes corresponding to a particular number of chunks requested

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ getLevel()

virtual int Tree::GenericTreeNode::getLevel ( NodeKey k)
pure virtual

depth of node corresponding to NodeKey

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ getLongestCommonPrefix()

virtual NodeKey Tree::GenericTreeNode::getLongestCommonPrefix ( NodeKey k1,
NodeKey k2 )
inlinevirtual

return the NodeKey of the lowest common ancestor.

Reimplemented in Tree::BinaryTreeNode.

◆ getParentKey()

virtual NodeKey Tree::GenericTreeNode::getParentKey ( )
pure virtual

return the key for the parent

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ makeOctChildren()

virtual void Tree::GenericTreeNode::makeOctChildren ( GravityParticle * part,
int totalPart,
int level,
NodePool * pool = NULL )
pure virtual

construct the children of the "this" node following the given logical criteria (Oct/Orb)

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ numChildren()

virtual unsigned int Tree::GenericTreeNode::numChildren ( ) const
pure virtual

return the number of children this node has

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ pup() [1/2]

virtual void Tree::GenericTreeNode::pup ( PUP::er & p)
inlinevirtual

PUP just this node.

Reimplemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ pup() [2/2]

virtual void Tree::GenericTreeNode::pup ( PUP::er & p,
int depth )
pure virtual

PUP node and children down to depth.

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ setChildren()

virtual void Tree::GenericTreeNode::setChildren ( int ,
GenericTreeNode *  )
pure virtual

set the specified child of this node to the passed pointer

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

◆ whichChild()

virtual int Tree::GenericTreeNode::whichChild ( NodeKey childkey)
pure virtual

return an integer with the number of the child reflecting the key

Implemented in Tree::BinaryTreeNode, and Tree::OctTreeNode.

Member Data Documentation

◆ remoteIndex

int Tree::GenericTreeNode::remoteIndex

An index to the real location of this node if this node is NonLocal, if it is Boundary or Internal or Bucket it is equal to thisIndex During Treebuid, it indicates whether remote moments are needed to calculate this nodes moment.

◆ rungs

int Tree::GenericTreeNode::rungs

The greatest rung amoung the particles contained in this node (greater means faster). This information is limited to the nodes in the current TreePiece, and do not consider non-local data.


The documentation for this class was generated from the following files: