Skip to content

Commit

Permalink
Update PointForce and Pressure load
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjamesnugent authored and Fraser Greenroyd committed Mar 28, 2023
1 parent fb7f8c8 commit d2dece5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MidasCivil_Adapter/CRUD/Create/Loads/PointForce.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public bool CreateCollection(IEnumerable<PointLoad> pointLoads)

foreach (string assignedNode in assignedNodes)
{
midasPointLoads.Add(Adapters.MidasCivil.Convert.FromPointLoad(PointLoad, assignedNode, m_forceUnit, m_lengthUnit));
midasPointLoads.Add(Adapters.MidasCivil.Convert.FromPointLoad(PointLoad, assignedNode, m_midasCivilVersion, m_forceUnit, m_lengthUnit));
}

RemoveEndOfDataString(PointLoadPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public static string FromAreaUniformlyDistributedLoad(this AreaUniformlyDistribu
switch (version)
{
case "9.1.0":
assignedFEMesh = assignedFEMesh + ", PRES, PLATE, FACE, " + FromLoadAxis(femeshLoad.Axis) + direction +
midasFEMeshLoad = assignedFEMesh + ", PRES, PLATE, FACE, " + FromLoadAxis(femeshLoad.Axis) + direction +
", 0, 0, 0, " + FromLoadProjection(femeshLoad.Projected) + ", " +
FromVectorDirection(femeshLoad.Pressure, direction).PressureFromSI(forceUnit, lengthUnit).ToString() +
", 0, 0, 0, 0, " + femeshLoad.Name + ",0";
break;
default:
assignedFEMesh = assignedFEMesh + ", PRES, PLATE, FACE, " + FromLoadAxis(femeshLoad.Axis) + direction +
midasFEMeshLoad = assignedFEMesh + ", PRES, PLATE, FACE, " + FromLoadAxis(femeshLoad.Axis) + direction +
", 0, 0, 0, " + FromLoadProjection(femeshLoad.Projected) + ", " +
FromVectorDirection(femeshLoad.Pressure, direction).PressureFromSI(forceUnit, lengthUnit).ToString() +
", 0, 0, 0, 0, " + femeshLoad.Name;
Expand Down
24 changes: 21 additions & 3 deletions MidasCivil_Adapter/Convert/ToMidasCivil/Loads/FromPointForce.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,33 @@ public static partial class Convert
/**** Public Methods ****/
/***************************************************/

public static string FromPointLoad(this PointLoad pointLoad, string assignedNode, string forceUnit, string lengthUnit)
public static string FromPointLoad(this PointLoad pointLoad, string assignedNode, string version, string forceUnit, string lengthUnit)
{
string midasPointLoad = assignedNode + "," + pointLoad.Force.X.ForceFromSI(forceUnit).ToString() +
string midasPointLoad = "";

switch(version)
{
case "9.1.0":
midasPointLoad = assignedNode + "," + pointLoad.Force.X.ForceFromSI(forceUnit).ToString() +
"," + pointLoad.Force.Y.ForceFromSI(forceUnit).ToString() +
"," + pointLoad.Force.Z.ForceFromSI(forceUnit).ToString() +
"," + pointLoad.Moment.X.MomentFromSI(forceUnit, lengthUnit).ToString() +
"," + pointLoad.Moment.Y.MomentFromSI(forceUnit, lengthUnit).ToString() +
"," + pointLoad.Moment.Z.MomentFromSI(forceUnit, lengthUnit).ToString() +
"," + pointLoad.Name;
"," + pointLoad.Name + ",";
break;
default:
midasPointLoad = assignedNode + "," + pointLoad.Force.X.ForceFromSI(forceUnit).ToString() +
"," + pointLoad.Force.Y.ForceFromSI(forceUnit).ToString() +
"," + pointLoad.Force.Z.ForceFromSI(forceUnit).ToString() +
"," + pointLoad.Moment.X.MomentFromSI(forceUnit, lengthUnit).ToString() +
"," + pointLoad.Moment.Y.MomentFromSI(forceUnit, lengthUnit).ToString() +
"," + pointLoad.Moment.Z.MomentFromSI(forceUnit, lengthUnit).ToString() +
"," + pointLoad.Name;
break;

}

return midasPointLoad;
}

Expand Down

0 comments on commit d2dece5

Please sign in to comment.