Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace BeamOS.Common.Application.Commands;
public record GuidBasedIdCommand(Guid Id)
{
public GuidBasedIdCommand(string id) : this(Guid.Parse(id))
{
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Folder Include="Responses\" />
<Folder Include="Requests\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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<UnsupportedStructureDisplacementId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -79,7 +79,7 @@ public IEnumerable<UnsupportedStructureDisplacementId> 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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.Enums;
namespace BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.Enums;
public enum ModelOrientation
{
Undefined = 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -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<AnalyticalModelId>
namespace BeamOS.DirectStiffnessMethod.Domain.ModelAggregate;
public class Model : BeamOSEntity<ModelId>
{
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<AnalyticalNodeId> NodeIds { get; set; }
//public List<Element1DId> Element1DIds { get; set; }
private readonly AnalyticalModelSettings settings;
private readonly List<AnalyticalNodeId> analyticalNodeIds = [];
public IReadOnlyList<AnalyticalNodeId> AnalyticalNodeIds => this.analyticalNodeIds.AsReadOnly();
private readonly ModelSettings settings;
private readonly List<NodeId> analyticalNodeIds = [];
public IReadOnlyList<NodeId> AnalyticalNodeIds => this.analyticalNodeIds.AsReadOnly();
private readonly List<Element1DId> element1DIds = [];
public IReadOnlyList<Element1DId> Element1DIds => this.element1DIds.AsReadOnly();
}
Original file line number Diff line number Diff line change
@@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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; }
public bool IsLocked { get; }
public Length Tolerance { get; }
public Length MinTreeNodeLength { get; }
public int ElementsPerTreeNode { get; }
public AnalyticalModelSettings(
public ModelSettings(
UnitSettings unitSettings,
ModelOrientation modelOrientation,
Length? tolerance = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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<AnalyticalNodeId>
namespace BeamOS.DirectStiffnessMethod.Domain.NodeAggregate;
public class Node : AggregateRoot<NodeId>
{
public Point LocationPoint { get; private set; }
private AnalyticalNode(
AnalyticalNodeId id,
private Node(
NodeId id,
double xCoordinate,
double yCoordinate,
double zCoordinate,
Expand All @@ -20,18 +20,18 @@ 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,
LengthUnit lengthUnit,
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,
Expand All @@ -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<LinearLoad> LinearLoads { get; } = [];
Expand All @@ -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];
Expand Down
Original file line number Diff line number Diff line change
@@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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<UnsupportedStructureDisplacementId>
{
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;
Expand All @@ -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; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>
//{
// public UnsupportedStructureDisplacementId(int value) : base(value)
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UnsupportedStructureDisplacementId, UnsupportedStructureDisplacement> dofIdentifierMap = [];
Expand Down Expand Up @@ -141,14 +141,14 @@ public class UnsupportedStructureDisplacementRepo : BeamOSValueObject
{
public List<UnsupportedStructureDisplacementId> DegreeOfFreedomIds { get; } = [];
public List<UnsupportedStructureDisplacementId> BoundaryConditionIds { get; } = [];
public UnsupportedStructureDisplacementRepo(IEnumerable<AnalyticalNode> nodes)
public UnsupportedStructureDisplacementRepo(IEnumerable<Node> nodes)
{
this.InitializeIdentifierMaps(nodes);
}

private void InitializeIdentifierMaps(IEnumerable<AnalyticalNode> nodes)
private void InitializeIdentifierMaps(IEnumerable<Node> nodes)
{
foreach (AnalyticalNode node in nodes)
foreach (var node in nodes)
{
foreach (CoordinateSystemDirection3D direction in Enum.GetValues(typeof(CoordinateSystemDirection3D)))
{
Expand Down
Loading