Implement recommended changes

This commit is contained in:
Jose Ignacio Marquez Damian 2022-09-26 11:19:54 +02:00 committed by Thomas Kittelmann
parent 29a10eafd3
commit 2e19260dea
6 changed files with 35 additions and 42 deletions

View file

@ -156,9 +156,9 @@ public:
double temperature() const;
#ifdef NCRYSTAL
//! Gwet pointer to NCrystal material object
//! Get pointer to NCrystal material object
//! \return Pointer to NCrystal material object
std::shared_ptr<const NCrystal::ProcImpl::Process> m_NCrystal_mat() const {return m_NCrystal_mat_; };
std::shared_ptr<const NCrystal::ProcImpl::Process> ncrystal_mat() const {return ncrystal_mat_; };
#endif
//----------------------------------------------------------------------------
@ -168,8 +168,8 @@ public:
vector<int> nuclide_; //!< Indices in nuclides vector
vector<int> element_; //!< Indices in elements vector
#ifdef NCRYSTAL
std::string cfg_; //!< NCrystal configuration string
std::shared_ptr<const NCrystal::ProcImpl::Process> m_NCrystal_mat_;
std::string ncrystal_cfg_; //!< NCrystal configuration string
std::shared_ptr<const NCrystal::ProcImpl::Process> ncrystal_mat_;
#endif
xt::xtensor<double, 1> atom_density_; //!< Nuclide atom density in [atom/b-cm]
double density_; //!< Total atom density in [atom/b-cm]

View file

@ -110,17 +110,11 @@ void split_particle(Particle& p);
// NCrystal wrapper class for the OpenMC random number generator
//==============================================================================
class NcrystalRNG_Wrapper : public NCrystal::RNGStream {
class NCrystalRNGWrapper : public NCrystal::RNGStream {
uint64_t* openmc_seed_;
public:
constexpr NcrystalRNG_Wrapper(uint64_t* s) noexcept : openmc_seed_(s) {}
//Can be cheaply created on the stack just before being used in calls to
//ProcImpl::Scatter objects, like:
//
// RNG_Wrapper rng(seed);
//
constexpr NCrystalRNGWrapper(uint64_t* seed) noexcept : openmc_seed_(seed) {}
protected:
//double actualGenerate() override { return prn(openmc_seed_); }
double actualGenerate() override {
return std::max<double>( std::numeric_limits<double>::min(), prn(openmc_seed_) );
}