From 5ae761796362002c86a7de16259807add18e35b5 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 11 Mar 2022 11:31:25 -0600 Subject: [PATCH] Removing specified length multiplier attribute. Updating string representation --- openmc/mesh.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 40d56f5025..584ea81ce8 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1137,9 +1137,6 @@ class UnstructuredMesh(MeshBase): output : bool Indicates whether or not automatic tally output should be generated for this mesh - specified_length_multiplier: bool - Indicates whether a non-unity length multiplier has been - applied to this mesh volumes : Iterable of float Volumes of the unstructured mesh elements total_volume : float @@ -1156,7 +1153,6 @@ class UnstructuredMesh(MeshBase): self._centroids = None self.library = library self._output = True - self._specified_length_multiplier = False self.length_multiplier = length_multiplier @property @@ -1241,17 +1237,17 @@ class UnstructuredMesh(MeshBase): @length_multiplier.setter def length_multiplier(self, length_multiplier): cv.check_type("Unstructured mesh length multiplier", - length_multiplier, - Real) + length_multiplier, + Real) self._length_multiplier = length_multiplier - if (self._length_multiplier != 1.0): - self._specified_length_multiplier = True - def __repr__(self): string = super().__repr__() string += '{: <16}=\t{}\n'.format('\tFilename', self.filename) string += '{: <16}=\t{}\n'.format('\tMesh Library', self.mesh_lib) + if self.length_multiplier != 1.0: + string += '{: <16}=\t{}\n'.format('\tLength multiplier', + self.length_multiplier) return string def write_data_to_vtk(self, filename, datasets, volume_normalization=True): @@ -1374,7 +1370,7 @@ class UnstructuredMesh(MeshBase): subelement = ET.SubElement(element, "filename") subelement.text = self.filename - if (self._specified_length_multiplier): + if self._length_multiplier != 1.0: element.set("length_multiplier", str(self.length_multiplier)) return element