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

openmc-dev / openmc / 14386648657

10 Apr 2025 05:30PM UTC coverage: 85.118% (+0.07%) from 85.044%
14386648657

Pull #3370

github

web-flow
Merge 993e23d39 into 07f533461
Pull Request #3370: Fix negative distances from bins_crossed for CylindricalMesh

6 of 6 new or added lines in 1 file covered. (100.0%)

199 existing lines in 18 files now uncovered.

51665 of 60698 relevant lines covered (85.12%)

37166875.55 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