Fix BeamShearCalculatorLogic
This commit is contained in:
@@ -35,7 +35,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public void Run()
|
||||
{
|
||||
PrepareNewResult();
|
||||
PrepareInputData();
|
||||
//PrepareInputData();
|
||||
try
|
||||
{
|
||||
InitializeStrategies();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -10,9 +12,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult>
|
||||
{
|
||||
private const LimitStates CollapsLimitState = LimitStates.ULS;
|
||||
private IBeamShearCalculatorResult result;
|
||||
private IBeamShearSectionLogic beamShearSectionLogic;
|
||||
private List<IBeamShearSectionLogicInputData> sectionInputDatas;
|
||||
private IBeamShearCalculatorInputData inputData;
|
||||
private List<CalcTerms> calcTerms = new() { CalcTerms.LongTerm, CalcTerms.ShortTerm };
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public BeamShearCalculatorLogic(IShiftTraceLogger? traceLogger)
|
||||
@@ -23,11 +29,12 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public IBeamShearCalculatorResult GetResultByInputData(IBeamShearCalculatorInputData inputData)
|
||||
{
|
||||
this.inputData = inputData;
|
||||
PrepareNewResult();
|
||||
InitializeStrategies();
|
||||
try
|
||||
{
|
||||
GetSectionInputDatas(inputData);
|
||||
GetSectionInputDatas();
|
||||
CalculateResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -64,25 +71,53 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
};
|
||||
}
|
||||
|
||||
private void GetSectionInputDatas(IBeamShearCalculatorInputData inputData)
|
||||
private void GetSectionInputDatas()
|
||||
{
|
||||
//sectionInputDatas = new();
|
||||
//foreach (var beamShearSection in inputData.Sections)
|
||||
//{
|
||||
// foreach (var stirrup in inputData.Stirrups)
|
||||
// {
|
||||
// foreach (var beamShearAction in inputData.Actions)
|
||||
// {
|
||||
// BeamShearSectionLogicInputData newInputData = new(Guid.NewGuid())
|
||||
// {
|
||||
// BeamShearSection = beamShearSection,
|
||||
// Stirrup = stirrup,
|
||||
// BeamShearAction = beamShearAction
|
||||
// };
|
||||
// sectionInputDatas.Add(newInputData);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
sectionInputDatas = new();
|
||||
foreach (var beamShearSection in inputData.Sections)
|
||||
{
|
||||
List<IInclinedSection> inclinedSections = GetInclinedSections(beamShearSection);
|
||||
foreach (var inclinedSection in inclinedSections)
|
||||
{
|
||||
GetSections(inclinedSection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void GetSections(IInclinedSection inclinedSection)
|
||||
{
|
||||
foreach (var stirrup in inputData.Stirrups)
|
||||
{
|
||||
foreach (var beamShearAction in inputData.Actions)
|
||||
{
|
||||
foreach (var calcTerm in calcTerms)
|
||||
{
|
||||
IForceTuple forceTuple = GetForceTupleByShearAction(beamShearAction, inclinedSection, CollapsLimitState, calcTerm);
|
||||
BeamShearSectionLogicInputData newInputData = new(Guid.NewGuid())
|
||||
{
|
||||
InclinedSection = inclinedSection,
|
||||
Stirrup = stirrup,
|
||||
ForceTuple = forceTuple,
|
||||
LimitState = CollapsLimitState,
|
||||
CalcTerm = calcTerm
|
||||
};
|
||||
sectionInputDatas.Add(newInputData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<IInclinedSection> GetInclinedSections(IBeamShearSection beamShearSection)
|
||||
{
|
||||
IGetInclinedSectionListInputData inclinedSectionInputDataLogic = new GetInclinedSectionListInputData(beamShearSection);
|
||||
IGetInclinedSectionListLogic getInclinedSectionListLogic = new GetInclinedSectionListLogic(inclinedSectionInputDataLogic, TraceLogger);
|
||||
return getInclinedSectionListLogic.GetInclinedSections();
|
||||
}
|
||||
|
||||
private IForceTuple GetForceTupleByShearAction(IBeamShearAction beamShearAction, IInclinedSection inclinedSection, LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
IGetDirectShearForceLogic getDirectShearForceLogic = new GetDirectShearForceLogic(beamShearAction, inclinedSection, limitState, calcTerm, TraceLogger);
|
||||
return getDirectShearForceLogic.CalculateShearForceTuple();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public class BeamShearSectionLogicInputData : IBeamShearSectionLogicInputData
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public IBeamShearSection BeamShearSection { get; set; }
|
||||
public Guid Id { get; }
|
||||
/// <inheritdoc/>
|
||||
public IInclinedSection InclinedSection { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IStirrup Stirrup { get; set; }
|
||||
/// <inheritdoc/>
|
||||
@@ -20,5 +22,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <inheritdoc/>
|
||||
public IForceTuple ForceTuple { get; set; }
|
||||
|
||||
public BeamShearSectionLogicInputData(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <summary>
|
||||
/// Properties of concrete cross-section for shear strength of beam
|
||||
/// Properties of RC cross-section for shear strength of beam
|
||||
/// </summary>
|
||||
public interface IBeamShearSection : ISaveable, ICloneable
|
||||
{
|
||||
|
||||
@@ -11,12 +11,27 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// <summary>
|
||||
/// Implements input data for calculating bearing capacity of cross-section of RC member for shear
|
||||
/// </summary>
|
||||
public interface IBeamShearSectionLogicInputData : IInputData
|
||||
public interface IBeamShearSectionLogicInputData : IInputData, ISaveable
|
||||
{
|
||||
IBeamShearSection BeamShearSection { get; set; }
|
||||
/// <summary>
|
||||
/// Properties of RC cross-section
|
||||
/// </summary>
|
||||
IInclinedSection InclinedSection { get; set; }
|
||||
/// <summary>
|
||||
/// Properties of stirrups in cross-section
|
||||
/// </summary>
|
||||
IStirrup Stirrup { get; set; }
|
||||
/// <summary>
|
||||
/// Limit state for calculating
|
||||
/// </summary>
|
||||
LimitStates LimitState { get; set; }
|
||||
/// <summary>
|
||||
/// Term (Duration) for calculation
|
||||
/// </summary>
|
||||
CalcTerms CalcTerm { get; set; }
|
||||
/// <summary>
|
||||
/// Force tuple for calculation
|
||||
/// </summary>
|
||||
IForceTuple ForceTuple { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
foreach (var calcTerm in calcTerms)
|
||||
{
|
||||
IForceTuple forceTuple = GetForceTuple(action, limitState, calcTerm);
|
||||
BeamShearSectionLogicInputData newItem = new()
|
||||
BeamShearSectionLogicInputData newItem = new(Guid.NewGuid())
|
||||
{
|
||||
BeamShearSection = section,
|
||||
//BeamShearSection = section,
|
||||
ForceTuple = forceTuple,
|
||||
Stirrup = stirrup,
|
||||
LimitState = limitState,
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Forces.BeamShearActions;
|
||||
using StructureHelperCommon.Models.Forces.Logics;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
@@ -15,42 +19,82 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public IBeamShearAxisAction AxisAction { get; private set; }
|
||||
public IInclinedSection InclinedSection { get; private set; }
|
||||
public IBeamShearAction AxisAction { get; set; }
|
||||
public IInclinedSection InclinedSection { get; set; }
|
||||
public LimitStates LimitState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
|
||||
public GetDirectShearForceLogic(
|
||||
IBeamShearAxisAction axisAction,
|
||||
IInclinedSection inclinedSection,
|
||||
IBeamShearAction axisAction,
|
||||
IInclinedSection inclinedSection,
|
||||
LimitStates limitState,
|
||||
CalcTerms calcTerm,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
AxisAction = axisAction;
|
||||
InclinedSection = inclinedSection;
|
||||
LimitState = limitState;
|
||||
CalcTerm = calcTerm;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
public GetDirectShearForceLogic(
|
||||
IBeamShearAxisAction axisAction,
|
||||
IBeamShearAction axisAction,
|
||||
IInclinedSection inclinedSection,
|
||||
LimitStates limitState,
|
||||
CalcTerms calcTerm,
|
||||
IShiftTraceLogger? traceLogger,
|
||||
ISumForceByShearLoadLogic summaryForceLogic)
|
||||
{
|
||||
this.summaryForceLogic = summaryForceLogic;
|
||||
AxisAction = axisAction;
|
||||
InclinedSection = inclinedSection;
|
||||
LimitState = limitState;
|
||||
CalcTerm = calcTerm;
|
||||
TraceLogger = traceLogger;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IForceTuple CalculateShearForce()
|
||||
public IForceTuple CalculateShearForceTuple()
|
||||
{
|
||||
IForceTuple externalTuple = CalculateExternalForceTuple();
|
||||
IForceTuple internalTuple = CalculateInternalForceTuple();
|
||||
IForceTuple totalTuple = ForceTupleService.SumTuples(internalTuple, externalTuple);
|
||||
TraceLogger?.AddMessage($"Total longitudinal force = {totalTuple.Nz}(N)");
|
||||
TraceLogger?.AddMessage($"Total shear force = {totalTuple.Qy}(N)");
|
||||
return totalTuple;
|
||||
}
|
||||
|
||||
private IForceTuple CalculateExternalForceTuple()
|
||||
{
|
||||
var forceTupleLogic = new GetForceTupleByFactoredTupleLogic()
|
||||
{
|
||||
FactoredForceTuple = AxisAction.ExternalForce,
|
||||
LimitState = LimitState,
|
||||
CalcTerm = CalcTerm
|
||||
};
|
||||
IForceTuple internalForceTuple = forceTupleLogic.GetForceTuple();
|
||||
return internalForceTuple;
|
||||
}
|
||||
|
||||
private IForceTuple CalculateInternalForceTuple()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
InitializeStrategies();
|
||||
IForceTuple supportShearForce = AxisAction.SupportForce.ForceTuple;
|
||||
TraceLogger?.AddMessage($"Shear force at support Qmax = {supportShearForce}(N)");
|
||||
IBeamShearAxisAction beamShearAxisAction = AxisAction.SupportAction;
|
||||
var forceTupleLogic = new GetForceTupleByFactoredTupleLogic()
|
||||
{
|
||||
FactoredForceTuple = beamShearAxisAction.SupportForce,
|
||||
LimitState = LimitState,
|
||||
CalcTerm = CalcTerm
|
||||
};
|
||||
IForceTuple supportShearForce= forceTupleLogic.GetForceTuple();
|
||||
|
||||
TraceLogger?.AddMessage($"Shear force at support Qmax = {supportShearForce.Qy}(N)");
|
||||
TraceLogger?.AddMessage($"Start of inclined section a,start = {InclinedSection.StartCoord}(m)");
|
||||
TraceLogger?.AddMessage($"End of inclined section a,end = {InclinedSection.EndCoord}(m)");
|
||||
ForceTuple summarySpanShearForce = new (Guid.NewGuid());
|
||||
foreach (var item in AxisAction.ShearLoads)
|
||||
foreach (var item in beamShearAxisAction.ShearLoads)
|
||||
{
|
||||
IForceTuple summarySpanLoad = summaryForceLogic.GetSumShearForce(item, InclinedSection.StartCoord, InclinedSection.EndCoord);
|
||||
ForceTupleService.SumTupleToTarget(summarySpanLoad, summarySpanShearForce);
|
||||
@@ -65,5 +109,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
summaryForceLogic ??= new SumForceByShearLoadLogic(TraceLogger);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class GetInclinedSectionListInputData : IGetInclinedSectionListInputData
|
||||
{
|
||||
public int StepCount { get; set; } = 50;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class GetInclinedSectionListLogic : IGetInclinedSectionListLogic
|
||||
{
|
||||
private readonly GetInclinedSectionListInputData inputData;
|
||||
private readonly IGetInclinedSectionListInputData inputData;
|
||||
private IGetInclinedSectionLogic inclinedSectionLogic;
|
||||
private double depth;
|
||||
private double effectiveDepth;
|
||||
@@ -16,7 +16,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public GetInclinedSectionListLogic(
|
||||
GetInclinedSectionListInputData inputData,
|
||||
IGetInclinedSectionListInputData inputData,
|
||||
IShiftTraceLogger? traceLogger)
|
||||
{
|
||||
this.inputData = inputData;
|
||||
|
||||
@@ -4,6 +4,7 @@ using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class GetInclinedSectionLogic : IGetInclinedSectionLogic
|
||||
{
|
||||
private readonly IBeamShearSection beamShearSection;
|
||||
|
||||
@@ -12,6 +12,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
/// Returns value of shear force at the end of inclined section
|
||||
/// </summary>
|
||||
/// <returns>Value of shear force at the end of inclined section</returns>
|
||||
IForceTuple CalculateShearForce();
|
||||
IForceTuple CalculateShearForceTuple();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
/// <summary>
|
||||
/// Implement logic for obtaining of inclined section
|
||||
/// Implements logic for obtaining of inclined section
|
||||
/// </summary>
|
||||
public interface IGetInclinedSectionLogic : ILogic
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
InitializeStrategies();
|
||||
double factor = getFactorLogic.GetFactor();
|
||||
IForceTuple directShearForce = getDirectShearForceLogic.CalculateShearForce();
|
||||
IForceTuple directShearForce = getDirectShearForceLogic.CalculateShearForceTuple();
|
||||
IForceTuple shearForce = ForceTupleService.MultiplyTupleByFactor(directShearForce,factor);
|
||||
return shearForce;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
LimitState = InputData.LimitState,
|
||||
CalcTerm = InputData.CalcTerm
|
||||
};
|
||||
getDirectShearForceLogic ??= new GetDirectShearForceLogic(InputData.AxisAction, InputData.InclinedSection, TraceLogger);
|
||||
//getDirectShearForceLogic ??= new GetDirectShearForceLogic(InputData.AxisAction, InputData.InclinedSection, TraceLogger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
if (concentratedForce.ForceCoordinate < limitCoordinate)
|
||||
{
|
||||
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.Qy}(N) * {concentratedForce.LoadRatio} = {totalLoad}(N)");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
TraceLogger?.AddMessage($"Total length L,tot = {loadEndCoord}(m) - {loadStartCoord}(m) = {loadLength}(m)");
|
||||
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)");
|
||||
TraceLogger?.AddMessage($"Total load Q,tot = {distributedLoad.LoadValue.Qy}(N/m) * {distributedLoad.LoadRatio} * {loadLength}(m) = {totalLoad.Qy}(N)");
|
||||
return totalLoad;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
sumConcentratedForceLogic ??= new SumConcentratedForceLogic(TraceLogger);
|
||||
IForceTuple sumForce = sumConcentratedForceLogic.GetSumShearForce(concenratedForce, startCoord, endCoord);
|
||||
TraceLogger?.AddMessage($"Sum of uniformly distributed load Qud = {sumForce}(N)");
|
||||
TraceLogger?.AddMessage($"Sum of concentrated force Qcf = {sumForce.Qy}(N)");
|
||||
return sumForce;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
sumDistributedLoadLogic ??= new SumDistributedLoadLogic(TraceLogger);
|
||||
IForceTuple sumForce = sumDistributedLoadLogic.GetSumShearForce(distributedLoad, startCoord, endCoord);
|
||||
TraceLogger?.AddMessage($"Sum of concentrated force Qcf = {sumForce}(N)");
|
||||
TraceLogger?.AddMessage($"Sum of uniformly distributed load Qud = {sumForce.Qy}(N)");
|
||||
return sumForce;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user