Skip to content

Commit fb352d0

Browse files
committed
nominal fixes for ray trace plots with dagmc
1 parent 6282f04 commit fb352d0

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

openmc/plots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ def _check_domains_consistent_with_color_by(self, domains):
11071107
'color_by=material')
11081108
else:
11091109
if not isinstance(region, openmc.Cell):
1110-
raise Exception('Domain list must be materials if '
1110+
raise Exception('Domain list must be cells if '
11111111
'color_by=cell')
11121112

11131113
def to_xml_element(self):

src/dagmc.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,7 @@ Direction DAGSurface::reflect(Position r, Direction u, GeometryState* p) const
766766
double dir[3];
767767
rval = dagmc_ptr_->get_angle(surf, pnt, dir, &p->history());
768768
MB_CHK_ERR_CONT(rval);
769-
p->last_dir() = u.reflect(dir);
770-
return p->last_dir();
769+
return u.reflect(dir);
771770
}
772771

773772
//==============================================================================

src/plot.cpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,18 +1626,7 @@ void Ray::trace()
16261626
return;
16271627
}
16281628

1629-
if (i_surface_ > 0 &&
1630-
model::surfaces[i_surface_]->geom_type_ == GeometryType::DAG) {
1631-
#ifdef DAGMC
1632-
int32_t i_cell = next_cell(
1633-
i_surface_, cell_last(n_coord() - 1), lowest_coord().universe);
1634-
inside_cell = i_cell >= 0;
1635-
#else
1636-
fatal_error("Not compiled for DAGMC, but somehow you have a DAGCell!");
1637-
#endif
1638-
} else {
1639-
inside_cell = exhaustive_find_cell(*this, settings::verbosity >= 10);
1640-
}
1629+
inside_cell = exhaustive_find_cell(*this, settings::verbosity >= 10);
16411630

16421631
if (inside_cell) {
16431632

@@ -1755,7 +1744,10 @@ void PhongRay::on_intersection()
17551744
return;
17561745
}
17571746

1758-
Direction normal = model::surfaces.at(i_surface())->normal(r_local());
1747+
// Get surface pointer
1748+
const auto& surf = model::surfaces.at(i_surface());
1749+
1750+
Direction normal = surf->normal(r_local());
17591751
normal /= normal.norm();
17601752

17611753
// Need to apply translations to find the normal vector in
@@ -1767,7 +1759,7 @@ void PhongRay::on_intersection()
17671759
}
17681760
}
17691761

1770-
if (surface() > 0) {
1762+
if (surf->geom_type_ != GeometryType::DAG && surface() > 0) {
17711763
normal *= -1.0;
17721764
}
17731765

0 commit comments

Comments
 (0)