The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends | List of all members
NestedDensityTreePolicy Class Reference

#include <NestedDensityTreePolicy.hpp>

Inheritance diagram for NestedDensityTreePolicy:
Inheritance graph
[legend]

Public Member Functions

double innerMaxX () const
 
double innerMaxY () const
 
double innerMaxZ () const
 
double innerMinX () const
 
double innerMinY () const
 
double innerMinZ () const
 
DensityTreePolicyinnerPolicy () const
 
bool needsSubdivide (TreeNode *node) override
 
- Public Member Functions inherited from DensityTreePolicy
vector< TreeNode * > constructTree (TreeNode *root) override
 
double maxDustDensityDispersion () const
 
double maxDustFraction () const
 
double maxDustOpticalDepth () const
 
double maxElectronFraction () const
 
double maxGasFraction () const
 
virtual bool needsSubdivide (TreeNode *node)
 
double wavelength () const
 
Range wavelengthRange () const override
 
- Public Member Functions inherited from TreePolicy
virtual vector< TreeNode * > constructTree (TreeNode *root)=0
 
int maxLevel () const
 
int minLevel () const
 
- Public Member Functions inherited from SimulationItem
template<class T >
T * find (bool setup=true) const
 
template<class T >
T * interface (int levels=-999999, bool setup=true) const
 
virtual string itemName () const
 
void setup ()
 
string typeAndName () const
 
- Public Member Functions inherited from Item
 Item (const Item &)=delete
 
virtual ~Item ()
 
void addChild (Item *child)
 
const vector< Item * > & children () const
 
virtual void clearItemListProperty (const PropertyDef *property)
 
void destroyChild (Item *child)
 
virtual bool getBoolProperty (const PropertyDef *property) const
 
virtual vector< double > getDoubleListProperty (const PropertyDef *property) const
 
virtual double getDoubleProperty (const PropertyDef *property) const
 
virtual string getEnumProperty (const PropertyDef *property) const
 
virtual int getIntProperty (const PropertyDef *property) const
 
virtual vector< Item * > getItemListProperty (const PropertyDef *property) const
 
virtual ItemgetItemProperty (const PropertyDef *property) const
 
virtual string getStringProperty (const PropertyDef *property) const
 
int getUtilityProperty (string name) const
 
virtual void insertIntoItemListProperty (const PropertyDef *property, int index, Item *item)
 
Itemoperator= (const Item &)=delete
 
Itemparent () const
 
virtual void removeFromItemListProperty (const PropertyDef *property, int index)
 
virtual void setBoolProperty (const PropertyDef *property, bool value)
 
virtual void setDoubleListProperty (const PropertyDef *property, vector< double > value)
 
virtual void setDoubleProperty (const PropertyDef *property, double value)
 
virtual void setEnumProperty (const PropertyDef *property, string value)
 
virtual void setIntProperty (const PropertyDef *property, int value)
 
virtual void setItemProperty (const PropertyDef *property, Item *item)
 
virtual void setStringProperty (const PropertyDef *property, string value)
 
void setUtilityProperty (string name, int value)
 
virtual string type () const
 
- Public Member Functions inherited from MaterialWavelengthRangeInterface
virtual WavelengthGridmaterialWavelengthGrid () const
 
- Public Member Functions inherited from WavelengthRangeInterface
virtual ~WavelengthRangeInterface ()
 
virtual Range wavelengthRange () const =0
 

Protected Member Functions

 NestedDensityTreePolicy ()
 
void setupSelfBefore () override
 
- Protected Member Functions inherited from DensityTreePolicy
 DensityTreePolicy ()
 
void setupSelfBefore () override
 
- Protected Member Functions inherited from TreePolicy
 TreePolicy ()
 
void setupSelfBefore () override
 
- Protected Member Functions inherited from SimulationItem
 SimulationItem ()
 
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
 
virtual void setupSelfAfter ()
 
virtual void setupSelfBefore ()
 
- Protected Member Functions inherited from Item
 Item ()
 
- Protected Member Functions inherited from MaterialWavelengthRangeInterface
 MaterialWavelengthRangeInterface ()
 
- Protected Member Functions inherited from WavelengthRangeInterface
 WavelengthRangeInterface ()
 

Private Types

using BaseType = DensityTreePolicy
 
