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

#include <MaterialMixFamily.hpp>

Inheritance diagram for MaterialMixFamily:
Inheritance graph
[legend]

Public Member Functions

virtual const MaterialMixmix (const Array &parameters) const =0
 
virtual vector< SnapshotParameterparameterInfo () const =0
 
- 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
 

Protected Member Functions

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

Private Types

using BaseType = SimulationItem
 
using ItemType = MaterialMixFamily
 

Friends

class ItemRegistry
 

Detailed Description

MaterialMixFamily is an abstract class for representing a family of material mixes of the same material type (i.e. either dust, electrons or gas; never a mixture of these). Each subclass implements a material mix family from which a particular material mix can be chosen based on one or more parameters. This base class offers a generic interface for obtaining information on the number and type of parameters appropriate for the subclass, and for actually selecting a material mix given specific parameter values.

Because each material mix is represented by a distinct C++ object, a material mix family must by necessity consist of a discrete number of family members. As a result, each subclass must implement a mechanism to map specified parameter values from their continuous ranges to one of a discrete set of material mixes.

Also, because a material mix object often consumes a significant amount of memory for holding material properties and precalculated values, the number of material mixes that can be offered by a material mix family is limited by the available memory resources.

Constructor & Destructor Documentation

◆ MaterialMixFamily()

MaterialMixFamily::MaterialMixFamily ( )
inlineprotected

Default constructor for abstract Item subclass MaterialMixFamily : "a family of material mixes" .

Member Function Documentation

◆ mix()

virtual const MaterialMix * MaterialMixFamily::mix ( const Array parameters) const
pure virtual

This function returns (a pointer to) the material mix corresponding to the given parameter values, or some default material mix if one or more of the parameter values are out of range. The material mix family retains ownership of the returned material mix, and guarantees that it will not be destroyed until the family itself is destroyed.

The number and type of parameters must match the information returned by the parameterInfo() function; if not the behavior is undefined.

Implemented in SelectDustMixFamily.

◆ parameterInfo()

virtual vector< SnapshotParameter > MaterialMixFamily::parameterInfo ( ) const
pure virtual

This function returns the number and type of parameters used by this particular material mix family as a list of SnapshotParameter objects. Each of these objects specifies unit information and a human-readable descripton for the parameter.

Implemented in SelectDustMixFamily.


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