Mantid
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Mantid::DataHandling::ReadMaterial Class Reference

This class contains code for interpreting a material input for SetSampleMaterial, validating the parameters before sending them on to MaterialBuilder. More...

#include <ReadMaterial.h>

Classes

struct  MaterialParameters
 This struct contains the parameters for constructing a material, and gives them a default value for ease of testing. More...
 

Public Member Functions

std::unique_ptr< Kernel::MaterialbuildMaterial ()
 Construct the material,. More...
 
void setMaterialParameters (const MaterialParameters &params)
 Set the parameters to build the material to the builder, taking into account which values were and weren't set. More...
 

Static Public Member Functions

static ValidationErrors validateInputs (const MaterialParameters &params)
 Validate the parameters to build the material from, this returns any errors in the inputs. More...
 

Private Member Functions

void setMaterial (const std::string &chemicalSymbol, const int atomicNumber, const int massNumber)
 
void setNumberDensity (const double rho_m, const double rho, const double rho_eff, const double pFrac, const Kernel::MaterialBuilder::NumberDensityUnit rhoUnit, const double zParameter, const double unitCellVolume)
 
void setScatteringInfo (double coherentXSection, double incoherentXSection, double attenuationXSection, double scatteringXSection, std::string attenuationProfileFileName, std::string xRayAttenuationProfileFileName)
 

Static Private Member Functions

static bool isEmpty (const double toCheck)
 

Private Attributes

Kernel::MaterialBuilder builder
 The builder used to construct the material. More...
 

Detailed Description

This class contains code for interpreting a material input for SetSampleMaterial, validating the parameters before sending them on to MaterialBuilder.

Definition at line 26 of file ReadMaterial.h.

Member Function Documentation

◆ buildMaterial()

std::unique_ptr< Kernel::Material > Mantid::DataHandling::ReadMaterial::buildMaterial ( )

◆ isEmpty()

bool Mantid::DataHandling::ReadMaterial::isEmpty ( const double  toCheck)
staticprivate

Definition at line 179 of file ReadMaterial.cpp.

References Mantid::EMPTY_DBL().

Referenced by setMaterialParameters(), setNumberDensity(), and validateInputs().

◆ setMaterial()

void Mantid::DataHandling::ReadMaterial::setMaterial ( const std::string &  chemicalSymbol,
const int  atomicNumber,
const int  massNumber 
)
private

◆ setMaterialParameters()

void Mantid::DataHandling::ReadMaterial::setMaterialParameters ( const MaterialParameters params)

Set the parameters to build the material to the builder, taking into account which values were and weren't set.

Parameters
paramsA struct containing all the parameters to be set.

Definition at line 110 of file ReadMaterial.cpp.

References Mantid::DataHandling::ReadMaterial::MaterialParameters::atomicNumber, Mantid::DataHandling::ReadMaterial::MaterialParameters::attenuationProfileFileName, Mantid::DataHandling::ReadMaterial::MaterialParameters::attenuationXSection, Mantid::DataHandling::ReadMaterial::MaterialParameters::chemicalSymbol, Mantid::DataHandling::ReadMaterial::MaterialParameters::coherentXSection, Mantid::DataHandling::ReadMaterial::MaterialParameters::incoherentXSection, isEmpty(), Mantid::DataHandling::ReadMaterial::MaterialParameters::mass, Mantid::DataHandling::ReadMaterial::MaterialParameters::massDensity, Mantid::DataHandling::ReadMaterial::MaterialParameters::massNumber, Mantid::DataHandling::ReadMaterial::MaterialParameters::numberDensity, Mantid::DataHandling::ReadMaterial::MaterialParameters::numberDensityEffective, Mantid::DataHandling::ReadMaterial::MaterialParameters::numberDensityUnit, Mantid::DataHandling::ReadMaterial::MaterialParameters::packingFraction, Mantid::DataHandling::ReadMaterial::MaterialParameters::scatteringXSection, setMaterial(), setNumberDensity(), setScatteringInfo(), Mantid::DataHandling::ReadMaterial::MaterialParameters::unitCellVolume, Mantid::DataHandling::ReadMaterial::MaterialParameters::volume, Mantid::DataHandling::ReadMaterial::MaterialParameters::xRayAttenuationProfileFileName, and Mantid::DataHandling::ReadMaterial::MaterialParameters::zParameter.

Referenced by Mantid::DataHandling::SetSampleMaterial::exec(), Mantid::DataHandling::SetSample::exec(), Mantid::DataHandling::LoadAsciiStl::readShape(), Mantid::DataHandling::LoadBinaryStl::readShape(), and Mantid::DataHandling::SetSample::setSampleEnvironmentFromXML().

◆ setNumberDensity()

void Mantid::DataHandling::ReadMaterial::setNumberDensity ( const double  rho_m,
const double  rho,
const double  rho_eff,
const double  pFrac,
const Kernel::MaterialBuilder::NumberDensityUnit  rhoUnit,
const double  zParameter,
const double  unitCellVolume 
)
private

◆ setScatteringInfo()

void Mantid::DataHandling::ReadMaterial::setScatteringInfo ( double  coherentXSection,
double  incoherentXSection,
double  attenuationXSection,
double  scatteringXSection,
std::string  attenuationProfileFileName,
std::string  xRayAttenuationProfileFileName 
)
private

◆ validateInputs()

ValidationErrors Mantid::DataHandling::ReadMaterial::validateInputs ( const MaterialParameters params)
static

Validate the parameters to build the material from, this returns any errors in the inputs.

Parameters
paramsA struct containing all the parameters to be set.
Returns
A map containing the relevent failure messages, if any.

Definition at line 22 of file ReadMaterial.cpp.

References Mantid::DataHandling::ReadMaterial::MaterialParameters::atomicNumber, Mantid::DataHandling::ReadMaterial::MaterialParameters::attenuationProfileFileName, Mantid::DataHandling::ReadMaterial::MaterialParameters::attenuationXSection, Mantid::DataHandling::ReadMaterial::MaterialParameters::chemicalSymbol, Mantid::DataHandling::ReadMaterial::MaterialParameters::coherentXSection, Mantid::DataHandling::ReadMaterial::MaterialParameters::incoherentXSection, isEmpty(), Mantid::DataHandling::ReadMaterial::MaterialParameters::massDensity, Mantid::DataHandling::ReadMaterial::MaterialParameters::massNumber, Mantid::DataHandling::ReadMaterial::MaterialParameters::numberDensity, Mantid::DataHandling::ReadMaterial::MaterialParameters::numberDensityEffective, Mantid::DataHandling::ReadMaterial::MaterialParameters::packingFraction, Mantid::DataHandling::ReadMaterial::MaterialParameters::scatteringXSection, Mantid::DataHandling::ReadMaterial::MaterialParameters::unitCellVolume, and Mantid::DataHandling::ReadMaterial::MaterialParameters::zParameter.

Referenced by Mantid::DataHandling::LoadSampleEnvironment::validateInputs(), Mantid::DataHandling::SetSampleMaterial::validateInputs(), and Mantid::DataHandling::SetSample::validateMaterial().

Member Data Documentation

◆ builder

Kernel::MaterialBuilder Mantid::DataHandling::ReadMaterial::builder
private

The builder used to construct the material.

Definition at line 97 of file ReadMaterial.h.

Referenced by buildMaterial(), setMaterial(), setNumberDensity(), and setScatteringInfo().


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