• 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

75.0
/include/openmc/distribution_multi.h
1
#ifndef DISTRIBUTION_MULTI_H
2
#define DISTRIBUTION_MULTI_H
3

4
#include "openmc/memory.h"
5

6
#include "pugixml.hpp"
7

8
#include "openmc/distribution.h"
9
#include "openmc/position.h"
10

11
namespace openmc {
12

13
//==============================================================================
14
//! Probability density function for points on the unit sphere. Extensions of
15
//! this type are used to sample angular distributions for starting sources
16
//==============================================================================
17

18
class UnitSphereDistribution {
19
public:
20
  UnitSphereDistribution() {};
42,732✔
UNCOV
21
  explicit UnitSphereDistribution(Direction u) : u_ref_ {u} {};
×
22
  explicit UnitSphereDistribution(pugi::xml_node node);
23
  virtual ~UnitSphereDistribution() = default;
45,629✔
UNCOV
24

×
25
  static unique_ptr<UnitSphereDistribution> create(pugi::xml_node node);
45,629✔
26

27
  //! Sample a direction from the distribution
28
  //! \param seed Pseudorandom number seed pointer
29
  //! \return Direction sampled
30
  virtual Direction sample(uint64_t* seed) const = 0;
31

32
  Direction u_ref_ {0.0, 0.0, 1.0}; //!< reference direction
33
};
34

35
//==============================================================================
36
//! Explicit distribution of polar and azimuthal angles
37
//==============================================================================
38

39
class PolarAzimuthal : public UnitSphereDistribution {
40
public:
41
  PolarAzimuthal(Direction u, UPtrDist mu, UPtrDist phi);
42
  explicit PolarAzimuthal(pugi::xml_node node);
43

44
  //! Sample a direction from the distribution
45
  //! \param seed Pseudorandom number seed pointer
46
  //! \return Direction sampled
47
  Direction sample(uint64_t* seed) const override;
48

49
  // Observing pointers
50
  Distribution* mu() const { return mu_.get(); }
51
  Distribution* phi() const { return phi_.get(); }
52

53
private:
54
  UPtrDist mu_;  //!< Distribution of polar angle
55
  UPtrDist phi_; //!< Distribution of azimuthal angle
56
};
57

58
//==============================================================================
59
//! Uniform distribution on the unit sphere
60
//==============================================================================
61

62
Direction isotropic_direction(uint64_t* seed);
63

64
class Isotropic : public UnitSphereDistribution {
65
public:
66
  Isotropic() {};
67

68
  //! Sample a direction from the distribution
42,732✔
69
  //! \param seed Pseudorandom number seed pointer
70
  //! \return Sampled direction
71
  Direction sample(uint64_t* seed) const override;
72
};
73

74
//==============================================================================
75
//! Monodirectional distribution
76
//==============================================================================
77

78
class Monodirectional : public UnitSphereDistribution {
79
public:
80
  Monodirectional(Direction u) : UnitSphereDistribution {u} {};
81
  explicit Monodirectional(pugi::xml_node node)
82
    : UnitSphereDistribution {node} {};
83

2,870✔
84
  //! Sample a direction from the distribution
2,870✔
85
  //! \param seed Pseudorandom number seed pointer
86
  //! \return Sampled direction
87
  Direction sample(uint64_t* seed) const override;
88
};
89

90
using UPtrAngle = unique_ptr<UnitSphereDistribution>;
91

92
} // namespace openmc
93

94
#endif // DISTRIBUTION_MULTI_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