Including making TL RayHistory, last_dir available in surface.cpp and adding a reflection method to DAGSurface.

This commit is contained in:
Patrick Shriwise 2019-06-07 12:47:30 -05:00
parent 90abce144c
commit 837796add0
5 changed files with 18 additions and 7 deletions

View file

@ -9,11 +9,15 @@ extern "C" const bool dagmc_enabled;
#ifdef DAGMC
#include "DagMC.hpp"
#include "openmc/cell.h"
#include "openmc/surface.h"
#include "openmc/xml_interface.h"
#include "openmc/position.h"
namespace openmc {
extern moab::DagMC::RayHistory history;
extern Direction last_dir;
#pragma omp threadprivate(history, last_dir)
namespace model {
extern moab::DagMC* DAG;
}

View file

@ -136,6 +136,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;
//! Get the bounding box of this surface.
BoundingBox bounding_box() const;

View file

@ -7,6 +7,7 @@
#include "openmc/capi.h"
#include "openmc/constants.h"
#include "openmc/dagmc.h"
#include "openmc/error.h"
#include "openmc/geometry.h"
#include "openmc/hdf5_interface.h"
@ -609,11 +610,6 @@ CSGCell::contains_complex(Position r, Direction u, int32_t on_surface) const
//==============================================================================
#ifdef DAGMC
extern moab::DagMC::RayHistory history;
extern Direction last_dir;
#pragma omp threadprivate(history, last_dir)
moab::DagMC::RayHistory history;
Direction last_dir;
DAGCell::DAGCell() : Cell{} {};

View file

@ -9,6 +9,7 @@
#include "openmc/material.h"
#include "openmc/string_utils.h"
#include "openmc/settings.h"
#include "openmc/surface.h"
#ifdef DAGMC
@ -37,6 +38,8 @@ const bool dagmc_enabled = false;
const std::string DAGMC_FILENAME = "dagmc.h5m";
namespace openmc {
moab::DagMC::RayHistory history;
Direction last_dir;
namespace model {

View file

@ -6,6 +6,7 @@
#include <utility>
#include "openmc/error.h"
#include "openmc/dagmc.h"
#include "openmc/hdf5_interface.h"
#include "openmc/settings.h"
#include "openmc/string_utils.h"
@ -264,6 +265,12 @@ Direction DAGSurface::normal(Position r) const
return u;
}
Direction DAGSurface::reflect(Position r, Direction u) const
{
history.rollback_last_intersection();
return Surface::reflect(r, u);
}
BoundingBox DAGSurface::bounding_box() const
{
moab::ErrorCode rval;