Skip to content

Commit

Permalink
Remove stress type from configuration #801
Browse files Browse the repository at this point in the history
  • Loading branch information
rupertnash committed Nov 17, 2023
1 parent 58174d1 commit 5cfaa84
Show file tree
Hide file tree
Showing 21 changed files with 0 additions and 52 deletions.
1 change: 0 additions & 1 deletion Code/configuration/SimBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 0 additions & 5 deletions Code/configuration/SimConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ namespace hemelb::configuration
};

struct GlobalSimInfo {
lb::StressTypes stress_type;
TimeInfo time;
SpaceInfo space;
FluidInfo fluid;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 0 additions & 14 deletions Code/configuration/SimConfigReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,6 @@ namespace hemelb::configuration {
GlobalSimInfo SimConfigReader::DoIOForSimulation(const Element simEl) const
{
GlobalSimInfo ans;
// Required element
// <stresstype value="enum lb::StressTypes" />
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<unsigned>("value"));

// Required element
// <steps value="unsigned" units="lattice />
Expand Down
3 changes: 0 additions & 3 deletions Code/configuration/SimConfigWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ namespace hemelb::configuration {

void SimConfigWriter::DoIOForSimulation(const GlobalSimInfo& sim_info) {
Element outSimEl = outputXml->GetRoot().AddChild("simulation");
// Required element
// <stresstype value="enum lb::StressTypes" />
outSimEl.AddChild("stresstype").SetAttribute("value", sim_info.stress_type);

AddChildDimensionalValue(outSimEl, "step_length", "s", sim_info.time.step_s);

Expand Down
9 changes: 0 additions & 9 deletions Code/lb/LbmParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ namespace hemelb::lb
{
class BoundaryValues;

enum StressTypes
{
VonMises = 0,
ShearStress = 1,
IgnoreStress = 2
};

class LbmParameters
{
inline void CalcDerivedParams() {
Expand Down Expand Up @@ -111,8 +104,6 @@ namespace hemelb::lb
return beta;
}

StressTypes StressType;

private:
PhysicalTime timeStep = 1; // seconds
PhysicalDistance voxelSize = 1; // metres
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/config-velocity-iolet.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" ?>
<hemelbsettings version="6">
<simulation>
<stresstype value="1" />
<steps value="40000" units="lattice" />
<step_length value="0.0001" units="s" />
<voxel_size value="0.01" units="m" />
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" ?>
<hemelbsettings version="6">
<simulation>
<stresstype value="1" />
<steps value="3000" units="lattice" />
<step_length value="0.0001" units="s" />
<voxel_size value="0.01" units="m" />
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/config0_2_0.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" ?>
<hemelbsettings version="6">
<simulation>
<stresstype value="1" />
<steps value="3000" units="lattice" />
<step_length value="0.0001" units="s" />
<voxel_size value="0.01" units="m" />
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/config_file_inlet.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" ?>
<hemelbsettings version="6">
<simulation>
<stresstype value="1" />
<steps value="40000" units="lattice" />
<step_length value="0.0001" units="s" />
<voxel_size value="0.01" units="m" />
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/config_file_velocity_inlet.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" ?>
<hemelbsettings version="6">
<simulation>
<stresstype value="1" />
<steps value="4000" units="lattice" />
<step_length value="0.001" units="s" />
<voxel_size value="0.01" units="m" />
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/config_new_velocity_inlets.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" ?>
<hemelbsettings version="6">
<simulation>
<stresstype value="1" />
<steps value="3000" units="lattice" />
<step_length value="0.0001" units="s" />
<voxel_size value="0.01" units="m" />
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/config_vel_dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<simulation>
<steps value="3000" units="lattice" />
<step_length value="0.0008571428571428571" units="s" />
<stresstype value="1" />
<voxel_size value="4.0e-4" units="m" />
<origin value="(-3.2e-3,-3.2e-3,-5.02e-2)" units="m" />
</simulation>
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/cyl_l100_r5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<simulation>
<step_length units="s" value="1.852e-08" />
<steps units="lattice" value="12000" />
<stresstype value="1" />
<voxel_size units="m" value="3.333e-07" />
<origin units="m" value="(-5.16615e-06,-5.16615e-06,-5.016165e-05)" />
</simulation>
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/fedosov1c.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<simulation>
<step_length units="s" value="9.25375434888e-08" />
<steps units="lattice" value="1000" />
<stresstype value="1" />
<voxel_size units="m" value="8.16253828854e-07" />
<origin units="m" value="(-6.53003063083e-06,-6.53003063083e-06,-3.55070415551e-05)" />
</simulation>
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/four_cube.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<voxel_size value="0.01" units="m" />
<origin value="(0.0,0.0,0.0)" units="m" />
<fluid_density value="1000.0" units="kg/m3" />
<stresstype value="1" />
</simulation>
<geometry>
<datafile path="./four_cube.gmy" />
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/four_cube_multiscale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<simulation>
<steps value="100" units="lattice" />
<step_length value="0.2" units="s" />
<stresstype value="1" />
<voxel_size value="0.01" units="m" />
<origin value="(0.0,0.0,0.0)" units="m" />
</simulation>
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/large_cylinder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<simulation>
<step_length units="s" value="4.4e-07" />
<steps units="lattice" value="50000" />
<stresstype value="1" />
<voxel_size units="m" value="1.4e-06" />
<origin units="m" value="(-1.05e-05,-1.05e-05,-2.45248049736e-05)" />
</simulation>
Expand Down
1 change: 0 additions & 1 deletion Code/tests/resources/large_cylinder_rbc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<simulation>
<step_length units="s" value="2.e-7" />
<steps units="lattice" value="500" />
<stresstype value="1" />
<voxel_size units="m" value="1.4e-06" />
<origin units="m" value="(-1.05e-05,-1.05e-05,-2.45e-05)" />
</simulation>
Expand Down
1 change: 0 additions & 1 deletion doc/user/XmlConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ The `<simulation>` is required and specifies some global properties of
the simulation, mainly time-related.

It's child elements are:
* Required: `<stresstype value="int">` - the type of stresses to calculate. Must correspond to the `enum hemelb::lb::StressTypes`
* Required: `<step_length value="float" units="s" />` - the length of a time step; units must be s (seconds)
* Required: `<steps value="int" units="lattice" />` - the length of the main simulation; units must be lattice
* Required: `<voxel_size value="float" units="m" />` - the voxel size in the gmy file
Expand Down
5 changes: 0 additions & 5 deletions geometry-tool/HlbGmyTool/Model/XmlWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def format_field(self, value, format_spec):

class XmlWriter(object):
VERSION = 6
STRESSTYPE = 1

FMT = HexFloatFormatter()

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
1 change: 0 additions & 1 deletion geometry-tool/tests/Model/data/test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<simulation>
<step_length units="s" value="0.0008571428571" />
<steps units="lattice" value="3000" />
<stresstype value="1" />
<voxel_size units="m" value="0.0001" />
<origin units="m" value="(-0.001506801748275757,-0.0013002707004547119,-0.0015515305995941163)" />
</simulation>
Expand Down

0 comments on commit 5cfaa84

Please sign in to comment.