Skip to content

Commit

Permalink
Merge pull request #65 from strusoft/#61-Motions-Rotations-Plastic-Li…
Browse files Browse the repository at this point in the history
…mits

Motions plastic limits & Rotations plastic limits
  • Loading branch information
andosca authored May 26, 2021
2 parents 88ceb39 + f9838ff commit 362acf4
Show file tree
Hide file tree
Showing 50 changed files with 986 additions and 542 deletions.
4 changes: 3 additions & 1 deletion FemDesign.Core/FemDesign.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<Compile Include="GenericClasses\GuidListType.cs" />
<Compile Include="GenericClasses\IFemDesignEntity.cs" />
<Compile Include="GenericClasses\ILoadElement.cs" />
<Compile Include="GenericClasses\ISupportElement.cs" />
<Compile Include="GenericClasses\IStructureElement.cs" />
<Compile Include="GenericClasses\LibraryBase.cs" />
<Compile Include="GenericClasses\LocationValue.cs" />
Expand Down Expand Up @@ -177,6 +178,8 @@
<Compile Include="Reinforcement\SurfaceReinforcementParameters.cs" />
<Compile Include="Reinforcement\Wire.cs" />
<Compile Include="Releases\DetachTypeEnum.cs" />
<Compile Include="Releases\RotationsPlasticLimits.cs" />
<Compile Include="Releases\MotionsPlasticLimits.cs" />
<Compile Include="Releases\Motions.cs" />
<Compile Include="Releases\PlasticityType3d.cs" />
<Compile Include="Releases\RigidityDataLibType1.cs" />
Expand Down Expand Up @@ -212,7 +215,6 @@
<Compile Include="StructureGrid\Axis.cs" />
<Compile Include="StructureGrid\Storey.cs" />
<Compile Include="StructureGrid\Storeys.cs" />
<Compile Include="Supports\GenericSupportObject.cs" />
<Compile Include="Supports\Group.cs" />
<Compile Include="Supports\LineSupport.cs" />
<Compile Include="Supports\PointSupport.cs" />
Expand Down
17 changes: 10 additions & 7 deletions FemDesign.Core/GenericClasses/EntityBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// https://strusoft.com/
using System;
using System.Globalization;
using System.Xml.Serialization;
using FemDesign.GenericClasses;
Expand All @@ -8,19 +9,19 @@ namespace FemDesign
/// <summary>
/// entity_attribs
/// </summary>
[System.Serializable]
[Serializable]
public partial class EntityBase : IFemDesignEntity
{
[XmlAttribute("guid")]
public System.Guid Guid { get; set; }
public Guid Guid { get; set; }
[XmlAttribute("last_change")]
public string _lastChange;
[XmlIgnore]
internal System.DateTime LastChange
internal DateTime LastChange
{
get
{
return System.DateTime.Parse(this._lastChange);
return DateTime.Parse(this._lastChange);
}
set
{
Expand All @@ -37,8 +38,8 @@ internal System.DateTime LastChange
/// </summary>
public void EntityCreated()
{
this.Guid = System.Guid.NewGuid();
this.LastChange = System.DateTime.UtcNow;
this.Guid = Guid.NewGuid();
this.LastChange = DateTime.UtcNow;
this.Action = "added";
}

Expand All @@ -49,8 +50,10 @@ public void EntityCreated()
/// </summary>
public void EntityModified()
{
this.LastChange = System.DateTime.UtcNow;
this.LastChange = DateTime.UtcNow;
this.Action = "modified";
}

public static implicit operator Guid(EntityBase entity) => entity.Guid;
}
}
34 changes: 22 additions & 12 deletions FemDesign.Core/GenericClasses/GuidListType.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// https://strusoft.com/
using System;
using System.Xml.Serialization;
using System.Linq;


namespace FemDesign
{
/// <summary>
/// guid_list_type
/// </summary>
[System.Serializable]
[Serializable]
public partial class GuidListType
{
[XmlAttribute("guid")]
public System.Guid Guid { get; set; }
public Guid Guid { get; set; }

/// <summary>
/// Parameterless constructor.
Expand All @@ -19,23 +22,30 @@ private GuidListType()
{

}
public GuidListType(System.Guid guid)
public GuidListType(Guid guid)
{
this.Guid = guid;
}


/// <summary>
/// Implicit conversion of a Entity to its Global Unique Identifier.
/// </summary>
/// <param name="entity"></param>
public static implicit operator GuidListType(EntityBase entity) => new GuidListType(entity.Guid);
}

/// <summary>
/// two_guid_list_type
/// </summary>
[System.Serializable]
[Serializable]
public partial class TwoGuidListType
{
[XmlAttribute("first")]
public System.Guid First { get; set; }
public Guid First { get; set; }

[XmlAttribute("second")]
public System.Guid Second { get; set; }
public Guid Second { get; set; }

/// <summary>
/// Parameterless constructor.
Expand All @@ -44,7 +54,7 @@ private TwoGuidListType()
{

}
public TwoGuidListType(System.Guid first, System.Guid second)
public TwoGuidListType(Guid first, Guid second)
{
this.First = first;
this.Second = second;
Expand All @@ -54,17 +64,17 @@ public TwoGuidListType(System.Guid first, System.Guid second)
/// <summary>
/// three_guid_list_type
/// </summary>
[System.Serializable]
[Serializable]
public partial class ThreeGuidListType
{
[XmlAttribute("first")]
public System.Guid First { get; set; }
public Guid First { get; set; }

[XmlAttribute("second")]
public System.Guid Second { get; set; }
public Guid Second { get; set; }

[XmlAttribute("third")]
public System.Guid Third { get; set; }
public Guid Third { get; set; }

/// <summary>
/// Parameterless constructor.
Expand All @@ -73,7 +83,7 @@ private ThreeGuidListType()
{

}
public ThreeGuidListType(System.Guid first, System.Guid second, System.Guid third)
public ThreeGuidListType(Guid first, Guid second, Guid third)
{
this.First = first;
this.Second = second;
Expand Down
15 changes: 15 additions & 0 deletions FemDesign.Core/GenericClasses/ISupportElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FemDesign.GenericClasses
{
/// <summary>
/// Support elements. Elements found in the Supports section under the Structure tab in FEM-Design 3D Structure.
/// </summary>
public interface ISupportElement : IFemDesignEntity
{
}
}
35 changes: 21 additions & 14 deletions FemDesign.Core/Geometry/FdCoordinateSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace FemDesign.Geometry
[System.Serializable]
public partial class FdCoordinateSystem
{
[XmlElement("local_pos", Order=1)]
[XmlElement("local_pos", Order = 1)]
public FdPoint3d Origin { get; set; }
[XmlElement("local_x", Order=2)]
[XmlElement("local_x", Order = 2)]
public FdVector3d _localX;
[XmlIgnore]
public FdVector3d LocalX
Expand All @@ -26,8 +26,9 @@ public FdVector3d LocalX
return this._localX;
}
}
}
[XmlElement("local_y", Order=3)]
}

[XmlElement("local_y", Order = 3)]
public FdVector3d _localY;
[XmlIgnore]
public FdVector3d LocalY
Expand All @@ -42,8 +43,9 @@ public FdVector3d LocalY
{
return this._localY;
}
}
}
}

