• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmc-dev / openmc / 14840340664

05 May 2025 03:38PM UTC coverage: 85.195% (-0.009%) from 85.204%
14840340664

Pull #3392

github

web-flow
Merge 5bc1ec35f into 1e7d8324e
Pull Request #3392: Map Compton subshell data to atomic relaxation data

14 of 14 new or added lines in 2 files covered. (100.0%)

330 existing lines in 19 files now uncovered.

52194 of 61264 relevant lines covered (85.2%)

37398320.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.0
/include/openmc/ncrystal_interface.h
1
#ifndef OPENMC_NCRYSTAL_INTERFACE_H
2
#define OPENMC_NCRYSTAL_INTERFACE_H
3

4
#include "openmc/ncrystal_load.h"
5
#include "openmc/particle.h"
6

7
#include <cstdint> // for uint64_t
8
#include <limits>  // for numeric_limits
9
#include <string>
10

11
namespace openmc {
12

13
//==============================================================================
14
// Constants
15
//==============================================================================
16

17
//! Energy in [eV] to switch between NCrystal and ENDF
18
constexpr double NCRYSTAL_MAX_ENERGY {5.0};
19

20
//==============================================================================
21
// Wrapper class for an NCrystal material
22
//==============================================================================
23

24
class NCrystalMat {
25
public:
26
  //----------------------------------------------------------------------------
27
  // Constructors
28
  NCrystalMat() = default; // empty object
13,804✔
29
  explicit NCrystalMat(const std::string& cfg);
30

31
  //----------------------------------------------------------------------------
32
  // Methods
33

34
  //! Return configuration string:
35
  const std::string& cfg() const { return cfg_; }
36

37
  //! Get cross section from NCrystal material
38
  //
39
  //! \param[in] p  Particle object
40
  //! \return  Cross section in [b]
41
  double xs(const Particle& p) const;
42

43
  // Process scattering event
44
  //
45
  //! \param[in] p  Particle object
46
  void scatter(Particle& p) const;
47

48
  //! Whether the object holds a valid NCrystal material
49
  operator bool() const { return !cfg_.empty(); }
1,906,903,789✔
50

UNCOV
51
  NCrystalMat clone() const
×
52
  {
UNCOV
53
    NCrystalMat c;
×
UNCOV
54
    c.cfg_ = cfg_;
×
UNCOV
55
    c.proc_ = proc_.clone();
×
UNCOV
56
    return c;
×
UNCOV
57
  }
×
58

59
private:
60
  //----------------------------------------------------------------------------
61
  // Data members (only present when compiling with NCrystal support)
62
  std::string cfg_;       //!< NCrystal configuration string
63
  NCrystalScatProc proc_; //!< NCrystal scatter process
64
};
65

66
//==============================================================================
67
// Functions
68
//==============================================================================
69

70
void ncrystal_update_micro(double xs, NuclideMicroXS& micro);
71

72
} // namespace openmc
73

74
#endif // OPENMC_NCRYSTAL_INTERFACE_H
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc