Mantid
|
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::Material > | buildMaterial () |
Construct the material,. More... | |
void | setMaterialParameters (const MaterialParameters ¶ms) |
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 ¶ms) |
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... | |
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.
std::unique_ptr< Kernel::Material > Mantid::DataHandling::ReadMaterial::buildMaterial | ( | ) |
Construct the material,.
Definition at line 132 of file ReadMaterial.cpp.
References Mantid::Kernel::MaterialBuilder::build(), and builder.
Referenced by Mantid::DataHandling::SetSampleMaterial::exec(), Mantid::DataHandling::SetSample::exec(), Mantid::DataHandling::LoadAsciiStl::readShape(), Mantid::DataHandling::LoadBinaryStl::readShape(), and Mantid::DataHandling::SetSample::setSampleEnvironmentFromXML().
|
staticprivate |
Definition at line 179 of file ReadMaterial.cpp.
References Mantid::EMPTY_DBL().
Referenced by setMaterialParameters(), setNumberDensity(), and validateInputs().
|
private |
Definition at line 136 of file ReadMaterial.cpp.
References builder, Mantid::Kernel::MaterialBuilder::setAtomicNumber(), Mantid::Kernel::MaterialBuilder::setFormula(), and Mantid::Kernel::MaterialBuilder::setMassNumber().
Referenced by 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.
params | A 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().
|
private |
Definition at line 145 of file ReadMaterial.cpp.
References builder, isEmpty(), rho, Mantid::Kernel::MaterialBuilder::setEffectiveNumberDensity(), Mantid::Kernel::MaterialBuilder::setMassDensity(), Mantid::Kernel::MaterialBuilder::setNumberDensity(), Mantid::Kernel::MaterialBuilder::setNumberDensityUnit(), Mantid::Kernel::MaterialBuilder::setPackingFraction(), Mantid::Kernel::MaterialBuilder::setUnitCellVolume(), and Mantid::Kernel::MaterialBuilder::setZParameter().
Referenced by setMaterialParameters().
|
private |
Definition at line 168 of file ReadMaterial.cpp.
References builder, Mantid::Kernel::MaterialBuilder::setAbsorptionXSection(), Mantid::Kernel::MaterialBuilder::setAttenuationProfileFilename(), Mantid::Kernel::MaterialBuilder::setCoherentXSection(), Mantid::Kernel::MaterialBuilder::setIncoherentXSection(), Mantid::Kernel::MaterialBuilder::setTotalScatterXSection(), and Mantid::Kernel::MaterialBuilder::setXRayAttenuationProfileFilename().
Referenced by setMaterialParameters().
|
static |
Validate the parameters to build the material from, this returns any errors in the inputs.
params | A struct containing all the parameters to be set. |
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().
|
private |
The builder used to construct the material.
Definition at line 97 of file ReadMaterial.h.
Referenced by buildMaterial(), setMaterial(), setNumberDensity(), and setScatteringInfo().