Mantid
Loading...
Searching...
No Matches
ReadMaterial.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "MantidDataHandling/DllConfig.h"
12#include <map>
13namespace Mantid {
14namespace Kernel {
15class Material;
16}
17namespace DataHandling {
18using ValidationErrors = std::map<std::string, std::string>;
19
26class MANTID_DATAHANDLING_DLL ReadMaterial {
27public:
34 std::string chemicalSymbol = "";
36 int atomicNumber = 0;
38 int massNumber = 0;
40 double numberDensity = EMPTY_DBL();
42 double numberDensityEffective = EMPTY_DBL();
44 double packingFraction = EMPTY_DBL();
46 double zParameter = EMPTY_DBL();
48 double unitCellVolume = EMPTY_DBL();
50 double massDensity = EMPTY_DBL();
52 double mass = EMPTY_DBL();
54 double volume = EMPTY_DBL();
56 double coherentXSection = EMPTY_DBL();
58 double incoherentXSection = EMPTY_DBL();
60 double attenuationXSection = EMPTY_DBL();
62 double scatteringXSection = EMPTY_DBL();
64 std::string attenuationProfileFileName = "";
66 std::string xRayAttenuationProfileFileName = "";
68 Kernel::MaterialBuilder::NumberDensityUnit numberDensityUnit = Kernel::MaterialBuilder::NumberDensityUnit::Atoms;
69 };
77 static ValidationErrors validateInputs(const MaterialParameters &params);
84 void setMaterialParameters(const MaterialParameters &params);
90 std::unique_ptr<Kernel::Material> buildMaterial();
91
92private:
98
99 void setMaterial(const std::string &chemicalSymbol, const int atomicNumber, const int massNumber);
100
101 void setNumberDensity(const double rho_m, const double rho, const double rho_eff, const double pFrac,
102 const Kernel::MaterialBuilder::NumberDensityUnit rhoUnit, const double zParameter,
103 const double unitCellVolume);
104 void setScatteringInfo(double coherentXSection, double incoherentXSection, double attenuationXSection,
105 double scatteringXSection, std::string attenuationProfileFileName,
106 std::string xRayAttenuationProfileFileName);
107
108 static bool isEmpty(const double toCheck);
109};
110} // namespace DataHandling
111} // namespace Mantid
This class contains code for interpreting a material input for SetSampleMaterial, validating the para...
Definition: ReadMaterial.h:26
Kernel::MaterialBuilder builder
The builder used to construct the material.
Definition: ReadMaterial.h:97
Create a material from a set of user defined options.
std::map< std::string, std::string > ValidationErrors
Definition: ReadMaterial.h:18
Helper class which provides the Collimation Length for SANS instruments.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
Definition: EmptyValues.h:43
This struct contains the parameters for constructing a material, and gives them a default value for e...
Definition: ReadMaterial.h:32