using ItemType = NestedDensityTreePolicy
 

Private Attributes

Box _inner
 
double _innerMaxX
 
double _innerMaxY
 
double _innerMaxZ
 
double _innerMinX
 
double _innerMinY
 
double _innerMinZ
 
DensityTreePolicy_innerPolicy
 

Friends

class ItemRegistry
 

Detailed Description

NestedDensityTreePolicy is a DensityTreePolicy policy that allows defining separate subdivision criteria in a given subregion of the spatial grid. This can be used, for example, to specify a higher resolution in a given region of interest.

The class inherits from DensityTreePolicy and uses all the inherited properties to classify the outer region. Additional innerMin/innerMax coordinate properties define the bounding box of the inner region. Finally, the additional property innerPolicy, which is also expected to be a DensityTreePolicy instance, specifies the subdivision criteria for the inner region.

If a TreeNode intersects with the inner region the node will be subdivided based on the criteria defined by the innerPolicy. This means that even TreeNodes that are almost fully outside the inner region can be subdivided by those criteria if they have a non-zero intersection with the inner region.

It is not meaningful to specify an inner region that extends outside of the spatial grid bounding box, because none of the tree nodes will intersect those outside areas. Therefore, a warning is issued if the inner region is not fully inside the spatial grid domain.

Recursive nesting

By default, the inner policy is a regular DensityTreePolicy instance. However, because NestedDensityTreePolicy inherits DensityTreePolicy, it is also possible to again select a NestedDensityTreePolicy instance as the inner policy, leading to recursive nesting. While this is not a recommended use case, it would allow specifying recursively increasing resolution in nested, successively smaller regions of the spatial domain.

This item type is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.

Constructor & Destructor Documentation

◆ NestedDensityTreePolicy()

NestedDensityTreePolicy::NestedDensityTreePolicy ( )
inlineprotected

Default constructor for concrete Item subclass NestedDensityTreePolicy : "a tree grid construction policy using a nested density tree policy" .

Member Function Documentation

◆ innerMaxX()

NestedDensityTreePolicy::innerMaxX ( ) const
inline

This function returns the value of the discoverable double property innerMaxX : "the end point of the inner box in the X direction" .

This property represents a physical quantity of type "length" .

◆ innerMaxY()

NestedDensityTreePolicy::innerMaxY ( ) const
inline

This function returns the value of the discoverable double property innerMaxY : "the end point of the inner box in the Y direction" .

This property represents a physical quantity of type "length" .

◆ innerMaxZ()

NestedDensityTreePolicy::innerMaxZ ( ) const
inline

This function returns the value of the discoverable double property innerMaxZ : "the end point of the inner box in the Z direction" .

This property represents a physical quantity of type "length" .

◆ innerMinX()

NestedDensityTreePolicy::innerMinX ( ) const
inline

This function returns the value of the discoverable double property innerMinX : "the start point of the inner box in the X direction" .

This property represents a physical quantity of type "length" .

◆ innerMinY()

NestedDensityTreePolicy::innerMinY ( ) const
inline

This function returns the value of the discoverable double property innerMinY : "the start point of the inner box in the Y direction" .

This property represents a physical quantity of type "length" .

◆ innerMinZ()

NestedDensityTreePolicy::innerMinZ ( ) const
inline

This function returns the value of the discoverable double property innerMinZ : "the start point of the inner box in the Z direction" .

This property represents a physical quantity of type "length" .

◆ innerPolicy()

NestedDensityTreePolicy::innerPolicy ( ) const
inline

This function returns the value of the discoverable item property innerPolicy : "the density tree policy for the inner region" .

The default value for this property is given by the conditional value expression "DensityTreePolicy" .

◆ needsSubdivide()

bool NestedDensityTreePolicy::needsSubdivide ( TreeNode node)
overridevirtual

This function determines whether the given node needs to be subdivided. Depending on whether the node intersects with the inner region or not, the request is passed to the needsSubdivide() function of the nested policy or to the needsSubdivide() function of our base class.

Reimplemented from DensityTreePolicy.

◆ setupSelfBefore()

void NestedDensityTreePolicy::setupSelfBefore ( )
overrideprotectedvirtual

This function checks whether the inner region is inside the outer region.

Reimplemented from DensityTreePolicy.


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