[XmlIgnore]
public FdVector3d _localZ;
[XmlIgnore]
Expand All @@ -56,7 +58,7 @@ public FdVector3d LocalZ
throw new System.ArgumentException("Impossible to get z-axis as either this.localX or this.localY is null.");
}
else
{
{
return this.LocalX.Cross(LocalY).Normalize();
}
}
Expand All @@ -79,10 +81,10 @@ public FdCoordinateSystem(FdPoint3d origin, FdVector3d localX, FdVector3d localY
this._localX = localX;
this._localY = localY;
this._localZ = localX.Cross(localY);

if (!this.IsComplete())
{
throw new System.ArgumentException("The defined coordinate system is not complete!");
throw new System.ArgumentException("The defined coordinate system is not complete!");
}

if (!this.IsOrthogonal())
Expand Down Expand Up @@ -112,6 +114,14 @@ public FdCoordinateSystem(FdPoint3d origin, FdVector3d localX, FdVector3d localY
}
}

/// <summary>
/// Global coordinate system
/// </summary>
public static FdCoordinateSystem Global()
{
return new FdCoordinateSystem(FdPoint3d.Origin(), FdVector3d.UnitX(), FdVector3d.UnitY());
}

/// <summary>
/// Check if this coordinate system is complete.
/// </summary>
Expand Down Expand Up @@ -187,7 +197,7 @@ public void SetYAroundZ(FdVector3d vector)
this._localY = val;
this._localX = val.Cross(z); // follows right-hand-rule
}

