Add logic for converting beam shear calculator input data
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
<uc:FactoredCombination Grid.Row="1" DataContext="{Binding CombinationProperty}"/>
|
<uc:FactoredCombination Grid.Row="1" DataContext="{Binding CombinationProperty}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Imternal force" DataContext="{Binding SupportAction.SupportForces}">
|
<TabItem Header="Internal force" DataContext="{Binding SupportAction.SupportForces}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="50"/>
|
<RowDefinition Height="50"/>
|
||||||
|
|||||||
@@ -8,12 +8,7 @@ using StructureHelperCommon.Models;
|
|||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperLogics.Models.BeamShears;
|
using StructureHelperLogics.Models.BeamShears;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace StructureHelper.Windows.BeamShears
|
namespace StructureHelper.Windows.BeamShears
|
||||||
@@ -28,13 +23,11 @@ namespace StructureHelper.Windows.BeamShears
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return runCommand ??
|
return runCommand ??= new RelayCommand(param =>
|
||||||
(
|
|
||||||
runCommand = new RelayCommand(param =>
|
|
||||||
{
|
{
|
||||||
RunMethod(param);
|
RunMethod(param);
|
||||||
}, o => SelectedItem != null
|
}, o => SelectedItem != null
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ namespace StructureHelper.Windows.BeamShears
|
|||||||
}
|
}
|
||||||
public double ForceValue
|
public double ForceValue
|
||||||
{
|
{
|
||||||
get => concenratedForce.ForceValue;
|
get => concenratedForce.ForceValue.Qy;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
concenratedForce.ForceValue = value;
|
concenratedForce.ForceValue.Qy = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public double LoadRatio
|
public double LoadRatio
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ namespace StructureHelper.Windows.BeamShears
|
|||||||
}
|
}
|
||||||
public double LoadValue
|
public double LoadValue
|
||||||
{
|
{
|
||||||
get => distributedLoad.LoadValue;
|
get => distributedLoad.LoadValue.Qy;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
distributedLoad.LoadValue = value;
|
distributedLoad.LoadValue.Qy = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public double RelativeLevel
|
public double RelativeLevel
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
|||||||
ConcentratedForce concentratedForce = new(Guid.NewGuid())
|
ConcentratedForce concentratedForce = new(Guid.NewGuid())
|
||||||
{
|
{
|
||||||
Name = "Concentrated force",
|
Name = "Concentrated force",
|
||||||
ForceValue = -5e4,
|
|
||||||
LoadRatio = 1,
|
LoadRatio = 1,
|
||||||
RelativeLoadLevel = 0.5,
|
RelativeLoadLevel = 0.5,
|
||||||
ForceCoordinate = 1
|
ForceCoordinate = 1
|
||||||
};
|
};
|
||||||
|
concentratedForce.ForceValue.Qy = -5e4;
|
||||||
return concentratedForce;
|
return concentratedForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,12 +47,12 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
|||||||
DistributedLoad distributedLoad = new(Guid.NewGuid())
|
DistributedLoad distributedLoad = new(Guid.NewGuid())
|
||||||
{
|
{
|
||||||
Name = "Distributed load",
|
Name = "Distributed load",
|
||||||
LoadValue = -5e3,
|
|
||||||
LoadRatio = 1,
|
LoadRatio = 1,
|
||||||
RelativeLoadLevel = 0.5,
|
RelativeLoadLevel = 0.5,
|
||||||
StartCoordinate = 0,
|
StartCoordinate = 0,
|
||||||
EndCoordinate = 100
|
EndCoordinate = 100
|
||||||
};
|
};
|
||||||
|
distributedLoad.LoadValue.Qy = -5e3;
|
||||||
return distributedLoad;
|
return distributedLoad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace StructureHelperCommon.Models.Forces
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public double ForceCoordinate { get; set; }
|
public double ForceCoordinate { get; set; }
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public double ForceValue { get; set; }
|
public IForceTuple ForceValue { get; set; } = new ForceTuple(Guid.NewGuid());
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public double RelativeLoadLevel
|
public double RelativeLoadLevel
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace StructureHelperCommon.Models.Forces
|
|||||||
public Guid Id { get; }
|
public Guid Id { get; }
|
||||||
|
|
||||||
public string Name { get; set; } = string.Empty;
|
public string Name { get; set; } = string.Empty;
|
||||||
public double LoadValue { get; set; } = 0d;
|
public IForceTuple LoadValue { get; set; } = new ForceTuple(Guid.NewGuid());
|
||||||
public double RelativeLoadLevel
|
public double RelativeLoadLevel
|
||||||
{
|
{
|
||||||
get => relativeLoadLevel;
|
get => relativeLoadLevel;
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ namespace StructureHelperCommon.Models.Forces
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Value of force, N
|
/// Value of force, N
|
||||||
/// </summary>
|
/// </summary>
|
||||||
double ForceValue { get; set; }
|
IForceTuple ForceValue { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Value of uniformly distributed load, N/m
|
/// Value of uniformly distributed load, N/m
|
||||||
/// </summary>
|
/// </summary>
|
||||||
double LoadValue { get; set; }
|
IForceTuple LoadValue { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Coordinate of start of load, m
|
/// Coordinate of start of load, m
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -71,6 +71,12 @@ namespace StructureHelperCommon.Services.Forces
|
|||||||
}
|
}
|
||||||
return tuples;
|
return tuples;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Renew target force tuple with adding source tuple
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="source">Source tuple</param>
|
||||||
|
/// <param name="target">Target tuple</param>
|
||||||
|
/// <param name="factor">Factor which source tuple will be multiplied by (1d is default value)</param>
|
||||||
public static void SumTupleToTarget(IForceTuple source, IForceTuple target, double factor = 1d)
|
public static void SumTupleToTarget(IForceTuple source, IForceTuple target, double factor = 1d)
|
||||||
{
|
{
|
||||||
target.Mx += source.Mx * factor;
|
target.Mx += source.Mx * factor;
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
public class BeamShearCalculator : IBeamShearCalculator
|
public class BeamShearCalculator : IBeamShearCalculator
|
||||||
{
|
{
|
||||||
|
private IUpdateStrategy<IBeamShearCalculator> updateStrategy;
|
||||||
private ICheckInputDataLogic<IBeamShearCalculatorInputData> checkInputDataLogic;
|
private ICheckInputDataLogic<IBeamShearCalculatorInputData> checkInputDataLogic;
|
||||||
private IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult> calculationLogic;
|
private IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult> calculationLogic;
|
||||||
private IBeamShearCalculatorResult result;
|
private IBeamShearCalculatorResult result;
|
||||||
@@ -30,7 +26,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
BeamShearCalculator newItem = new(Guid.NewGuid());
|
||||||
|
updateStrategy ??= new BeamShearCalculatorUpdateStrategy();
|
||||||
|
updateStrategy.Update(newItem, this);
|
||||||
|
return newItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult>
|
public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult>
|
||||||
{
|
{
|
||||||
private IBeamShearCalculatorResult result;
|
private IBeamShearCalculatorResult result;
|
||||||
private IBeamShearSectionCalculator beamShearSectionCalculator;
|
private IBeamShearSectionLogic beamShearSectionLogic;
|
||||||
private List<IBeamShearSectionCalculatorInputData> sectionInputDatas;
|
private List<IBeamShearSectionLogicInputData> sectionInputDatas;
|
||||||
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
public BeamShearCalculatorLogic(IShiftTraceLogger? traceLogger)
|
public BeamShearCalculatorLogic(IShiftTraceLogger? traceLogger)
|
||||||
{
|
{
|
||||||
TraceLogger = traceLogger;
|
TraceLogger = traceLogger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
|
||||||
|
|
||||||
public IBeamShearCalculatorResult GetResultByInputData(IBeamShearCalculatorInputData inputData)
|
public IBeamShearCalculatorResult GetResultByInputData(IBeamShearCalculatorInputData inputData)
|
||||||
{
|
{
|
||||||
@@ -43,16 +43,16 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
foreach (var sectionInputData in sectionInputDatas)
|
foreach (var sectionInputData in sectionInputDatas)
|
||||||
{
|
{
|
||||||
beamShearSectionCalculator.InputData = sectionInputData;
|
beamShearSectionLogic.InputData = sectionInputData;
|
||||||
beamShearSectionCalculator.Run();
|
beamShearSectionLogic.Run();
|
||||||
var sectionResult = beamShearSectionCalculator.Result as IBeamShearSectionCalculatorResult;
|
var sectionResult = beamShearSectionLogic.Result as IBeamShearSectionLogicResult;
|
||||||
result.SectionResults.Add(sectionResult);
|
result.SectionResults.Add(sectionResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeStrategies()
|
private void InitializeStrategies()
|
||||||
{
|
{
|
||||||
beamShearSectionCalculator ??= new BeamShearSectionCalculator();
|
beamShearSectionLogic ??= new BeamShearSectionLogic();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PrepareNewResult()
|
private void PrepareNewResult()
|
||||||
@@ -66,23 +66,23 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
|
|
||||||
private void GetSectionInputDatas(IBeamShearCalculatorInputData inputData)
|
private void GetSectionInputDatas(IBeamShearCalculatorInputData inputData)
|
||||||
{
|
{
|
||||||
sectionInputDatas = new();
|
//sectionInputDatas = new();
|
||||||
foreach (var beamShearSection in inputData.Sections)
|
//foreach (var beamShearSection in inputData.Sections)
|
||||||
{
|
//{
|
||||||
foreach (var stirrup in inputData.Stirrups)
|
// foreach (var stirrup in inputData.Stirrups)
|
||||||
{
|
// {
|
||||||
foreach (var beamShearAction in inputData.Actions)
|
// foreach (var beamShearAction in inputData.Actions)
|
||||||
{
|
// {
|
||||||
BeamShearSectionCalculatorInputData newInputData = new(Guid.NewGuid())
|
// BeamShearSectionLogicInputData newInputData = new(Guid.NewGuid())
|
||||||
{
|
// {
|
||||||
BeamShearSection = beamShearSection,
|
// BeamShearSection = beamShearSection,
|
||||||
Stirrup = stirrup,
|
// Stirrup = stirrup,
|
||||||
BeamShearAction = beamShearAction
|
// BeamShearAction = beamShearAction
|
||||||
};
|
// };
|
||||||
sectionInputDatas.Add(newInputData);
|
// sectionInputDatas.Add(newInputData);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
public bool IsValid { get; set; } = true;
|
public bool IsValid { get; set; } = true;
|
||||||
public string? Description { get; set; } = string.Empty;
|
public string? Description { get; set; } = string.Empty;
|
||||||
public List<IBeamShearSectionCalculatorResult> SectionResults { get; set; } = new();
|
public List<IBeamShearSectionLogicResult> SectionResults { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
|
||||||
{
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public class BeamShearSectionCalculatorInputData : IBeamShearSectionCalculatorInputData
|
|
||||||
{
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public Guid Id { get; }
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public IBeamShearSection? BeamShearSection { get; set; }
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public IBeamShearAction? BeamShearAction { get; set; }
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public IStirrup? Stirrup { get; set; }
|
|
||||||
public BeamShearSectionCalculatorInputData(Guid id)
|
|
||||||
{
|
|
||||||
Id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
public class BeamShearSectionCalculatorResult : IBeamShearSectionCalculatorResult
|
public class BeamShearSectionCalculatorResult : IBeamShearSectionLogicResult
|
||||||
{
|
{
|
||||||
public bool IsValid { get; set; }
|
public bool IsValid { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|||||||
@@ -8,23 +8,15 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
public class BeamShearSectionCalculator : IBeamShearSectionCalculator
|
public class BeamShearSectionLogic : IBeamShearSectionLogic
|
||||||
{
|
{
|
||||||
private IBeamShearSectionCalculatorResult result;
|
private IBeamShearSectionLogicResult result;
|
||||||
|
|
||||||
public Guid Id { get; }
|
public IBeamShearSectionLogicInputData InputData { get; set; }
|
||||||
public string Name { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
public IBeamShearSectionCalculatorInputData InputData { get; set; }
|
|
||||||
|
|
||||||
public IResult Result => result;
|
public IResult Result => result;
|
||||||
|
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public object Clone()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
|
||||||
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
|
//All rights reserved.
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public class BeamShearSectionLogicInputData : IBeamShearSectionLogicInputData
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IBeamShearSection BeamShearSection { get; set; }
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IStirrup Stirrup { get; set; }
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public LimitStates LimitState { get; set; }
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public CalcTerms CalcTerm { get; set; }
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IForceTuple ForceTuple { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
public interface IBeamShearCalculatorResult : IResult
|
public interface IBeamShearCalculatorResult : IResult
|
||||||
{
|
{
|
||||||
List<IBeamShearSectionCalculatorResult> SectionResults { get; set; }
|
List<IBeamShearSectionLogicResult> SectionResults { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
using StructureHelperCommon.Models.Calculators;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
|
||||||
{
|
|
||||||
public interface IBeamShearSectionCalculator : ICalculator
|
|
||||||
{
|
|
||||||
IBeamShearSectionCalculatorInputData InputData { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -9,10 +8,11 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
public interface IBeamShearSectionCalculatorInputData : IInputData, ISaveable
|
public interface IBeamShearSectionLogic : ILogic
|
||||||
{
|
{
|
||||||
IBeamShearSection? BeamShearSection { get; set; }
|
IBeamShearSectionLogicInputData InputData { get; set; }
|
||||||
IBeamShearAction? BeamShearAction { get; set; }
|
IResult Result { get; }
|
||||||
IStirrup? Stirrup { get; set; }
|
|
||||||
|
void Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
|
||||||
|
//Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
|
//All rights reserved.
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public interface IBeamShearSectionLogicInputData : IInputData
|
||||||
|
{
|
||||||
|
IBeamShearSection BeamShearSection { get; set; }
|
||||||
|
IStirrup Stirrup { get; set; }
|
||||||
|
LimitStates LimitState { get; set; }
|
||||||
|
CalcTerms CalcTerm { get; set; }
|
||||||
|
IForceTuple ForceTuple { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
public interface IBeamShearSectionCalculatorResult : IResult
|
public interface IBeamShearSectionLogicResult : IResult
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
internal class BeamShearCalculatorInputDataUpdateStrategy : IUpdateStrategy<IBeamShearCalculatorInputData>
|
||||||
|
{
|
||||||
|
private IUpdateStrategy<IHasBeamShearActions>? hasActionUpdateStrategy;
|
||||||
|
private IUpdateStrategy<IHasStirrups>? hasStirrupsUpdateStrategy;
|
||||||
|
private IUpdateStrategy<IHasBeamShearSections> hasSectionsUpdateStrategy;
|
||||||
|
public void Update(IBeamShearCalculatorInputData targetObject, IBeamShearCalculatorInputData sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||||
|
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||||
|
InitializeStrategies();
|
||||||
|
hasActionUpdateStrategy?.Update(targetObject, sourceObject);
|
||||||
|
hasStirrupsUpdateStrategy?.Update(targetObject, sourceObject);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeStrategies()
|
||||||
|
{
|
||||||
|
hasActionUpdateStrategy ??= new HasBeamShearActionUpdateStrategy();
|
||||||
|
hasStirrupsUpdateStrategy ??= new HasStirrupsUpdateStrategy();
|
||||||
|
hasSectionsUpdateStrategy ??= new HasBeamShearSectionUpdateStrategy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using StructureHelperCommon.Services.Forces;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearCalculatorToLogicInputDataConvertStrategy
|
||||||
|
{
|
||||||
|
const LimitStates limitState = LimitStates.ULS;
|
||||||
|
private readonly IShiftTraceLogger? traceLogger;
|
||||||
|
private readonly List<CalcTerms> calcTerms = new() { CalcTerms.ShortTerm, CalcTerms.LongTerm };
|
||||||
|
|
||||||
|
public BeamShearCalculatorToLogicInputDataConvertStrategy(IShiftTraceLogger? traceLogger)
|
||||||
|
{
|
||||||
|
this.traceLogger = traceLogger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<IBeamShearSectionLogicInputData> Convert(IBeamShearCalculatorInputData source)
|
||||||
|
{
|
||||||
|
List<IBeamShearSectionLogicInputData> result = new();
|
||||||
|
foreach (var section in source.Sections)
|
||||||
|
{
|
||||||
|
foreach (var action in source.Actions)
|
||||||
|
{
|
||||||
|
foreach (var stirrup in source.Stirrups)
|
||||||
|
{
|
||||||
|
foreach (var calcTerm in calcTerms)
|
||||||
|
{
|
||||||
|
IForceTuple forceTuple = GetForceTuple(action, limitState, calcTerm);
|
||||||
|
BeamShearSectionLogicInputData newItem = new()
|
||||||
|
{
|
||||||
|
BeamShearSection = section,
|
||||||
|
ForceTuple = forceTuple,
|
||||||
|
Stirrup = stirrup,
|
||||||
|
LimitState = limitState,
|
||||||
|
CalcTerm = calcTerm
|
||||||
|
};
|
||||||
|
result.Add(newItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IForceTuple GetForceTuple(IBeamShearAction action, LimitStates limitState, CalcTerms calcTerm)
|
||||||
|
{
|
||||||
|
IForceTuple externalForceTuple = GetExternalForceTuple(action.ExternalForce, limitState, calcTerm);
|
||||||
|
IForceTuple internalForceTuple = GetInternalForceTuple(action.SupportAction, limitState, calcTerm);
|
||||||
|
IForceTuple sumForceTuple = ForceTupleService.SumTuples(externalForceTuple, internalForceTuple);
|
||||||
|
return sumForceTuple;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IForceTuple GetInternalForceTuple(IBeamShearAxisAction supportAction, LimitStates limitState, CalcTerms calcTerm)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
private IForceTuple GetExternalForceTuple(IFactoredForceTuple externalForce, LimitStates limitState, CalcTerms calcTerm)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public class BeamShearCalculatorUpdateStrategy : IUpdateStrategy<IBeamShearCalculator>
|
||||||
|
{
|
||||||
|
private IUpdateStrategy<IBeamShearCalculatorInputData>? inputDataUpdateStrategy;
|
||||||
|
public void Update(IBeamShearCalculator targetObject, IBeamShearCalculator sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||||
|
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||||
|
targetObject.Name = sourceObject.Name;
|
||||||
|
targetObject.InputData ??= new BeamShearCalculatorInputData(Guid.NewGuid());
|
||||||
|
InitializeStrategies();
|
||||||
|
inputDataUpdateStrategy.Update(targetObject.InputData, sourceObject.InputData);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeStrategies()
|
||||||
|
{
|
||||||
|
inputDataUpdateStrategy ??= new BeamShearCalculatorInputDataUpdateStrategy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperCommon.Services.Forces;
|
||||||
|
|
||||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
//All rights reserved.
|
//All rights reserved.
|
||||||
@@ -40,19 +41,23 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public double CalculateShearForce()
|
public IForceTuple CalculateShearForce()
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||||
InitializeStrategies();
|
InitializeStrategies();
|
||||||
double supportShearForce = AxisAction.SupportForce.ForceTuple.Qx;
|
IForceTuple supportShearForce = AxisAction.SupportForce.ForceTuple;
|
||||||
TraceLogger?.AddMessage($"Shear force at support Qmax = {supportShearForce}(N)");
|
TraceLogger?.AddMessage($"Shear force at support Qmax = {supportShearForce}(N)");
|
||||||
TraceLogger?.AddMessage($"Start of inclined section a,start = {InclinedSection.StartCoord}(m)");
|
TraceLogger?.AddMessage($"Start of inclined section a,start = {InclinedSection.StartCoord}(m)");
|
||||||
TraceLogger?.AddMessage($"End of inclined section a,end = {InclinedSection.EndCoord}(m)");
|
TraceLogger?.AddMessage($"End of inclined section a,end = {InclinedSection.EndCoord}(m)");
|
||||||
double summarySpanShearForce = AxisAction.ShearLoads
|
ForceTuple summarySpanShearForce = new (Guid.NewGuid());
|
||||||
.Sum(load => summaryForceLogic.GetSumShearForce(load, InclinedSection.StartCoord, InclinedSection.EndCoord));
|
foreach (var item in AxisAction.ShearLoads)
|
||||||
TraceLogger?.AddMessage($"Summary span force deltaQ = {summarySpanShearForce}(N)");
|
{
|
||||||
double shearForce = supportShearForce + summarySpanShearForce;
|
IForceTuple summarySpanLoad = summaryForceLogic.GetSumShearForce(item, InclinedSection.StartCoord, InclinedSection.EndCoord);
|
||||||
TraceLogger?.AddMessage($"Summary shear force at the end of inclined section Q = {shearForce}(N)");
|
ForceTupleService.SumTupleToTarget(summarySpanLoad, summarySpanShearForce);
|
||||||
|
}
|
||||||
|
TraceLogger?.AddMessage($"Summary span force deltaQ = {summarySpanShearForce.Qy}(N)");
|
||||||
|
IForceTuple shearForce = ForceTupleService.SumTuples(supportShearForce,summarySpanShearForce);
|
||||||
|
TraceLogger?.AddMessage($"Summary shear force at the end of inclined section Q = {shearForce.Qy}(N)");
|
||||||
return shearForce;
|
return shearForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public class HasBeamShearActionUpdateStrategy : IUpdateStrategy<IHasBeamShearActions>
|
||||||
|
{
|
||||||
|
public void Update(IHasBeamShearActions targetObject, IHasBeamShearActions sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||||
|
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||||
|
CheckObject.IsNull(sourceObject.Actions);
|
||||||
|
CheckObject.IsNull(targetObject.Actions);
|
||||||
|
targetObject.Actions.Clear();
|
||||||
|
targetObject.Actions.AddRange(sourceObject.Actions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public class HasBeamShearSectionUpdateStrategy : IUpdateStrategy<IHasBeamShearSections>
|
||||||
|
{
|
||||||
|
public void Update(IHasBeamShearSections targetObject, IHasBeamShearSections sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||||
|
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||||
|
CheckObject.IsNull(sourceObject.Sections);
|
||||||
|
CheckObject.IsNull(targetObject.Sections);
|
||||||
|
targetObject.Sections.Clear();
|
||||||
|
targetObject.Sections.AddRange(sourceObject.Sections);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Services;
|
||||||
|
|
||||||
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
|
{
|
||||||
|
public class HasStirrupsUpdateStrategy : IUpdateStrategy<IHasStirrups>
|
||||||
|
{
|
||||||
|
public void Update(IHasStirrups targetObject, IHasStirrups sourceObject)
|
||||||
|
{
|
||||||
|
CheckObject.IsNull(sourceObject, ErrorStrings.SourceObject);
|
||||||
|
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
|
||||||
|
if (ReferenceEquals(targetObject, sourceObject)) { return; };
|
||||||
|
CheckObject.IsNull(sourceObject.Stirrups);
|
||||||
|
CheckObject.IsNull(targetObject.Stirrups);
|
||||||
|
targetObject.Stirrups.Clear();
|
||||||
|
targetObject.Stirrups.AddRange(sourceObject.Stirrups);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
/// Returns value of shear force at the end of inclined section
|
/// Returns value of shear force at the end of inclined section
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Value of shear force at the end of inclined section</returns>
|
/// <returns>Value of shear force at the end of inclined section</returns>
|
||||||
double CalculateShearForce();
|
IForceTuple CalculateShearForce();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
|
||||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
//All rights reserved.
|
//All rights reserved.
|
||||||
@@ -7,7 +8,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
internal interface IShearForceLogic : ILogic
|
internal interface IShearForceLogic : ILogic
|
||||||
{
|
{
|
||||||
double GetShearForce();
|
IForceTuple GetShearForce();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
/// <param name="startCoord">Coordinate of start point, m</param>
|
/// <param name="startCoord">Coordinate of start point, m</param>
|
||||||
/// <param name="endCoord">Coordinate of end point, m</param>
|
/// <param name="endCoord">Coordinate of end point, m</param>
|
||||||
/// <returns>Summary force, N</returns>
|
/// <returns>Summary force, N</returns>
|
||||||
double GetSumShearForce(IBeamSpanLoad beamShearLoad, double startCoord, double endCoord);
|
IForceTuple GetSumShearForce(IBeamSpanLoad beamShearLoad, double startCoord, double endCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Models.Forces.Logics;
|
using StructureHelperCommon.Models.Forces.Logics;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperCommon.Services.Forces;
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
@@ -31,13 +32,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
this.getDirectShearForceLogic = getDirectShearForceLogic;
|
this.getDirectShearForceLogic = getDirectShearForceLogic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double GetShearForce()
|
public IForceTuple GetShearForce()
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||||
InitializeStrategies();
|
InitializeStrategies();
|
||||||
double factor = getFactorLogic.GetFactor();
|
double factor = getFactorLogic.GetFactor();
|
||||||
double directShearForce = getDirectShearForceLogic.CalculateShearForce();
|
IForceTuple directShearForce = getDirectShearForceLogic.CalculateShearForce();
|
||||||
double shearForce = directShearForce * factor;
|
IForceTuple shearForce = ForceTupleService.MultiplyTupleByFactor(directShearForce,factor);
|
||||||
return shearForce;
|
return shearForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperCommon.Services.Forces;
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
@@ -22,13 +23,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
TraceLogger = traceLogger;
|
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);
|
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||||
if (beamShearLoad is IConcentratedForce concentratedForce)
|
if (beamShearLoad is IConcentratedForce concentratedForce)
|
||||||
{
|
{
|
||||||
InitializeStrategies();
|
InitializeStrategies();
|
||||||
double sumForce = GetConcentratedForceSum(concentratedForce, startCoord, endCoord);
|
IForceTuple sumForce = GetConcentratedForceSum(concentratedForce, startCoord, endCoord);
|
||||||
return sumForce;
|
return sumForce;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -42,20 +43,20 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
coordinateByLevelLogic ??= new CoordinateByLevelLogic(TraceLogger);
|
coordinateByLevelLogic ??= new CoordinateByLevelLogic(TraceLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double GetConcentratedForceSum(IConcentratedForce concentratedForce, double startCoord, double endCoord)
|
private IForceTuple GetConcentratedForceSum(IConcentratedForce concentratedForce, double startCoord, double endCoord)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Concentrated force Name = {concentratedForce.Name}, Value = {concentratedForce.ForceValue}(N/m) ");
|
TraceLogger?.AddMessage($"Concentrated force Name = {concentratedForce.Name}, Value = {concentratedForce.ForceValue.Qy}(N/m) ");
|
||||||
if (concentratedForce.ForceCoordinate > endCoord)
|
if (concentratedForce.ForceCoordinate > endCoord)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Force coordinate {concentratedForce.ForceCoordinate}(m) is bigger than section end {endCoord}(m), so total load is zero");
|
TraceLogger?.AddMessage($"Force coordinate {concentratedForce.ForceCoordinate}(m) is bigger than section end {endCoord}(m), so total load is zero");
|
||||||
return 0;
|
return new ForceTuple(Guid.NewGuid());
|
||||||
}
|
}
|
||||||
return GetConcentratedForce(concentratedForce, startCoord, endCoord);
|
return GetConcentratedForce(concentratedForce, startCoord, endCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double GetConcentratedForce(IConcentratedForce concentratedForce, double startCoord, double endCoord)
|
private IForceTuple GetConcentratedForce(IConcentratedForce concentratedForce, double startCoord, double endCoord)
|
||||||
{
|
{
|
||||||
double totalLoad;
|
IForceTuple totalLoad;
|
||||||
double limitCoordinate = startCoord;
|
double limitCoordinate = startCoord;
|
||||||
if (concentratedForce.ForceCoordinate >= startCoord)
|
if (concentratedForce.ForceCoordinate >= startCoord)
|
||||||
{
|
{
|
||||||
@@ -63,13 +64,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
}
|
}
|
||||||
if (concentratedForce.ForceCoordinate < limitCoordinate)
|
if (concentratedForce.ForceCoordinate < limitCoordinate)
|
||||||
{
|
{
|
||||||
totalLoad = concentratedForce.ForceValue * concentratedForce.LoadRatio;
|
totalLoad = ForceTupleService.MultiplyTupleByFactor(concentratedForce.ForceValue, concentratedForce.LoadRatio);
|
||||||
TraceLogger?.AddMessage($"Total load Q,tot = {concentratedForce.ForceValue}(N) * {concentratedForce.LoadRatio} = {totalLoad}(N)");
|
TraceLogger?.AddMessage($"Total load Q,tot = {concentratedForce.ForceValue}(N) * {concentratedForce.LoadRatio} = {totalLoad}(N)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Force coordinate {concentratedForce.ForceCoordinate}(m) is bigger than limit coordinate {limitCoordinate}(m), so total load is zero");
|
TraceLogger?.AddMessage($"Force coordinate {concentratedForce.ForceCoordinate}(m) is bigger than limit coordinate {limitCoordinate}(m), so total load is zero");
|
||||||
totalLoad = 0d;
|
totalLoad = new ForceTuple(Guid.NewGuid());
|
||||||
}
|
}
|
||||||
return totalLoad;
|
return totalLoad;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
|
using StructureHelperCommon.Services.Forces;
|
||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
@@ -21,13 +22,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
TraceLogger = traceLogger;
|
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);
|
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||||
if (beamShearLoad is IDistributedLoad distributedLoad)
|
if (beamShearLoad is IDistributedLoad distributedLoad)
|
||||||
{
|
{
|
||||||
InitializeStrategies();
|
InitializeStrategies();
|
||||||
double sumForce = GetDistributedLoadSum(distributedLoad, startCoord, endCoord);
|
IForceTuple sumForce = GetDistributedLoadSum(distributedLoad, startCoord, endCoord);
|
||||||
return sumForce;
|
return sumForce;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -41,21 +42,22 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
coordinateByLevelLogic ??= new CoordinateByLevelLogic(TraceLogger);
|
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);
|
double loadStartCoord = Math.Max(distributedLoad.StartCoordinate, 0d);
|
||||||
if (loadStartCoord > endCoord)
|
if (loadStartCoord > endCoord)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Load start coordinate {loadStartCoord}(m) is bigger than section end {endCoord}(m), so total load is zero");
|
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 endCoordByLevel = coordinateByLevelLogic.GetCoordinate(startCoord, endCoord, distributedLoad.RelativeLoadLevel);
|
||||||
double loadEndCoord = Math.Min(distributedLoad.EndCoordinate, endCoordByLevel);
|
double loadEndCoord = Math.Min(distributedLoad.EndCoordinate, endCoordByLevel);
|
||||||
double loadLength = loadEndCoord - loadStartCoord;
|
double loadLength = loadEndCoord - loadStartCoord;
|
||||||
TraceLogger?.AddMessage($"Total length L,tot = {loadEndCoord}(m) - {loadStartCoord}(m) = {loadLength}(m)");
|
TraceLogger?.AddMessage($"Total length L,tot = {loadEndCoord}(m) - {loadStartCoord}(m) = {loadLength}(m)");
|
||||||
double totalLoad = distributedLoad.LoadValue * distributedLoad.LoadRatio * loadLength;
|
double sumFactor = distributedLoad.LoadRatio * loadLength;
|
||||||
TraceLogger?.AddMessage($"Total load Q,tot = {distributedLoad.LoadValue}(N/m) * {distributedLoad.LoadRatio} * {loadLength}(m) = {totalLoad}(N)");
|
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;
|
return totalLoad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
TraceLogger = traceLogger;
|
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);
|
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||||
if (beamShearLoad is IDistributedLoad distributedLoad)
|
if (beamShearLoad is IDistributedLoad distributedLoad)
|
||||||
{
|
{
|
||||||
TraceLogger?.AddMessage($"Load is uniformly distributed load");
|
TraceLogger?.AddMessage($"Load is uniformly distributed load");
|
||||||
double sumDistributed = GetDistributedLoadSum(distributedLoad, startCoord, endCoord);
|
IForceTuple sumDistributed = GetDistributedLoadSum(distributedLoad, startCoord, endCoord);
|
||||||
return sumDistributed;
|
return sumDistributed;
|
||||||
}
|
}
|
||||||
else if (beamShearLoad is IConcentratedForce concenratedForce)
|
else if (beamShearLoad is IConcentratedForce concenratedForce)
|
||||||
@@ -46,18 +46,18 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private double GetConcentratedForceSum(IConcentratedForce concenratedForce, double startCoord, double endCoord)
|
private IForceTuple GetConcentratedForceSum(IConcentratedForce concenratedForce, double startCoord, double endCoord)
|
||||||
{
|
{
|
||||||
sumConcentratedForceLogic ??= new SumConcentratedForceLogic(TraceLogger);
|
sumConcentratedForceLogic ??= new SumConcentratedForceLogic(TraceLogger);
|
||||||
double sumForce = sumConcentratedForceLogic.GetSumShearForce(concenratedForce, startCoord, endCoord);
|
IForceTuple sumForce = sumConcentratedForceLogic.GetSumShearForce(concenratedForce, startCoord, endCoord);
|
||||||
TraceLogger?.AddMessage($"Sum of uniformly distributed load Qud = {sumForce}(N)");
|
TraceLogger?.AddMessage($"Sum of uniformly distributed load Qud = {sumForce}(N)");
|
||||||
return sumForce;
|
return sumForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double GetDistributedLoadSum(IDistributedLoad distributedLoad, double startCoord, double endCoord)
|
private IForceTuple GetDistributedLoadSum(IDistributedLoad distributedLoad, double startCoord, double endCoord)
|
||||||
{
|
{
|
||||||
sumDistributedLoadLogic ??= new SumDistributedLoadLogic(TraceLogger);
|
sumDistributedLoadLogic ??= new SumDistributedLoadLogic(TraceLogger);
|
||||||
double sumForce = sumDistributedLoadLogic.GetSumShearForce(distributedLoad, startCoord, endCoord);
|
IForceTuple sumForce = sumDistributedLoadLogic.GetSumShearForce(distributedLoad, startCoord, endCoord);
|
||||||
TraceLogger?.AddMessage($"Sum of concentrated force Qcf = {sumForce}(N)");
|
TraceLogger?.AddMessage($"Sum of concentrated force Qcf = {sumForce}(N)");
|
||||||
return sumForce;
|
return sumForce;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace StructureHelperTests.UnitTests.BeamShearTests
|
|||||||
mockInclinedSection.Setup(i => i.StartCoord).Returns(2.0);
|
mockInclinedSection.Setup(i => i.StartCoord).Returns(2.0);
|
||||||
mockInclinedSection.Setup(i => i.EndCoord).Returns(5.0);
|
mockInclinedSection.Setup(i => i.EndCoord).Returns(5.0);
|
||||||
|
|
||||||
_mockSummaryForceLogic.Setup(s => s.GetSumShearForce(mockShearLoad.Object, 2.0, 5.0)).Returns(50.0);
|
_mockSummaryForceLogic.Setup(s => s.GetSumShearForce(mockShearLoad.Object, 2.0, 5.0)).Returns(new ForceTuple() { Qy = 50.0});
|
||||||
_logic = new GetDirectShearForceLogic(mockAxisAction.Object, mockInclinedSection.Object, _mockLogger.Object, _mockSummaryForceLogic.Object);
|
_logic = new GetDirectShearForceLogic(mockAxisAction.Object, mockInclinedSection.Object, _mockLogger.Object, _mockSummaryForceLogic.Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ namespace StructureHelperTests.UnitTests.BeamShearTests
|
|||||||
// Arrange
|
// Arrange
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
double result = _logic.CalculateShearForce();
|
double result = _logic.CalculateShearForce().Qy;
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.That(result, Is.EqualTo(150.0));
|
Assert.That(result, Is.EqualTo(150.0));
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ namespace StructureHelperTests.UnitTests.BeamShearTests
|
|||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
_mockGetFactorLogic.Setup(f => f.GetFactor()).Returns(1.5);
|
_mockGetFactorLogic.Setup(f => f.GetFactor()).Returns(1.5);
|
||||||
_mockGetDirectShearForceLogic.Setup(d => d.CalculateShearForce()).Returns(100.0);
|
_mockGetDirectShearForceLogic.Setup(d => d.CalculateShearForce()).Returns(new ForceTuple() { Qy = 100.0 });
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
double result = _logic.GetShearForce();
|
double result = _logic.GetShearForce().Qy;
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.That(result, Is.EqualTo(150.0));
|
Assert.That(result, Is.EqualTo(150.0));
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ namespace StructureHelperTests.UnitTests.BeamShearTests
|
|||||||
// Arrange
|
// Arrange
|
||||||
var mockConcentratedForce = new Mock<IConcentratedForce>();
|
var mockConcentratedForce = new Mock<IConcentratedForce>();
|
||||||
mockConcentratedForce.Setup(f => f.ForceCoordinate).Returns(3.0);
|
mockConcentratedForce.Setup(f => f.ForceCoordinate).Returns(3.0);
|
||||||
mockConcentratedForce.Setup(f => f.ForceValue).Returns(100.0);
|
mockConcentratedForce.Setup(f => f.ForceValue).Returns(new ForceTuple() { Qy = 100.0 });
|
||||||
mockConcentratedForce.Setup(f => f.LoadRatio).Returns(0.8);
|
mockConcentratedForce.Setup(f => f.LoadRatio).Returns(0.8);
|
||||||
mockConcentratedForce.Setup(f => f.RelativeLoadLevel).Returns(0.5);
|
mockConcentratedForce.Setup(f => f.RelativeLoadLevel).Returns(0.5);
|
||||||
|
|
||||||
_mockCoordinateByLevelLogic.Setup(c => c.GetCoordinate(2.0, 5.0, 0.5)).Returns(3.5);
|
_mockCoordinateByLevelLogic.Setup(c => c.GetCoordinate(2.0, 5.0, 0.5)).Returns(3.5);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
double result = _logic.GetSumShearForce(mockConcentratedForce.Object, 2.0, 5.0);
|
double result = _logic.GetSumShearForce(mockConcentratedForce.Object, 2.0, 5.0).Qy;
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.That(result, Is.EqualTo(80.0));
|
Assert.That(result, Is.EqualTo(80.0));
|
||||||
@@ -50,7 +50,7 @@ namespace StructureHelperTests.UnitTests.BeamShearTests
|
|||||||
mockConcentratedForce.Setup(f => f.ForceCoordinate).Returns(6.0);
|
mockConcentratedForce.Setup(f => f.ForceCoordinate).Returns(6.0);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
double result = _logic.GetSumShearForce(mockConcentratedForce.Object, 2.0, 5.0);
|
double result = _logic.GetSumShearForce(mockConcentratedForce.Object, 2.0, 5.0).Qy;
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.That(result, Is.EqualTo(0.0));
|
Assert.That(result, Is.EqualTo(0.0));
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ namespace StructureHelperTests.UnitTests.BeamShearTests
|
|||||||
var mockDistributedLoad = new Mock<IDistributedLoad>();
|
var mockDistributedLoad = new Mock<IDistributedLoad>();
|
||||||
mockDistributedLoad.Setup(d => d.StartCoordinate).Returns(1.0);
|
mockDistributedLoad.Setup(d => d.StartCoordinate).Returns(1.0);
|
||||||
mockDistributedLoad.Setup(d => d.EndCoordinate).Returns(4.0);
|
mockDistributedLoad.Setup(d => d.EndCoordinate).Returns(4.0);
|
||||||
mockDistributedLoad.Setup(d => d.LoadValue).Returns(50.0);
|
mockDistributedLoad.Setup(d => d.LoadValue).Returns(new ForceTuple() { Qy = 50.0 });
|
||||||
mockDistributedLoad.Setup(d => d.LoadRatio).Returns(0.9);
|
mockDistributedLoad.Setup(d => d.LoadRatio).Returns(0.9);
|
||||||
mockDistributedLoad.Setup(d => d.RelativeLoadLevel).Returns(0.5);
|
mockDistributedLoad.Setup(d => d.RelativeLoadLevel).Returns(0.5);
|
||||||
|
|
||||||
_mockCoordinateByLevelLogic.Setup(c => c.GetCoordinate(2.0, 5.0, 0.5)).Returns(4.5);
|
_mockCoordinateByLevelLogic.Setup(c => c.GetCoordinate(2.0, 5.0, 0.5)).Returns(4.5);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
double result = _logic.GetSumShearForce(mockDistributedLoad.Object, 2.0, 5.0);
|
double result = _logic.GetSumShearForce(mockDistributedLoad.Object, 2.0, 5.0).Qy;
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.That(result, Is.EqualTo(135.0));
|
Assert.That(result, Is.EqualTo(135.0));
|
||||||
@@ -51,7 +51,7 @@ namespace StructureHelperTests.UnitTests.BeamShearTests
|
|||||||
mockDistributedLoad.Setup(d => d.StartCoordinate).Returns(6.0);
|
mockDistributedLoad.Setup(d => d.StartCoordinate).Returns(6.0);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
double result = _logic.GetSumShearForce(mockDistributedLoad.Object, 2.0, 5.0);
|
double result = _logic.GetSumShearForce(mockDistributedLoad.Object, 2.0, 5.0).Qy;
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.That(result, Is.EqualTo(0.0));
|
Assert.That(result, Is.EqualTo(0.0));
|
||||||
|
|||||||
Reference in New Issue
Block a user