diff --git a/BeamOS.Common/BeamOS.Common.Application/Commands/GuidBasedIdCommand.cs b/BeamOS.Common/BeamOS.Common.Application/Commands/GuidBasedIdCommand.cs
new file mode 100644
index 00000000..8e4a64e9
--- /dev/null
+++ b/BeamOS.Common/BeamOS.Common.Application/Commands/GuidBasedIdCommand.cs
@@ -0,0 +1,7 @@
+namespace BeamOS.Common.Application.Commands;
+public record GuidBasedIdCommand(Guid Id)
+{
+ public GuidBasedIdCommand(string id) : this(Guid.Parse(id))
+ {
+ }
+};
diff --git a/BeamOS.Common/BeamOS.Common.Contracts/BeamOS.Common.Contracts.csproj b/BeamOS.Common/BeamOS.Common.Contracts/BeamOS.Common.Contracts.csproj
new file mode 100644
index 00000000..60b1e397
--- /dev/null
+++ b/BeamOS.Common/BeamOS.Common.Contracts/BeamOS.Common.Contracts.csproj
@@ -0,0 +1,14 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Common/ValueObjects/VectorIdentified.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Common/ValueObjects/VectorIdentified.cs
index 1f017ec6..52ad9991 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Common/ValueObjects/VectorIdentified.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Common/ValueObjects/VectorIdentified.cs
@@ -1,4 +1,4 @@
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
+using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
namespace BeamOS.DirectStiffnessMethod.Domain.Common.ValueObjects;
public class VectorIdentified : VectorIdentifiedGeneric
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Element1DAggregate/Element1D.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Element1DAggregate/Element1D.cs
index 5dde47a7..d4d4aa61 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Element1DAggregate/Element1D.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Element1DAggregate/Element1D.cs
@@ -2,11 +2,11 @@
using BeamOS.Common.Domain.Extensions;
using BeamOS.Common.Domain.Models;
using BeamOS.Common.Domain.ValueObjects;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
using BeamOS.DirectStiffnessMethod.Domain.Common.ValueObjects;
using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate.ValueObjects;
+using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects;
+using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate;
+using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.LinearAlgebra.Double;
using UnitsNet;
@@ -18,8 +18,8 @@ public Element1D(
Element1DId element1DId,
Angle sectionProfileRotation,
UnitSettings unitSettings,
- AnalyticalNode startNode,
- AnalyticalNode endNode,
+ Node startNode,
+ Node endNode,
Material material,
SectionProfile sectionProfile
) : base(element1DId)
@@ -44,8 +44,8 @@ SectionProfile sectionProfile
public static Element1D Create(
Angle sectionProfileRotation,
UnitSettings unitSettings,
- AnalyticalNode startNode,
- AnalyticalNode endNode,
+ Node startNode,
+ Node endNode,
Material material,
SectionProfile sectionProfile)
{
@@ -67,8 +67,8 @@ public static Element1D Create(
public Line BaseLine { get; }
public Length Length => this.BaseLine.Length;
- public AnalyticalNodeId StartNodeId { get; set; }
- public AnalyticalNodeId EndNodeId { get; set; }
+ public NodeId StartNodeId { get; set; }
+ public NodeId EndNodeId { get; set; }
public static Line GetBaseLine(Point startPoint, Point endPoint)
{
@@ -79,7 +79,7 @@ public IEnumerable GetUnsupportedStructureDi
{
for (int i = 0; i < 2; i++)
{
- AnalyticalNodeId nodeId = i == 0 ? this.StartNodeId : this.EndNodeId;
+ NodeId nodeId = i == 0 ? this.StartNodeId : this.EndNodeId;
foreach (CoordinateSystemDirection3D direction in Enum.GetValues(typeof(CoordinateSystemDirection3D)))
{
if (direction == CoordinateSystemDirection3D.Undefined)
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/Enums/ModelOrientation.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/Enums/ModelOrientation.cs
similarity index 50%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/Enums/ModelOrientation.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/Enums/ModelOrientation.cs
index d243cfc3..e6aa398f 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/Enums/ModelOrientation.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/Enums/ModelOrientation.cs
@@ -1,4 +1,4 @@
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.Enums;
+namespace BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.Enums;
public enum ModelOrientation
{
Undefined = 0,
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/AnalyticalModel.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/Model.cs
similarity index 52%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/AnalyticalModel.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/Model.cs
index 2157e12b..57b937ad 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/AnalyticalModel.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/Model.cs
@@ -1,35 +1,36 @@
using BeamOS.Common.Domain.Models;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate.ValueObjects;
+using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects;
+using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate;
-public class AnalyticalModel : BeamOSEntity
+namespace BeamOS.DirectStiffnessMethod.Domain.ModelAggregate;
+public class Model : BeamOSEntity
{
- public AnalyticalModel(
- AnalyticalModelId id,
+ public Model(
+ ModelId id,
UnitSettings unitSettings
) : base(id)
{
this.UnitSettings = unitSettings;
//this.NodeIds = nodeIds;
//this.Element1DIds = element1DIds;
+
}
- public static AnalyticalModel Create(
+ public static Model Create(
UnitSettings unitSettings
)
{
//return new(AnalyticalModelId.CreateUnique(), unitSettings, nodeIds, element1DIds);
- return new(AnalyticalModelId.CreateUnique(), unitSettings);
+ return new(ModelId.CreateUnique(), unitSettings);
}
public UnitSettings UnitSettings { get; set; }
//public List NodeIds { get; set; }
//public List Element1DIds { get; set; }
- private readonly AnalyticalModelSettings settings;
- private readonly List analyticalNodeIds = [];
- public IReadOnlyList AnalyticalNodeIds => this.analyticalNodeIds.AsReadOnly();
+ private readonly ModelSettings settings;
+ private readonly List analyticalNodeIds = [];
+ public IReadOnlyList AnalyticalNodeIds => this.analyticalNodeIds.AsReadOnly();
private readonly List element1DIds = [];
public IReadOnlyList Element1DIds => this.element1DIds.AsReadOnly();
}
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelId.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/ModelId.cs
similarity index 54%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelId.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/ModelId.cs
index 7c81e01b..d00a081d 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelId.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/ModelId.cs
@@ -1,14 +1,14 @@
using BeamOS.Common.Domain.Models;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects;
-public class AnalyticalModelId : BeamOSValueObject
+namespace BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects;
+public class ModelId : BeamOSValueObject
{
public Guid Value { get; }
- private AnalyticalModelId(Guid value)
+ private ModelId(Guid value)
{
this.Value = value;
}
- public static AnalyticalModelId CreateUnique()
+ public static ModelId CreateUnique()
{
return new(Guid.NewGuid());
}
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelSettings.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/ModelSettings.cs
similarity index 83%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelSettings.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/ModelSettings.cs
index 658dfb2b..4dbebc13 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelSettings.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/ModelSettings.cs
@@ -1,10 +1,10 @@
using BeamOS.Common.Domain.Models;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.Enums;
+using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.Enums;
using UnitsNet;
using UnitsNet.Units;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects;
-public class AnalyticalModelSettings : BeamOSValueObject
+namespace BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects;
+public class ModelSettings : BeamOSValueObject
{
public UnitSettings UnitSettings { get; }
public ModelOrientation ModelOrientation { get; }
@@ -12,7 +12,7 @@ public class AnalyticalModelSettings : BeamOSValueObject
public Length Tolerance { get; }
public Length MinTreeNodeLength { get; }
public int ElementsPerTreeNode { get; }
- public AnalyticalModelSettings(
+ public ModelSettings(
UnitSettings unitSettings,
ModelOrientation modelOrientation,
Length? tolerance = null,
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/UnitSettings.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/UnitSettings.cs
similarity index 95%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/UnitSettings.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/UnitSettings.cs
index 910205ae..79c2c176 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalModelAggregate/ValueObjects/UnitSettings.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/ModelAggregate/ValueObjects/UnitSettings.cs
@@ -1,7 +1,7 @@
using BeamOS.Common.Domain.Models;
using UnitsNet.Units;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects;
+namespace BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects;
public class UnitSettings : BeamOSValueObject
{
public UnitSettings(
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/AnalyticalNode.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/Node.cs
similarity index 70%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/AnalyticalNode.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/Node.cs
index a01ecc42..554bc378 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/AnalyticalNode.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/Node.cs
@@ -1,16 +1,16 @@
using BeamOS.Common.Domain.Models;
using BeamOS.Common.Domain.ValueObjects;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
using BeamOS.DirectStiffnessMethod.Domain.Common.ValueObjects;
+using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
using UnitsNet;
using UnitsNet.Units;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate;
-public class AnalyticalNode : AggregateRoot
+namespace BeamOS.DirectStiffnessMethod.Domain.NodeAggregate;
+public class Node : AggregateRoot
{
public Point LocationPoint { get; private set; }
- private AnalyticalNode(
- AnalyticalNodeId id,
+ private Node(
+ NodeId id,
double xCoordinate,
double yCoordinate,
double zCoordinate,
@@ -20,7 +20,7 @@ private AnalyticalNode(
this.LocationPoint = new(xCoordinate, yCoordinate, zCoordinate, lengthUnit);
this.Restraints = restraint ?? Restraints.Free;
}
- public static AnalyticalNode Create(
+ public static Node Create(
double xCoordinate,
double yCoordinate,
double zCoordinate,
@@ -28,10 +28,10 @@ public static AnalyticalNode Create(
Restraints? restraint = null
)
{
- return new(AnalyticalNodeId.CreateUnique(), xCoordinate, yCoordinate, zCoordinate, lengthUnit, restraint);
+ return new(NodeId.CreateUnique(), xCoordinate, yCoordinate, zCoordinate, lengthUnit, restraint);
}
- private AnalyticalNode(
- AnalyticalNodeId id,
+ private Node(
+ NodeId id,
Length xCoordinate,
Length yCoordinate,
Length zCoordinate,
@@ -40,14 +40,14 @@ private AnalyticalNode(
this.LocationPoint = new(xCoordinate, yCoordinate, zCoordinate);
this.Restraints = restraint ?? Restraints.Free;
}
- public static AnalyticalNode Create(
+ public static Node Create(
Length xCoordinate,
Length yCoordinate,
Length zCoordinate,
Restraints? restraint = null
)
{
- return new(AnalyticalNodeId.CreateUnique(), xCoordinate, yCoordinate, zCoordinate, restraint);
+ return new(NodeId.CreateUnique(), xCoordinate, yCoordinate, zCoordinate, restraint);
}
public List LinearLoads { get; } = [];
@@ -57,13 +57,13 @@ public static AnalyticalNode Create(
public Forces GetForcesInGlobalCoordinates()
{
- Force forceAlongX = Force.Zero;
- Force forceAlongY = Force.Zero;
- Force forceAlongZ = Force.Zero;
- Torque momentAboutX = Torque.Zero;
- Torque momentAboutY = Torque.Zero;
- Torque momentAboutZ = Torque.Zero;
- foreach (LinearLoad linearLoad in this.LinearLoads)
+ var forceAlongX = Force.Zero;
+ var forceAlongY = Force.Zero;
+ var forceAlongZ = Force.Zero;
+ var momentAboutX = Torque.Zero;
+ var momentAboutY = Torque.Zero;
+ var momentAboutZ = Torque.Zero;
+ foreach (var linearLoad in this.LinearLoads)
{
forceAlongX += linearLoad.Magnitude * linearLoad.NormalizedDirection[0];
forceAlongY += linearLoad.Magnitude * linearLoad.NormalizedDirection[1];
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/AnalyticalNodeId.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/NodeId.cs
similarity index 76%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/AnalyticalNodeId.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/NodeId.cs
index acb8b087..e73de4d5 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/AnalyticalNodeId.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/NodeId.cs
@@ -1,15 +1,15 @@
using BeamOS.Common.Domain.Enums;
using BeamOS.Common.Domain.Models;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
-public class AnalyticalNodeId : BeamOSValueObject
+namespace BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
+public class NodeId : BeamOSValueObject
{
public Guid Value { get; }
- private AnalyticalNodeId(Guid value)
+ private NodeId(Guid value)
{
this.Value = value;
}
- public static AnalyticalNodeId CreateUnique()
+ public static NodeId CreateUnique()
{
return new(Guid.NewGuid());
}
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacement.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacement.cs
similarity index 71%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacement.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacement.cs
index adc8ba33..bea696b1 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacement.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacement.cs
@@ -1,10 +1,10 @@
using BeamOS.Common.Domain.Enums;
using BeamOS.Common.Domain.Models;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
+namespace BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
public class UnsupportedStructureDisplacement : BeamOSEntity
{
- public UnsupportedStructureDisplacement(UnsupportedStructureDisplacementId identifier, AnalyticalNodeId nodeId, CoordinateSystemDirection3D direction) : base(identifier)
+ public UnsupportedStructureDisplacement(UnsupportedStructureDisplacementId identifier, NodeId nodeId, CoordinateSystemDirection3D direction) : base(identifier)
{
this.NodeId = nodeId;
this.Direction = direction;
@@ -15,7 +15,7 @@ public UnsupportedStructureDisplacement Create(UnsupportedStructureDisplacementI
return new UnsupportedStructureDisplacement(identifier, NodeId, direction);
}
- public AnalyticalNodeId NodeId { get; set; }
+ public NodeId NodeId { get; set; }
public CoordinateSystemDirection3D Direction { get; set; }
}
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacementId.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacementId.cs
similarity index 73%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacementId.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacementId.cs
index cb236ca2..fb57e76e 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacementId.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacementId.cs
@@ -2,7 +2,7 @@
using BeamOS.Common.Domain.Models;
using BeamOS.Common.Domain.ValueObjects;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
+namespace BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
//public class UnsupportedStructureDisplacementId : SingleValueWrapperValueObject
//{
// public UnsupportedStructureDisplacementId(int value) : base(value)
@@ -12,9 +12,9 @@ namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjec
public class UnsupportedStructureDisplacementId : BeamOSValueObject
{
- public AnalyticalNodeId NodeId { get; }
+ public NodeId NodeId { get; }
public CoordinateSystemDirection3D Direction { get; }
- public UnsupportedStructureDisplacementId(AnalyticalNodeId nodeId, CoordinateSystemDirection3D direction)
+ public UnsupportedStructureDisplacementId(NodeId nodeId, CoordinateSystemDirection3D direction)
{
this.NodeId = nodeId;
this.Direction = direction;
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacementRepo.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacementRepo.cs
similarity index 95%
rename from BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacementRepo.cs
rename to BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacementRepo.cs
index d8a68110..8b5c8718 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/AnalyticalNodeAggregate/ValueObjects/UnsupportedStructureDisplacementRepo.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/NodeAggregate/ValueObjects/UnsupportedStructureDisplacementRepo.cs
@@ -2,7 +2,7 @@
using BeamOS.Common.Domain.Models;
using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate;
-namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
+namespace BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
//public class UnsupportedStructureDisplacementRepo : BeamOSValueObject
//{
// private readonly Dictionary dofIdentifierMap = [];
@@ -141,14 +141,14 @@ public class UnsupportedStructureDisplacementRepo : BeamOSValueObject
{
public List DegreeOfFreedomIds { get; } = [];
public List BoundaryConditionIds { get; } = [];
- public UnsupportedStructureDisplacementRepo(IEnumerable nodes)
+ public UnsupportedStructureDisplacementRepo(IEnumerable nodes)
{
this.InitializeIdentifierMaps(nodes);
}
- private void InitializeIdentifierMaps(IEnumerable nodes)
+ private void InitializeIdentifierMaps(IEnumerable nodes)
{
- foreach (AnalyticalNode node in nodes)
+ foreach (var node in nodes)
{
foreach (CoordinateSystemDirection3D direction in Enum.GetValues(typeof(CoordinateSystemDirection3D)))
{
diff --git a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Services/SolverService.cs b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Services/SolverService.cs
index f0fb87e1..ce0ad2a3 100644
--- a/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Services/SolverService.cs
+++ b/BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/Services/SolverService.cs
@@ -1,8 +1,8 @@
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate;
-using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate.ValueObjects;
using BeamOS.DirectStiffnessMethod.Domain.Common.ValueObjects;
using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate;
+using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects;
+using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate;
+using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects;
using MathNet.Numerics.LinearAlgebra;
namespace BeamOS.DirectStiffnessMethod.Domain.Services;
@@ -11,7 +11,7 @@ public class SolverService
public static void Solve(
UnitSettings unitSettings,
List element1Ds,
- Dictionary nodes)
+ Dictionary nodes)
{
UnsupportedStructureDisplacementRepo displacementOrDOFRepo = new(nodes.Values);
@@ -39,7 +39,7 @@ private static VectorIdentified GetReactionVector(
private static VectorIdentified GetJointDisplacementVector(
UnitSettings unitSettings,
List element1Ds,
- Dictionary nodes,
+ Dictionary nodes,
UnsupportedStructureDisplacementRepo displacementOrDOFRepo)
{
List dofIds = displacementOrDOFRepo.DegreeOfFreedomIds;
@@ -56,11 +56,11 @@ private static VectorIdentified GetJointDisplacementVector(
private static VectorIdentified BuildLoadVector(
UnitSettings unitSettings,
- Dictionary nodes,
+ Dictionary nodes,
List dofIds)
{
VectorIdentified loadVector = new(dofIds);
- foreach (AnalyticalNode node in nodes.Values)
+ foreach (Node node in nodes.Values)
{
VectorIdentified localLoadVector = node
.GetForceVectorIdentifiedInGlobalCoordinates(unitSettings.ForceUnit, unitSettings.TorqueUnit);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/BeamOS.PhysicalModel.Api.csproj b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/BeamOS.PhysicalModel.Api.csproj
index 867a67d5..5285058a 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/BeamOS.PhysicalModel.Api.csproj
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/BeamOS.PhysicalModel.Api.csproj
@@ -1,4 +1,4 @@
-
+
net8.0
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/CreateElement1DEndpoint.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/CreateElement1DEndpoint.cs
new file mode 100644
index 00000000..c31f0852
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/CreateElement1DEndpoint.cs
@@ -0,0 +1,33 @@
+using BeamOS.PhysicalModel.Api.Mappers;
+using BeamOS.PhysicalModel.Application.Element1Ds;
+using BeamOS.PhysicalModel.Application.Models.Commands;
+using BeamOS.PhysicalModel.Contracts.Element1D;
+using FastEndpoints;
+
+namespace BeamOS.PhysicalModel.Api.Element1Ds;
+
+public class CreateElement1DEndpoint(CreateElement1DCommandHandler createNodeCommandHandler) : Endpoint
+{
+ public override void Configure()
+ {
+ this.Post("element1D");
+ this.AllowAnonymous();
+ this.Summary(s => s.ExampleRequest = new CreateElement1DRequest(
+ "00000000-0000-0000-0000-000000000000",
+ "00000000-0000-0000-0000-000000000001",
+ "00000000-0000-0000-0000-000000000002",
+ "00000000-0000-0000-0000-000000000003",
+ "00000000-0000-0000-0000-000000000004")
+ );
+ }
+
+ public override async Task HandleAsync(CreateElement1DRequest req, CancellationToken ct)
+ {
+ var command = req.ToCommand();
+
+ var node = await createNodeCommandHandler.ExecuteAsync(command, ct);
+
+ var response = node.ToResponse();
+ await this.SendAsync(response, cancellation: ct);
+ }
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/CreateElement1DRequestMapper.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/CreateElement1DRequestMapper.cs
new file mode 100644
index 00000000..f95e5cbf
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/CreateElement1DRequestMapper.cs
@@ -0,0 +1,11 @@
+using BeamOS.PhysicalModel.Application.Element1Ds;
+using BeamOS.PhysicalModel.Contracts.Element1D;
+using Riok.Mapperly.Abstractions;
+
+namespace BeamOS.PhysicalModel.Application.Models.Commands;
+
+[Mapper]
+public static partial class CreateElement1DCommandMapper
+{
+ public static partial CreateElement1DCommand ToCommand(this CreateElement1DRequest request);
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/Element1DResponseMapper.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/Element1DResponseMapper.cs
new file mode 100644
index 00000000..58ae7bf8
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/Element1DResponseMapper.cs
@@ -0,0 +1,10 @@
+using BeamOS.PhysicalModel.Contracts.Element1D;
+using BeamOS.PhysicalModel.Domain.Element1DAggregate;
+using Riok.Mapperly.Abstractions;
+
+namespace BeamOS.PhysicalModel.Api.Mappers;
+[Mapper]
+public static partial class Element1DResponseMapper
+{
+ public static partial Element1DResponse ToResponse(this Element1D model);
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Endpoints/CreateNodeEndpoint.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Endpoints/CreateNodeEndpoint.cs
deleted file mode 100644
index 4fcff518..00000000
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Endpoints/CreateNodeEndpoint.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using BeamOS.PhysicalModel.Api.Mappers;
-using BeamOS.PhysicalModel.Application.Models.Commands;
-using BeamOS.PhysicalModel.Application.Nodes.Commands;
-using BeamOS.PhysicalModel.Contracts.Nodes;
-using BeamOS.PhysicalModel.Domain.AnalyticalNodeAggregate;
-using FastEndpoints;
-
-namespace BeamOS.PhysicalModel.Api.Endpoints;
-
-public class CreateNodeEndpoint(CreateNodeCommandHandler createNodeCommandHandler) : Endpoint
-{
- public override void Configure()
- {
- this.Post("node");
- this.AllowAnonymous();
- this.Summary(s => s.ExampleRequest = new CreateNodeRequest(
- "00000000-0000-0000-0000-000000000000",
- 0.0,
- 0.0,
- 10.0,
- "Foot",
- new RestraintsRequest(
- false,
- false,
- false,
- false,
- false,
- false)));
- }
-
- public override async Task HandleAsync(CreateNodeRequest req, CancellationToken ct)
- {
- CreateNodeCommand command = req.ToCommand();
-
- AnalyticalNode node = await createNodeCommandHandler.ExecuteAsync(command, ct);
-
- NodeResponse response = node.ToResponse();
- await this.SendAsync(response, cancellation: ct);
- }
-}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Endpoints/CreateModelEndpoint.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Endpoints/CreateModelEndpoint.cs
similarity index 67%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Endpoints/CreateModelEndpoint.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Endpoints/CreateModelEndpoint.cs
index 573304e2..8705b869 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Endpoints/CreateModelEndpoint.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Endpoints/CreateModelEndpoint.cs
@@ -1,10 +1,10 @@
using BeamOS.PhysicalModel.Api.Mappers;
using BeamOS.PhysicalModel.Application.Models.Commands;
-using BeamOS.PhysicalModel.Contracts;
+using BeamOS.PhysicalModel.Contracts.Model;
using BeamOS.PhysicalModel.Domain.AnalyticalModelAggregate;
using FastEndpoints;
-namespace BeamOS.PhysicalModel.Api.Endpoints;
+namespace BeamOS.PhysicalModel.Api.Models.Endpoints;
public class CreateModelEndpoint(CreateModelCommandHandler createModelCommandHandler) : Endpoint
{
@@ -16,11 +16,11 @@ public override void Configure()
public override async Task HandleAsync(CreateModelRequest req, CancellationToken ct)
{
- CreateModelCommand command = req.ToCommand();
+ var command = req.ToCommand();
- AnalyticalModel model = await createModelCommandHandler.ExecuteAsync(command, ct);
+ var model = await createModelCommandHandler.ExecuteAsync(command, ct);
- ModelResponse response = model.ToResponse();
+ var response = model.ToResponse();
await this.SendAsync(response, cancellation: ct);
}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/CreateModelCommandMapper.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Mappers/CreateModelRequestMapper.cs
similarity index 67%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/CreateModelCommandMapper.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Mappers/CreateModelRequestMapper.cs
index 9a3dc9f9..a3b9b236 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/CreateModelCommandMapper.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Mappers/CreateModelRequestMapper.cs
@@ -1,10 +1,10 @@
-using BeamOS.PhysicalModel.Contracts;
+using BeamOS.PhysicalModel.Contracts.Model;
using Riok.Mapperly.Abstractions;
namespace BeamOS.PhysicalModel.Application.Models.Commands;
[Mapper]
-public static partial class CreateModelCommandMapper
+public static partial class CreateModelRequestMapper
{
public static partial CreateModelCommand ToCommand(this CreateModelRequest request);
}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/ModelResponseMapper.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Mappers/ModelResponseMapper.cs
similarity index 86%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/ModelResponseMapper.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Mappers/ModelResponseMapper.cs
index d53e617a..5c96af06 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/ModelResponseMapper.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Models/Mappers/ModelResponseMapper.cs
@@ -1,4 +1,4 @@
-using BeamOS.PhysicalModel.Contracts;
+using BeamOS.PhysicalModel.Contracts.Model;
using BeamOS.PhysicalModel.Domain.AnalyticalModelAggregate;
using Riok.Mapperly.Abstractions;
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/CreateNodeCommandMapper.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/CreateNodeRequestMapper.cs
similarity index 72%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/CreateNodeCommandMapper.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/CreateNodeRequestMapper.cs
index 1850bc26..f7b4c0c5 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/CreateNodeCommandMapper.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/CreateNodeRequestMapper.cs
@@ -1,11 +1,11 @@
using BeamOS.PhysicalModel.Application.Nodes.Commands;
-using BeamOS.PhysicalModel.Contracts.Nodes;
+using BeamOS.PhysicalModel.Contracts.Node;
using Riok.Mapperly.Abstractions;
namespace BeamOS.PhysicalModel.Application.Models.Commands;
[Mapper]
-public static partial class CreateNodeCommandMapper
+public static partial class CreateNodeRequestMapper
{
public static partial CreateNodeCommand ToCommand(this CreateNodeRequest request);
}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/Endpoints/CreateNodeEndpoint.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/Endpoints/CreateNodeEndpoint.cs
new file mode 100644
index 00000000..c887f1d4
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/Endpoints/CreateNodeEndpoint.cs
@@ -0,0 +1,41 @@
+using BeamOS.PhysicalModel.Api.Mappers;
+using BeamOS.PhysicalModel.Application.Models.Commands;
+using BeamOS.PhysicalModel.Application.Nodes.Commands;
+using BeamOS.PhysicalModel.Contracts.Node;
+using FastEndpoints;
+
+namespace BeamOS.PhysicalModel.Api.Nodes.Endpoints;
+
+public class CreateNodeEndpoint(CreateNodeCommandHandler createNodeCommandHandler) : Endpoint
+{
+ public override void Configure()
+ {
+ this.Post("node");
+ this.AllowAnonymous();
+ this.Summary(s => s.ExampleRequest = new CreateNodeRequest(
+ "00000000-0000-0000-0000-000000000000",
+ 0.0,
+ 0.0,
+ 10.0,
+ "Foot",
+ new RestraintsRequest(
+ false,
+ false,
+ false,
+ false,
+ false,
+ false)
+ )
+ );
+ }
+
+ public override async Task HandleAsync(CreateNodeRequest req, CancellationToken ct)
+ {
+ var command = req.ToCommand();
+
+ var node = await createNodeCommandHandler.ExecuteAsync(command, ct);
+
+ var response = node.ToResponse();
+ await this.SendAsync(response, cancellation: ct);
+ }
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/NodeResponseMapper.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/NodeResponseMapper.cs
similarity index 86%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/NodeResponseMapper.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/NodeResponseMapper.cs
index 0a3720bd..30d7a212 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Mappers/NodeResponseMapper.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/NodeResponseMapper.cs
@@ -1,4 +1,4 @@
-using BeamOS.PhysicalModel.Contracts.Nodes;
+using BeamOS.PhysicalModel.Contracts.Node;
using BeamOS.PhysicalModel.Domain.AnalyticalNodeAggregate;
using Riok.Mapperly.Abstractions;
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Endpoints/CreatePointLoadEndpoint.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Endpoints/CreatePointLoadEndpoint.cs
new file mode 100644
index 00000000..2dfe1af9
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Endpoints/CreatePointLoadEndpoint.cs
@@ -0,0 +1,32 @@
+using BeamOS.PhysicalModel.Api.PointLoads.Mappers;
+using BeamOS.PhysicalModel.Application.PointLoads.Commands;
+using BeamOS.PhysicalModel.Contracts.Common;
+using BeamOS.PhysicalModel.Contracts.PointLoad;
+using FastEndpoints;
+
+namespace BeamOS.PhysicalModel.Api.PointLoads.Endpoints;
+public class CreatePointLoadEndpoint(CreatePointLoadCommandHandler createPointLoadCommandHandler)
+ : Endpoint
+{
+ public override void Configure()
+ {
+ this.Post("point-load");
+ this.AllowAnonymous();
+ this.Summary(s => s.ExampleRequest = new CreatePointLoadRequest(
+ "00000000-0000-0000-0000-000000000000",
+ new UnitValueDTO(55.0, "KilopoundForce"),
+ new Vector3(10, 15, 20)
+ )
+ );
+ }
+
+ public override async Task HandleAsync(CreatePointLoadRequest req, CancellationToken ct)
+ {
+ var command = req.ToCommand();
+
+ var node = await createPointLoadCommandHandler.ExecuteAsync(command, ct);
+
+ var response = node.ToResponse();
+ await this.SendAsync(response, cancellation: ct);
+ }
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Mappers/CreatePointLoadRequestMapper.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Mappers/CreatePointLoadRequestMapper.cs
new file mode 100644
index 00000000..f275990a
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Mappers/CreatePointLoadRequestMapper.cs
@@ -0,0 +1,44 @@
+using BeamOS.PhysicalModel.Application.PointLoads.Commands;
+using BeamOS.PhysicalModel.Contracts.Common;
+using BeamOS.PhysicalModel.Contracts.PointLoad;
+using MathNet.Numerics.LinearAlgebra;
+using MathNet.Numerics.LinearAlgebra.Double;
+using Riok.Mapperly.Abstractions;
+using UnitsNet;
+using UnitsNet.Units;
+
+namespace BeamOS.PhysicalModel.Api.PointLoads.Mappers;
+[Mapper]
+[UseStaticMapper(typeof(Vector3Mapper))]
+[UseStaticMapper(typeof(UnitValueDTOToForceMapper))]
+public static partial class CreatePointLoadRequestMapper
+{
+ public static partial CreatePointLoadCommand ToCommand(this CreatePointLoadRequest request);
+}
+
+public static class Vector3Mapper
+{
+ public static Vector MapVector3(this Vector3 vector3)
+ {
+ return DenseVector.OfArray([vector3.X, vector3.Y, vector3.Z]);
+ }
+
+ public static Vector3 MapMathnetVector(this Vector vector)
+ {
+ return new(vector[0], vector[1], vector[2]);
+ }
+}
+
+[Mapper]
+public static partial class StringToForceUnitMapper
+{
+ public static partial ForceUnit MapToForceUnit(this string unit);
+}
+
+public static class UnitValueDTOToForceMapper
+{
+ public static Force MapToForce(this UnitValueDTO dto)
+ {
+ return new(dto.Value, dto.Unit.MapToForceUnit());
+ }
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Mappers/PointLoadResponseMapper.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Mappers/PointLoadResponseMapper.cs
new file mode 100644
index 00000000..6aa7ddd0
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Mappers/PointLoadResponseMapper.cs
@@ -0,0 +1,11 @@
+using BeamOS.PhysicalModel.Contracts.PointLoad;
+using BeamOS.PhysicalModel.Domain.PointLoadAggregate;
+using Riok.Mapperly.Abstractions;
+
+namespace BeamOS.PhysicalModel.Api.PointLoads.Mappers;
+[Mapper]
+[UseStaticMapper(typeof(Vector3Mapper))]
+public static partial class PointLoadResponseMapper
+{
+ public static partial PointLoadResponse ToResponse(this PointLoad pointLoad);
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/DependencyInjection.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/DependencyInjection.cs
index 10158671..93dee85a 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/DependencyInjection.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/DependencyInjection.cs
@@ -1,5 +1,7 @@
+using BeamOS.PhysicalModel.Application.Element1Ds;
using BeamOS.PhysicalModel.Application.Models.Commands;
using BeamOS.PhysicalModel.Application.Nodes.Commands;
+using BeamOS.PhysicalModel.Application.PointLoads.Commands;
using Microsoft.Extensions.DependencyInjection;
namespace BeamOS.PhysicalModel.Application;
@@ -9,6 +11,8 @@ public static IServiceCollection AddPhysicalModelApplication(this IServiceCollec
{
_ = services.AddTransient();
_ = services.AddTransient();
+ _ = services.AddTransient();
+ _ = services.AddTransient();
return services;
}
}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Element1Ds/CreateElement1DCommand.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Element1Ds/CreateElement1DCommand.cs
new file mode 100644
index 00000000..706c252c
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Element1Ds/CreateElement1DCommand.cs
@@ -0,0 +1,10 @@
+using BeamOS.Common.Application.Commands;
+
+namespace BeamOS.PhysicalModel.Application.Element1Ds;
+
+public record CreateElement1DCommand(
+ GuidBasedIdCommand ModelId,
+ GuidBasedIdCommand StartNodeId,
+ GuidBasedIdCommand EndNodeId,
+ GuidBasedIdCommand MaterialId,
+ GuidBasedIdCommand SectionProfileId);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Element1Ds/CreateElement1DCommandHandler.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Element1Ds/CreateElement1DCommandHandler.cs
new file mode 100644
index 00000000..b9094a41
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Element1Ds/CreateElement1DCommandHandler.cs
@@ -0,0 +1,24 @@
+using BeamOS.Common.Application.Interfaces;
+using BeamOS.PhysicalModel.Domain.Element1DAggregate;
+using Riok.Mapperly.Abstractions;
+
+namespace BeamOS.PhysicalModel.Application.Element1Ds;
+public class CreateElement1DCommandHandler : ICommandHandler
+{
+ public async Task ExecuteAsync(CreateElement1DCommand command, CancellationToken ct)
+ {
+ await Task.CompletedTask;
+
+ Element1D element = command.ToDomainObject();
+
+ // TODO : persist element
+
+ return element;
+ }
+}
+
+[Mapper]
+public static partial class CreateElement1DCommandMapper
+{
+ public static partial Element1D ToDomainObject(this CreateElement1DCommand command);
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Nodes/Commands/CreateNodeCommand.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Nodes/Commands/CreateNodeCommand.cs
index 5925d43b..7cde4a60 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Nodes/Commands/CreateNodeCommand.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Nodes/Commands/CreateNodeCommand.cs
@@ -1,24 +1,16 @@
-using BeamOS.PhysicalModel.Domain.AnalyticalNodeAggregate;
-using FastEndpoints;
+using BeamOS.Common.Application.Commands;
using UnitsNet.Units;
namespace BeamOS.PhysicalModel.Application.Nodes.Commands;
public record CreateNodeCommand(
- GuidBasedIdDto ModelId,
+ GuidBasedIdCommand ModelId,
double XCoordinate,
double YCoordinate,
double ZCoordinate,
LengthUnit LengthUnit,
- RestraintsCommand? Restraint = null) : ICommand;
+ RestraintsCommand? Restraint = null);
-public record GuidBasedIdDto(Guid ModelId)
-{
- public GuidBasedIdDto(string modelId) : this(Guid.Parse(modelId))
- {
-
- }
-};
public record RestraintsCommand(
bool CanTranslateAlongX,
bool CanTranslateAlongY,
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/PointLoads/Commands/CreatePointLoadCommand.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/PointLoads/Commands/CreatePointLoadCommand.cs
new file mode 100644
index 00000000..d4c0fee0
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/PointLoads/Commands/CreatePointLoadCommand.cs
@@ -0,0 +1,9 @@
+using BeamOS.Common.Application.Commands;
+using MathNet.Numerics.LinearAlgebra;
+using UnitsNet;
+
+namespace BeamOS.PhysicalModel.Application.PointLoads.Commands;
+public record CreatePointLoadCommand(
+ GuidBasedIdCommand NodeId,
+ Force Force,
+ Vector Direction);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/PointLoads/Commands/CreatePointLoadCommandHandler.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/PointLoads/Commands/CreatePointLoadCommandHandler.cs
new file mode 100644
index 00000000..c5c0fe58
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/PointLoads/Commands/CreatePointLoadCommandHandler.cs
@@ -0,0 +1,25 @@
+using BeamOS.Common.Application.Interfaces;
+using BeamOS.PhysicalModel.Domain.PointLoadAggregate;
+using Riok.Mapperly.Abstractions;
+
+namespace BeamOS.PhysicalModel.Application.PointLoads.Commands;
+
+public class CreatePointLoadCommandHandler : ICommandHandler
+{
+ public async Task ExecuteAsync(CreatePointLoadCommand command, CancellationToken ct)
+ {
+ await Task.CompletedTask;
+
+ PointLoad load = command.ToDomainObject();
+
+ // TODO : persist load
+
+ return load;
+ }
+}
+
+[Mapper]
+public static partial class CreatePointLoadCommandMapper
+{
+ public static partial PointLoad ToDomainObject(this CreatePointLoadCommand command);
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Common/UnitValueDTO.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Common/UnitValueDTO.cs
new file mode 100644
index 00000000..74204903
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Common/UnitValueDTO.cs
@@ -0,0 +1,2 @@
+namespace BeamOS.PhysicalModel.Contracts.Common;
+public record UnitValueDTO(double Value, string Unit);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Common/Vector3.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Common/Vector3.cs
new file mode 100644
index 00000000..2b891748
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Common/Vector3.cs
@@ -0,0 +1,2 @@
+namespace BeamOS.PhysicalModel.Contracts.Common;
+public record Vector3(double X, double Y, double Z);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Element1D/CreateElement1DRequest.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Element1D/CreateElement1DRequest.cs
new file mode 100644
index 00000000..ab52f751
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Element1D/CreateElement1DRequest.cs
@@ -0,0 +1,7 @@
+namespace BeamOS.PhysicalModel.Contracts.Element1D;
+public record CreateElement1DRequest(
+ string ModelId,
+ string StartNodeId,
+ string EndNodeId,
+ string MaterialId,
+ string SectionProfileId);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Element1D/Element1DResponse.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Element1D/Element1DResponse.cs
new file mode 100644
index 00000000..bd716d24
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Element1D/Element1DResponse.cs
@@ -0,0 +1,11 @@
+using BeamOS.PhysicalModel.Contracts.Common;
+
+namespace BeamOS.PhysicalModel.Contracts.Element1D;
+public record Element1DResponse(
+ string Id,
+ string ModelId,
+ string StartNodeId,
+ string EndNodeId,
+ string MaterialId,
+ string SectionProfileId,
+ UnitValueDTO SectionProfileRotation);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Models/CreateModelRequest.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Model/CreateModelRequest.cs
similarity index 88%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Models/CreateModelRequest.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Model/CreateModelRequest.cs
index ed3e414b..cf189400 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Models/CreateModelRequest.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Model/CreateModelRequest.cs
@@ -1,4 +1,4 @@
-namespace BeamOS.PhysicalModel.Contracts;
+namespace BeamOS.PhysicalModel.Contracts.Model;
public record CreateModelRequest(
string Name,
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Models/ModelResponse.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Model/ModelResponse.cs
similarity index 91%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Models/ModelResponse.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Model/ModelResponse.cs
index 8ae4347f..c1b066a0 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Models/ModelResponse.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Model/ModelResponse.cs
@@ -1,4 +1,4 @@
-namespace BeamOS.PhysicalModel.Contracts;
+namespace BeamOS.PhysicalModel.Contracts.Model;
public record ModelResponse(
string Id,
string Name,
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Nodes/CreateNodeRequest.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Node/CreateNodeRequest.cs
similarity index 89%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Nodes/CreateNodeRequest.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Node/CreateNodeRequest.cs
index a5dc46f3..c454a42c 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Nodes/CreateNodeRequest.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Node/CreateNodeRequest.cs
@@ -1,4 +1,4 @@
-namespace BeamOS.PhysicalModel.Contracts.Nodes;
+namespace BeamOS.PhysicalModel.Contracts.Node;
public record CreateNodeRequest(
string ModelId,
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Nodes/NodeResponse.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Node/NodeResponse.cs
similarity index 62%
rename from BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Nodes/NodeResponse.cs
rename to BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Node/NodeResponse.cs
index 44b7f84d..15f6be84 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Nodes/NodeResponse.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Node/NodeResponse.cs
@@ -1,4 +1,6 @@
-namespace BeamOS.PhysicalModel.Contracts.Nodes;
+using BeamOS.PhysicalModel.Contracts.Common;
+
+namespace BeamOS.PhysicalModel.Contracts.Node;
public record NodeResponse(
string Id,
string ModelId,
@@ -6,8 +8,10 @@ public record NodeResponse(
List PointLoadIds,
RestraintsResponse Restraints);
-public record PointResponse(LengthResponse XCoordinate, LengthResponse YCoordinate, LengthResponse ZCoordinate);
-public record LengthResponse(double Value, string Unit);
+public record PointResponse(
+ UnitValueDTO XCoordinate,
+ UnitValueDTO YCoordinate,
+ UnitValueDTO ZCoordinate);
public record RestraintsResponse(
bool CanTranslateAlongX,
bool CanTranslateAlongY,
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/PointLoad/CreatePointLoadRequest.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/PointLoad/CreatePointLoadRequest.cs
new file mode 100644
index 00000000..3d237797
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/PointLoad/CreatePointLoadRequest.cs
@@ -0,0 +1,7 @@
+using BeamOS.PhysicalModel.Contracts.Common;
+
+namespace BeamOS.PhysicalModel.Contracts.PointLoad;
+public record CreatePointLoadRequest(
+ string NodeId,
+ UnitValueDTO Force,
+ Vector3 Direction);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/PointLoad/PointLoadResponse.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/PointLoad/PointLoadResponse.cs
new file mode 100644
index 00000000..32c58d23
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/PointLoad/PointLoadResponse.cs
@@ -0,0 +1,8 @@
+using BeamOS.PhysicalModel.Contracts.Common;
+
+namespace BeamOS.PhysicalModel.Contracts.PointLoad;
+public record PointLoadResponse(
+ string Id,
+ string NodeId,
+ UnitValueDTO Force,
+ Vector3 NormalizedDirection);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalModelAggregate/AnalyticalModel.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalModelAggregate/AnalyticalModel.cs
index 7b2d3df3..55923347 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalModelAggregate/AnalyticalModel.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalModelAggregate/AnalyticalModel.cs
@@ -18,7 +18,7 @@ public AnalyticalModel(
string name,
string description,
AnalyticalModelSettings settings,
- AnalyticalModelId? id = null) : base(id ?? AnalyticalModelId.CreateUnique())
+ AnalyticalModelId? id = null) : base(id ?? new())
{
this.Name = name;
this.Description = description;
@@ -62,13 +62,13 @@ public AnalyticalNode AddNode(AnalyticalNode node)
}
public Element1D AddElement1D(
- AnalyticalNode startNode,
- AnalyticalNode endNode,
- MaterialId material,
- SectionProfileId sectionProfile
+ AnalyticalNodeId startNodeId,
+ AnalyticalNodeId endNodeId,
+ MaterialId materialId,
+ SectionProfileId sectionProfileId
)
{
- var el = Element1D.Create(this.Id, startNode, endNode, material, sectionProfile);
+ Element1D el = new(this.Id, startNodeId, endNodeId, materialId, sectionProfileId);
return this.AddElement1D(el);
}
public Element1D AddElement1D(Element1D element1D)
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelId.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelId.cs
index 4c9d48ac..f9b6479b 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelId.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalModelAggregate/ValueObjects/AnalyticalModelId.cs
@@ -1,10 +1,6 @@
using BeamOS.Common.Domain.ValueObjects;
namespace BeamOS.PhysicalModel.Domain.AnalyticalModelAggregate.ValueObjects;
-public class AnalyticalModelId(Guid? modelId = null) : GuidBasedId(modelId)
+public class AnalyticalModelId(Guid? id = null) : GuidBasedId(id)
{
- public static AnalyticalModelId CreateUnique()
- {
- return new(Guid.NewGuid());
- }
}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalNodeAggregate/AnalyticalNode.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalNodeAggregate/AnalyticalNode.cs
index e2938fea..e6d3015e 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalNodeAggregate/AnalyticalNode.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalNodeAggregate/AnalyticalNode.cs
@@ -18,7 +18,7 @@ public AnalyticalNode(
double zCoordinate,
LengthUnit lengthUnit,
Restraints? restraint = null,
- AnalyticalNodeId? id = null) : base(id ?? AnalyticalNodeId.CreateUnique())
+ AnalyticalNodeId? id = null) : base(id ?? new())
{
this.ModelId = modelId;
this.LocationPoint = new(xCoordinate, yCoordinate, zCoordinate, lengthUnit);
@@ -31,7 +31,7 @@ public AnalyticalNode(
Length yCoordinate,
Length zCoordinate,
Restraints? restraint = null,
- AnalyticalNodeId? id = null) : base(id ?? AnalyticalNodeId.CreateUnique())
+ AnalyticalNodeId? id = null) : base(id ?? new())
{
this.ModelId = modelId;
this.LocationPoint = new(xCoordinate, yCoordinate, zCoordinate);
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalNodeAggregate/ValueObjects/AnalyticalNodeId.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalNodeAggregate/ValueObjects/AnalyticalNodeId.cs
index 1c2293b3..baab8186 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalNodeAggregate/ValueObjects/AnalyticalNodeId.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/AnalyticalNodeAggregate/ValueObjects/AnalyticalNodeId.cs
@@ -1,10 +1,7 @@
using BeamOS.Common.Domain.ValueObjects;
+using BeamOS.PhysicalModel.Domain.Common.ValueObjects;
namespace BeamOS.PhysicalModel.Domain.AnalyticalNodeAggregate.ValueObjects;
-public class AnalyticalNodeId(Guid? value = null) : GuidBasedId(value)
+public class AnalyticalNodeId(Guid? id = null) : NodeBaseId(id)
{
- public static AnalyticalNodeId CreateUnique()
- {
- return new(Guid.NewGuid());
- }
}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/BeamOS.PhysicalModel.Domain.csproj b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/BeamOS.PhysicalModel.Domain.csproj
index ff8a1b11..72002950 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/BeamOS.PhysicalModel.Domain.csproj
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/BeamOS.PhysicalModel.Domain.csproj
@@ -1,4 +1,4 @@
-
+
net8.0
@@ -10,10 +10,6 @@
-
-
-
-
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Common/ValueObjects/NodeBaseId.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Common/ValueObjects/NodeBaseId.cs
new file mode 100644
index 00000000..dbf1710a
--- /dev/null
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Common/ValueObjects/NodeBaseId.cs
@@ -0,0 +1,6 @@
+using BeamOS.Common.Domain.ValueObjects;
+
+namespace BeamOS.PhysicalModel.Domain.Common.ValueObjects;
+public class NodeBaseId(Guid? id = null) : GuidBasedId(id)
+{
+}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Element1DAggregate/Element1D.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Element1DAggregate/Element1D.cs
index 1fc39e72..ff837dfd 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Element1DAggregate/Element1D.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Element1DAggregate/Element1D.cs
@@ -1,7 +1,6 @@
using BeamOS.Common.Domain.Models;
using BeamOS.Common.Domain.ValueObjects;
using BeamOS.PhysicalModel.Domain.AnalyticalModelAggregate.ValueObjects;
-using BeamOS.PhysicalModel.Domain.AnalyticalNodeAggregate;
using BeamOS.PhysicalModel.Domain.AnalyticalNodeAggregate.ValueObjects;
using BeamOS.PhysicalModel.Domain.Element1DAggregate.ValueObjects;
using BeamOS.PhysicalModel.Domain.MaterialAggregate.ValueObjects;
@@ -13,34 +12,21 @@ namespace BeamOS.PhysicalModel.Domain.Element1DAggregate;
public class Element1D : AggregateRoot
{
public Element1D(
- Element1DId id,
- AnalyticalModelId analyticalModelId,
- AnalyticalNode startNode,
- AnalyticalNode endNode,
- MaterialId material,
- SectionProfileId sectionProfile
- ) : base(id)
+ AnalyticalModelId modelId,
+ AnalyticalNodeId startNodeId,
+ AnalyticalNodeId endNodeId,
+ MaterialId materialId,
+ SectionProfileId sectionProfileId,
+ Element1DId? id = null) : base(id ?? new Element1DId())
{
- this.AnalyticalModelId = analyticalModelId;
- this.StartNodeId = startNode.Id;
- this.EndNodeId = endNode.Id;
- this.MaterialId = material;
- this.SectionProfileId = sectionProfile;
- this.BaseLine = GetBaseLine(startNode.LocationPoint, endNode.LocationPoint);
+ this.ModelId = modelId;
+ this.StartNodeId = startNodeId;
+ this.EndNodeId = endNodeId;
+ this.MaterialId = materialId;
+ this.SectionProfileId = sectionProfileId;
}
- public static Element1D Create(
- AnalyticalModelId analyticalModelId,
- AnalyticalNode startNode,
- AnalyticalNode endNode,
- MaterialId material,
- SectionProfileId sectionProfile
- )
- {
- return new(Element1DId.CreateUnique(), analyticalModelId, startNode, endNode, material, sectionProfile);
- }
-
- public AnalyticalModelId AnalyticalModelId { get; }
+ public AnalyticalModelId ModelId { get; }
public AnalyticalNodeId StartNodeId { get; }
public AnalyticalNodeId EndNodeId { get; }
public MaterialId MaterialId { get; }
@@ -53,8 +39,8 @@ SectionProfileId sectionProfile
private readonly SortedList loads = new();
public IReadOnlyDictionary Loads => this.loads.AsReadOnly();
- public Line BaseLine { get; }
- public Length Length => this.BaseLine.Length;
+ //public Line BaseLine { get; }
+ //public Length Length => this.BaseLine.Length;
public static Line GetBaseLine(Point startPoint, Point endPoint)
{
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Element1DAggregate/ValueObjects/Element1DId.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Element1DAggregate/ValueObjects/Element1DId.cs
index b0b9b110..e5e87af7 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Element1DAggregate/ValueObjects/Element1DId.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Element1DAggregate/ValueObjects/Element1DId.cs
@@ -1,10 +1,6 @@
using BeamOS.Common.Domain.ValueObjects;
namespace BeamOS.PhysicalModel.Domain.Element1DAggregate.ValueObjects;
-public class Element1DId(Guid? value = null) : GuidBasedId(value)
+public class Element1DId(Guid? id = null) : GuidBasedId(id)
{
- public static Element1DId CreateUnique()
- {
- return new(Guid.NewGuid());
- }
}
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/MaterialAggregate/Material.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/MaterialAggregate/Material.cs
index 01473c50..0d2bc434 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/MaterialAggregate/Material.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/MaterialAggregate/Material.cs
@@ -12,7 +12,7 @@ private Material(MaterialId id, Pressure modulusOfElasticity, Pressure modulusOf
}
public static Material Create(Pressure modulusOfElasticity, Pressure modulusOfRigidity)
{
- return new(MaterialId.CreateUnique(), modulusOfElasticity, modulusOfRigidity);
+ return new(new MaterialId(), modulusOfElasticity, modulusOfRigidity);
}
public Pressure ModulusOfElasticity { get; set; }
public Pressure ModulusOfRigidity { get; set; }
diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/MaterialAggregate/ValueObjects/MaterialId.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/MaterialAggregate/ValueObjects/MaterialId.cs
index 87f2c994..0ea6a19d 100644
--- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/MaterialAggregate/ValueObjects/MaterialId.cs
+++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/MaterialAggregate/ValueObjects/MaterialId.cs
@@ -1,19 +1,6 @@
-using BeamOS.Common.Domain.Models;
+using BeamOS.Common.Domain.ValueObjects;
namespace BeamOS.PhysicalModel.Domain.MaterialAggregate.ValueObjects;
-public class MaterialId : BeamOSValueObject
+public class MaterialId(Guid? id = null) : GuidBasedId(id)
{
- public Guid Value { get; }
- private MaterialId(Guid value)
- {
- this.Value = value;
- }
- public static MaterialId CreateUnique()
- {
- return new(Guid.NewGuid());
- }
- protected override IEnumerable