MCPlusPlus
A Monte Carlo C++ code for radiative transport
Public Member Functions | List of all members
MCPP::Sample Class Reference

The Sample class describes a multi-layer sample made of infinitely extended slabs. More...

#include <MCPlusPlus/sample.h>

+ Inheritance diagram for MCPP::Sample:
+ Collaboration diagram for MCPP::Sample:

Public Member Functions

void addLayer (Material *material, double thickness)
 Adds a layer to the sample. More...
 
void addPreLayer (Material *material, double thickness)
 Adds a non-scattering pre-layer to the sample. More...
 
unsigned int layerAt (MCfloat z)
 The index of the layer in which the given $ z $ lies. More...
 
Materialmaterial (unsigned int layerIndex) const
 The material of the $ i $-th layer. More...
 
unsigned int nLayers () const
 The total number of layers and pre-layers that make up the sample. More...
 
 Sample (BaseObject *parent=NULL)
 
void setSurroundingEnvironment (Material *material)
 Set the material that surrounds the sample. More...
 
void setSurroundingEnvironment (Material *leftMaterial, Material *rightMaterial)
 Set the materials surrounding the sample on the two sides (left and right) More...
 
MCfloat totalThickness () const
 
const deque< MCfloat > * zBoundaries () const
 Returns a pointer to a deque containing the layer boundaries along $ z $. More...
 
- Public Member Functions inherited from MCPP::BaseObject
 BaseObject (BaseObject *parent=NULL)
 
list< BaseObject * > childList () const
 
BaseObjectclone () const
 Returns a cloned instance of the current object. More...
 
void describe () const
 Prints a description of the object and its main properties. More...
 
bool hasAParent () const
 
bool inheritsRandom () const
 Determines whether or not the object derives from BaseRandom. More...
 
BaseObjectparent () const
 Returns a pointer to the parent object.
 
bool sanityCheck () const
 Performs a series of integrity checks on internal data to ensure that the object is properly initialized and ready to be used. More...
 
void setParent (BaseObject *parent)
 Makes the object a child of parent. More...
 
string typeName () const
 The class name of the object. More...
 
bool wasCloned () const
 Determines whether or not the object was cloned. More...
 

Additional Inherited Members

- Protected Member Functions inherited from MCPP::BaseObject
void addObjectToCheck (const BaseObject **const obj)
 Adds a BaseObject pointer to the list of objects to be checked. More...
 
void clearObjectsToCheck ()
 
void copyToInternalVariable (char **dest, const char *src)
 
void logMessage (const string &msg) const
 Logs a message to stderr. More...
 
void logMessage (const char *fmt,...) const
 
- Protected Attributes inherited from MCPP::BaseObject
bool _inheritsRandom
 
list< const BaseObject *const * > objectsToCheck
 

Detailed Description

The Sample class describes a multi-layer sample made of infinitely extended slabs.

Member Function Documentation

◆ addLayer()

void Sample::addLayer ( Material material,
double  thickness 
)

Adds a layer to the sample.

Parameters
material
thickness

A layer is an infinitely extended slab with the given material and the given finite thickness (measured along $ z $). Layers are stacked from left to right. The first interface of the first layer is placed in $ z=0 $.

◆ addPreLayer()

void Sample::addPreLayer ( Material material,
double  thickness 
)

Adds a non-scattering pre-layer to the sample.

Parameters
material
thickness

Pre-layers are stacked from left to right. The first interface of the first layer is placed in $ z=0 $.

◆ layerAt()

unsigned int Sample::layerAt ( MCfloat  z)

The index of the layer in which the given $ z $ lies.

Parameters
z
Returns

Interfaces are considered to belong to the leftmost layer

◆ material()

Material * Sample::material ( unsigned int  layerIndex) const

The material of the $ i $-th layer.

Parameters
layerIndex
Returns

◆ nLayers()

unsigned int Sample::nLayers ( ) const

The total number of layers and pre-layers that make up the sample.

Returns

◆ setSurroundingEnvironment() [1/2]

void Sample::setSurroundingEnvironment ( Material material)

Set the material that surrounds the sample.

Parameters
material

◆ setSurroundingEnvironment() [2/2]

void Sample::setSurroundingEnvironment ( Material leftMaterial,
Material rightMaterial 
)

Set the materials surrounding the sample on the two sides (left and right)

Parameters
leftMaterial
rightMaterial

◆ zBoundaries()

const deque< MCfloat > * Sample::zBoundaries ( ) const

Returns a pointer to a deque containing the layer boundaries along $ z $.

Returns

The n-th element of this deque is the upper boundary of the n-th layer. The 0-th element is the upper boundary of the surrounding environment semi-infinte space towards negative infinity.


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