Skip to content

Commit fa23301

Browse files
authored
Release of version 0.14.0 (#2754)
1 parent 847e9b5 commit fa23301

File tree

11 files changed

+357
-59
lines changed

11 files changed

+357
-59
lines changed

docs/source/pythonapi/base.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Geometry Plotting
160160
:template: myclass.rst
161161

162162
openmc.Plot
163+
openmc.ProjectionPlot
163164
openmc.Plots
164165

165166
Running OpenMC

docs/source/releasenotes/0.14.0.rst

Lines changed: 284 additions & 0 deletions
Large diffs are not rendered by default.

docs/source/releasenotes/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Release Notes
77
.. toctree::
88
:maxdepth: 1
99

10+
0.14.0
1011
0.13.3
1112
0.13.2
1213
0.13.1

docs/source/usersguide/plots.rst

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -126,27 +126,29 @@ will depend on the 3D viewer, but should be straightforward.
126126
Projection Plots
127127
----------------
128128

129-
.. image:: ../_images/hexlat_anim.gif
130-
:width: 200px
131-
132-
The :class:`openmc.ProjectionPlot` class presents an alternative method
133-
of producing 3D visualizations of OpenMC geometries. It was developed to
134-
overcome the primary shortcoming of voxel plots, that an enormous number
135-
of voxels must be employed to capture detailed geometric features.
136-
Projection plots perform volume rendering on material or
137-
cell volumes, with colors specified in the same manner as slice plots.
138-
This is done using the native ray tracing capabilities within OpenMC,
139-
so any geometry in which particles successfully run without overlaps
140-
or leaks will work with projection plots.
141-
142-
One drawback of projection plots is that particle tracks cannot be overlaid
143-
on them at present. Moreover, checking for overlap regions is not currently possible with projection plots. The image heading this section can
144-
be created by adding the following code to the hexagonal lattice example packaged
145-
with OpenMC, before exporting to plots.xml.
129+
.. only:: html
130+
131+
.. image:: ../_images/hexlat_anim.gif
132+
:width: 200px
133+
134+
The :class:`openmc.ProjectionPlot` class presents an alternative method of
135+
producing 3D visualizations of OpenMC geometries. It was developed to overcome
136+
the primary shortcoming of voxel plots, that an enormous number of voxels must
137+
be employed to capture detailed geometric features. Projection plots perform
138+
volume rendering on material or cell volumes, with colors specified in the same
139+
manner as slice plots. This is done using the native ray tracing capabilities
140+
within OpenMC, so any geometry in which particles successfully run without
141+
overlaps or leaks will work with projection plots.
142+
143+
One drawback of projection plots is that particle tracks cannot be overlaid on
144+
them at present. Moreover, checking for overlap regions is not currently
145+
possible with projection plots. The image heading this section can be created by
146+
adding the following code to the hexagonal lattice example packaged with OpenMC,
147+
before exporting to plots.xml.
146148

147149
::
148150

149-
r = 5
151+
r = 5
150152
import numpy as np
151153
for i in range(100):
152154
phi = 2 * np.pi * i/100
@@ -162,48 +164,46 @@ with OpenMC, before exporting to plots.xml.
162164
thisp.xs[iron] = 1.0
163165
thisp.wireframe_domains = [fuel]
164166
thisp.wireframe_thickness = 2
165-
167+
166168
plot_file.append(thisp)
167169

168-
This generates a sequence of png files which can be joined to form a gif.
169-
Each image specifies a different camera position using some simple periodic
170-
functions to create a perfectly looped gif. :attr:`ProjectionPlot.look_at`
171-
defines where the camera's centerline should point at.
172-
:attr:`ProjectionPlot.camera_position` similarly defines where the camera
173-
is situated in the universe level we seek to plot. The other settings
174-
resemble those employed by :class:`openmc.Plot`, with the exception of
175-
the :class:`ProjectionPlot.set_transparent` method and :attr:`ProjectionPlot.xs`
176-
dictionary. These are used to control volume rendering of material
177-
volumes. "xs" here stands for cross section, and it defines material
178-
opacities in units of inverse centimeters. Setting this value to a
179-
large number would make a material or cell opaque, and setting it to
180-
zero makes a material transparent. Thus, the :class:`ProjectionPlot.set_transparent`
181-
can be used to make all materials in the geometry transparent. From there,
182-
individual material or cell opacities can be tuned to produce the
183-
desired result.
184-
185-
Two camera projections are available when using these plots, perspective
186-
and orthographic. The default, perspective projection,
187-
is a cone of rays passing through each pixel which radiate from the camera
188-
position and span the field of view in the x and y positions. The horizontal
189-
field of view can be set with the :attr: `ProjectionPlot.horizontal_field_of_view` attribute,
190-
which is to be specified in units of degrees. The field of view only influences
191-
behavior in perspective projection mode.
170+
This generates a sequence of png files which can be joined to form a gif. Each
171+
image specifies a different camera position using some simple periodic functions
172+
to create a perfectly looped gif. :attr:`ProjectionPlot.look_at` defines where
173+
the camera's centerline should point at. :attr:`ProjectionPlot.camera_position`
174+
similarly defines where the camera is situated in the universe level we seek to
175+
plot. The other settings resemble those employed by :class:`openmc.Plot`, with
176+
the exception of the :class:`ProjectionPlot.set_transparent` method and
177+
:attr:`ProjectionPlot.xs` dictionary. These are used to control volume rendering
178+
of material volumes. "xs" here stands for cross section, and it defines material
179+
opacities in units of inverse centimeters. Setting this value to a large number
180+
would make a material or cell opaque, and setting it to zero makes a material
181+
transparent. Thus, the :class:`ProjectionPlot.set_transparent` can be used to
182+
make all materials in the geometry transparent. From there, individual material
183+
or cell opacities can be tuned to produce the desired result.
184+
185+
Two camera projections are available when using these plots, perspective and
186+
orthographic. The default, perspective projection, is a cone of rays passing
187+
through each pixel which radiate from the camera position and span the field of
188+
view in the x and y positions. The horizontal field of view can be set with the
189+
:attr: `ProjectionPlot.horizontal_field_of_view` attribute, which is to be
190+
specified in units of degrees. The field of view only influences behavior in
191+
perspective projection mode.
192192

193193
In the orthographic projection, rays follow the same angle but originate from
194-
different points. The horizontal width of this plane of ray starting points
195-
may be set with the :attr: `ProjectionPlot.orthographic_width` element. If this element
196-
is nonzero, the orthographic projection is employed. Left to its default value
197-
of zero, the perspective projection is employed.
198-
199-
Lastly, projection plots come packaged with wireframe generation that
200-
can target either all surface/cell/material boundaries in the geometry,
201-
or only wireframing around specific regions. In the above example, we
202-
have set only the fuel region from the hexagonal lattice example to have
203-
a wireframe drawn around it. This is accomplished by setting the
204-
:attr: `ProjectionPlot.wireframe_domains`, which may be set to either material
205-
IDs or cell IDs. The :attr:`ProjectionPlot.wireframe_thickness`
206-
attribute sets the wireframe thickness in units of pixels.
194+
different points. The horizontal width of this plane of ray starting points may
195+
be set with the :attr: `ProjectionPlot.orthographic_width` element. If this
196+
element is nonzero, the orthographic projection is employed. Left to its default
197+
value of zero, the perspective projection is employed.
198+
199+
Lastly, projection plots come packaged with wireframe generation that can target
200+
either all surface/cell/material boundaries in the geometry, or only wireframing
201+
around specific regions. In the above example, we have set only the fuel region
202+
from the hexagonal lattice example to have a wireframe drawn around it. This is
203+
accomplished by setting the :attr: `ProjectionPlot.wireframe_domains`, which may
204+
be set to either material IDs or cell IDs. The
205+
:attr:`ProjectionPlot.wireframe_thickness` attribute sets the wireframe
206+
thickness in units of pixels.
207207

208208
.. note:: When setting specific material or cell regions to have wireframes
209209
drawn around them, the plot must be colored by materials if wireframing

include/openmc/boundary_condition.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class Surface;
1818

1919
class BoundaryCondition {
2020
public:
21+
virtual ~BoundaryCondition() = default;
22+
2123
//! Perform tracking operations for a particle that strikes the boundary.
2224
//! \param p The particle that struck the boundary. This class is not meant
2325
//! to directly modify anything about the particle, but it will do so

include/openmc/version.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace openmc {
1010
constexpr int VERSION_MAJOR {@OPENMC_VERSION_MAJOR@};
1111
constexpr int VERSION_MINOR {@OPENMC_VERSION_MINOR@};
1212
constexpr int VERSION_RELEASE {@OPENMC_VERSION_RELEASE@};
13-
constexpr bool VERSION_DEV {true};
13+
constexpr bool VERSION_DEV {false};
1414
constexpr std::array<int, 3> VERSION {VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE};
1515
// clang-format on
1616

openmc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
from openmc.model import Model
4040

4141

42-
__version__ = '0.14.0-dev'
42+
__version__ = '0.14.0'

openmc/deplete/results.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def get_activity(
104104
) -> Tuple[np.ndarray, typing.Union[np.ndarray, List[dict]]]:
105105
"""Get activity of material over time.
106106
107+
.. versionadded:: 0.14.0
108+
107109
Parameters
108110
----------
109111
mat : openmc.Material, str
@@ -220,6 +222,8 @@ def get_decay_heat(
220222
) -> Tuple[np.ndarray, typing.Union[np.ndarray, List[dict]]]:
221223
"""Get decay heat of material over time.
222224
225+
.. versionadded:: 0.14.0
226+
223227
Parameters
224228
----------
225229
mat : openmc.Material, str

openmc/model/surface_composite.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ def _plane(axis, name, value, boundary_type='transmission', albedo=1.0):
13211321
class RectangularPrism(CompositeSurface):
13221322
"""Infinite rectangular prism bounded by four planar surfaces.
13231323
1324-
.. versionadded:: 0.13.4
1324+
.. versionadded:: 0.14.0
13251325
13261326
Parameters
13271327
----------
@@ -1445,6 +1445,8 @@ def __neg__(self):
14451445
class HexagonalPrism(CompositeSurface):
14461446
"""Hexagonal prism comoposed of six planar surfaces
14471447
1448+
.. versionadded:: 0.14.0
1449+
14481450
Parameters
14491451
----------
14501452
edge_length : float

openmc/plots.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,8 @@ class ProjectionPlot(PlotBase):
990990
projections are more similar to a pinhole camera, and orthographic projections
991991
preserve parallel lines and distances.
992992
993+
.. versionadded:: 0.14.0
994+
993995
Parameters
994996
----------
995997
plot_id : int

0 commit comments

Comments
 (0)