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