Fix BeamShearCalculatorLogic
This commit is contained in:
@@ -11,7 +11,7 @@ namespace StructureHelperCommon.Models.Forces
|
|||||||
{
|
{
|
||||||
readonly IUpdateStrategy<IForceFactoredList> updateStrategy = new ForceFactoredListUpdateStrategy();
|
readonly IUpdateStrategy<IForceFactoredList> updateStrategy = new ForceFactoredListUpdateStrategy();
|
||||||
private List<IForceCombinationList> result;
|
private List<IForceCombinationList> result;
|
||||||
private IGetCombinationByFactoredTupleLogic getCombinationLogic = new GetCombinationByFactoredTupleLogic();
|
private IGetCombinationsByFactoredTupleLogic getCombinationLogic = new GetCombinationsByFactoredTupleLogic();
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public Guid Id { get; }
|
public Guid Id { get; }
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperCommon.Models.Shapes;
|
||||||
using StructureHelperCommon.Services.Forces;
|
using StructureHelperCommon.Services.Forces;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -9,9 +10,12 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
|
//All rights reserved.
|
||||||
|
|
||||||
namespace StructureHelperCommon.Models.Forces.Logics
|
namespace StructureHelperCommon.Models.Forces.Logics
|
||||||
{
|
{
|
||||||
public class GetCombinationByFactoredTupleLogic : IGetCombinationByFactoredTupleLogic
|
public class GetCombinationsByFactoredTupleLogic : IGetCombinationsByFactoredTupleLogic
|
||||||
{
|
{
|
||||||
private ForceCombinationList? result;
|
private ForceCombinationList? result;
|
||||||
private IForceTuple? fullSLSTuple;
|
private IForceTuple? fullSLSTuple;
|
||||||
@@ -20,7 +24,7 @@ namespace StructureHelperCommon.Models.Forces.Logics
|
|||||||
|
|
||||||
public IForceTuple? SourceForceTuple { get; set; }
|
public IForceTuple? SourceForceTuple { get; set; }
|
||||||
public IFactoredCombinationProperty? CombinationProperty { get; set; }
|
public IFactoredCombinationProperty? CombinationProperty { get; set; }
|
||||||
public IForceActionProperty? ForceActionProperty { get; set; }
|
public IForceActionProperty? ForceActionProperty { get; set; } = new ForceActionProperty() { ForcePoint = new Point2D(), SetInGravityCenter = false };
|
||||||
public IForceCombinationList GetCombinationList()
|
public IForceCombinationList GetCombinationList()
|
||||||
{
|
{
|
||||||
Check();
|
Check();
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
namespace StructureHelperCommon.Models.Forces.Logics
|
namespace StructureHelperCommon.Models.Forces.Logics
|
||||||
{
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
public class GetFactorByFactoredCombinationProperty : IGetLoadFactor
|
public class GetFactorByFactoredCombinationProperty : IGetLoadFactor
|
||||||
{
|
{
|
||||||
private const double defaultSLSfactor = 1d;
|
private const double defaultSLSfactor = 1d;
|
||||||
@@ -13,7 +14,7 @@ namespace StructureHelperCommon.Models.Forces.Logics
|
|||||||
public IFactoredCombinationProperty CombinationProperty { get; set; }
|
public IFactoredCombinationProperty CombinationProperty { get; set; }
|
||||||
public LimitStates LimitState { get; set; }
|
public LimitStates LimitState { get; set; }
|
||||||
public CalcTerms CalcTerm { get; set; }
|
public CalcTerms CalcTerm { get; set; }
|
||||||
|
/// <inheritdoc/>
|
||||||
public double GetFactor()
|
public double GetFactor()
|
||||||
{
|
{
|
||||||
double stateFactor = CombinationProperty.LimitState is LimitStates.SLS ? defaultSLSfactor : (1d / CombinationProperty.ULSFactor);
|
double stateFactor = CombinationProperty.LimitState is LimitStates.SLS ? defaultSLSfactor : (1d / CombinationProperty.ULSFactor);
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models.Calculators;
|
||||||
|
using StructureHelperCommon.Services.Forces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Forces.Logics
|
||||||
|
{
|
||||||
|
public class GetForceTupleByFactoredTupleLogic : IGetForceTupleByFactoredTupleLogic
|
||||||
|
{
|
||||||
|
private IGetLoadFactor getFactorLogic;
|
||||||
|
|
||||||
|
public GetForceTupleByFactoredTupleLogic(IGetLoadFactor getFactorLogic)
|
||||||
|
{
|
||||||
|
this.getFactorLogic = getFactorLogic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetForceTupleByFactoredTupleLogic()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public IFactoredForceTuple FactoredForceTuple { get; set; }
|
||||||
|
public LimitStates LimitState { get; set; }
|
||||||
|
public CalcTerms CalcTerm { get; set; }
|
||||||
|
|
||||||
|
public IForceTuple GetForceTuple()
|
||||||
|
{
|
||||||
|
getFactorLogic ??= new GetFactorByFactoredCombinationProperty()
|
||||||
|
{
|
||||||
|
CombinationProperty = FactoredForceTuple.CombinationProperty,
|
||||||
|
LimitState = LimitState,
|
||||||
|
CalcTerm = CalcTerm
|
||||||
|
};
|
||||||
|
double factor = getFactorLogic.GetFactor();
|
||||||
|
return ForceTupleService.MultiplyTupleByFactor(FactoredForceTuple.ForceTuple, factor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,18 @@
|
|||||||
namespace StructureHelperCommon.Models.Forces.Logics
|
namespace StructureHelperCommon.Models.Forces.Logics
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return combinations for source combination and properties
|
/// Returns combinations for source combination and properties
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGetCombinationByFactoredTupleLogic
|
public interface IGetCombinationsByFactoredTupleLogic
|
||||||
{
|
{ /// <summary>
|
||||||
/// <summary>
|
|
||||||
/// Source combination of forces
|
/// Source combination of forces
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IForceTuple? SourceForceTuple { get; set; }
|
IForceTuple? SourceForceTuple { get; set; }
|
||||||
/// <inheritdoc/>
|
/// <summary>
|
||||||
|
/// Properties of combination for source combination of force
|
||||||
|
/// </summary>
|
||||||
IFactoredCombinationProperty? CombinationProperty { get; set; }
|
IFactoredCombinationProperty? CombinationProperty { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
IForceActionProperty? ForceActionProperty { get; set; }
|
IForceActionProperty? ForceActionProperty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Forces.Logics
|
||||||
|
{
|
||||||
|
public interface IGetForceTupleByFactoredTupleLogic : IGetForceTupleLogic
|
||||||
|
{
|
||||||
|
IFactoredForceTuple FactoredForceTuple { get; set; }
|
||||||
|
LimitStates LimitState { get; set; }
|
||||||
|
CalcTerms CalcTerm { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelperCommon.Models.Forces.Logics
|
||||||
|
{
|
||||||
|
public interface IGetForceTupleLogic
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Calculates force tuple
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
IForceTuple GetForceTuple();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,10 @@ namespace StructureHelperCommon.Models.Forces
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGetLoadFactor
|
public interface IGetLoadFactor
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns factor for load
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Factor for load</returns>
|
||||||
double GetFactor();
|
double GetFactor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
PrepareNewResult();
|
PrepareNewResult();
|
||||||
PrepareInputData();
|
//PrepareInputData();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
InitializeStrategies();
|
InitializeStrategies();
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
|
using StructureHelperCommon.Models.Forces;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -10,9 +12,13 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult>
|
public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult>
|
||||||
{
|
{
|
||||||
|
private const LimitStates CollapsLimitState = LimitStates.ULS;
|
||||||
private IBeamShearCalculatorResult result;
|
private IBeamShearCalculatorResult result;
|
||||||
private IBeamShearSectionLogic beamShearSectionLogic;
|
private IBeamShearSectionLogic beamShearSectionLogic;
|
||||||
private List<IBeamShearSectionLogicInputData> sectionInputDatas;
|
private List<IBeamShearSectionLogicInputData> sectionInputDatas;
|
||||||
|
private IBeamShearCalculatorInputData inputData;
|
||||||
|
private List<CalcTerms> calcTerms = new() { CalcTerms.LongTerm, CalcTerms.ShortTerm };
|
||||||
|
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
public BeamShearCalculatorLogic(IShiftTraceLogger? traceLogger)
|
public BeamShearCalculatorLogic(IShiftTraceLogger? traceLogger)
|
||||||
@@ -23,11 +29,12 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
|
|
||||||
public IBeamShearCalculatorResult GetResultByInputData(IBeamShearCalculatorInputData inputData)
|
public IBeamShearCalculatorResult GetResultByInputData(IBeamShearCalculatorInputData inputData)
|
||||||
{
|
{
|
||||||
|
this.inputData = inputData;
|
||||||
PrepareNewResult();
|
PrepareNewResult();
|
||||||
InitializeStrategies();
|
InitializeStrategies();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GetSectionInputDatas(inputData);
|
GetSectionInputDatas();
|
||||||
CalculateResult();
|
CalculateResult();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -64,25 +71,53 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetSectionInputDatas(IBeamShearCalculatorInputData inputData)
|
private void GetSectionInputDatas()
|
||||||
{
|
{
|
||||||
//sectionInputDatas = new();
|
sectionInputDatas = new();
|
||||||
//foreach (var beamShearSection in inputData.Sections)
|
foreach (var beamShearSection in inputData.Sections)
|
||||||
//{
|
{
|
||||||
// foreach (var stirrup in inputData.Stirrups)
|
List<IInclinedSection> inclinedSections = GetInclinedSections(beamShearSection);
|
||||||
// {
|
foreach (var inclinedSection in inclinedSections)
|
||||||
// foreach (var beamShearAction in inputData.Actions)
|
{
|
||||||
// {
|
GetSections(inclinedSection);
|
||||||
// BeamShearSectionLogicInputData newInputData = new(Guid.NewGuid())
|
}
|
||||||
// {
|
}
|
||||||
// BeamShearSection = beamShearSection,
|
}
|
||||||
// Stirrup = stirrup,
|
|
||||||
// BeamShearAction = beamShearAction
|
private void GetSections(IInclinedSection inclinedSection)
|
||||||
// };
|
{
|
||||||
// sectionInputDatas.Add(newInputData);
|
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
|
public class BeamShearSectionLogicInputData : IBeamShearSectionLogicInputData
|
||||||
{
|
{
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IBeamShearSection BeamShearSection { get; set; }
|
public Guid Id { get; }
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IInclinedSection InclinedSection { get; set; }
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IStirrup Stirrup { get; set; }
|
public IStirrup Stirrup { get; set; }
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
@@ -20,5 +22,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IForceTuple ForceTuple { get; set; }
|
public IForceTuple ForceTuple { get; set; }
|
||||||
|
|
||||||
|
public BeamShearSectionLogicInputData(Guid id)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
|||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Properties of concrete cross-section for shear strength of beam
|
/// Properties of RC cross-section for shear strength of beam
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IBeamShearSection : ISaveable, ICloneable
|
public interface IBeamShearSection : ISaveable, ICloneable
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,12 +11,27 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Implements input data for calculating bearing capacity of cross-section of RC member for shear
|
/// Implements input data for calculating bearing capacity of cross-section of RC member for shear
|
||||||
/// </summary>
|
/// </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; }
|
IStirrup Stirrup { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Limit state for calculating
|
||||||
|
/// </summary>
|
||||||
LimitStates LimitState { get; set; }
|
LimitStates LimitState { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Term (Duration) for calculation
|
||||||
|
/// </summary>
|
||||||
CalcTerms CalcTerm { get; set; }
|
CalcTerms CalcTerm { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Force tuple for calculation
|
||||||
|
/// </summary>
|
||||||
IForceTuple ForceTuple { get; set; }
|
IForceTuple ForceTuple { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
foreach (var calcTerm in calcTerms)
|
foreach (var calcTerm in calcTerms)
|
||||||
{
|
{
|
||||||
IForceTuple forceTuple = GetForceTuple(action, limitState, calcTerm);
|
IForceTuple forceTuple = GetForceTuple(action, limitState, calcTerm);
|
||||||
BeamShearSectionLogicInputData newItem = new()
|
BeamShearSectionLogicInputData newItem = new(Guid.NewGuid())
|
||||||
{
|
{
|
||||||
BeamShearSection = section,
|
//BeamShearSection = section,
|
||||||
ForceTuple = forceTuple,
|
ForceTuple = forceTuple,
|
||||||
Stirrup = stirrup,
|
Stirrup = stirrup,
|
||||||
LimitState = limitState,
|
LimitState = limitState,
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
|
using StructureHelperCommon.Models;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
|
using StructureHelperCommon.Models.Forces.BeamShearActions;
|
||||||
|
using StructureHelperCommon.Models.Forces.Logics;
|
||||||
using StructureHelperCommon.Models.Loggers;
|
using StructureHelperCommon.Models.Loggers;
|
||||||
using StructureHelperCommon.Services.Forces;
|
using StructureHelperCommon.Services.Forces;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
|
||||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||||
//All rights reserved.
|
//All rights reserved.
|
||||||
@@ -15,42 +19,82 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
public IBeamShearAxisAction AxisAction { get; private set; }
|
public IBeamShearAction AxisAction { get; set; }
|
||||||
public IInclinedSection InclinedSection { get; private set; }
|
public IInclinedSection InclinedSection { get; set; }
|
||||||
|
public LimitStates LimitState { get; set; }
|
||||||
|
public CalcTerms CalcTerm { get; set; }
|
||||||
|
|
||||||
public GetDirectShearForceLogic(
|
public GetDirectShearForceLogic(
|
||||||
IBeamShearAxisAction axisAction,
|
IBeamShearAction axisAction,
|
||||||
IInclinedSection inclinedSection,
|
IInclinedSection inclinedSection,
|
||||||
|
LimitStates limitState,
|
||||||
|
CalcTerms calcTerm,
|
||||||
IShiftTraceLogger? traceLogger)
|
IShiftTraceLogger? traceLogger)
|
||||||
{
|
{
|
||||||
AxisAction = axisAction;
|
AxisAction = axisAction;
|
||||||
InclinedSection = inclinedSection;
|
InclinedSection = inclinedSection;
|
||||||
|
LimitState = limitState;
|
||||||
|
CalcTerm = calcTerm;
|
||||||
TraceLogger = traceLogger;
|
TraceLogger = traceLogger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetDirectShearForceLogic(
|
public GetDirectShearForceLogic(
|
||||||
IBeamShearAxisAction axisAction,
|
IBeamShearAction axisAction,
|
||||||
IInclinedSection inclinedSection,
|
IInclinedSection inclinedSection,
|
||||||
|
LimitStates limitState,
|
||||||
|
CalcTerms calcTerm,
|
||||||
IShiftTraceLogger? traceLogger,
|
IShiftTraceLogger? traceLogger,
|
||||||
ISumForceByShearLoadLogic summaryForceLogic)
|
ISumForceByShearLoadLogic summaryForceLogic)
|
||||||
{
|
{
|
||||||
this.summaryForceLogic = summaryForceLogic;
|
this.summaryForceLogic = summaryForceLogic;
|
||||||
AxisAction = axisAction;
|
AxisAction = axisAction;
|
||||||
InclinedSection = inclinedSection;
|
InclinedSection = inclinedSection;
|
||||||
|
LimitState = limitState;
|
||||||
|
CalcTerm = calcTerm;
|
||||||
TraceLogger = traceLogger;
|
TraceLogger = traceLogger;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <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);
|
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||||
InitializeStrategies();
|
InitializeStrategies();
|
||||||
IForceTuple supportShearForce = AxisAction.SupportForce.ForceTuple;
|
IBeamShearAxisAction beamShearAxisAction = AxisAction.SupportAction;
|
||||||
TraceLogger?.AddMessage($"Shear force at support Qmax = {supportShearForce}(N)");
|
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($"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)");
|
||||||
ForceTuple summarySpanShearForce = new (Guid.NewGuid());
|
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);
|
IForceTuple summarySpanLoad = summaryForceLogic.GetSumShearForce(item, InclinedSection.StartCoord, InclinedSection.EndCoord);
|
||||||
ForceTupleService.SumTupleToTarget(summarySpanLoad, summarySpanShearForce);
|
ForceTupleService.SumTupleToTarget(summarySpanLoad, summarySpanShearForce);
|
||||||
@@ -65,5 +109,6 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
summaryForceLogic ??= new SumForceByShearLoadLogic(TraceLogger);
|
summaryForceLogic ??= new SumForceByShearLoadLogic(TraceLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
public class GetInclinedSectionListInputData : IGetInclinedSectionListInputData
|
public class GetInclinedSectionListInputData : IGetInclinedSectionListInputData
|
||||||
{
|
{
|
||||||
public int StepCount { get; set; } = 50;
|
public int StepCount { get; set; } = 50;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
public class GetInclinedSectionListLogic : IGetInclinedSectionListLogic
|
public class GetInclinedSectionListLogic : IGetInclinedSectionListLogic
|
||||||
{
|
{
|
||||||
private readonly GetInclinedSectionListInputData inputData;
|
private readonly IGetInclinedSectionListInputData inputData;
|
||||||
private IGetInclinedSectionLogic inclinedSectionLogic;
|
private IGetInclinedSectionLogic inclinedSectionLogic;
|
||||||
private double depth;
|
private double depth;
|
||||||
private double effectiveDepth;
|
private double effectiveDepth;
|
||||||
@@ -16,7 +16,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||||
|
|
||||||
public GetInclinedSectionListLogic(
|
public GetInclinedSectionListLogic(
|
||||||
GetInclinedSectionListInputData inputData,
|
IGetInclinedSectionListInputData inputData,
|
||||||
IShiftTraceLogger? traceLogger)
|
IShiftTraceLogger? traceLogger)
|
||||||
{
|
{
|
||||||
this.inputData = inputData;
|
this.inputData = inputData;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using StructureHelperCommon.Models.Shapes;
|
|||||||
|
|
||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
public class GetInclinedSectionLogic : IGetInclinedSectionLogic
|
public class GetInclinedSectionLogic : IGetInclinedSectionLogic
|
||||||
{
|
{
|
||||||
private readonly IBeamShearSection beamShearSection;
|
private readonly IBeamShearSection beamShearSection;
|
||||||
|
|||||||
@@ -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>
|
||||||
IForceTuple CalculateShearForce();
|
IForceTuple CalculateShearForceTuple();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
|||||||
namespace StructureHelperLogics.Models.BeamShears
|
namespace StructureHelperLogics.Models.BeamShears
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Implement logic for obtaining of inclined section
|
/// Implements logic for obtaining of inclined section
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGetInclinedSectionLogic : ILogic
|
public interface IGetInclinedSectionLogic : ILogic
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||||
InitializeStrategies();
|
InitializeStrategies();
|
||||||
double factor = getFactorLogic.GetFactor();
|
double factor = getFactorLogic.GetFactor();
|
||||||
IForceTuple directShearForce = getDirectShearForceLogic.CalculateShearForce();
|
IForceTuple directShearForce = getDirectShearForceLogic.CalculateShearForceTuple();
|
||||||
IForceTuple shearForce = ForceTupleService.MultiplyTupleByFactor(directShearForce,factor);
|
IForceTuple shearForce = ForceTupleService.MultiplyTupleByFactor(directShearForce,factor);
|
||||||
return shearForce;
|
return shearForce;
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
LimitState = InputData.LimitState,
|
LimitState = InputData.LimitState,
|
||||||
CalcTerm = InputData.CalcTerm
|
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)
|
if (concentratedForce.ForceCoordinate < limitCoordinate)
|
||||||
{
|
{
|
||||||
totalLoad = ForceTupleService.MultiplyTupleByFactor(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.Qy}(N) * {concentratedForce.LoadRatio} = {totalLoad}(N)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
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 sumFactor = distributedLoad.LoadRatio * loadLength;
|
double sumFactor = distributedLoad.LoadRatio * loadLength;
|
||||||
IForceTuple totalLoad = ForceTupleService.MultiplyTupleByFactor(distributedLoad.LoadValue, sumFactor);
|
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;
|
return totalLoad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
sumConcentratedForceLogic ??= new SumConcentratedForceLogic(TraceLogger);
|
sumConcentratedForceLogic ??= new SumConcentratedForceLogic(TraceLogger);
|
||||||
IForceTuple 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 concentrated force Qcf = {sumForce.Qy}(N)");
|
||||||
return sumForce;
|
return sumForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ namespace StructureHelperLogics.Models.BeamShears
|
|||||||
{
|
{
|
||||||
sumDistributedLoadLogic ??= new SumDistributedLoadLogic(TraceLogger);
|
sumDistributedLoadLogic ??= new SumDistributedLoadLogic(TraceLogger);
|
||||||
IForceTuple 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 uniformly distributed load Qud = {sumForce.Qy}(N)");
|
||||||
return sumForce;
|
return sumForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace StructureHelperTests.UnitTests.BeamShearTests
|
|||||||
// Arrange
|
// Arrange
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
double result = _logic.CalculateShearForce().Qy;
|
double result = _logic.CalculateShearForceTuple().Qy;
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.That(result, Is.EqualTo(150.0));
|
Assert.That(result, Is.EqualTo(150.0));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ 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(new ForceTuple() { Qy = 100.0 });
|
_mockGetDirectShearForceLogic.Setup(d => d.CalculateShearForceTuple()).Returns(new ForceTuple() { Qy = 100.0 });
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
double result = _logic.GetShearForce().Qy;
|
double result = _logic.GetShearForce().Qy;
|
||||||
|
|||||||
Reference in New Issue
Block a user