mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Fix use of get_map<IdData> within plot.cpp and failing properties test
This commit is contained in:
parent
6190ff8ff3
commit
803f17500c
2 changed files with 4 additions and 2 deletions
|
|
@ -157,7 +157,8 @@ void create_ppm(Plot const& pl)
|
|||
// assign colors
|
||||
for (size_t y = 0; y < height; y++) {
|
||||
for (size_t x = 0; x < width; x++) {
|
||||
auto id = ids.data_(y, x, pl.color_by_);
|
||||
int idx = pl.color_by_ == PlotColorBy::cells ? 0 : 2;
|
||||
auto id = ids.data_(y, x, idx);
|
||||
// no setting needed if not found
|
||||
if (id == NOT_FOUND) { continue; }
|
||||
if (id == OVERLAP) {
|
||||
|
|
@ -840,7 +841,7 @@ void create_voxel(Plot const& pl)
|
|||
IdData ids = pltbase.get_map<IdData>();
|
||||
|
||||
// select only cell/material ID data and flip the y-axis
|
||||
int idx = pl.color_by_ == PlotColorBy::cells ? 0 : 1;
|
||||
int idx = pl.color_by_ == PlotColorBy::cells ? 0 : 2;
|
||||
xt::xtensor<int32_t, 2> data_slice = xt::view(ids.data_, xt::all(), xt::all(), idx);
|
||||
xt::xtensor<int32_t, 2> data_flipped = xt::flip(data_slice, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ def test_import_properties(run_in_tmpdir, mpi_intracomm):
|
|||
"""Test importing properties on the Model class """
|
||||
|
||||
# Create PWR pin cell model and write XML files
|
||||
openmc.reset_auto_ids()
|
||||
model = openmc.examples.pwr_pin_cell()
|
||||
model.export_to_xml()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue