mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Putting history and last_dir in the simulation namespace.
This commit is contained in:
parent
42b5f2aa7e
commit
e86317ecd4
5 changed files with 20 additions and 12 deletions
|
|
@ -14,10 +14,14 @@ extern "C" const bool dagmc_enabled;
|
|||
|
||||
namespace openmc {
|
||||
|
||||
extern moab::DagMC::RayHistory history;
|
||||
extern Direction last_dir;
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -617,9 +617,9 @@ DAGCell::distance(Position r, Direction u, int32_t on_surface) const
|
|||
{
|
||||
// if we've changed direction or we're not on a surface,
|
||||
// reset the history and update last direction
|
||||
if (u != last_dir || on_surface == 0) {
|
||||
history.reset();
|
||||
last_dir = u;
|
||||
if (u != simulation::last_dir || on_surface == 0) {
|
||||
simulation::history.reset();
|
||||
simulation::last_dir = u;
|
||||
}
|
||||
|
||||
moab::ErrorCode rval;
|
||||
|
|
@ -628,7 +628,7 @@ DAGCell::distance(Position r, Direction u, int32_t on_surface) const
|
|||
double dist;
|
||||
double pnt[3] = {r.x, r.y, r.z};
|
||||
double dir[3] = {u.x, u.y, u.z};
|
||||
rval = dagmc_ptr_->ray_fire(vol, pnt, dir, hit_surf, dist, &history);
|
||||
rval = dagmc_ptr_->ray_fire(vol, pnt, dir, hit_surf, dist, &simulation::history);
|
||||
MB_CHK_ERR_CONT(rval);
|
||||
int surf_idx;
|
||||
if (hit_surf != 0) {
|
||||
|
|
|
|||
|
|
@ -38,9 +38,15 @@ const bool dagmc_enabled = false;
|
|||
const std::string DAGMC_FILENAME = "dagmc.h5m";
|
||||
|
||||
namespace openmc {
|
||||
|
||||
|
||||
namespace simulation {
|
||||
|
||||
moab::DagMC::RayHistory history;
|
||||
Direction last_dir;
|
||||
|
||||
}
|
||||
|
||||
namespace model {
|
||||
|
||||
moab::DagMC* DAG;
|
||||
|
|
|
|||
|
|
@ -373,9 +373,7 @@ Particle::transport()
|
|||
}
|
||||
|
||||
#ifdef DAGMC
|
||||
if(settings::dagmc) {
|
||||
history.reset();
|
||||
}
|
||||
if (settings::dagmc) simulation::history.reset();
|
||||
#endif
|
||||
|
||||
// Finish particle track output.
|
||||
|
|
|
|||
|
|
@ -266,9 +266,9 @@ Direction DAGSurface::normal(Position r) const
|
|||
|
||||
Direction DAGSurface::reflect(Position r, Direction u) const
|
||||
{
|
||||
history.reset_to_last_intersection();
|
||||
last_dir = Surface::reflect(r, u);
|
||||
return last_dir;
|
||||
simulation::history.reset_to_last_intersection();
|
||||
simulation::last_dir = Surface::reflect(r, u);
|
||||
return simulation::last_dir;
|
||||
}
|
||||
|
||||
BoundingBox DAGSurface::bounding_box() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue