From 5cfaa846dc28243dcabf9c8721484780e26fb379 Mon Sep 17 00:00:00 2001 From: Rupert Nash Date: Tue, 12 Sep 2023 13:16:22 +0100 Subject: [PATCH] Remove stress type from configuration #801 --- Code/configuration/SimBuilder.cc | 1 - Code/configuration/SimConfig.h | 5 ----- Code/configuration/SimConfigReader.cc | 14 -------------- Code/configuration/SimConfigWriter.cc | 3 --- Code/lb/LbmParameters.h | 9 --------- Code/tests/resources/config-velocity-iolet.xml | 1 - Code/tests/resources/config.xml | 1 - Code/tests/resources/config0_2_0.xml | 1 - Code/tests/resources/config_file_inlet.xml | 1 - .../tests/resources/config_file_velocity_inlet.xml | 1 - .../tests/resources/config_new_velocity_inlets.xml | 1 - Code/tests/resources/config_vel_dist.xml | 1 - Code/tests/resources/cyl_l100_r5.xml | 1 - Code/tests/resources/fedosov1c.xml | 1 - Code/tests/resources/four_cube.xml | 1 - Code/tests/resources/four_cube_multiscale.xml | 1 - Code/tests/resources/large_cylinder.xml | 1 - Code/tests/resources/large_cylinder_rbc.xml | 1 - doc/user/XmlConfiguration.md | 1 - geometry-tool/HlbGmyTool/Model/XmlWriter.py | 5 ----- geometry-tool/tests/Model/data/test.xml | 1 - 21 files changed, 52 deletions(-) diff --git a/Code/configuration/SimBuilder.cc b/Code/configuration/SimBuilder.cc index 9ca493c07..45d6a5540 100644 --- a/Code/configuration/SimBuilder.cc +++ b/Code/configuration/SimBuilder.cc @@ -51,7 +51,6 @@ namespace hemelb::configuration { lb::LbmParameters SimBuilder::BuildLbmParams() const { auto&& i = config.sim_info; lb::LbmParameters ans(i.time.step_s, i.space.step_m, i.fluid.density_kgm3, i.fluid.viscosity_Pas); - ans.StressType = i.stress_type; return ans; } diff --git a/Code/configuration/SimConfig.h b/Code/configuration/SimConfig.h index e45c1b8e1..ff94d40ca 100644 --- a/Code/configuration/SimConfig.h +++ b/Code/configuration/SimConfig.h @@ -77,7 +77,6 @@ namespace hemelb::configuration }; struct GlobalSimInfo { - lb::StressTypes stress_type; TimeInfo time; SpaceInfo space; FluidInfo fluid; @@ -228,10 +227,6 @@ friend class io::Checkpointer; { return outlets; } - lb::StressTypes GetStressType() const - { - return sim_info.stress_type; - } const path& GetDataFilePath() const { return dataFilePath; diff --git a/Code/configuration/SimConfigReader.cc b/Code/configuration/SimConfigReader.cc index e7d94d3d5..4dc0152cc 100644 --- a/Code/configuration/SimConfigReader.cc +++ b/Code/configuration/SimConfigReader.cc @@ -149,20 +149,6 @@ namespace hemelb::configuration { GlobalSimInfo SimConfigReader::DoIOForSimulation(const Element simEl) const { GlobalSimInfo ans; - // Required element - // - ans.stress_type = [](unsigned v) { - switch (v) { - case lb::IgnoreStress: - return lb::IgnoreStress; - case lb::ShearStress: - return lb::IgnoreStress; - case lb::VonMises: - return lb::IgnoreStress; - default: - throw Exception() << "Invalid stresstype: " << v; - } - }(simEl.GetChildOrThrow("stresstype").GetAttributeOrThrow("value")); // Required element // - outSimEl.AddChild("stresstype").SetAttribute("value", sim_info.stress_type); AddChildDimensionalValue(outSimEl, "step_length", "s", sim_info.time.step_s); diff --git a/Code/lb/LbmParameters.h b/Code/lb/LbmParameters.h index 0480b31d9..3df4cea3c 100644 --- a/Code/lb/LbmParameters.h +++ b/Code/lb/LbmParameters.h @@ -22,13 +22,6 @@ namespace hemelb::lb { class BoundaryValues; - enum StressTypes - { - VonMises = 0, - ShearStress = 1, - IgnoreStress = 2 - }; - class LbmParameters { inline void CalcDerivedParams() { @@ -111,8 +104,6 @@ namespace hemelb::lb return beta; } - StressTypes StressType; - private: PhysicalTime timeStep = 1; // seconds PhysicalDistance voxelSize = 1; // metres diff --git a/Code/tests/resources/config-velocity-iolet.xml b/Code/tests/resources/config-velocity-iolet.xml index ab6b4ec40..6ff8c0b82 100644 --- a/Code/tests/resources/config-velocity-iolet.xml +++ b/Code/tests/resources/config-velocity-iolet.xml @@ -1,7 +1,6 @@ - diff --git a/Code/tests/resources/config.xml b/Code/tests/resources/config.xml index f346114a2..9b4a851be 100644 --- a/Code/tests/resources/config.xml +++ b/Code/tests/resources/config.xml @@ -1,7 +1,6 @@ - diff --git a/Code/tests/resources/config0_2_0.xml b/Code/tests/resources/config0_2_0.xml index e1401140e..d774393dd 100644 --- a/Code/tests/resources/config0_2_0.xml +++ b/Code/tests/resources/config0_2_0.xml @@ -1,7 +1,6 @@ - diff --git a/Code/tests/resources/config_file_inlet.xml b/Code/tests/resources/config_file_inlet.xml index f18abe934..376683fbf 100644 --- a/Code/tests/resources/config_file_inlet.xml +++ b/Code/tests/resources/config_file_inlet.xml @@ -1,7 +1,6 @@ - diff --git a/Code/tests/resources/config_file_velocity_inlet.xml b/Code/tests/resources/config_file_velocity_inlet.xml index 3b3d3e7b0..f8781bfe0 100644 --- a/Code/tests/resources/config_file_velocity_inlet.xml +++ b/Code/tests/resources/config_file_velocity_inlet.xml @@ -1,7 +1,6 @@ - diff --git a/Code/tests/resources/config_new_velocity_inlets.xml b/Code/tests/resources/config_new_velocity_inlets.xml index aab5f3084..06af6558d 100644 --- a/Code/tests/resources/config_new_velocity_inlets.xml +++ b/Code/tests/resources/config_new_velocity_inlets.xml @@ -1,7 +1,6 @@ - diff --git a/Code/tests/resources/config_vel_dist.xml b/Code/tests/resources/config_vel_dist.xml index 581fcd6b6..a972092ba 100644 --- a/Code/tests/resources/config_vel_dist.xml +++ b/Code/tests/resources/config_vel_dist.xml @@ -3,7 +3,6 @@ - diff --git a/Code/tests/resources/cyl_l100_r5.xml b/Code/tests/resources/cyl_l100_r5.xml index e32ddcce7..b4a9ae89b 100644 --- a/Code/tests/resources/cyl_l100_r5.xml +++ b/Code/tests/resources/cyl_l100_r5.xml @@ -3,7 +3,6 @@ - diff --git a/Code/tests/resources/fedosov1c.xml b/Code/tests/resources/fedosov1c.xml index e4fe9ff40..fd0f33929 100644 --- a/Code/tests/resources/fedosov1c.xml +++ b/Code/tests/resources/fedosov1c.xml @@ -3,7 +3,6 @@ - diff --git a/Code/tests/resources/four_cube.xml b/Code/tests/resources/four_cube.xml index bc53136c7..11e0a28b6 100644 --- a/Code/tests/resources/four_cube.xml +++ b/Code/tests/resources/four_cube.xml @@ -6,7 +6,6 @@ - diff --git a/Code/tests/resources/four_cube_multiscale.xml b/Code/tests/resources/four_cube_multiscale.xml index 1fd5ace2b..e5e17cade 100644 --- a/Code/tests/resources/four_cube_multiscale.xml +++ b/Code/tests/resources/four_cube_multiscale.xml @@ -3,7 +3,6 @@ - diff --git a/Code/tests/resources/large_cylinder.xml b/Code/tests/resources/large_cylinder.xml index 9abc591dc..36ab3dab6 100644 --- a/Code/tests/resources/large_cylinder.xml +++ b/Code/tests/resources/large_cylinder.xml @@ -3,7 +3,6 @@ - diff --git a/Code/tests/resources/large_cylinder_rbc.xml b/Code/tests/resources/large_cylinder_rbc.xml index 1d4d1bdb7..973f690c6 100644 --- a/Code/tests/resources/large_cylinder_rbc.xml +++ b/Code/tests/resources/large_cylinder_rbc.xml @@ -3,7 +3,6 @@ - diff --git a/doc/user/XmlConfiguration.md b/doc/user/XmlConfiguration.md index 2c8fcd8cf..a76a9f6d4 100644 --- a/doc/user/XmlConfiguration.md +++ b/doc/user/XmlConfiguration.md @@ -41,7 +41,6 @@ The `` is required and specifies some global properties of the simulation, mainly time-related. It's child elements are: -* Required: `` - the type of stresses to calculate. Must correspond to the `enum hemelb::lb::StressTypes` * Required: `` - the length of a time step; units must be s (seconds) * Required: `` - the length of the main simulation; units must be lattice * Required: `` - the voxel size in the gmy file diff --git a/geometry-tool/HlbGmyTool/Model/XmlWriter.py b/geometry-tool/HlbGmyTool/Model/XmlWriter.py index 266e7eaf9..859707bc4 100644 --- a/geometry-tool/HlbGmyTool/Model/XmlWriter.py +++ b/geometry-tool/HlbGmyTool/Model/XmlWriter.py @@ -28,7 +28,6 @@ def format_field(self, value, format_spec): class XmlWriter(object): VERSION = 6 - STRESSTYPE = 1 FMT = HexFloatFormatter() @@ -78,7 +77,6 @@ def DoSimulation(self, root): round(self.profile.DurationSeconds / self.profile.TimeStepSeconds), "lattice", ) - self.ValueElement(sim, "stresstype", self.STRESSTYPE) self.QuantityElement(sim, "voxel_size", self.profile.VoxelSizeMetres, "m") self.QuantityElement(sim, "origin", self.profile.OriginMetres, "m") return @@ -143,8 +141,5 @@ def DoIolets(self, root): continue return - def ValueElement(self, parent, name, value): - return SubElement(parent, name, value=self._totext(value)) - def QuantityElement(self, parent, name, value, units): return SubElement(parent, name, value=self._totext(value), units=units) diff --git a/geometry-tool/tests/Model/data/test.xml b/geometry-tool/tests/Model/data/test.xml index 5e8860de0..d312cce31 100644 --- a/geometry-tool/tests/Model/data/test.xml +++ b/geometry-tool/tests/Model/data/test.xml @@ -3,7 +3,6 @@ -