Logics of accidental eccentricity were separated and tested
This commit is contained in:
@@ -4,13 +4,16 @@ using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models.Sections;
|
||||
using StructureHelperCommon.Models.Sections.Logics;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using StructureHelperLogics.NdmCalculations.Buckling;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using System;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
@@ -19,6 +22,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
static readonly ForceCalculatorUpdateStrategy updateStrategy = new();
|
||||
private readonly IForceTupleCalculator forceTupleCalculator;
|
||||
private ForcesResults result;
|
||||
private IProcessorLogic<IForceTuple> eccentricityLogic;
|
||||
private ForceTupleBucklingLogic bucklingLogic;
|
||||
|
||||
public string Name { get; set; }
|
||||
public List<LimitStates> LimitStatesList { get; private set; }
|
||||
@@ -34,6 +39,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
var checkResult = CheckInputData();
|
||||
if (checkResult != "")
|
||||
{
|
||||
@@ -95,13 +101,14 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
CalcTerms calcTerm = tuple.CalcTerm;
|
||||
var ndms = NdmPrimitivesService.GetNdms(Primitives, limitState, calcTerm);
|
||||
IPoint2D point2D;
|
||||
IProcessorLogic<IForceTuple> forcelogic = new ForceTupleCopier(tuple.ForceTuple);
|
||||
if (combination.SetInGravityCenter == true)
|
||||
{
|
||||
var (Cx, Cy) = LoaderCalculator.Logics.Geometry.GeometryOperations.GetGravityCenter(ndms);
|
||||
point2D = new Point2D(){ X = Cx, Y = Cy };
|
||||
point2D = new Point2D() { X = Cx, Y = Cy };
|
||||
forcelogic = new ForceTupleMoveToPointDecorator(forcelogic) { Point2D = point2D};
|
||||
}
|
||||
else point2D = combination.ForcePoint;
|
||||
var newTuple = ForceTupleService.MoveTupleIntoPoint(tuple.ForceTuple, point2D);
|
||||
var newTuple = forcelogic.GetValue();
|
||||
TraceLogger?.AddMessage($"Input force combination");
|
||||
TraceLogger?.AddEntry(new TraceTablesFactory().GetByForceTuple(newTuple));
|
||||
if (CompressedMember.Buckling == true)
|
||||
@@ -109,27 +116,12 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
if (newTuple.Nz >= 0d)
|
||||
{
|
||||
TraceLogger?.AddMessage(string.Format("Second order effect is not considered as Nz={0} >= 0", newTuple.Nz));
|
||||
tupleResult = GetForceResult(limitState, calcTerm, ndms, newTuple);
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage("Get eccentricity for full load");
|
||||
newTuple = ProcessAccEccentricity(ndms, newTuple);
|
||||
var buckResult = GetForceTupleByBuckling(combination, limitState, calcTerm, ndms, newTuple);
|
||||
if (buckResult.isValid == true)
|
||||
{
|
||||
newTuple = buckResult.tuple;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ForcesTupleResult()
|
||||
{
|
||||
IsValid = false,
|
||||
DesignForceTuple = tuple,
|
||||
Description = buckResult.description,
|
||||
};
|
||||
}
|
||||
}
|
||||
tupleResult = GetForceResult(limitState, calcTerm, ndms, newTuple);
|
||||
tupleResult = ProcessCompressedMember(combination, tuple, ndms, newTuple);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -143,10 +135,19 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
return tupleResult;
|
||||
}
|
||||
|
||||
private (bool isValid, IForceTuple tuple, string description) GetForceTupleByBuckling(IForceCombinationList combination, LimitStates limitState, CalcTerms calcTerm, List<INdm> ndms, IForceTuple newTuple)
|
||||
private IForcesTupleResult ProcessCompressedMember(IForceCombinationList combination, IDesignForceTuple tuple, List<INdm> ndms, IForceTuple newTuple)
|
||||
{
|
||||
var tuple = newTuple.Clone() as IForceTuple;
|
||||
var inputData = new BucklingInputData()
|
||||
IForcesTupleResult tupleResult;
|
||||
LimitStates limitState = tuple.LimitState;
|
||||
CalcTerms calcTerm = tuple.CalcTerm;
|
||||
|
||||
TraceLogger?.AddMessage("Get eccentricity for full load");
|
||||
eccentricityLogic = new ProcessEccentricity(CompressedMember, ndms, newTuple)
|
||||
{
|
||||
TraceLogger = TraceLogger ?? null
|
||||
};
|
||||
newTuple = eccentricityLogic.GetValue();
|
||||
var buclingInputData = new BucklingInputData()
|
||||
{
|
||||
Combination = combination,
|
||||
LimitState = limitState,
|
||||
@@ -154,117 +155,42 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
Ndms = ndms,
|
||||
ForceTuple = newTuple
|
||||
};
|
||||
var bucklingResult = ProcessBuckling(inputData);
|
||||
|
||||
if (bucklingResult.IsValid != true)
|
||||
bucklingLogic = new ForceTupleBucklingLogic(buclingInputData)
|
||||
{
|
||||
TraceLogger?.AddMessage(bucklingResult.Description, TraceLogStatuses.Error);
|
||||
return (false, tuple, $"Buckling result:\n{bucklingResult.Description}");
|
||||
CompressedMember = CompressedMember,
|
||||
Accuracy = Accuracy,
|
||||
Primitives = Primitives,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
var buckResult = bucklingLogic.GetForceTupleByBuckling();
|
||||
if (buckResult.IsValid == true)
|
||||
{
|
||||
newTuple = buckResult.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
tuple = CalculateBuckling(tuple, bucklingResult);
|
||||
TraceLogger?.AddMessage(string.Intern("Force combination with considering of second order effects"));
|
||||
TraceLogger?.AddEntry(new TraceTablesFactory().GetByForceTuple(tuple));
|
||||
return new ForcesTupleResult()
|
||||
{
|
||||
IsValid = false,
|
||||
DesignForceTuple = tuple,
|
||||
Description = buckResult.Description,
|
||||
};
|
||||
}
|
||||
|
||||
return (true, tuple, string.Empty);
|
||||
TraceLogger?.AddMessage(string.Intern("Result of second order was obtained succesfully, new force combination was obtained"));
|
||||
tupleResult = GetForceResult(limitState, calcTerm, ndms, newTuple);
|
||||
return tupleResult;
|
||||
}
|
||||
|
||||
private IForcesTupleResult GetForceResult(LimitStates limitState, CalcTerms calcTerm, List<INdm> ndms, IForceTuple newTuple)
|
||||
{
|
||||
TraceLogger?.AddMessage("Calculation of cross-section is started");
|
||||
var tupleResult = GetPrimitiveStrainMatrix(ndms, newTuple, Accuracy);
|
||||
tupleResult.DesignForceTuple.LimitState = limitState;
|
||||
tupleResult.DesignForceTuple.CalcTerm = calcTerm;
|
||||
tupleResult.DesignForceTuple.ForceTuple = newTuple;
|
||||
return tupleResult;
|
||||
|
||||
}
|
||||
|
||||
private IForceTuple ProcessAccEccentricity(List<INdm> ndms, IForceTuple tuple)
|
||||
{
|
||||
var newTuple = tuple.Clone() as IForceTuple;
|
||||
var accLogic = new AccidentalEccentricityLogic()
|
||||
{
|
||||
Length = CompressedMember.GeometryLength,
|
||||
SizeX = ndms.Max(x => x.CenterX) - ndms.Min(x => x.CenterX),
|
||||
SizeY = ndms.Max(x => x.CenterY) - ndms.Min(x => x.CenterY),
|
||||
InitialForceTuple = newTuple,
|
||||
};
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
accLogic.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
newTuple = accLogic.GetForceTuple();
|
||||
return newTuple;
|
||||
}
|
||||
|
||||
private IConcreteBucklingResult ProcessBuckling(BucklingInputData inputData)
|
||||
{
|
||||
IForceTuple resultTuple;
|
||||
IForceTuple longTuple;
|
||||
if (inputData.CalcTerm == CalcTerms.LongTerm)
|
||||
{
|
||||
longTuple = inputData.ForceTuple;
|
||||
}
|
||||
else
|
||||
{
|
||||
longTuple = GetLongTuple(inputData.Combination.DesignForces, inputData.LimitState);
|
||||
}
|
||||
TraceLogger?.AddMessage("Get eccentricity for long term load");
|
||||
longTuple = ProcessAccEccentricity(inputData.Ndms, longTuple);
|
||||
var bucklingCalculator = GetBucklingCalculator(CompressedMember, inputData.LimitState, inputData.CalcTerm, inputData.ForceTuple, longTuple);
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
bucklingCalculator.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
bucklingCalculator.Run();
|
||||
var bucklingResult = bucklingCalculator.Result as IConcreteBucklingResult;
|
||||
|
||||
return bucklingResult;
|
||||
}
|
||||
|
||||
private IForceTuple GetLongTuple(List<IDesignForceTuple> designForces, LimitStates limitState)
|
||||
{
|
||||
IForceTuple longTuple;
|
||||
try
|
||||
{
|
||||
longTuple = designForces
|
||||
.Where(x => x.LimitState == limitState & x.CalcTerm == CalcTerms.LongTerm)
|
||||
.Single()
|
||||
.ForceTuple;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
longTuple = new ForceTuple();
|
||||
}
|
||||
return longTuple;
|
||||
}
|
||||
|
||||
private IConcreteBucklingCalculator GetBucklingCalculator(ICompressedMember compressedMember, LimitStates limitStates, CalcTerms calcTerms, IForceTuple calcTuple, IForceTuple longTuple)
|
||||
{
|
||||
var options = new ConcreteBucklingOptions()
|
||||
{
|
||||
CompressedMember = compressedMember,
|
||||
LimitState = limitStates,
|
||||
CalcTerm = calcTerms,
|
||||
CalcForceTuple = calcTuple,
|
||||
LongTermTuple = longTuple,
|
||||
Primitives = Primitives
|
||||
};
|
||||
var bucklingCalculator = new ConcreteBucklingCalculator(options, Accuracy);
|
||||
return bucklingCalculator;
|
||||
}
|
||||
|
||||
private ForceTuple CalculateBuckling(IForceTuple calcTuple, IConcreteBucklingResult bucklingResult)
|
||||
{
|
||||
var newTuple = calcTuple.Clone() as ForceTuple;
|
||||
newTuple.Mx *= bucklingResult.EtaFactorAlongY;
|
||||
newTuple.My *= bucklingResult.EtaFactorAlongX;
|
||||
return newTuple;
|
||||
}
|
||||
|
||||
|
||||
private string CheckInputData()
|
||||
{
|
||||
string result = "";
|
||||
|
||||
@@ -57,6 +57,66 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
otherNdms = ndmCollection.Except(concreteNdms).ToList();
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(LoggerStrings.MethodBasedOn + "SP63.13330.2018");
|
||||
var checkResult = CheckInputData();
|
||||
if (checkResult != "")
|
||||
{
|
||||
ProcessFalseResult(checkResult);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessValidResult();
|
||||
}
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculationHasDone);
|
||||
}
|
||||
|
||||
private void ProcessValidResult()
|
||||
{
|
||||
var phiLLogic = GetPhiLogic();
|
||||
var (DeltaLogicAboutX, DeltaLogicAboutY) = GetDeltaLogics();
|
||||
stiffnessLogicX = new RCStiffnessLogicSP63(phiLLogic, DeltaLogicAboutX);
|
||||
stiffnessLogicY = new RCStiffnessLogicSP63(phiLLogic, DeltaLogicAboutY);
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
stiffnessLogicX.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
stiffnessLogicY.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
criticalForceLogic = new EilerCriticalForceLogic();
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
criticalForceLogic.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
|
||||
var (EtaFactorX, EtaFactorY) = GetBucklingCoefficients();
|
||||
var messageString = "Eta factor orbitrary {0} axis, Eta{0} = {1} (dimensionless)";
|
||||
var messageStringX = string.Format(messageString, "X", EtaFactorX);
|
||||
var messageStringY = string.Format(messageString, "Y", EtaFactorY);
|
||||
TraceLogger?.AddMessage(messageStringX);
|
||||
TraceLogger?.AddMessage(messageStringY);
|
||||
Result = new ConcreteBucklingResult()
|
||||
{
|
||||
IsValid = true,
|
||||
EtaFactorAlongX = EtaFactorX,
|
||||
EtaFactorAlongY = EtaFactorY
|
||||
};
|
||||
}
|
||||
|
||||
private void ProcessFalseResult(string checkResult)
|
||||
{
|
||||
TraceLogger?.AddMessage(checkResult, TraceLogStatuses.Error);
|
||||
Result = new ConcreteBucklingResult()
|
||||
{
|
||||
IsValid = false,
|
||||
Description = checkResult,
|
||||
EtaFactorAlongX = double.PositiveInfinity,
|
||||
EtaFactorAlongY = double.PositiveInfinity
|
||||
};
|
||||
}
|
||||
|
||||
private (IConcreteDeltaELogic DeltaLogicX, IConcreteDeltaELogic DeltaLogicY) GetDeltaLogics()
|
||||
{
|
||||
IForceTuple forceTuple = options.CalcForceTuple;
|
||||
@@ -66,6 +126,15 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
}
|
||||
var eccentricityAlongX = options.CalcForceTuple.My / forceTuple.Nz;
|
||||
var eccentricityAlongY = options.CalcForceTuple.Mx / forceTuple.Nz;
|
||||
const string eccMesssage = "Eccentricity along {0}-axis e{0} = {1}(N * m) / {2}(N) = {3}(m)";
|
||||
TraceLogger?.AddMessage(string.Format(eccMesssage,
|
||||
"x",
|
||||
options.CalcForceTuple.My, forceTuple.Nz,
|
||||
eccentricityAlongX));
|
||||
TraceLogger?.AddMessage(string.Format(eccMesssage,
|
||||
"y",
|
||||
options.CalcForceTuple.Mx, forceTuple.Nz,
|
||||
eccentricityAlongY));
|
||||
var sizeAlongX = ndmCollection.Max(x => x.CenterX) - ndmCollection.Min(x => x.CenterX);
|
||||
var sizeAlongY = ndmCollection.Max(x => x.CenterY) - ndmCollection.Min(x => x.CenterY);
|
||||
var DeltaElogicAboutX = new DeltaELogicSP63(eccentricityAlongY, sizeAlongY);
|
||||
@@ -82,7 +151,7 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
{
|
||||
const string sumStif = "Summary stiffness";
|
||||
var gravityCenter = GeometryOperations.GetGravityCenter(ndmCollection);
|
||||
string message = string.Format("Gravity center, x = {0}, y = {1}", gravityCenter.Cx, gravityCenter.Cy);
|
||||
string message = string.Format("Gravity center, x = {0}(m), y = {1}(m)", gravityCenter.Cx, gravityCenter.Cy);
|
||||
TraceLogger?.AddMessage(message);
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
@@ -152,55 +221,7 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
return calculator;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(LoggerStrings.MethodBasedOn + "SP63.13330.2018");
|
||||
var checkResult = CheckInputData();
|
||||
if (checkResult != "")
|
||||
{
|
||||
TraceLogger?.AddMessage(checkResult, TraceLogStatuses.Error);
|
||||
Result = new ConcreteBucklingResult()
|
||||
{
|
||||
IsValid = false,
|
||||
Description = checkResult,
|
||||
EtaFactorAlongX = double.PositiveInfinity,
|
||||
EtaFactorAlongY = double.PositiveInfinity
|
||||
};
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
var phiLLogic = GetPhiLogic();
|
||||
var (DeltaLogicAboutX, DeltaLogicAboutY) = GetDeltaLogics();
|
||||
stiffnessLogicX = new RCStiffnessLogicSP63(phiLLogic, DeltaLogicAboutX);
|
||||
stiffnessLogicY = new RCStiffnessLogicSP63(phiLLogic, DeltaLogicAboutY);
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
stiffnessLogicX.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
stiffnessLogicY.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
criticalForceLogic = new EilerCriticalForceLogic();
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
criticalForceLogic.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
|
||||
var (EtaFactorX, EtaFactorY) = GetBucklingCoefficients();
|
||||
var messageString = "Eta factor orbitrary {0} axis, Eta{0} = {1} (dimensionless)";
|
||||
var messageStringX = string.Format(messageString, "X", EtaFactorX);
|
||||
var messageStringY = string.Format(messageString, "Y", EtaFactorY);
|
||||
TraceLogger?.AddMessage(messageStringX);
|
||||
TraceLogger?.AddMessage(messageStringY);
|
||||
Result = new ConcreteBucklingResult()
|
||||
{
|
||||
IsValid = true,
|
||||
EtaFactorAlongX = EtaFactorX,
|
||||
EtaFactorAlongY = EtaFactorY
|
||||
};
|
||||
}
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculationHasDone);
|
||||
}
|
||||
|
||||
|
||||
private string CheckInputData()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Models.Sections;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
{
|
||||
public class ForceTupleBucklingLogic : IForceTupleBucklingLogic
|
||||
{
|
||||
private IProcessorLogic<IForceTuple> eccentricityLogic;
|
||||
private BucklingInputData bucklingInputData;
|
||||
|
||||
public ICompressedMember CompressedMember { get; set; }
|
||||
public IAccuracy Accuracy { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public IEnumerable<INdmPrimitive> Primitives { get; set; }
|
||||
|
||||
public ForceTupleBucklingLogic(BucklingInputData inputData)
|
||||
{
|
||||
bucklingInputData = inputData;
|
||||
}
|
||||
|
||||
public GenericResult<IForceTuple> GetForceTupleByBuckling()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
|
||||
var tuple = bucklingInputData.ForceTuple.Clone() as IForceTuple;
|
||||
|
||||
var bucklingResult = ProcessBuckling(bucklingInputData);
|
||||
|
||||
if (bucklingResult.IsValid != true)
|
||||
{
|
||||
TraceLogger?.AddMessage(bucklingResult.Description, TraceLogStatuses.Error);
|
||||
var tupleResult = new GenericResult<IForceTuple>()
|
||||
{
|
||||
IsValid = false,
|
||||
Description = $"Buckling result:\n{bucklingResult.Description}",
|
||||
Value = tuple
|
||||
};
|
||||
return tupleResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
tuple = CalculateBuckling(tuple, bucklingResult);
|
||||
TraceLogger?.AddMessage(string.Intern("Force combination with considering of second order effects"));
|
||||
TraceLogger?.AddEntry(new TraceTablesFactory().GetByForceTuple(tuple));
|
||||
}
|
||||
var trueTupleResult = new GenericResult<IForceTuple>()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
Value = tuple
|
||||
};
|
||||
return trueTupleResult;
|
||||
}
|
||||
|
||||
private IConcreteBucklingResult ProcessBuckling(BucklingInputData inputData)
|
||||
{
|
||||
IForceTuple resultTuple;
|
||||
IForceTuple longTuple;
|
||||
if (inputData.CalcTerm == CalcTerms.LongTerm)
|
||||
{
|
||||
longTuple = inputData.ForceTuple;
|
||||
}
|
||||
else
|
||||
{
|
||||
longTuple = GetLongTuple(inputData.Combination.DesignForces, inputData.LimitState);
|
||||
}
|
||||
TraceLogger?.AddMessage("Get eccentricity for long term load");
|
||||
eccentricityLogic = new ProcessEccentricity(CompressedMember, inputData.Ndms, longTuple)
|
||||
{
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
longTuple = eccentricityLogic.GetValue();
|
||||
var bucklingCalculator = GetBucklingCalculator(inputData.LimitState, inputData.CalcTerm, inputData.ForceTuple, longTuple);
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
bucklingCalculator.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
bucklingCalculator.Run();
|
||||
var bucklingResult = bucklingCalculator.Result as IConcreteBucklingResult;
|
||||
|
||||
return bucklingResult;
|
||||
}
|
||||
|
||||
private IForceTuple GetLongTuple(List<IDesignForceTuple> designForces, LimitStates limitState)
|
||||
{
|
||||
IForceTuple longTuple;
|
||||
try
|
||||
{
|
||||
longTuple = designForces
|
||||
.Where(x => x.LimitState == limitState & x.CalcTerm == CalcTerms.LongTerm)
|
||||
.Single()
|
||||
.ForceTuple;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
longTuple = new ForceTuple();
|
||||
}
|
||||
return longTuple;
|
||||
}
|
||||
|
||||
private IConcreteBucklingCalculator GetBucklingCalculator(LimitStates limitStates, CalcTerms calcTerms, IForceTuple calcTuple, IForceTuple longTuple)
|
||||
{
|
||||
var options = new ConcreteBucklingOptions()
|
||||
{
|
||||
CompressedMember = CompressedMember,
|
||||
LimitState = limitStates,
|
||||
CalcTerm = calcTerms,
|
||||
CalcForceTuple = calcTuple,
|
||||
LongTermTuple = longTuple,
|
||||
Primitives = Primitives
|
||||
};
|
||||
var bucklingCalculator = new ConcreteBucklingCalculator(options, Accuracy);
|
||||
return bucklingCalculator;
|
||||
}
|
||||
|
||||
private ForceTuple CalculateBuckling(IForceTuple calcTuple, IConcreteBucklingResult bucklingResult)
|
||||
{
|
||||
var newTuple = calcTuple.Clone() as ForceTuple;
|
||||
newTuple.Mx *= bucklingResult.EtaFactorAlongY;
|
||||
newTuple.My *= bucklingResult.EtaFactorAlongX;
|
||||
return newTuple;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
{
|
||||
public interface IForceTupleBucklingLogic : ILogic
|
||||
{
|
||||
GenericResult<IForceTuple> GetForceTupleByBuckling();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Sections;
|
||||
using StructureHelperCommon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
{
|
||||
public class ProcessEccentricity : IProcessorLogic<IForceTuple>
|
||||
{
|
||||
private IProcessorLogic<IForceTuple> eccentricityLogic;
|
||||
|
||||
public ICompressedMember CompressedMember { get; private set; }
|
||||
public IEnumerable<INdm> Ndms { get; private set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public IForceTuple InputForceTuple { get; set; }
|
||||
|
||||
private double sizeX;
|
||||
private double sizeY;
|
||||
|
||||
public ProcessEccentricity(IProcessorLogic<IForceTuple> eccentricityLogic)
|
||||
{
|
||||
this.eccentricityLogic = eccentricityLogic;
|
||||
}
|
||||
public ProcessEccentricity(ICompressedMember compressedMember, IEnumerable<INdm> ndms, IForceTuple initialForceTuple)
|
||||
{
|
||||
CompressedMember = compressedMember;
|
||||
Ndms = ndms;
|
||||
InputForceTuple = initialForceTuple;
|
||||
sizeX = ndms.Max(x => x.CenterX) - ndms.Min(x => x.CenterX);
|
||||
sizeY = ndms.Max(x => x.CenterY) - ndms.Min(x => x.CenterY);
|
||||
eccentricityLogic = new RcEccentricityLogic()
|
||||
{
|
||||
InputForceTuple = InputForceTuple,
|
||||
Length = CompressedMember.GeometryLength,
|
||||
SizeX = sizeX,
|
||||
SizeY = sizeY,
|
||||
};
|
||||
}
|
||||
|
||||
public IForceTuple GetValue()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage("Get eccentricity taking into account accidental eccentricity");
|
||||
TraceLogger?.AddMessage(string.Format("Cross-section size along x-axis dx = {0}, along y-axis dy = {1}", sizeX, sizeY));
|
||||
|
||||
eccentricityLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||
var newTuple = eccentricityLogic.GetValue();
|
||||
return newTuple;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user