mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Flipping id_map ordering.
This commit is contained in:
parent
7d98804bca
commit
b0bafee385
2 changed files with 7 additions and 7 deletions
|
|
@ -178,6 +178,6 @@ _dll.openmc_id_map.restype = c_int
|
|||
_dll.openmc_id_map.errcheck = _error_handler
|
||||
|
||||
def id_map(plot):
|
||||
img_data = np.zeros((plot.pixels_[0], plot.pixels_[1], 2), dtype=np.dtype('int32'))
|
||||
img_data = np.zeros((plot.pixels_[1], plot.pixels_[0], 2), dtype=np.dtype('int32'))
|
||||
out = _dll.openmc_id_map(POINTER(_Plot)(plot), img_data.ctypes.data_as(POINTER(c_int32)))
|
||||
return img_data
|
||||
|
|
|
|||
12
src/plot.cpp
12
src/plot.cpp
|
|
@ -988,7 +988,7 @@ extern "C" int openmc_id_map(const CPlot& pl, int* data_out) {
|
|||
double out_pixel = (pl.width_[1])/static_cast<double>(height);
|
||||
|
||||
IDData data;
|
||||
data.resize({width, height, 2});
|
||||
data.resize({height, width, 2});
|
||||
|
||||
int in_i, out_i;
|
||||
double xyz[3];
|
||||
|
|
@ -1039,15 +1039,15 @@ extern "C" int openmc_id_map(const CPlot& pl, int* data_out) {
|
|||
j = p.n_coord - 1;
|
||||
if (level >=0) {j = level + 1;}
|
||||
if (!found_cell) {
|
||||
data(x,y,0) = -1;
|
||||
data(x,y,1) = -1;
|
||||
data(y,x,0) = -1;
|
||||
data(y,x,1) = -1;
|
||||
} else {
|
||||
Cell *c = model::cells[p.coord[j].cell];
|
||||
data(x,y,0) = c->id_;
|
||||
data(y,x,0) = c->id_;
|
||||
if (c->type_ == FILL_UNIVERSE || p.material == MATERIAL_VOID) {
|
||||
data(x,y,1) = -1;
|
||||
data(y,x,1) = -1;
|
||||
} else {
|
||||
data(x,y,1) = model::materials[p.material - 1]->id_;
|
||||
data(y,x,1) = model::materials[p.material - 1]->id_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue