mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Converted DagMC threadprivate variables to particle owned as well. Not quite as bad as I was expecting.
This commit is contained in:
parent
f6020279c9
commit
f7fb5a036b
9 changed files with 31 additions and 34 deletions
|
|
@ -110,7 +110,7 @@ public:
|
|||
|
||||
//! Find the oncoming boundary of this cell.
|
||||
virtual std::pair<double, int32_t>
|
||||
distance(Position r, Direction u, int32_t on_surface) const = 0;
|
||||
distance(Position r, Direction u, int32_t on_surface, Particle* p) const = 0;
|
||||
|
||||
//! Write all information needed to reconstruct the cell to an HDF5 group.
|
||||
//! \param group_id An HDF5 group id.
|
||||
|
|
@ -201,7 +201,7 @@ public:
|
|||
contains(Position r, Direction u, int32_t on_surface) const;
|
||||
|
||||
std::pair<double, int32_t>
|
||||
distance(Position r, Direction u, int32_t on_surface) const;
|
||||
distance(Position r, Direction u, int32_t on_surface, Particle* p) const;
|
||||
|
||||
void to_hdf5(hid_t group_id) const;
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ public:
|
|||
bool contains(Position r, Direction u, int32_t on_surface) const;
|
||||
|
||||
std::pair<double, int32_t>
|
||||
distance(Position r, Direction u, int32_t on_surface) const;
|
||||
distance(Position r, Direction u, int32_t on_surface, Particle* p) const;
|
||||
|
||||
BoundingBox bounding_box() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,14 +14,6 @@ extern "C" const bool dagmc_enabled;
|
|||
|
||||
namespace openmc {
|
||||
|
||||
namespace simulation {
|
||||
|
||||
extern moab::DagMC::RayHistory history; //!< facet history for DagMC particles
|
||||
extern Direction last_dir; //!< last direction passed to DagMC's ray_fire
|
||||
#pragma omp threadprivate(history, last_dir)
|
||||
|
||||
}
|
||||
|
||||
namespace model {
|
||||
extern moab::DagMC* DAG;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
#include "openmc/random_lcg.h"
|
||||
#include "openmc/tallies/filter_match.h"
|
||||
|
||||
#ifdef DAGMC
|
||||
#include "DagMC.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
namespace openmc {
|
||||
|
||||
|
|
@ -349,6 +353,12 @@ public:
|
|||
double collision_distance_; // distance to particle's next closest collision
|
||||
|
||||
int n_event_ {0}; // number of events executed in this particle's history
|
||||
|
||||
// DagMC state variables
|
||||
#ifdef DAGMC
|
||||
moab::DagMC::RayHistory history_;
|
||||
Direction last_dir_;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "pugixml.hpp"
|
||||
|
||||
#include "openmc/constants.h"
|
||||
#include "openmc/particle.h"
|
||||
#include "openmc/position.h"
|
||||
#include "dagmc.h"
|
||||
|
||||
|
|
@ -113,8 +114,9 @@ public:
|
|||
//! Determine the direction of a ray reflected from the surface.
|
||||
//! \param[in] r The point at which the ray is incident.
|
||||
//! \param[in] u Incident direction of the ray
|
||||
//! \param[inout] p Pointer to the particle
|
||||
//! \return Outgoing direction of the ray
|
||||
virtual Direction reflect(Position r, Direction u) const;
|
||||
virtual Direction reflect(Position r, Direction u, Particle* p) const;
|
||||
|
||||
virtual Direction diffuse_reflect(Position r, Direction u,
|
||||
uint64_t* seed) const;
|
||||
|
|
@ -171,7 +173,7 @@ public:
|
|||
double evaluate(Position r) const;
|
||||
double distance(Position r, Direction u, bool coincident) const;
|
||||
Direction normal(Position r) const;
|
||||
Direction reflect(Position r, Direction u) const;
|
||||
Direction reflect(Position r, Direction u, Particle* p) const;
|
||||
|
||||
void to_hdf5(hid_t group_id) const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue