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

openmc-dev / openmc / 15453458076

04 Jun 2025 09:48PM UTC coverage: 85.152% (-0.07%) from 85.218%
15453458076

Pull #3421

github

web-flow
Merge f544beed4 into ace73ab5d
Pull Request #3421: Fix no serialization of periodic_surface_id bug

18 of 18 new or added lines in 3 files covered. (100.0%)

373 existing lines in 24 files now uncovered.

52152 of 61246 relevant lines covered (85.15%)

36751900.52 hits per line

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

0.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
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
UNCOV
49
  operator bool() const { return !cfg_.empty(); }
×
50

51
  NCrystalMat clone() const
52
  {
53
    NCrystalMat c;
54
    c.cfg_ = cfg_;
55
    c.proc_ = proc_.clone();
56
    return c;
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

© 2026 Coveralls, Inc