else
{
throw new System.ArgumentException($"Y-axis is not perpendicular to Z-axis. The dot-product is {dot}, but should be 0");
Expand All @@ -209,7 +219,7 @@ public void SetZAroundX(FdVector3d vector)
this._localZ = val;
this._localY = val.Cross(x); // follows right-hand-rule
}

else
{
throw new System.ArgumentException($"Z-axis is not perpendicular to X-axis. The dot-product is {dot}, but should be 0");
Expand Down Expand Up @@ -240,7 +250,7 @@ public void OrientEdgeTypeLcsToGcs()
else
{
throw new System.ArgumentException("Impossible to orient axes as the passed coordinate system is incomplete.");
}
}
}

/// <summary>
Expand Down Expand Up @@ -298,8 +308,5 @@ public void OrientPlaneTypeLcsToGcs()
throw new System.ArgumentException($"Impossible to orient axes. Dot product, {dot}, should be between -1 and 1");
}
}



}
}
10 changes: 5 additions & 5 deletions FemDesign.Core/Model/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void SerializeModel(string filePath)
/// <summary>
/// Add entities to Model.
/// </summary>
public Model AddEntities(List<Bars.Bar> bars, List<ModellingTools.FictitiousBar> fictitiousBars, List<Shells.Slab> shells, List<ModellingTools.FictitiousShell> fictitiousShells, List<Shells.Panel> panels, List<Cover> covers, List<object> loads, List<Loads.LoadCase> loadCases, List<Loads.LoadCombination> loadCombinations, List<object> supports, List<StructureGrid.Storey> storeys, List<StructureGrid.Axis> axes, bool overwrite)
public Model AddEntities(List<Bars.Bar> bars, List<ModellingTools.FictitiousBar> fictitiousBars, List<Shells.Slab> shells, List<ModellingTools.FictitiousShell> fictitiousShells, List<Shells.Panel> panels, List<Cover> covers, List<object> loads, List<Loads.LoadCase> loadCases, List<Loads.LoadCombination> loadCombinations, List<ISupportElement> supports, List<StructureGrid.Storey> storeys, List<StructureGrid.Axis> axes, bool overwrite)
{
// check if model contains entities, sections and materials
if (this.Entities == null)
Expand Down Expand Up @@ -288,7 +288,7 @@ public Model AddEntities(List<Bars.Bar> bars, List<ModellingTools.FictitiousBar>

if (supports != null)
{
foreach (object support in supports)
foreach (ISupportElement support in supports)
{
this.AddSupport(support, overwrite);
}
Expand Down Expand Up @@ -1616,8 +1616,8 @@ private bool SurfaceReinforcementParametersInModel(Reinforcement.SurfaceReinforc
/// <summary>
/// Add Support to Model
/// </summary>
/// <param name="obj">PointSupport, LineSupport</param>
private void AddSupport(object obj, bool overwrite)
/// <param name="obj">PointSupport, LineSupport or SurfaceSupport</param>
private void AddSupport(ISupportElement obj, bool overwrite)
{
if (obj == null)
{
Expand All @@ -1637,7 +1637,7 @@ private void AddSupport(object obj, bool overwrite)
}
else
{
throw new System.ArgumentException("Passed object must be PointSupport or LineSupport");
throw new System.ArgumentException("Passed object must be PointSupport, LineSupport or SurfaceSupport");
}
}

Expand Down
2 changes: 0 additions & 2 deletions FemDesign.Core/ModellingTools/ConnectedLines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,5 @@ public ConnectedLines(Geometry.Edge firstEdge, Geometry.Edge secondEdge, Geometr
this.InterfaceStart = interfaceStart;
this.InterfaceEnd = interfaceEnd;
}


}
}
Loading

0 comments on commit 362acf4

Please sign in to comment.