Add logic for converting beam shear calculator input data
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
@@ -21,13 +22,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public double GetSumShearForce(IBeamSpanLoad beamShearLoad, double startCoord, double endCoord)
|
||||
public IForceTuple GetSumShearForce(IBeamSpanLoad beamShearLoad, double startCoord, double endCoord)
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
if (beamShearLoad is IDistributedLoad distributedLoad)
|
||||
{
|
||||
InitializeStrategies();
|
||||
double sumForce = GetDistributedLoadSum(distributedLoad, startCoord, endCoord);
|
||||
IForceTuple sumForce = GetDistributedLoadSum(distributedLoad, startCoord, endCoord);
|
||||
return sumForce;
|
||||
}
|
||||
else
|
||||
@@ -41,21 +42,22 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
coordinateByLevelLogic ??= new CoordinateByLevelLogic(TraceLogger);
|
||||
}
|
||||
|
||||
private double GetDistributedLoadSum(IDistributedLoad distributedLoad, double startCoord, double endCoord)
|
||||
private IForceTuple GetDistributedLoadSum(IDistributedLoad distributedLoad, double startCoord, double endCoord)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Uniformly distributed load Name = {distributedLoad.Name}, Value = {distributedLoad.LoadValue}(N/m) ");
|
||||
TraceLogger?.AddMessage($"Uniformly distributed load Name = {distributedLoad.Name}, Value = {distributedLoad.LoadValue.Qy}(N/m) ");
|
||||
double loadStartCoord = Math.Max(distributedLoad.StartCoordinate, 0d);
|
||||
if (loadStartCoord > endCoord)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Load start coordinate {loadStartCoord}(m) is bigger than section end {endCoord}(m), so total load is zero");
|
||||
return 0d;
|
||||
return new ForceTuple(Guid.NewGuid());
|
||||
}
|
||||
double endCoordByLevel = coordinateByLevelLogic.GetCoordinate(startCoord, endCoord, distributedLoad.RelativeLoadLevel);
|
||||
double loadEndCoord = Math.Min(distributedLoad.EndCoordinate, endCoordByLevel);
|
||||
double loadLength = loadEndCoord - loadStartCoord;
|
||||
TraceLogger?.AddMessage($"Total length L,tot = {loadEndCoord}(m) - {loadStartCoord}(m) = {loadLength}(m)");
|
||||
double totalLoad = distributedLoad.LoadValue * distributedLoad.LoadRatio * loadLength;
|
||||
TraceLogger?.AddMessage($"Total load Q,tot = {distributedLoad.LoadValue}(N/m) * {distributedLoad.LoadRatio} * {loadLength}(m) = {totalLoad}(N)");
|
||||
double sumFactor = distributedLoad.LoadRatio * loadLength;
|
||||
IForceTuple totalLoad = ForceTupleService.MultiplyTupleByFactor(distributedLoad.LoadValue, sumFactor);
|
||||
TraceLogger?.AddMessage($"Total load Q,tot = {distributedLoad.LoadValue.Qy}(N/m) * {distributedLoad.LoadRatio} * {loadLength}(m) = {totalLoad}(N)");
|
||||
return totalLoad;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user