Skip to content

Commit

Permalink
spiner already had Abar and Zbar in metadata. Just add it to class.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Dec 3, 2024
1 parent 388a596 commit 44b9fc8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion singularity-eos/eos/eos_spiner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class SpinerEOSDependsRhoT : public EosBase<SpinerEOSDependsRhoT> {
struct Lambda {
enum Index { lRho = 0, lT = 1 };
};
SG_ADD_DEFAULT_MEAN_ATOMIC_FUNCTIONS(AZbar_)
SG_ADD_BASE_CLASS_USINGS(SpinerEOSDependsRhoT);
inline SpinerEOSDependsRhoT(const std::string &filename, int matid,
bool reproduciblity_mode = false);
Expand Down Expand Up @@ -307,7 +308,7 @@ class SpinerEOSDependsRhoT : public EosBase<SpinerEOSDependsRhoT> {
Real rhoNormal_, TNormal_, sieNormal_, PNormal_;
Real CvNormal_, bModNormal_, dPdENormal_, dVdTNormal_;
Real lRhoOffset_, lTOffset_; // offsets must be non-negative
MeanAtomicProperties _AZbar; // TODO(JMM): Load from table.
MeanAtomicProperties AZbar_; // TODO(JMM): Load from table.
int matid_;
bool reproducible_;
// whereAmI_ and status_ used only for reporting. They are not thread-safe.
Expand Down Expand Up @@ -350,6 +351,7 @@ class SpinerEOSDependsRhoSie : public EosBase<SpinerEOSDependsRhoSie> {
};
using STricks = table_utils::SpinerTricks<SpinerEOSDependsRhoSie>;

SG_ADD_DEFAULT_MEAN_ATOMIC_FUNCTIONS(AZbar_)
SG_ADD_BASE_CLASS_USINGS(SpinerEOSDependsRhoSie);
PORTABLE_INLINE_FUNCTION SpinerEOSDependsRhoSie()
: memoryStatus_(DataStatus::Deallocated) {}
Expand Down Expand Up @@ -539,6 +541,7 @@ class SpinerEOSDependsRhoSie : public EosBase<SpinerEOSDependsRhoSie> {
thermalqs::density | thermalqs::temperature;
// static constexpr const char _eos_type[] = "SpinerEOSDependsRhoSie";
int matid_;
MeanAtomicProperties AZbar_; // TODO(JMM): Load from table.
bool reproducible_;
mutable RootFinding1D::Status status_;
static constexpr const int _n_lambda = 1;
Expand Down Expand Up @@ -717,6 +720,11 @@ inline herr_t SpinerEOSDependsRhoT::loadDataboxes_(const std::string &matid_str,
status += H5LTget_attribute_double(file, matid_str.c_str(),
SP5::Material::normalDensity, &rhoNormal_);
rhoNormal_ = std::abs(rhoNormal_);
// Mean atomic mass and mean atomic number
status += H5LTget_attribute_double(file, matid_str.c_str(),
SP5::Material::meanAtomicMass, &(AZbar_.Abar));
status += H5LTget_attribute_double(file, matid_str.c_str(),
SP5::Material::meanAtomicNumber, &(AZbar_.Zbar));

// tables
status += P_.loadHDF(lTGroup, SP5::Fields::P);
Expand Down Expand Up @@ -1553,6 +1561,11 @@ herr_t SpinerEOSDependsRhoSie::loadDataboxes_(const std::string &matid_str, hid_
status += H5LTget_attribute_double(file, matid_str.c_str(),
SP5::Material::normalDensity, &rhoNormal_);
rhoNormal_ = std::abs(rhoNormal_);
// Mean atomic mass and mean atomic number
status += H5LTget_attribute_double(file, matid_str.c_str(),
SP5::Material::meanAtomicMass, &(AZbar_.Abar));
status += H5LTget_attribute_double(file, matid_str.c_str(),
SP5::Material::meanAtomicNumber, &(AZbar_.Zbar));

// sometimes independent variables
status += sie_.loadHDF(lTGroup, SP5::Fields::sie);
Expand Down

0 comments on commit 44b9fc8

Please sign in to comment.