From cbfffa9d481d86296c2e94a047f645e4240efadd Mon Sep 17 00:00:00 2001 From: Connor Ivy Date: Thu, 9 Nov 2023 19:08:15 -0600 Subject: [PATCH 1/2] add create point endpoint --- .../Commands/GuidBasedIdCommand.cs | 7 +++ .../BeamOS.Common.Contracts.csproj | 14 ++++++ .../BeamOS.PhysicalModel.Api.csproj | 2 +- .../Element1Ds/CreateElement1DEndpoint.cs | 33 ++++++++++++++ .../CreateElement1DRequestMapper.cs | 11 +++++ .../Element1Ds/Element1DResponseMapper.cs | 10 +++++ .../Endpoints/CreateNodeEndpoint.cs | 40 ----------------- .../Endpoints/CreateModelEndpoint.cs | 10 ++--- .../Mappers/CreateModelRequestMapper.cs} | 4 +- .../Mappers/ModelResponseMapper.cs | 2 +- .../CreateNodeRequestMapper.cs} | 4 +- .../Nodes/Endpoints/CreateNodeEndpoint.cs | 41 +++++++++++++++++ .../{Mappers => Nodes}/NodeResponseMapper.cs | 2 +- .../Endpoints/CreatePointLoadEndpoint.cs | 32 ++++++++++++++ .../Mappers/CreatePointLoadRequestMapper.cs | 44 +++++++++++++++++++ .../Mappers/PointLoadResponseMapper.cs | 11 +++++ .../DependencyInjection.cs | 4 ++ .../Element1Ds/CreateElement1DCommand.cs | 10 +++++ .../CreateElement1DCommandHandler.cs | 24 ++++++++++ .../Nodes/Commands/CreateNodeCommand.cs | 14 ++---- .../Commands/CreatePointLoadCommand.cs | 9 ++++ .../Commands/CreatePointLoadCommandHandler.cs | 25 +++++++++++ .../Common/UnitValueDTO.cs | 2 + .../Common/Vector3.cs | 2 + .../Element1D/CreateElement1DRequest.cs | 7 +++ .../Element1D/Element1DResponse.cs | 11 +++++ .../{Models => Model}/CreateModelRequest.cs | 2 +- .../{Models => Model}/ModelResponse.cs | 2 +- .../{Nodes => Node}/CreateNodeRequest.cs | 2 +- .../{Nodes => Node}/NodeResponse.cs | 10 +++-- .../PointLoad/CreatePointLoadRequest.cs | 7 +++ .../PointLoad/PointLoadResponse.cs | 8 ++++ .../AnalyticalModel.cs | 12 ++--- .../ValueObjects/AnalyticalModelId.cs | 6 +-- .../AnalyticalNodeAggregate/AnalyticalNode.cs | 4 +- .../ValueObjects/AnalyticalNodeId.cs | 7 +-- .../BeamOS.PhysicalModel.Domain.csproj | 6 +-- .../Common/ValueObjects/NodeBaseId.cs | 6 +++ .../Element1DAggregate/Element1D.cs | 42 ++++++------------ .../ValueObjects/Element1DId.cs | 6 +-- .../MaterialAggregate/Material.cs | 2 +- .../ValueObjects/MaterialId.cs | 17 +------ .../PointLoadAggregate/PointLoad.cs | 11 ++++- .../ValueObjects/PointLoadId.cs | 17 +------ .../ValueObjects/SectionProfileId.cs | 17 +------ BeamOS/BeamOS/Program.cs | 2 +- beamOS.sln | 10 ++++- 47 files changed, 396 insertions(+), 175 deletions(-) create mode 100644 BeamOS.Common/BeamOS.Common.Application/Commands/GuidBasedIdCommand.cs create mode 100644 BeamOS.Common/BeamOS.Common.Contracts/BeamOS.Common.Contracts.csproj create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/CreateElement1DEndpoint.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/CreateElement1DRequestMapper.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Element1Ds/Element1DResponseMapper.cs delete mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Endpoints/CreateNodeEndpoint.cs rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/{ => Models}/Endpoints/CreateModelEndpoint.cs (67%) rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/{Mappers/CreateModelCommandMapper.cs => Models/Mappers/CreateModelRequestMapper.cs} (67%) rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/{ => Models}/Mappers/ModelResponseMapper.cs (86%) rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/{Mappers/CreateNodeCommandMapper.cs => Nodes/CreateNodeRequestMapper.cs} (72%) create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/Nodes/Endpoints/CreateNodeEndpoint.cs rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/{Mappers => Nodes}/NodeResponseMapper.cs (86%) create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Endpoints/CreatePointLoadEndpoint.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Mappers/CreatePointLoadRequestMapper.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Api/PointLoads/Mappers/PointLoadResponseMapper.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Element1Ds/CreateElement1DCommand.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/Element1Ds/CreateElement1DCommandHandler.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/PointLoads/Commands/CreatePointLoadCommand.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Application/PointLoads/Commands/CreatePointLoadCommandHandler.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Common/UnitValueDTO.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Common/Vector3.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Element1D/CreateElement1DRequest.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/Element1D/Element1DResponse.cs rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/{Models => Model}/CreateModelRequest.cs (88%) rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/{Models => Model}/ModelResponse.cs (91%) rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/{Nodes => Node}/CreateNodeRequest.cs (89%) rename BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/{Nodes => Node}/NodeResponse.cs (62%) create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/PointLoad/CreatePointLoadRequest.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Contracts/PointLoad/PointLoadResponse.cs create mode 100644 BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/Common/ValueObjects/NodeBaseId.cs 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.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 GetEqualityComponents() - { - yield return this.Value; - } } diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/PointLoadAggregate/PointLoad.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/PointLoadAggregate/PointLoad.cs index 485b1c61..e1261bea 100644 --- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/PointLoadAggregate/PointLoad.cs +++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/PointLoadAggregate/PointLoad.cs @@ -1,4 +1,5 @@ using BeamOS.Common.Domain.Models; +using BeamOS.PhysicalModel.Domain.Common.ValueObjects; using BeamOS.PhysicalModel.Domain.PointLoadAggregate.ValueObjects; using MathNet.Numerics.LinearAlgebra; using UnitsNet; @@ -6,10 +7,18 @@ namespace BeamOS.PhysicalModel.Domain.PointLoadAggregate; public class PointLoad : AggregateRoot { - public PointLoad(PointLoadId id) : base(id) + public PointLoad( + NodeBaseId nodeId, + Force force, + Vector direction, + PointLoadId? id = null) : base(id ?? new()) { + this.NodeId = nodeId; + this.Force = force; + this.NormalizedDirection = direction.Normalize(2); } + public NodeBaseId NodeId { get; set; } public Force Force { get; set; } public Vector NormalizedDirection { get; set; } } diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/PointLoadAggregate/ValueObjects/PointLoadId.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/PointLoadAggregate/ValueObjects/PointLoadId.cs index 301521eb..5e3cd967 100644 --- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/PointLoadAggregate/ValueObjects/PointLoadId.cs +++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/PointLoadAggregate/ValueObjects/PointLoadId.cs @@ -1,19 +1,6 @@ -using BeamOS.Common.Domain.Models; +using BeamOS.Common.Domain.ValueObjects; namespace BeamOS.PhysicalModel.Domain.PointLoadAggregate.ValueObjects; -public class PointLoadId : BeamOSValueObject +public class PointLoadId(Guid? id = null) : GuidBasedId(id) { - public Guid Value { get; } - private PointLoadId(Guid value) - { - this.Value = value; - } - public static PointLoadId CreateUnique() - { - return new(Guid.NewGuid()); - } - protected override IEnumerable GetEqualityComponents() - { - yield return this.Value; - } } diff --git a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/SectionProfileAggregate/ValueObjects/SectionProfileId.cs b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/SectionProfileAggregate/ValueObjects/SectionProfileId.cs index b4ba012e..741c04a1 100644 --- a/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/SectionProfileAggregate/ValueObjects/SectionProfileId.cs +++ b/BeamOS.PhysicalModel/BeamOS.PhysicalModel.Domain/SectionProfileAggregate/ValueObjects/SectionProfileId.cs @@ -1,19 +1,6 @@ -using BeamOS.Common.Domain.Models; +using BeamOS.Common.Domain.ValueObjects; namespace BeamOS.PhysicalModel.Domain.SectionProfileAggregate.ValueObjects; -public class SectionProfileId : BeamOSValueObject +public class SectionProfileId(Guid? id = null) : GuidBasedId(id) { - public Guid Value { get; } - private SectionProfileId(Guid value) - { - this.Value = value; - } - public static SectionProfileId CreateUnique() - { - return new(Guid.NewGuid()); - } - protected override IEnumerable GetEqualityComponents() - { - yield return this.Value; - } } diff --git a/BeamOS/BeamOS/Program.cs b/BeamOS/BeamOS/Program.cs index 1fde9e11..428a20cf 100644 --- a/BeamOS/BeamOS/Program.cs +++ b/BeamOS/BeamOS/Program.cs @@ -2,7 +2,7 @@ using BeamOS.Client.Pages; using BeamOS.Components; //using BeamOS.DirectStiffnessMethod.Api; -using BeamOS.PhysicalModel.Api.Endpoints; +using BeamOS.PhysicalModel.Api.Models.Endpoints; using BeamOS.PhysicalModel.Application; using BeamOS.PhysicalModel.Application.Models.Commands; using FastEndpoints; diff --git a/beamOS.sln b/beamOS.sln index c1f6248b..ba3417a7 100644 --- a/beamOS.sln +++ b/beamOS.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34212.112 @@ -49,7 +48,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeamOS.PhysicalModel.Api", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeamOS.Common.Domain", "BeamOS.Common\BeamOS.Common.Domain\BeamOS.Common.Domain.csproj", "{44433842-20DE-4BEA-B8ED-66A49AD598D1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeamOS.Common.Application", "BeamOS.Common\BeamOS.Common.Application\BeamOS.Common.Application.csproj", "{3C24C74F-069D-4405-9C84-6A507CE57C69}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeamOS.Common.Application", "BeamOS.Common\BeamOS.Common.Application\BeamOS.Common.Application.csproj", "{3C24C74F-069D-4405-9C84-6A507CE57C69}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeamOS.Common.Contracts", "BeamOS.Common\BeamOS.Common.Contracts\BeamOS.Common.Contracts.csproj", "{79CBA285-74AE-42AC-B62D-16CEC0C11B86}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -109,6 +110,10 @@ Global {3C24C74F-069D-4405-9C84-6A507CE57C69}.Debug|Any CPU.Build.0 = Debug|Any CPU {3C24C74F-069D-4405-9C84-6A507CE57C69}.Release|Any CPU.ActiveCfg = Release|Any CPU {3C24C74F-069D-4405-9C84-6A507CE57C69}.Release|Any CPU.Build.0 = Release|Any CPU + {79CBA285-74AE-42AC-B62D-16CEC0C11B86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79CBA285-74AE-42AC-B62D-16CEC0C11B86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79CBA285-74AE-42AC-B62D-16CEC0C11B86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79CBA285-74AE-42AC-B62D-16CEC0C11B86}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -127,6 +132,7 @@ Global {F48D5D05-5ED8-4DA0-B988-1C708D62CEC0} = {C98CCB50-6C71-4241-993B-C6B86BB59C5C} {44433842-20DE-4BEA-B8ED-66A49AD598D1} = {1FCCD156-2A73-4393-B516-8AD77FD49F5B} {3C24C74F-069D-4405-9C84-6A507CE57C69} = {1FCCD156-2A73-4393-B516-8AD77FD49F5B} + {79CBA285-74AE-42AC-B62D-16CEC0C11B86} = {1FCCD156-2A73-4393-B516-8AD77FD49F5B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DCC0AF93-F9F0-490C-9F01-0DDF9F09494F} From e12a996af80b2dd02f3133717a72988980e2bc2a Mon Sep 17 00:00:00 2001 From: Connor Ivy Date: Thu, 9 Nov 2023 19:20:52 -0600 Subject: [PATCH 2/2] rename physical aggregates to remove "analytical" prefix --- .../Common/ValueObjects/VectorIdentified.cs | 2 +- .../Element1DAggregate/Element1D.cs | 20 ++++---- .../Enums/ModelOrientation.cs | 2 +- .../Model.cs} | 23 +++++---- .../ValueObjects/ModelId.cs} | 8 +-- .../ValueObjects/ModelSettings.cs} | 8 +-- .../ValueObjects/UnitSettings.cs | 2 +- .../Node.cs} | 36 ++++++------- .../ValueObjects/NodeId.cs} | 8 +-- .../UnsupportedStructureDisplacement.cs | 6 +-- .../UnsupportedStructureDisplacementId.cs | 6 +-- .../UnsupportedStructureDisplacementRepo.cs | 8 +-- .../Services/SolverService.cs | 14 +++--- .../Common/Constants.cs | 8 +-- .../Common/Factories/Element1DFactory.cs | 12 ++--- .../AnalyticalModelFixture.cs | 6 +-- .../Example8_4.cs | 16 +++--- .../Element1DTests.GetRotationMatrix.cs | 50 +++++++++---------- .../Element1DTests.GetStiffnessMatrix.cs | 6 +-- .../Services/SolverServiceTests.cs | 16 +++--- 20 files changed, 129 insertions(+), 128 deletions(-) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalModelAggregate => ModelAggregate}/Enums/ModelOrientation.cs (50%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalModelAggregate/AnalyticalModel.cs => ModelAggregate/Model.cs} (52%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalModelAggregate/ValueObjects/AnalyticalModelId.cs => ModelAggregate/ValueObjects/ModelId.cs} (54%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalModelAggregate/ValueObjects/AnalyticalModelSettings.cs => ModelAggregate/ValueObjects/ModelSettings.cs} (83%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalModelAggregate => ModelAggregate}/ValueObjects/UnitSettings.cs (95%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalNodeAggregate/AnalyticalNode.cs => NodeAggregate/Node.cs} (70%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalNodeAggregate/ValueObjects/AnalyticalNodeId.cs => NodeAggregate/ValueObjects/NodeId.cs} (76%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalNodeAggregate => NodeAggregate}/ValueObjects/UnsupportedStructureDisplacement.cs (71%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalNodeAggregate => NodeAggregate}/ValueObjects/UnsupportedStructureDisplacementId.cs (73%) rename BeamOS.DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.Domain/{AnalyticalNodeAggregate => NodeAggregate}/ValueObjects/UnsupportedStructureDisplacementRepo.cs (95%) 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/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Constants.cs b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Constants.cs index ba11e63a..0f5dcb8d 100644 --- a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Constants.cs +++ b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Constants.cs @@ -1,19 +1,19 @@ -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.Enums; -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate.ValueObjects; +using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.Enums; +using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects; using UnitsNet; namespace BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common; public static partial class Constants { - public static AnalyticalModelSettings DefaultSettingsK_IN { get; } = new( + public static ModelSettings DefaultSettingsK_IN { get; } = new( UnitSettings.K_IN, ModelOrientation.ZUp, new Length(.005, UnitSystem.SI), new Length(5, UnitSystem.SI), 10 ); - public static AnalyticalModelSettings DefaultSettingsSI { get; } = new( + public static ModelSettings DefaultSettingsSI { get; } = new( UnitSettings.SI, ModelOrientation.ZUp, new Length(.005, UnitSystem.SI), diff --git a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Factories/Element1DFactory.cs b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Factories/Element1DFactory.cs index 036a3211..8d821df7 100644 --- a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Factories/Element1DFactory.cs +++ b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Factories/Element1DFactory.cs @@ -1,7 +1,7 @@ -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects; -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate.ValueObjects; +using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects; +using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate; using UnitsNet; namespace BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Factories; @@ -9,8 +9,8 @@ internal static class Element1DFactory { public static Element1D Create( UnitSettings? unitSettings = null, - AnalyticalNode? startNode = null, - AnalyticalNode? endNode = null, + Node? startNode = null, + Node? endNode = null, Material? material = null, SectionProfile? sectionProfile = null, Angle? rotation = default @@ -20,8 +20,8 @@ public static Element1D Create( return Element1D.Create( rotation ?? Angle.Zero, settings, - startNode ?? AnalyticalNode.Create(0, 0, 0, settings.LengthUnit), - endNode ?? AnalyticalNode.Create(1, 0, 0, settings.LengthUnit), + startNode ?? Node.Create(0, 0, 0, settings.LengthUnit), + endNode ?? Node.Create(1, 0, 0, settings.LengthUnit), material ?? Constants.UnitMaterialSI, sectionProfile ?? Constants.UnitSectionProfileSI ); diff --git a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Fixtures/AnalyticalModels/AnalyticalModelFixture.cs b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Fixtures/AnalyticalModels/AnalyticalModelFixture.cs index 5b4cc288..ab19a6ac 100644 --- a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Fixtures/AnalyticalModels/AnalyticalModelFixture.cs +++ b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Fixtures/AnalyticalModels/AnalyticalModelFixture.cs @@ -1,4 +1,4 @@ -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate; +using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Fixtures.AnalyticalElement1Ds; using MathNet.Numerics.LinearAlgebra; @@ -6,8 +6,8 @@ namespace BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Fixtures.Analytic public class AnalyticalModelFixture : IHasGlobalResults { public AnalyticalModelFixture() { } - public AnalyticalModelFixture(AnalyticalModel model) => this.AnalyticalModel = model; - public AnalyticalModel AnalyticalModel { get; set; } + public AnalyticalModelFixture(Model model) => this.AnalyticalModel = model; + public Model AnalyticalModel { get; set; } public Matrix? ExpectedGlobalStiffnessMatrix { get; set; } public Vector? ExpectedGlobalFixedEndForces { get; set; } public Vector? ExpectedGlobalEndDisplacements { get; set; } diff --git a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Fixtures/SolvedProblems/MatrixAnalysisOfStructures2ndEd/Example8_4.cs b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Fixtures/SolvedProblems/MatrixAnalysisOfStructures2ndEd/Example8_4.cs index 705cde6e..77b75c61 100644 --- a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Fixtures/SolvedProblems/MatrixAnalysisOfStructures2ndEd/Example8_4.cs +++ b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Common/Fixtures/SolvedProblems/MatrixAnalysisOfStructures2ndEd/Example8_4.cs @@ -1,7 +1,7 @@ -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalModelAggregate.ValueObjects; -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate.ValueObjects; +using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects; +using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Fixtures.AnalyticalElement1Ds; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Fixtures.AnalyticalModels; using MathNet.Numerics.LinearAlgebra; @@ -63,8 +63,8 @@ public static AnalyticalModelFixture GetAnalyticalModel() private static AnalyticalElement1DFixture GetElement1Fixture() { #region ElementDefinition - AnalyticalNode startNode = AnalyticalNode.Create(-20, 0, 0, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(0, 0, 0, LengthUnit.Foot); + Node startNode = Node.Create(-20, 0, 0, LengthUnit.Foot); + Node endNode = Node.Create(0, 0, 0, LengthUnit.Foot); var element = Element1D.Create(Angle.Zero, UnitSettings.K_IN, startNode, endNode, Steel29000ksi, Profile33in2); #endregion @@ -174,8 +174,8 @@ private static AnalyticalElement1DFixture GetElement1Fixture() public static AnalyticalElement1DFixture GetElement2Fixture() { #region ElementDefinition - AnalyticalNode startNode = AnalyticalNode.Create(0, -20, 0, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(0, 0, 0, LengthUnit.Foot); + Node startNode = Node.Create(0, -20, 0, LengthUnit.Foot); + Node endNode = Node.Create(0, 0, 0, LengthUnit.Foot); Element1D element = Element1D.Create( new Angle(Math.PI / 2, AngleUnit.Radian), @@ -325,8 +325,8 @@ public static AnalyticalElement1DFixture GetElement2Fixture() public static AnalyticalElement1DFixture GetElement3Fixture() { #region ElementDefinition - AnalyticalNode startNode = AnalyticalNode.Create(0, 0, -20, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(0, 0, 0, LengthUnit.Foot); + Node startNode = Node.Create(0, 0, -20, LengthUnit.Foot); + Node endNode = Node.Create(0, 0, 0, LengthUnit.Foot); Element1D element = Element1D.Create( new Angle(30, AngleUnit.Degree), diff --git a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Element1DAggregate/Element1DTests.GetRotationMatrix.cs b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Element1DAggregate/Element1DTests.GetRotationMatrix.cs index 686b5e9a..8c9f3e0d 100644 --- a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Element1DAggregate/Element1DTests.GetRotationMatrix.cs +++ b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Element1DAggregate/Element1DTests.GetRotationMatrix.cs @@ -1,5 +1,5 @@ -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate; +using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Extensions; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Factories; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Fixtures.AnalyticalElement1Ds; @@ -30,8 +30,8 @@ public void GetRotationMatrix_AlignedWithGlobalCoords_ShouldEqualExpectedValue() { // if the beam is oriented in the same direction as the global coordinate system, // then the unit vectors of the global domain should be returned - var startNode = AnalyticalNode.Create(10, 7, -3, LengthUnit.Foot); - var endNode = AnalyticalNode.Create(20, 7, -3, LengthUnit.Foot); + var startNode = Node.Create(10, 7, -3, LengthUnit.Foot); + var endNode = Node.Create(20, 7, -3, LengthUnit.Foot); Element1D element = Element1DFactory.Create(startNode: startNode, endNode: endNode); Matrix expectedRotationMatrix = DenseMatrix.OfArray(new[,] @@ -57,8 +57,8 @@ public void GetRotationMatrix_ParallelToGlobalXYPlane_ShouldEqualExpectedValue( { // if an elements local xy plane is equal to or parallel with the global xy plane, // return the following matrix (ref Advanced Structural Analysis with MATLAB eqn 4.17) - AnalyticalNode startNode = AnalyticalNode.Create(x0, y0, z0, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(x1, y1, z1, LengthUnit.Foot); + Node startNode = Node.Create(x0, y0, z0, LengthUnit.Foot); + Node endNode = Node.Create(x1, y1, z1, LengthUnit.Foot); Element1D element = Element1DFactory.Create(startNode: startNode, endNode: endNode); var L = element.Length; @@ -89,8 +89,8 @@ public void GetRotationMatrix_ParallelToGlobalXZPlane_ShouldEqualExpectedValue( { // if an elements local xz is equal to or parallel with the global xz plane, // return the following matrix (ref Advanced Structural Analysis with MATLAB eqn 4.16) - AnalyticalNode startNode = AnalyticalNode.Create(x0, y0, z0, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(x1, y1, z1, LengthUnit.Foot); + Node startNode = Node.Create(x0, y0, z0, LengthUnit.Foot); + Node endNode = Node.Create(x1, y1, z1, LengthUnit.Foot); Element1D element = Element1DFactory.Create(startNode: startNode, endNode: endNode); var L = element.Length; @@ -122,8 +122,8 @@ public void GetRotationMatrix_AlignedWithGlobalCoordsRotated_ShouldEqualExpected // if an element is aligned with the global coord system, but has a non 0 rotation, // return the following matrix (ref Advanced Structural Analysis with MATLAB eqn 4.18) Angle rotation = new(rotationDegrees, AngleUnit.Degree); - AnalyticalNode startNode = AnalyticalNode.Create(x0, y0, z0, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(x1, y1, z1, LengthUnit.Foot); + Node startNode = Node.Create(x0, y0, z0, LengthUnit.Foot); + Node endNode = Node.Create(x1, y1, z1, LengthUnit.Foot); Element1D element = Element1DFactory.Create( startNode: startNode, endNode: endNode, @@ -144,8 +144,8 @@ public void GetRotationMatrix_AlignedWithGlobalCoordsRotated_ShouldEqualExpected public void GetRotationMatrix_AlignedWithGlobalPlanesRotateMinus36Degree_ShouldEqualExpectedValue() { Angle rotation = new(-36, AngleUnit.Degree); - AnalyticalNode startNode = AnalyticalNode.Create(10, 18, -15, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(20, 18, -15, LengthUnit.Foot); + Node startNode = Node.Create(10, 18, -15, LengthUnit.Foot); + Node endNode = Node.Create(20, 18, -15, LengthUnit.Foot); Element1D element = Element1DFactory.Create( startNode: startNode, endNode: endNode, @@ -167,8 +167,8 @@ public void GetRotationMatrix_VerticalSimple_ShouldEqualExpectedValue() { // by default (aka no profile rotation), a vertical member will end up with it's local // y axis aligned in the global -x direction - AnalyticalNode startNode = AnalyticalNode.Create(10, 10, 5, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(10, 18, 5, LengthUnit.Foot); + Node startNode = Node.Create(10, 10, 5, LengthUnit.Foot); + Node endNode = Node.Create(10, 18, 5, LengthUnit.Foot); Element1D element = Element1DFactory.Create(startNode: startNode, endNode: endNode); Matrix expectedRotationMatrix = DenseMatrix.OfArray(new[,] @@ -186,8 +186,8 @@ public void GetRotationMatrix_VerticalMemberRotated90_ShouldEqualExpectedValue() { // a positive (counter clockwise) 90 degree rotation will align the local y axis in the global +z direction Angle rotation = new(90, AngleUnit.Degree); - AnalyticalNode startNode = AnalyticalNode.Create(-9, -7, 5, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(-9, 0, 5, LengthUnit.Foot); + Node startNode = Node.Create(-9, -7, 5, LengthUnit.Foot); + Node endNode = Node.Create(-9, 0, 5, LengthUnit.Foot); Element1D element = Element1DFactory.Create( startNode: startNode, endNode: endNode, @@ -211,8 +211,8 @@ public void GetRotationMatrix_VerticalMemberRotatedMinus30_ShouldEqualExpectedVa // the local y axis will be -cos(-30d) in the global x direction and sin(-30d) in the global z dir // the local z axis will be sin(-30d) in the global x direction and cos(-30d) in the global z dir Angle rotation = new(-30, AngleUnit.Degree); - AnalyticalNode startNode = AnalyticalNode.Create(10, -7, -15, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(10, 18, -15, LengthUnit.Foot); + Node startNode = Node.Create(10, -7, -15, LengthUnit.Foot); + Node endNode = Node.Create(10, 18, -15, LengthUnit.Foot); Element1D element = Element1DFactory.Create( startNode: startNode, endNode: endNode, @@ -236,8 +236,8 @@ public void GetRotationMatrix_VerticalUpsideDown_ShouldEqualExpectedValue() { // a vertical member that has point 0 above point 1 will be aligned in the global -x dir // the local y axis will be in the global +x dir and the local z will be in the global +z - AnalyticalNode startNode = AnalyticalNode.Create(10, 10, 5, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(10, 18, 5, LengthUnit.Foot); + Node startNode = Node.Create(10, 10, 5, LengthUnit.Foot); + Node endNode = Node.Create(10, 18, 5, LengthUnit.Foot); Element1D element = Element1DFactory.Create(startNode: startNode, endNode: endNode); Matrix expectedRotationMatrix = DenseMatrix.OfArray(new[,] @@ -256,8 +256,8 @@ public void GetRotationMatrix_VerticalUpsideDownRotated_ShouldEqualExpectedValue // for an element aligned with the global -y axis, // a positive (counter clockwise) 90 degree rotation will align the local y axis in the global +z direction Angle rotation = new(90, AngleUnit.Degree); - AnalyticalNode startNode = AnalyticalNode.Create(10, 36, -15, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(10, 18, -15, LengthUnit.Foot); + Node startNode = Node.Create(10, 36, -15, LengthUnit.Foot); + Node endNode = Node.Create(10, 18, -15, LengthUnit.Foot); Element1D element = Element1DFactory.Create( startNode: startNode, endNode: endNode, @@ -278,8 +278,8 @@ public void GetRotationMatrix_VerticalUpsideDownRotated_ShouldEqualExpectedValue public void GetRotationMatrix_MisalignedFromGlobal_ShouldEqualExpectedValue() { // simplest case - AnalyticalNode startNode = AnalyticalNode.Create(0, 0, 0, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(1, 1, 1, LengthUnit.Foot); + Node startNode = Node.Create(0, 0, 0, LengthUnit.Foot); + Node endNode = Node.Create(1, 1, 1, LengthUnit.Foot); Element1D element = Element1DFactory.Create(startNode: startNode, endNode: endNode); Matrix expectedRotationMatrix = DenseMatrix.OfArray(new[,] @@ -297,8 +297,8 @@ public void GetRotationMatrix_MisalignedFromGlobalComplex_ShouldEqualExpectedVal { // This answer is taken from Matrix Analysis of Structures example 8.3 Angle rotation = new(0.857302717, AngleUnit.Radian); - AnalyticalNode startNode = AnalyticalNode.Create(4, 7, 6, LengthUnit.Foot); - AnalyticalNode endNode = AnalyticalNode.Create(20, 15, 17, LengthUnit.Foot); + Node startNode = Node.Create(4, 7, 6, LengthUnit.Foot); + Node endNode = Node.Create(20, 15, 17, LengthUnit.Foot); Element1D element = Element1DFactory.Create( startNode: startNode, endNode: endNode, diff --git a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Element1DAggregate/Element1DTests.GetStiffnessMatrix.cs b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Element1DAggregate/Element1DTests.GetStiffnessMatrix.cs index b09bee1c..7d91b837 100644 --- a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Element1DAggregate/Element1DTests.GetStiffnessMatrix.cs +++ b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Element1DAggregate/Element1DTests.GetStiffnessMatrix.cs @@ -1,6 +1,6 @@ -using BeamOS.DirectStiffnessMethod.Domain.AnalyticalNodeAggregate; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate.ValueObjects; +using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Extensions; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Factories; using BeamOS.DirectStiffnessMethod.Domain.UnitTests.Common.Fixtures.AnalyticalElement1Ds; @@ -210,8 +210,8 @@ public void GetStiffnessMatrix_WithIsolatedJVariable_ShouldEqualExpectedValue() public void GetStiffnessMatrix_WithIsolatedLVariable_ShouldEqualExpectedValue() { Element1D element = Element1DFactory.Create( - startNode: AnalyticalNode.Create(0, 0, 0, UnitsNet.Units.LengthUnit.Meter), - endNode: AnalyticalNode.Create(5, 0, 0, UnitsNet.Units.LengthUnit.Meter) + startNode: Node.Create(0, 0, 0, UnitsNet.Units.LengthUnit.Meter), + endNode: Node.Create(5, 0, 0, UnitsNet.Units.LengthUnit.Meter) ); Matrix calculatedLocalStiffnessMatrix = element.GetLocalStiffnessMatrix(); diff --git a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Services/SolverServiceTests.cs b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Services/SolverServiceTests.cs index ff6512de..38ef2526 100644 --- a/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Services/SolverServiceTests.cs +++ b/Tests/UnitTests/DirectStiffnessMethod/BeamOS.DirectStiffnessMethod.UnitTests/Services/SolverServiceTests.cs @@ -1,9 +1,9 @@ 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.Element1DAggregate; using BeamOS.DirectStiffnessMethod.Domain.Element1DAggregate.ValueObjects; +using BeamOS.DirectStiffnessMethod.Domain.ModelAggregate.ValueObjects; +using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate; +using BeamOS.DirectStiffnessMethod.Domain.NodeAggregate.ValueObjects; using BeamOS.DirectStiffnessMethod.Domain.Services; using MathNet.Numerics.LinearAlgebra.Double; using UnitsNet; @@ -16,7 +16,7 @@ public class SolverServiceTests public void SolveGivenSimpleBeamAndLoadsShouldEqualExpectedValue() { Restraints free2D = new(true, true, false, false, false, true); - AnalyticalNode node0 = AnalyticalNode.Create(0, 16, 0, LengthUnit.Foot, free2D); + Node node0 = Node.Create(0, 16, 0, LengthUnit.Foot, free2D); node0.LinearLoads.Add(new( new Force(150, ForceUnit.KilopoundForce), DenseVector.OfArray([1, 0, 0]) @@ -26,9 +26,9 @@ public void SolveGivenSimpleBeamAndLoadsShouldEqualExpectedValue() DenseVector.OfArray([0, -1, 0]) )); Restraints pinned2d = new(false, false, false, false, false, true); - AnalyticalNode node1 = AnalyticalNode.Create(-12, 0, 0, LengthUnit.Foot, pinned2d); - AnalyticalNode node2 = AnalyticalNode.Create(0, 0, 0, LengthUnit.Foot, pinned2d); - AnalyticalNode node3 = AnalyticalNode.Create(12, 0, 0, LengthUnit.Foot, pinned2d); + Node node1 = Node.Create(-12, 0, 0, LengthUnit.Foot, pinned2d); + Node node2 = Node.Create(0, 0, 0, LengthUnit.Foot, pinned2d); + Node node3 = Node.Create(12, 0, 0, LengthUnit.Foot, pinned2d); Material steel29000ksi = new( new Pressure(29000, PressureUnit.KilopoundForcePerSquareInch), @@ -51,7 +51,7 @@ public void SolveGivenSimpleBeamAndLoadsShouldEqualExpectedValue() var element2 = Element1D.Create(Angle.Zero, UnitSettings.K_IN, node0, node3, steel29000ksi, area8in); List element1Ds = [element0, element1, element2]; - Dictionary nodes = new() + Dictionary nodes = new() { { node0.Id, node0 }, { node1.Id, node1 },