Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::OrientedBoxTreeTool::Settings Struct Reference

Misc. knobs controlling tree subdivision. More...

#include <OrientedBoxTreeTool.hpp>

Public Member Functions

 Settings ()
 set defaults More...
 
bool valid () const
 Check if settings are valid. More...
 

Public Attributes

int max_leaf_entities
 Average number of entities per leaf. More...
 
int max_depth
 Maximum tree depth - 0->no limit Must be in [best_split_ratio,1.0] A tree node will not be split if the ratio of children in the child nodes is greater than this value. More...
 
double worst_split_ratio
 
double best_split_ratio
 Must be in [0.0,worst_split_ratio] The search for an optimal split plane for splitting a node will stop if at least this ratio is achieved for the number of entities on each side of the split plane. More...
 
unsigned int set_options
 Flags used to create entity sets representing tree nodes. More...
 

Detailed Description

Misc. knobs controlling tree subdivision.

Available settings for controlling when and how nodes in the tree are split. The constructor will initialize to the default settings. All settings except best_split_ratio control when a node is subdivided. best_split_ratio influences the choice of how the node is subdivided.

A calculated ratio is used in the determination of when and how to split a node. The ratio is calculated as:

  • \(max(\frac{|n_L - n_R|}{n_L+n_R}, f*\frac{n_I}{n_L+n_R})\)
  • \(n_L\) : num entities to be placed in left child
  • \(n_R\) : num entities to be placed in right child
  • \(f\) : Settings::intersect_ratio_factor
  • \(n_I\): num entities intersecting split plane

ALL of the following conditions must be met for a node to be further subdivied:

  • Depth must be less than max_depth
  • Node must contain more than max_leaf_entities entities.
  • The 'ratio' must be less than worst_split_ratio

The node will be subdivided using a plane normal to one of the box axis and containing the box center. The planes are tested beginning with the one orthogonal to the longest box axis and finishing with the one orthogonal to the shortest box axis. The search will stop at the first plane for which the 'ratio' is at least Settings::best_split_ratio . Giving Settings::best_split_ratio a non-zero value gives preference to a split orthogonal to larger box dimensions.

Definition at line 88 of file OrientedBoxTreeTool.hpp.

Constructor & Destructor Documentation

◆ Settings()

moab::OrientedBoxTreeTool::Settings::Settings ( )

set defaults

Definition at line 72 of file OrientedBoxTreeTool.cpp.

73  : max_leaf_entities( 8 ), max_depth( 0 ), worst_split_ratio( 0.95 ), best_split_ratio( 0.4 ),
75 {
76 }

Member Function Documentation

◆ valid()

bool moab::OrientedBoxTreeTool::Settings::valid ( ) const

Check if settings are valid.

Definition at line 78 of file OrientedBoxTreeTool.cpp.

79 {
80  return max_leaf_entities > 0 && max_depth >= 0 && worst_split_ratio <= 1.0 && best_split_ratio >= 0.0 &&
82 }

Referenced by moab::OrientedBoxTreeTool::build(), and moab::OrientedBoxTreeTool::join_trees().

Member Data Documentation

◆ best_split_ratio

double moab::OrientedBoxTreeTool::Settings::best_split_ratio

Must be in [0.0,worst_split_ratio] The search for an optimal split plane for splitting a node will stop if at least this ratio is achieved for the number of entities on each side of the split plane.

Definition at line 102 of file OrientedBoxTreeTool.hpp.

Referenced by moab::OrientedBoxTreeTool::build_tree().

◆ max_depth

int moab::OrientedBoxTreeTool::Settings::max_depth

Maximum tree depth - 0->no limit Must be in [best_split_ratio,1.0] A tree node will not be split if the ratio of children in the child nodes is greater than this value.

Definition at line 93 of file OrientedBoxTreeTool.hpp.

Referenced by moab::OrientedBoxTreeTool::build_tree().

◆ max_leaf_entities

int moab::OrientedBoxTreeTool::Settings::max_leaf_entities

Average number of entities per leaf.

Definition at line 92 of file OrientedBoxTreeTool.hpp.

Referenced by moab::OrientedBoxTreeTool::build_tree().

◆ set_options

unsigned int moab::OrientedBoxTreeTool::Settings::set_options

Flags used to create entity sets representing tree nodes.

Definition at line 104 of file OrientedBoxTreeTool.hpp.

Referenced by moab::OrientedBoxTreeTool::build_sets(), and moab::OrientedBoxTreeTool::build_tree().

◆ worst_split_ratio

double moab::OrientedBoxTreeTool::Settings::worst_split_ratio

Definition at line 97 of file OrientedBoxTreeTool.hpp.

Referenced by moab::OrientedBoxTreeTool::build_tree().


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