Skip to content

Commit

Permalink
added version guards until we can require version
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke committed Apr 14, 2023
1 parent 9b0060e commit 6b1988b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/dagmc/DagMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,14 @@ ErrorCode DagMC::point_in_volume_slow(EntityHandle volume, const double xyz[3],
return rval;
}

#if MOAB_VERSION_MAJOR == 5 && MOAB_VERSION_MINOR > 2
// find a which volume contains the current point
ErrorCode DagMC::find_volume(const double xyz[3], EntityHandle& volume,
const double* uvw) {
ErrorCode rval = ray_tracer->find_volume(xyz, volume, uvw);
return rval;
}
#endif

// detemine distance to nearest surface
ErrorCode DagMC::closest_to_location(EntityHandle volume,
Expand Down
3 changes: 2 additions & 1 deletion src/dagmc/DagMC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,10 @@ class DagMC {

ErrorCode point_in_volume_slow(const EntityHandle volume, const double xyz[3],
int& result);

#if MOAB_VERSION_MAJOR == 5 && MOAB_VERSION_MINOR > 2
ErrorCode find_volume(const double xyz[3], EntityHandle& volume,
const double* uvw = NULL);
#endif

ErrorCode test_volume_boundary(const EntityHandle volume,
const EntityHandle surface,
Expand Down
2 changes: 2 additions & 0 deletions src/dagmc/tests/dagmc_simple_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ TEST_F(DagmcSimpleTest, dagmc_point_in) {
EXPECT_EQ(expect_result, result);
}

#if MOAB_VERSION_MAJOR == 5 && MOAB_VERSION_MINOR > 2
TEST_F(DagmcSimpleTest, dagmc_find_volume) {
int vol_idx = 1;
int vol_dim = 3;
Expand All @@ -166,6 +167,7 @@ TEST_F(DagmcSimpleTest, dagmc_find_volume) {
EXPECT_EQ(rval, MB_SUCCESS);
EXPECT_EQ(expected_vol_h, vol_h);
}
#endif

TEST_F(DagmcSimpleTest, dagmc_test_obb_retreval_rayfire) {
// make new dagmc
Expand Down

0 comments on commit 6b1988b

Please sign in to comment.