From 476feab519f357bbff1089364540c5f502befd9c Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Fri, 9 Sep 2022 11:40:15 +0100 Subject: [PATCH] changing the description of tracks arg --- openmc/executor.py | 8 ++++++-- openmc/mesh.py | 30 ++++++++++++++++++++++++++++++ openmc/model/model.py | 8 ++++++-- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/openmc/executor.py b/openmc/executor.py index 357fa64d5..a73d896ff 100644 --- a/openmc/executor.py +++ b/openmc/executor.py @@ -31,7 +31,9 @@ def _process_CLI_arguments(volume=False, geometry_debug=False, particles=None, to the number of hardware threads available (or a value set by the :envvar:`OMP_NUM_THREADS` environment variable). tracks : bool, optional - Write tracks for all particles. Defaults to False. + Enables the writing of particles tracks. The number of particle + tracks written to tracks.h5 is limited to 1000 unless + Settings.max_tracks is set. Defaults to False. event_based : None or bool, optional Turns on event-based parallelism if True. If None, the value in the Settings will be used. @@ -245,7 +247,9 @@ def run(particles=None, threads=None, geometry_debug=False, restart_file : str, optional Path to restart file to use tracks : bool, optional - Write tracks for all particles. Defaults to False. + Enables the writing of particles tracks. The number of particle + tracks written to tracks.h5 is limited to 1000 unless + Settings.max_tracks is set. Defaults to False. output : bool Capture OpenMC output from standard out cwd : str, optional diff --git a/openmc/mesh.py b/openmc/mesh.py index 8ac4b1594..9f191e879 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -458,6 +458,36 @@ class RegularMesh(StructuredMesh): string += '{0: <16}{1}{2}\n'.format('\tWidth', '=\t', self._width) return string + @classmethod + def from_universe(cls, universe, dimension=[10, 10, 10], mesh_id=None, name=''): + """Create mesh from an existing openmc universe + + Parameters + ---------- + universe : openmc.Universe + Open used as a template for this mesh + dimension : Iterable of int + The number of mesh cells in each direction. + mesh_id : int + Unique identifier for the mesh + name : str + Name of the mesh + + Returns + ------- + openmc.RegularMesh + RegularMesh instance + + """ + cv.check_type('rectangular lattice', universe, openmc.Universe) + + mesh = cls(mesh_id, name) + mesh.lower_left = universe.bounding_box[0] + mesh.upper_right = universe.bounding_box[1] + mesh.dimension = dimension + + return mesh + @classmethod def from_hdf5(cls, group): mesh_id = int(group.name.split('/')[-1].lstrip('mesh ')) diff --git a/openmc/model/model.py b/openmc/model/model.py index ab99ac978..625094cce 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -256,7 +256,9 @@ class Model: restart_file : str, optional Path to restart file to use tracks : bool, optional - Write tracks for all particles. Defaults to False. + Enables the writing of particles tracks. The number of particle + tracks written to tracks.h5 is limited to 1000 unless + Settings.max_tracks is set. Defaults to False. output : bool Capture OpenMC output from standard out event_based : None or bool, optional @@ -517,7 +519,9 @@ class Model: restart_file : str, optional Path to restart file to use tracks : bool, optional - Write tracks for all particles. Defaults to False. + Enables the writing of particles tracks. The number of particle + tracks written to tracks.h5 is limited to 1000 unless + Settings.max_tracks is set. Defaults to False. output : bool, optional Capture OpenMC output from standard out cwd : str, optional