# openmc.model.RectangularParallelepiped usage

**URL:** <https://openmc.discourse.group/t/openmc-model-rectangularparallelepiped-usage/858>\
**Category:** User Support\
**Created:** [November 10, 2020, 11:53pm UTC](https://openmc.discourse.group/t/openmc-model-rectangularparallelepiped-usage/858 "2020-11-10T23:53:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jujuC31](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jujuC31](https://openmc.discourse.group/u/jujuC31)\
**Post date:** [November 10, 2020, 11:53pm UTC](https://openmc.discourse.group/t/openmc-model-rectangularparallelepiped-usage/858/1 "2020-11-10T23:53:35Z")

</div>

Hi all !  
I’m trying to insert a openmc.model.RectangularParallelepiped() in another openmc.model.RectangularParallelepiped() : method introduced with 0.12 version).

Following XML geometry code is produced by python code below.

```
<geometry>
  <cell id="1" material="1" name="Cell1" region="1 -2 3 -4 5 -6" universe="1" />
  <cell id="2" material="2" name="Cell2" region="7 -8 9 -10 11 -12 (-1 | 4 | -3 | 4 | -5 | 6)" universe="1" />
  <surface coeffs="-5.0" id="1" type="x-plane" />
  <surface coeffs="5.0" id="2" type="x-plane" />
  <surface coeffs="-5.0" id="3" type="y-plane" />
  <surface coeffs="5.0" id="4" type="y-plane" />
  <surface coeffs="-5.0" id="5" type="z-plane" />
  <surface coeffs="5.0" id="6" type="z-plane" />
  <surface coeffs="-10.0" id="7" type="x-plane" />
  <surface coeffs="10.0" id="8" type="x-plane" />
  <surface coeffs="-10.0" id="9" type="y-plane" />
  <surface coeffs="10.0" id="10" type="y-plane" />
  <surface coeffs="-10.0" id="11" type="z-plane" />
  <surface coeffs="10.0" id="12" type="z-plane" />
</geometry>

```

Produced by this python code :

```
import openmc

mat_meat = openmc.Material()
mat_meat.add_nuclide("U235", 1.0, "wo")
mat_meat.set_density("g/cm3", 1.0)

mat_al = openmc.Material()
mat_al.add_nuclide("Al27", 1.0, "ao")
mat_al.set_density("g/cm3", 2.7)

mats = openmc.Materials([mat_meat, mat_al])
mats.cross_sections = "/home/julien/Documents/codes/endfb80_hdf5/cross_sections.xml"
mats.export_to_xml()

dim=[10.,10., 10.]
dim2=[20.,20., 20.]

parrallelepiped_surf = openmc.model.RectangularParallelepiped(-dim[0]/2,dim[0]/2,-dim[1]/2,dim[1]/2,-dim[2]/2,dim[2]/2)
parrallelepiped_surf2 = openmc.model.RectangularParallelepiped(-dim2[0]/2,dim2[0]/2,-dim2[1]/2,dim2[1]/2,-dim2[2]/2,dim2[2]/2)

parrallelepiped_cell = openmc.Cell(name="Cell1" , fill=mat_meat, region = -parrallelepiped_surf)
parrallelepiped_cell2 = openmc.Cell(name="Cell2" , fill=mat_al, region = -parrallelepiped_surf2 & +parrallelepiped_surf)

p = openmc.Universe()
p.add_cells([parrallelepiped_cell, parrallelepiped_cell2])

geom = openmc.Geometry(p)
geom.export_to_xml()

plot_xy= openmc.Plot()
plot_xy.origin = (0, 0, 0)
plot_xy.width = (50.,50.)
plot_xy.pixels = (1000, 1000)
plot_xy.basis = 'xy'
plot_xy.id = 1
plot_xy.colors={mat_meat:"Red", mat_al:"Gray"}
plot_xy.color_by='material'

openmc.plot_inline(plots=[plot_xy])

```

I was expecting this definition for 2nd cell:  
` <cell id="2" material="2" name="Cell2" region="7 -8 9 -10 11 -12 (-1 | 2 | -3 | 4 | -5 | 6)" universe="1" />`

Is there a misuse or a problem ?

Best regards,

Julien

---

<div class="post-metadata">

**Author:** ![pshriwise](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pshriwise/32/3863_2.png) [@pshriwise](https://openmc.discourse.group/u/pshriwise)\
**Post date:** [November 12, 2020, 6:37pm UTC](https://openmc.discourse.group/t/openmc-model-rectangularparallelepiped-usage/858/2 "2020-11-12T18:37:56Z")

</div>

Hi Julien! Thank you for reporting this.

This is indeed a bug and is specific to the use of the positive halfspace of the `RectangularParallelepiped` object. I’ll submit a fix for this ASAP.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 13, 2020, 3:52pm UTC](https://openmc.discourse.group/t/openmc-model-rectangularparallelepiped-usage/858/3 "2020-11-13T15:52:54Z")

</div>

@pshriwise’s fix has been merged in the develop branch, so this will be part of the next release.

---

<div class="post-metadata">

**Author:** ![jujuC31](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jujuC31](https://openmc.discourse.group/u/jujuC31)\
**Post date:** [November 14, 2020, 10:38am UTC](https://openmc.discourse.group/t/openmc-model-rectangularparallelepiped-usage/858/4 "2020-11-14T10:38:35Z")

</div>

Thx for your answers and for fixing it. For my information, when is planned the next release ?

Best

Julien

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 17, 2020, 8:45pm UTC](https://openmc.discourse.group/t/openmc-model-rectangularparallelepiped-usage/858/5 "2020-11-17T20:45:55Z")

</div>

We should have another release out by the end of the year or sooner.
