Mantid
Loading...
Searching...
No Matches
Material.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
8#include "MantidKernel/Atom.h"
11#include <NeXusFile.hpp>
12#include <boost/lexical_cast.hpp>
13#include <memory>
14#include <numeric>
15#include <utility>
16
17namespace Mantid::Kernel {
19using str_pair = std::pair<std::string, std::string>;
20
24
25namespace {
26constexpr double INV_FOUR_PI = 1. / (4. * M_PI);
27
28inline double scatteringLength(const double real, const double imag) {
29 double length;
30 if (imag == 0.) {
31 length = std::abs(real);
32 } else if (real == 0.) {
33 length = std::abs(imag);
34 } else {
35 length = std::hypot(real, imag);
36 }
37
38 if (!std::isnormal(length)) {
39 return 0.;
40 } else {
41 return length;
42 }
43}
44
45inline double scatteringXS(const double realLength, const double imagLength) {
46 double lengthSqrd = (realLength * realLength) + (imagLength * imagLength);
47
48 if (!std::isnormal(lengthSqrd)) {
49 return 0.;
50 } else {
51 return .04 * M_PI * lengthSqrd;
52 }
53}
54} // namespace
55
56Mantid::Kernel::Material::FormulaUnit::FormulaUnit(std::shared_ptr<PhysicalConstants::Atom> atom,
57 const double multiplicity)
58 : atom(std::move(atom)), multiplicity(multiplicity) {}
59
61 : atom(std::make_shared<PhysicalConstants::Atom>(atom)), multiplicity(multiplicity) {}
62
69
79Material::Material(std::string name, const ChemicalFormula &formula, const double numberDensity,
80 const double packingFraction, const double temperature, const double pressure)
81 : m_name(std::move(name)), m_atomTotal(0.0), m_numberDensity(numberDensity), m_packingFraction(packingFraction),
82 m_temperature(temperature), m_pressure(pressure) {
83 m_chemicalFormula.assign(formula.begin(), formula.end());
84 this->countAtoms();
87}
88
98Material::Material(std::string name, const PhysicalConstants::NeutronAtom &atom, const double numberDensity,
99 const double packingFraction, const double temperature, const double pressure)
100 : m_name(std::move(name)), m_chemicalFormula(), m_atomTotal(1.0), m_numberDensity(numberDensity),
101 m_packingFraction(packingFraction), m_temperature(temperature), m_pressure(pressure) {
102 if (atom.z_number == 0) { // user specified atom
103 m_chemicalFormula.emplace_back(atom, 1.);
104 } else if (atom.a_number > 0) { // single isotope
105 m_chemicalFormula.emplace_back(getAtom(atom.z_number, atom.a_number), 1.);
106 } else { // isotopic average
107 m_chemicalFormula.emplace_back(atom, 1.);
108 }
111}
112
113// update the total atom count
116 std::accumulate(std::begin(m_chemicalFormula), std::end(m_chemicalFormula), 0.,
117 [](double subtotal, const FormulaUnit &right) { return subtotal + right.multiplicity; });
118}
119
129 double weightedTotal;
130
131 if (m_chemicalFormula.size() == 1) {
132 weightedTotal = m_chemicalFormula.front().atom->neutron.abs_scatt_xs;
133 } else {
134 weightedTotal = std::accumulate(std::begin(m_chemicalFormula), std::end(m_chemicalFormula), 0.,
135 [](double subtotal, const FormulaUnit &right) {
136 return subtotal + right.atom->neutron.abs_scatt_xs * right.multiplicity;
137 }) /
139 }
140
141 if (!std::isnormal(weightedTotal)) {
142 weightedTotal = 0.;
143 }
144
146}
147
148// calculate the total scattering x section (by wavelength) following Sears
149// eqn 13.
151 double weightedTotal;
152 if (m_chemicalFormula.size() == 1)
153 weightedTotal = m_chemicalFormula.front().atom->neutron.tot_scatt_xs;
154 else {
155 weightedTotal = std::accumulate(std::begin(m_chemicalFormula), std::end(m_chemicalFormula), 0.,
156 [](double subtotal, const FormulaUnit &right) {
157 return subtotal + right.atom->neutron.tot_scatt_xs * right.multiplicity;
158 }) /
160 }
161
162 if (!std::isnormal(weightedTotal)) {
164 } else {
165 m_totalScatterXSection = weightedTotal;
166 }
167}
168
170 m_attenuationOverride = std::move(attenuationOverride);
171}
172
174 m_xRayAttenuationProfile = std::move(attenuationProfile);
175}
176
181const std::string &Material::name() const { return m_name; }
182
184
189double Material::numberDensity() const { return m_numberDensity; }
190
196
203
209double Material::totalAtoms() const { return m_atomTotal; }
210
215double Material::temperature() const { return m_temperature; }
216
221double Material::pressure() const { return m_pressure; }
222
229 if (m_chemicalFormula.size() == 1)
230 return m_chemicalFormula.front().atom->neutron.coh_scatt_xs;
231
232 return scatteringXS(cohScatterLengthReal(), cohScatterLengthImg());
233}
234
241 if (m_chemicalFormula.size() == 1)
242 return m_chemicalFormula.front().atom->neutron.inc_scatt_xs;
243
245}
246
253
260double Material::absorbXSection(const double lambda) const { return m_linearAbsorpXSectionByWL * lambda; }
261
267double Material::attenuationCoefficient(const double lambda) const {
270 } else {
271 return m_attenuationOverride->getAttenuationCoefficient(lambda);
272 }
273}
274
281double Material::attenuation(const double distance, const double lambda) const {
282 return exp(-attenuationCoefficient(lambda) * distance);
283}
284
290double Material::xRayAttenuation(const double distance, const double energy) const {
292 return exp(-m_xRayAttenuationProfile->getAttenuationCoefficient(energy) * distance);
293 } else {
294 throw std::runtime_error("xRayAttenuationProfile override not set");
295 }
296}
297/*
298 * @returns true if m_xRayAttenuationOverride is set and false if not
299 */
302 return true;
303 } else {
304 return false;
305 }
306}
307// NOTE: the angstrom^-2 to barns and the angstrom^-1 to cm^-1
308// will cancel for mu to give units: cm^-1
309double Material::linearAbsorpCoef(const double lambda) const {
311}
312
313// This must match the values that come from the scalar version
314std::vector<double> Material::linearAbsorpCoef(std::vector<double>::const_iterator lambdaBegin,
315 std::vector<double>::const_iterator lambdaEnd) const {
316
317 const double densityTerm = 100. * numberDensityEffective();
318
319 std::vector<double> linearCoef(std::distance(lambdaBegin, lambdaEnd));
320
321 std::transform(lambdaBegin, lambdaEnd, linearCoef.begin(),
322 [densityTerm, this](const double lambda) { return densityTerm * this->absorbXSection(lambda); });
323
324 return linearCoef;
325}
326
328double Material::cohScatterLength(const double lambda) const {
330
331 if (m_chemicalFormula.size() == 1)
332 return m_chemicalFormula.front().atom->neutron.coh_scatt_length;
333
334 // these have already accounted for single atom case
335 return scatteringLength(cohScatterLengthReal(), cohScatterLengthImg());
336}
337
339double Material::incohScatterLength(const double lambda) const {
341
342 if (m_chemicalFormula.size() == 1)
343 return m_chemicalFormula.front().atom->neutron.inc_scatt_length;
344
345 return scatteringLength(incohScatterLengthReal(), incohScatterLengthImg());
346}
347
349double Material::cohScatterLengthReal(const double lambda) const {
351 if (m_chemicalFormula.size() == 1)
352 return m_chemicalFormula.front().atom->neutron.coh_scatt_length_real;
353
354 const double weightedTotal =
355 std::accumulate(std::begin(m_chemicalFormula), std::end(m_chemicalFormula), 0.,
356 [](double subtotal, const FormulaUnit &right) {
357 return subtotal + right.atom->neutron.coh_scatt_length_real * right.multiplicity;
358 }) /
360
361 if (!std::isnormal(weightedTotal)) {
362 return 0.;
363 } else {
364 return weightedTotal;
365 }
366}
367
369double Material::cohScatterLengthImg(const double lambda) const {
371
372 if (m_chemicalFormula.size() == 1)
373 return m_chemicalFormula.front().atom->neutron.coh_scatt_length_img;
374
375 const double weightedTotal =
376 std::accumulate(std::begin(m_chemicalFormula), std::end(m_chemicalFormula), 0.,
377 [](double subtotal, const FormulaUnit &right) {
378 return subtotal + right.atom->neutron.coh_scatt_length_img * right.multiplicity;
379 }) /
381
382 if (!std::isnormal(weightedTotal)) {
383 return 0.;
384 } else {
385 return weightedTotal;
386 }
387}
388
390double Material::incohScatterLengthReal(const double lambda) const {
392
393 if (m_chemicalFormula.size() == 1)
394 return m_chemicalFormula.front().atom->neutron.inc_scatt_length_real;
395
396 const double weightedTotal =
397 std::accumulate(std::begin(m_chemicalFormula), std::end(m_chemicalFormula), 0.,
398 [](double subtotal, const FormulaUnit &right) {
399 return subtotal + right.atom->neutron.inc_scatt_length_real * right.multiplicity;
400 }) /
402
403 if (!std::isnormal(weightedTotal)) {
404 return 0.;
405 } else {
406 return weightedTotal;
407 }
408}
409
411double Material::incohScatterLengthImg(const double lambda) const {
413
414 if (m_chemicalFormula.size() == 1)
415 return m_chemicalFormula.front().atom->neutron.inc_scatt_length_img;
416
417 const double weightedTotal =
418 std::accumulate(std::begin(m_chemicalFormula), std::end(m_chemicalFormula), 0.,
419 [](double subtotal, const FormulaUnit &right) {
420 return subtotal + right.atom->neutron.inc_scatt_length_img * right.multiplicity;
421 }) /
423
424 if (!std::isnormal(weightedTotal)) {
425 return 0.;
426 } else {
427 return weightedTotal;
428 }
429}
430
432double Material::totalScatterLength(const double lambda) const {
434
435 if (m_chemicalFormula.size() == 1)
436 return m_chemicalFormula.front().atom->neutron.tot_scatt_length;
437
438 const double crossSection = totalScatterXSection();
439 return 10. * std::sqrt(crossSection) * INV_FOUR_PI;
440}
441
442double Material::cohScatterLengthSqrd(const double lambda) const {
444
445 // these have already acconted for single atom case
446 const double real = this->cohScatterLengthReal();
447 const double imag = this->cohScatterLengthImg();
448
449 double lengthSqrd;
450 if (imag == 0.) {
451 lengthSqrd = real * real;
452 } else if (real == 0.) {
453 lengthSqrd = imag * imag;
454 } else {
455 lengthSqrd = real * real + imag * imag;
456 }
457
458 if (!std::isnormal(lengthSqrd)) {
459 return 0.;
460 } else {
461 return lengthSqrd;
462 }
463}
464
465double Material::incohScatterLengthSqrd(const double lambda) const {
467
468 // cross section has this properly averaged already
469 const double crossSection = incohScatterXSection();
470
471 // 1 barn = 100 fm^2
472 return 100. * crossSection * INV_FOUR_PI;
473}
474
475double Material::totalScatterLengthSqrd(const double lambda) const {
477
478 // cross section has this properly averaged already
479 const double crossSection = totalScatterXSection();
480
481 // 1 barn = 100 fm^2
482 return 100. * crossSection * INV_FOUR_PI;
483}
484
489void Material::saveNexus(::NeXus::File *file, const std::string &group) const {
490 file->makeGroup(group, "NXdata", true);
491 file->putAttr("version", 2);
492 file->putAttr("name", m_name);
493
494 // determine how the information will be stored
495 std::string style = "formula"; // default is a chemical formula
496 if (m_chemicalFormula.empty()) {
497 style = "empty";
498 } else if (m_chemicalFormula.size() == 1) {
499 if (m_chemicalFormula[0].atom->symbol == "user") {
500 style = "userdefined";
501 }
502 }
503 file->putAttr("formulaStyle", style);
504
505 // write the actual information out
506 if (style == "formula") {
507 std::stringstream formula;
508 for (const auto &formulaUnit : m_chemicalFormula) {
509 if (formulaUnit.atom->a_number != 0) {
510 formula << "(";
511 }
512 formula << formulaUnit.atom->symbol;
513 if (formulaUnit.atom->a_number != 0) {
514 formula << formulaUnit.atom->a_number << ")";
515 }
516 formula << formulaUnit.multiplicity << " ";
517 }
518 file->writeData("chemical_formula", formula.str());
519 } else if (style == "userdefined") {
520 file->writeData("coh_scatt_length_real", m_chemicalFormula[0].atom->neutron.coh_scatt_length_real);
521 file->writeData("coh_scatt_length_img", m_chemicalFormula[0].atom->neutron.coh_scatt_length_img);
522 file->writeData("inc_scatt_length_real", m_chemicalFormula[0].atom->neutron.inc_scatt_length_real);
523 file->writeData("inc_scatt_length_img", m_chemicalFormula[0].atom->neutron.inc_scatt_length_img);
524 file->writeData("coh_scatt_xs", m_chemicalFormula[0].atom->neutron.coh_scatt_xs);
525 file->writeData("inc_scatt_xs", m_chemicalFormula[0].atom->neutron.inc_scatt_xs);
526 file->writeData("tot_scatt_xs", m_chemicalFormula[0].atom->neutron.tot_scatt_xs);
527 file->writeData("abs_scatt_xs", m_chemicalFormula[0].atom->neutron.abs_scatt_xs);
528 file->writeData("tot_scatt_length", m_chemicalFormula[0].atom->neutron.tot_scatt_length);
529 file->writeData("coh_scatt_length", m_chemicalFormula[0].atom->neutron.coh_scatt_length);
530 file->writeData("inc_scatt_length", m_chemicalFormula[0].atom->neutron.inc_scatt_length);
531 }
532
533 file->writeData("number_density", m_numberDensity);
534 file->writeData("packing_fraction", m_packingFraction);
535 file->writeData("temperature", m_temperature);
536 file->writeData("pressure", m_pressure);
537 file->closeGroup();
538}
539
544void Material::loadNexus(::NeXus::File *file, const std::string &group) {
545 file->openGroup(group, "NXdata");
546 file->getAttr("name", m_name);
547 int version;
548 file->getAttr("version", version);
549
550 if (version == 1) {
551 // Find the element
552 uint16_t element_Z, element_A;
553 file->readData("element_Z", element_Z);
554 file->readData("element_A", element_A);
555 try {
556 m_chemicalFormula.clear();
557 if (element_Z > 0) {
558 m_chemicalFormula.emplace_back(getAtom(element_Z, element_A), 1);
559 } else {
560 m_chemicalFormula.emplace_back(Mantid::PhysicalConstants::getNeutronAtom(element_Z, element_A), 1);
561 }
562 } catch (std::runtime_error &) { /* ignore and use the default */
563 }
564 } else if (version == 2) {
565 std::string style;
566 file->getAttr("formulaStyle", style);
567
568 if (style == "formula") {
569 std::string formula;
570 file->readData("chemical_formula", formula);
572 this->countAtoms();
573 } else if (style == "userdefined") {
574 NeutronAtom neutron;
575 file->readData("coh_scatt_length_real", neutron.coh_scatt_length_real);
576 file->readData("coh_scatt_length_img", neutron.coh_scatt_length_img);
577 file->readData("inc_scatt_length_real", neutron.inc_scatt_length_real);
578 file->readData("inc_scatt_length_img", neutron.inc_scatt_length_img);
579 file->readData("coh_scatt_xs", neutron.coh_scatt_xs);
580 file->readData("inc_scatt_xs", neutron.inc_scatt_xs);
581 file->readData("tot_scatt_xs", neutron.tot_scatt_xs);
582 file->readData("abs_scatt_xs", neutron.abs_scatt_xs);
583 file->readData("tot_scatt_length", neutron.tot_scatt_length);
584 file->readData("coh_scatt_length", neutron.coh_scatt_length);
585 file->readData("inc_scatt_length", neutron.inc_scatt_length);
586
587 m_chemicalFormula.emplace_back(std::make_shared<Atom>(neutron), 1);
588 }
589 // the other option is empty which does not need to be addressed
590 } else {
591 throw std::runtime_error("Only know how to read version 1 or 2 for Material");
592 }
593 this->countAtoms();
596
597 file->readData("number_density", m_numberDensity);
598 try {
599 file->readData("packing_fraction", m_packingFraction);
600 } catch (std::runtime_error &) {
602 }
603 file->readData("temperature", m_temperature);
604 file->readData("pressure", m_pressure);
605 file->closeGroup();
606}
607
608namespace { // anonymous namespace to hide the function
609str_pair getAtomName(const std::string &text) // TODO change to get number after letters
610{
611 // one character doesn't need
612 if (text.size() <= 1)
613 return std::make_pair(text, "");
614
615 // check the second character
616 const char *s;
617 s = text.c_str();
618 if ((s[1] >= '0' && s[1] <= '9') || s[1] == '.')
619 return std::make_pair(text.substr(0, 1), text.substr(1));
620 else
621 return std::make_pair(text.substr(0, 2), text.substr(2));
622}
623} // namespace
624
627
629 for (const auto &atom : tokens) {
630 try {
631 std::string name;
632 float numberAtoms = 1;
633 uint16_t aNumber = 0;
634
635 // split out the isotope bit
636 if (atom.find('(') != std::string::npos) {
637 // error check
638 size_t end = atom.find(')');
639 if (end == std::string::npos) {
640 std::stringstream msg;
641 msg << "Failed to parse isotope \"" << atom << "\"";
642 throw std::runtime_error(msg.str());
643 }
644
645 // get the number of atoms
646 std::string numberAtomsStr = atom.substr(end + 1);
647 if (!numberAtomsStr.empty())
648 numberAtoms = boost::lexical_cast<float>(numberAtomsStr);
649
650 // split up the atom and isotope number
651 name = atom.substr(1, end - 1);
652 str_pair temp = getAtomName(name);
653
654 name = temp.first;
655 aNumber = boost::lexical_cast<uint16_t>(temp.second);
656 } else // for non-isotopes
657 {
658 str_pair temp = getAtomName(atom);
659 name = temp.first;
660 if (!temp.second.empty())
661 numberAtoms = boost::lexical_cast<float>(temp.second);
662 }
663
664 CF.emplace_back(getAtom(name, aNumber), static_cast<double>(numberAtoms));
665 } catch (boost::bad_lexical_cast &e) {
666 std::stringstream msg;
667 msg << "While trying to parse atom \"" << atom << "\" encountered bad_lexical_cast: " << e.what();
668 throw std::runtime_error(msg.str());
669 }
670 }
671
672 return CF;
673}
674} // namespace Mantid::Kernel
const std::vector< double > * lambda
double energy
Definition: GetAllEi.cpp:157
double right
Definition: LineProfile.cpp:81
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
ChemicalFormula m_chemicalFormula
The normalized chemical formula.
Definition: Material.h:185
Material()
Default constructor.
Definition: Material.cpp:66
double attenuationCoefficient(const double lambda) const
Definition: Material.cpp:267
double m_temperature
Temperature.
Definition: Material.h:193
void setAttenuationProfile(AttenuationProfile attenuationOverride)
Allow an explicit attenuation profile to be loaded onto the material that overrides the standard line...
Definition: Material.cpp:169
double attenuation(const double distance, const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Compute the attenuation at a given wavelength over the given distance.
Definition: Material.cpp:281
void setXRayAttenuationProfile(AttenuationProfile attenuationProfile)
Definition: Material.cpp:173
std::vector< FormulaUnit > ChemicalFormula
Definition: Material.h:60
const Material::ChemicalFormula & chemicalFormula() const
Definition: Material.cpp:183
void saveNexus(::NeXus::File *file, const std::string &group) const
Save the object to an open NeXus file.
Definition: Material.cpp:489
double packingFraction() const
Get the packing fraction.
Definition: Material.cpp:202
static ChemicalFormula parseChemicalFormula(const std::string &chemicalSymbol)
Definition: Material.cpp:625
void countAtoms()
Update the total atom count.
Definition: Material.cpp:114
double cohScatterLengthReal(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the coherent scattering length for a given wavelength in fm.
Definition: Material.cpp:349
void calculateLinearAbsorpXSectionByWL()
Update the linear absorption x section (by wavelength)
Definition: Material.cpp:128
double incohScatterLengthSqrd(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the incoherent length squared, , for a given wavelength in .
Definition: Material.cpp:465
double incohScatterLength(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the incoherent length for a given wavelength in fm.
Definition: Material.cpp:339
double temperature() const
Get the temperature.
Definition: Material.cpp:215
double cohScatterLength(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the coherent scattering length for a given wavelength in fm.
Definition: Material.cpp:328
double cohScatterLengthSqrd(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the coherent scattering length squared, , for a given wavelength in .
Definition: Material.cpp:442
double cohScatterLengthImg(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the coherent scattering length for a given wavelength in fm.
Definition: Material.cpp:369
double numberDensity() const
Get the number density.
Definition: Material.cpp:189
double incohScatterLengthReal(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the incoherent length for a given wavelength in fm.
Definition: Material.cpp:390
double m_packingFraction
Packing fraction should be between 0 and 2.
Definition: Material.h:191
double m_atomTotal
Total number of atoms.
Definition: Material.h:187
double totalAtoms() const
The total number of atoms in the formula.
Definition: Material.cpp:209
boost::optional< AttenuationProfile > m_attenuationOverride
Definition: Material.h:199
double cohScatterXSection() const
Get the coherent scattering cross section for a given wavelength in barns.
Definition: Material.cpp:228
void loadNexus(::NeXus::File *file, const std::string &group)
Load the object from an open NeXus file.
Definition: Material.cpp:544
double totalScatterLength(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Return the total scattering length for a given wavelength in fm.
Definition: Material.cpp:432
double absorbXSection(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the absorption cross section at a given wavelength in barns.
Definition: Material.cpp:260
const std::string & name() const
Returns the name of the material.
Definition: Material.cpp:181
double numberDensityEffective() const
Get the effective number density.
Definition: Material.cpp:195
double incohScatterXSection() const
Get the incoherent cross section for a given wavelength in barns.
Definition: Material.cpp:240
double pressure() const
Get the pressure.
Definition: Material.cpp:221
double incohScatterLengthImg(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Get the incoherent length for a given wavelength in fm.
Definition: Material.cpp:411
double linearAbsorpCoef(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Returns the linear coefficient of absorption for the material in units of cm^-1 this should match the...
Definition: Material.cpp:309
double totalScatterXSection() const
Return the total scattering cross section for a given wavelength in barns.
Definition: Material.cpp:252
std::string m_name
Material name.
Definition: Material.h:183
double m_linearAbsorpXSectionByWL
Definition: Material.h:196
double m_pressure
Pressure.
Definition: Material.h:195
boost::optional< AttenuationProfile > m_xRayAttenuationProfile
Definition: Material.h:200
double m_numberDensity
Number density in atoms per A^-3.
Definition: Material.h:189
bool hasValidXRayAttenuationProfile()
Definition: Material.cpp:300
double xRayAttenuation(const double distance, const double energy) const
Compute the x-ray attenuation at a given energy over the given distance.
Definition: Material.cpp:290
double totalScatterLengthSqrd(const double lambda=PhysicalConstants::NeutronAtom::ReferenceLambda) const
Return the total scattering length squared, , for a given wavelength in .
Definition: Material.cpp:475
void calculateTotalScatterXSection()
Update the total scatter x section.
Definition: Material.cpp:150
@ TOK_IGNORE_EMPTY
ignore empty tokens
Struture to hold the common information for an atom.
Definition: Atom.h:20
std::pair< std::string, std::string > str_pair
Definition: Material.cpp:19
A namespace containing physical constants that are required by algorithms and unit routines.
Definition: Atom.h:14
MANTID_KERNEL_DLL const Atom & getAtom(const uint16_t z_number, const uint16_t a_number=0)
Definition: Atom.cpp:3167
MANTID_KERNEL_DLL NeutronAtom getNeutronAtom(const uint16_t z_number, const uint16_t a_number=0)
Retrieve a copy of NeutronAtom.
STL namespace.
Structure to hold the information for a parsed chemical formula.
Definition: Material.h:53
FormulaUnit(std::shared_ptr< PhysicalConstants::Atom > atom, const double multiplicity)
Definition: Material.cpp:56
Structure to store neutronic scattering information for the various elements.
Definition: NeutronAtom.h:22
double coh_scatt_length_real
The real part of the coherent scattering length in fm.
Definition: NeutronAtom.h:51
double tot_scatt_length
The total scattering length in fm.
Definition: NeutronAtom.h:75
double inc_scatt_length
The incoherent scattering length in fm.
Definition: NeutronAtom.h:81
uint16_t z_number
The atomic number, or number of protons, for the atom.
Definition: NeutronAtom.h:44
double coh_scatt_length
The coherent scattering length in fm.
Definition: NeutronAtom.h:78
double coh_scatt_length_img
The imaginary part of the coherent scattering length in fm.
Definition: NeutronAtom.h:54
double inc_scatt_length_img
The imaginary part of the incoherent scattering length in fm.
Definition: NeutronAtom.h:60
double inc_scatt_xs
The incoherent scattering cross section in barns.
Definition: NeutronAtom.h:66
double tot_scatt_xs
The total scattering cross section in barns.
Definition: NeutronAtom.h:69
double abs_scatt_xs
The absorption cross section for 2200m/s neutrons in barns.
Definition: NeutronAtom.h:72
double inc_scatt_length_real
The real part of the incoherent scattering length in fm.
Definition: NeutronAtom.h:57
double coh_scatt_xs
The coherent scattering cross section in barns.
Definition: NeutronAtom.h:63
static const double ReferenceLambda
The reference wavelength value for absorption cross sections.
Definition: NeutronAtom.h:25
uint16_t a_number
The total number of protons and neutrons, or mass number, for the atom for isotopic averages this is ...
Definition: NeutronAtom.h:48