# Defining region between hexagonal lattice & a cylinder

**URL:** <https://openmc.discourse.group/t/defining-region-between-hexagonal-lattice-a-cylinder/1490>\
**Category:** User Support\
**Created:** [October 21, 2021, 8:06am UTC](https://openmc.discourse.group/t/defining-region-between-hexagonal-lattice-a-cylinder/1490 "2021-10-21T08:06:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![imtiaj\_hossain](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@imtiaj\_hossain](https://openmc.discourse.group/u/imtiaj_hossain)\
**Post date:** [October 21, 2021, 8:06am UTC](https://openmc.discourse.group/t/defining-region-between-hexagonal-lattice-a-cylinder/1490/1 "2021-10-21T08:06:21Z")

</div>

Hi all, how can i define a region & assign a material between a hexagonal lattice & a cylinder??

-Thanks

---

<div class="post-metadata">

**Author:** ![tjlaboss](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/tjlaboss/32/1390_2.png) [@tjlaboss](https://openmc.discourse.group/u/tjlaboss)\
**Post date:** [October 22, 2021, 12:09am UTC](https://openmc.discourse.group/t/defining-region-between-hexagonal-lattice-a-cylinder/1490/2 "2021-10-22T00:09:59Z")

</div>

One approach could be using the `Lattice.outer` attribute:

```python
# Create the hexagonal lattice as you normally would.
hex_lattice = openmc.HexLattice()
populate_the_hex_lattice(...)
# Create a universe containing just an infinite cell
c = openmc.Cell(fill=some_material)
u = openmc.Universe(cells=[c])
hex_lattice.outer = u
# Put it in the cylinder. 
cyl = openmc.ZCylinder(...)
your_cell = openmc.Cell()
your_cell.region = -cyl
your_cell.fill = hex_lattice # Space outside the hex lattice will be filled with some_material.

```

---

<div class="post-metadata">

**Author:** ![imtiaj\_hossain](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@imtiaj\_hossain](https://openmc.discourse.group/u/imtiaj_hossain)\
**Post date:** [October 22, 2021, 10:49am UTC](https://openmc.discourse.group/t/defining-region-between-hexagonal-lattice-a-cylinder/1490/3 "2021-10-22T10:49:05Z")

</div>

Thanks for your concern but what i wanted to do is actually to define the region between a cylinder (larger in diameter) & the hexagonal prism/lattice i defined. By doing as u mentioned will fill that cylinder with the hex cell. But still i can’t freely define the region in between. I already solved this issue myself.

Defining the six planes separately using openmc.Plane(a,b,c,d) & then doing boolean operation between the six planes & the cylinder will give me the defined region & i can use it after that to assign any material i want.

-Thanks

---

<div class="post-metadata">

**Author:** ![imtiaj\_hossain](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@imtiaj\_hossain](https://openmc.discourse.group/u/imtiaj_hossain)\
**Post date:** [October 22, 2021, 8:27pm UTC](https://openmc.discourse.group/t/defining-region-between-hexagonal-lattice-a-cylinder/1490/4 "2021-10-22T20:27:48Z")

</div>

sorry to say, but i guess my solution is also not entirely correct. it’ll still leave some areas undefined in between. it’ll be better if we can define a region outside a hexagonal prism & inside another geometry by boolean .but i dont know how to do it!!

---

<div class="post-metadata">

**Author:** ![tjlaboss](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/tjlaboss/32/1390_2.png) [@tjlaboss](https://openmc.discourse.group/u/tjlaboss)\
**Post date:** [October 23, 2021, 2:41am UTC](https://openmc.discourse.group/t/defining-region-between-hexagonal-lattice-a-cylinder/1490/5 "2021-10-23T02:41:23Z")

</div>

Not sure I follow. Are you placing a cylinder around a `HexLattice`, or around a hexagon made from six planes?

---

<div class="post-metadata">

**Author:** ![imtiaj\_hossain](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@imtiaj\_hossain](https://openmc.discourse.group/u/imtiaj_hossain)\
**Post date:** [October 23, 2021, 3:58pm UTC](https://openmc.discourse.group/t/defining-region-between-hexagonal-lattice-a-cylinder/1490/6 "2021-10-23T15:58:51Z")

</div>

I actually had a misconception .thank you so much.this was the right thing.i got it now

-Imtiaj
