diff --git a/docs/source/pythonapi/examples/pandas-dataframes.ipynb b/docs/source/pythonapi/examples/pandas-dataframes.ipynb index cb63e2ac3..357f10620 100644 --- a/docs/source/pythonapi/examples/pandas-dataframes.ipynb +++ b/docs/source/pythonapi/examples/pandas-dataframes.ipynb @@ -26,6 +26,7 @@ "import openmc\n", "from openmc.statepoint import StatePoint\n", "from openmc.summary import Summary\n", + "from openmc.region import Intersection\n", "\n", "%matplotlib inline" ] @@ -172,20 +173,20 @@ "# Create fuel Cell\n", "fuel_cell = openmc.Cell(name='1.6% Fuel')\n", "fuel_cell.fill = fuel\n", - "fuel_cell.add_surface(fuel_outer_radius, halfspace=-1)\n", + "fuel_cell.region = fuel_outer_radius.negative\n", "pin_cell_universe.add_cell(fuel_cell)\n", "\n", "# Create a clad Cell\n", "clad_cell = openmc.Cell(name='1.6% Clad')\n", "clad_cell.fill = zircaloy\n", - "clad_cell.add_surface(fuel_outer_radius, halfspace=+1)\n", - "clad_cell.add_surface(clad_outer_radius, halfspace=-1)\n", + "clad_cell.region = Intersection(fuel_outer_radius.positive,\n", + " clad_outer_radius.negative)\n", "pin_cell_universe.add_cell(clad_cell)\n", "\n", "# Create a moderator Cell\n", "moderator_cell = openmc.Cell(name='1.6% Moderator')\n", "moderator_cell.fill = water\n", - "moderator_cell.add_surface(clad_outer_radius, halfspace=+1)\n", + "moderator_cell.region = clad_outer_radius.positive\n", "pin_cell_universe.add_cell(moderator_cell)" ] }, @@ -232,12 +233,9 @@ "root_cell.fill = assembly\n", "\n", "# Add boundary planes\n", - "root_cell.add_surface(min_x, halfspace=+1)\n", - "root_cell.add_surface(max_x, halfspace=-1)\n", - "root_cell.add_surface(min_y, halfspace=+1)\n", - "root_cell.add_surface(max_y, halfspace=-1)\n", - "root_cell.add_surface(min_z, halfspace=+1)\n", - "root_cell.add_surface(max_z, halfspace=-1)\n", + "root_cell.region = Intersection(min_x.positive, max_x.negative,\n", + " min_y.positive, max_y.negative,\n", + " min_z.positive, max_z.negative)\n", "\n", "# Create root Universe\n", "root_universe = openmc.Universe(universe_id=0, name='root universe')\n", diff --git a/docs/source/pythonapi/examples/post-processing.ipynb b/docs/source/pythonapi/examples/post-processing.ipynb index 1bd7ee49a..e83c5bb8a 100644 --- a/docs/source/pythonapi/examples/post-processing.ipynb +++ b/docs/source/pythonapi/examples/post-processing.ipynb @@ -21,6 +21,7 @@ "\n", "import openmc\n", "from openmc.statepoint import StatePoint\n", + "from openmc.region import Intersection\n", "\n", "%matplotlib inline" ] @@ -167,20 +168,20 @@ "# Create fuel Cell\n", "fuel_cell = openmc.Cell(name='1.6% Fuel')\n", "fuel_cell.fill = fuel\n", - "fuel_cell.add_surface(fuel_outer_radius, halfspace=-1)\n", + "fuel_cell.region = fuel_outer_radius.negative\n", "pin_cell_universe.add_cell(fuel_cell)\n", "\n", "# Create a clad Cell\n", "clad_cell = openmc.Cell(name='1.6% Clad')\n", "clad_cell.fill = zircaloy\n", - "clad_cell.add_surface(fuel_outer_radius, halfspace=+1)\n", - "clad_cell.add_surface(clad_outer_radius, halfspace=-1)\n", + "clad_cell.region = Intersection(fuel_outer_radius.positive,\n", + " clad_outer_radius.negative)\n", "pin_cell_universe.add_cell(clad_cell)\n", "\n", "# Create a moderator Cell\n", "moderator_cell = openmc.Cell(name='1.6% Moderator')\n", "moderator_cell.fill = water\n", - "moderator_cell.add_surface(clad_outer_radius, halfspace=+1)\n", + "moderator.region = clad_outer_radius.positive\n", "pin_cell_universe.add_cell(moderator_cell)" ] }, @@ -204,12 +205,9 @@ "root_cell.fill = pin_cell_universe\n", "\n", "# Add boundary planes\n", - "root_cell.add_surface(min_x, halfspace=+1)\n", - "root_cell.add_surface(max_x, halfspace=-1)\n", - "root_cell.add_surface(min_y, halfspace=+1)\n", - "root_cell.add_surface(max_y, halfspace=-1)\n", - "root_cell.add_surface(min_z, halfspace=+1)\n", - "root_cell.add_surface(max_z, halfspace=-1)\n", + "root_cell.region = Intersection(min_x.positive, max_x.negative,\n", + " min_y.positive, max_y.negative,\n", + " min_z.positive, max_z.negative)\n", "\n", "# Create root Universe\n", "root_universe = openmc.Universe(universe_id=0, name='root universe')\n", diff --git a/docs/source/pythonapi/examples/tally-arithmetic.ipynb b/docs/source/pythonapi/examples/tally-arithmetic.ipynb index 2f32f3d9a..b5ba328a0 100644 --- a/docs/source/pythonapi/examples/tally-arithmetic.ipynb +++ b/docs/source/pythonapi/examples/tally-arithmetic.ipynb @@ -36,6 +36,7 @@ "import openmc\n", "from openmc.statepoint import StatePoint\n", "from openmc.summary import Summary\n", + "from openmc.region import Intersection\n", "\n", "%matplotlib inline" ] @@ -182,20 +183,20 @@ "# Create fuel Cell\n", "fuel_cell = openmc.Cell(name='1.6% Fuel')\n", "fuel_cell.fill = fuel\n", - "fuel_cell.add_surface(fuel_outer_radius, halfspace=-1)\n", + "fuel_cell.region = fuel_outer_radius.negative\n", "pin_cell_universe.add_cell(fuel_cell)\n", "\n", "# Create a clad Cell\n", "clad_cell = openmc.Cell(name='1.6% Clad')\n", "clad_cell.fill = zircaloy\n", - "clad_cell.add_surface(fuel_outer_radius, halfspace=+1)\n", - "clad_cell.add_surface(clad_outer_radius, halfspace=-1)\n", + "clad_cell.region = Intersection(fuel_outer_radius.positive,\n", + " clad_outer_radius.negative)\n", "pin_cell_universe.add_cell(clad_cell)\n", "\n", "# Create a moderator Cell\n", "moderator_cell = openmc.Cell(name='1.6% Moderator')\n", "moderator_cell.fill = water\n", - "moderator_cell.add_surface(clad_outer_radius, halfspace=+1)\n", + "moderator_cell.region = clad_outer_radius.positive\n", "pin_cell_universe.add_cell(moderator_cell)" ] }, @@ -219,12 +220,9 @@ "root_cell.fill = pin_cell_universe\n", "\n", "# Add boundary planes\n", - "root_cell.add_surface(min_x, halfspace=+1)\n", - "root_cell.add_surface(max_x, halfspace=-1)\n", - "root_cell.add_surface(min_y, halfspace=+1)\n", - "root_cell.add_surface(max_y, halfspace=-1)\n", - "root_cell.add_surface(min_z, halfspace=+1)\n", - "root_cell.add_surface(max_z, halfspace=-1)\n", + "root_cell.region = Intersection(min_x.positive, max_x.negative,\n", + " min_y.positive, max_y.negative,\n", + " min_z.positive, max_z.negative)\n", "\n", "# Create root Universe\n", "root_universe = openmc.Universe(universe_id=0, name='root universe')\n",