Skip to content

Commit

Permalink
✨ soil calculation in cmdglobalcfg
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Pellegrino committed Aug 1, 2024
1 parent fcc76b3 commit 934fbbf
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
34 changes: 32 additions & 2 deletions FemDesign.Core/Calculate/CmdGlobalCfg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public partial class CmdGlobalCfg : CmdCommand
[XmlElement("peaksm_auto")]
public PeaksmAuto PeaksmAuto { get; set; }

[XmlElement("soil_calculation")]
public SoilCalculation SoilCalculation { get; set; }

/// <summary>
/// Parameterless constructor for serialization.
/// </summary>
Expand All @@ -41,14 +44,15 @@ private CmdGlobalCfg()

}

public CmdGlobalCfg(MeshGeneral meshGeneral, MeshElements meshElements, MeshFunctions meshFunctions, MeshPrepare meshPrepare, PeaksmMethod peaksmMethod, PeaksmAuto peaksmAuto)
public CmdGlobalCfg(MeshGeneral meshGeneral, MeshElements meshElements, MeshFunctions meshFunctions, MeshPrepare meshPrepare, PeaksmMethod peaksmMethod, PeaksmAuto peaksmAuto, SoilCalculation soilCalculation)
{
this.MeshGeneral = meshGeneral;
this.MeshElements = meshElements;
this.Meshfunctions = meshFunctions;
this.MeshPrepare = meshPrepare;
this.PeaksmMethod = peaksmMethod;
this.PeaksmAuto = peaksmAuto;
this.SoilCalculation = soilCalculation;
}

public static CmdGlobalCfg Default()
Expand All @@ -59,13 +63,15 @@ public static CmdGlobalCfg Default()
var meshPrepare = MeshPrepare.Default();
var peaksmMethod = PeaksmMethod.Default();
var peaksmAuto = PeaksmAuto.Default();
var soilCalculation = SoilCalculation.Default();

var cmdGlobalCfg = new CmdGlobalCfg(meshGeneral,
meshElements,
meshfunctions,
meshPrepare,
peaksmMethod,
peaksmAuto);
peaksmAuto,
soilCalculation);

return cmdGlobalCfg;
}
Expand Down Expand Up @@ -440,4 +446,28 @@ public static PeaksmAuto Default()
}
}

public partial class SoilCalculation
{
[XmlAttribute("fSoilAsSolid")]
public int _soilAsSolid { get; set; }

/// <summary>
/// Parameterless constructor for serialization.
/// </summary>
private SoilCalculation()
{

}

public SoilCalculation(bool soilAsSolid = true)
{
this._soilAsSolid = System.Convert.ToInt32(soilAsSolid);
}

public static SoilCalculation Default()
{
return new SoilCalculation(soilAsSolid : false);
}
}

}
2 changes: 2 additions & 0 deletions FemDesign.Core/Calculate/Config/cmdglobalcfg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!-- attributes that start with 'f' must be 0 or 1 -->
<!-- attributes that start with 'r' are double numbers -->
<!-- attributes that start with 's' are integer numbers -->
<soil_calculation
fSoilAsSolid = "0" />
<mesh_general
fAdjustToLoads = "0" />
<mesh_elements
Expand Down

0 comments on commit 934fbbf

Please sign in to comment.