Tuple cracl calculator was changed
This commit is contained in:
@@ -35,6 +35,10 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
CalcTerm = shortTerm,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
}
|
||||
public CrackedSectionTriangulationLogic()
|
||||
{
|
||||
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public List<INdm> GetNdmCollection()
|
||||
@@ -66,14 +70,14 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public List<RebarPrimitive> GetRebarPrimitives()
|
||||
public List<IRebarPrimitive> GetRebarPrimitives()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Debug);
|
||||
TraceLogger?.AddMessage(ndmPrimitiveCountMessage, TraceLogStatuses.Debug);
|
||||
List<RebarPrimitive> rebarPrimitives = new();
|
||||
List<IRebarPrimitive> rebarPrimitives = new();
|
||||
foreach (var item in NdmPrimitives)
|
||||
{
|
||||
if (item is RebarPrimitive rebar)
|
||||
if (item is IRebarPrimitive rebar)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Primitive {rebar.Name} is rebar primitive", TraceLogStatuses.Service);
|
||||
rebarPrimitives.Add(rebar);
|
||||
@@ -86,7 +90,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <inheritdoc/>
|
||||
public List<INdm> GetElasticNdmCollection()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Debug);
|
||||
TraceLogger?.AddMessage(ndmPrimitiveCountMessage, TraceLogStatuses.Debug);
|
||||
triangulateLogic = new TriangulatePrimitiveLogic(new MeshElasticLogic())
|
||||
{
|
||||
|
||||
@@ -37,6 +37,6 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// Return collection of primitives which contain only rebars
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<RebarPrimitive> GetRebarPrimitives();
|
||||
List<IRebarPrimitive> GetRebarPrimitives();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// </summary>
|
||||
public interface ILengthBetweenCracksLogic : ILogic
|
||||
{
|
||||
#error
|
||||
//to do change to primitive collection since it is required to gain difference rebar strain and concrete strain
|
||||
/// <summary>
|
||||
/// Full collection of ndm parts of cross-section
|
||||
/// </summary>
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
TupleCrackInputData InputData { get; set; }
|
||||
double LongLength { get; set; }
|
||||
IEnumerable<RebarPrimitive> Rebars { get; set; }
|
||||
IEnumerable<IRebarPrimitive> Rebars { get; set; }
|
||||
double ShortLength { get; set; }
|
||||
|
||||
List<IRebarCrackCalculator> GetCalculators();
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface IRebarCrackInputDataFactory
|
||||
{
|
||||
RebarPrimitive Rebar { get; set; }
|
||||
IRebarPrimitive Rebar { get; set; }
|
||||
TupleCrackInputData InputData { get; set; }
|
||||
double LongLength { get; set; }
|
||||
double ShortLength { get; set; }
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
TupleCrackInputData InputData { get; set; }
|
||||
bool IsResultValid { get; }
|
||||
double LongLength { get; set; }
|
||||
IEnumerable<RebarPrimitive> Rebars { get; set; }
|
||||
IEnumerable<IRebarPrimitive> Rebars { get; set; }
|
||||
List<RebarCrackResult> Result { get; }
|
||||
double ShortLength { get; set; }
|
||||
|
||||
|
||||
@@ -35,7 +35,9 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <inheritdoc/>
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public LengthBetweenCracksLogicSP63(IAverageDiameterLogic diameterLogic, ITensileConcreteAreaLogic concreteAreaLogic, ITensionRebarAreaLogic rebarAreaLogic)
|
||||
public LengthBetweenCracksLogicSP63(IAverageDiameterLogic diameterLogic,
|
||||
ITensileConcreteAreaLogic concreteAreaLogic,
|
||||
ITensionRebarAreaLogic rebarAreaLogic)
|
||||
{
|
||||
this.diameterLogic = diameterLogic;
|
||||
this.concreteAreaLogic = concreteAreaLogic;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
private IRebarCrackInputDataFactory inputFactory;
|
||||
|
||||
public IEnumerable<RebarPrimitive> Rebars { get; set; }
|
||||
public IEnumerable<IRebarPrimitive> Rebars { get; set; }
|
||||
public TupleCrackInputData InputData { get; set; }
|
||||
public double LongLength { get; set; }
|
||||
public double ShortLength { get; set; }
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
}
|
||||
|
||||
public RebarPrimitive Rebar { get; set; }
|
||||
public IRebarPrimitive Rebar { get; set; }
|
||||
public TupleCrackInputData InputData { get; set; }
|
||||
public double LongLength { get; set; }
|
||||
public double ShortLength { get; set; }
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
}
|
||||
public double GetTensionRebarArea()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Debug);
|
||||
TraceLogger?.AddMessage("Method of obtaining of summary area of rebars in tension based on areas which are proportional by maximum strain");
|
||||
var rebars = Rebars
|
||||
.Where(x => stressLogic.GetSectionStrain(StrainMatrix, x) > 0d);
|
||||
|
||||
@@ -22,10 +22,11 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
private const CalcTerms crackingTerm = CalcTerms.ShortTerm;
|
||||
private const LimitStates crackingLimitState = LimitStates.SLS;
|
||||
private static readonly ILengthBetweenCracksLogic lengthLogic = new LengthBetweenCracksLogicSP63();
|
||||
private ILengthBetweenCracksLogic lengthLogic;
|
||||
private TupleCrackResult result;
|
||||
private ICrackedSectionTriangulationLogic triangulationLogic;
|
||||
private List<RebarPrimitive>? rebarPrimitives;
|
||||
private ITupleRebarsCrackSolver solver;
|
||||
private List<IRebarPrimitive>? rebarPrimitives;
|
||||
private IEnumerable<INdm> crackableNdms;
|
||||
private IEnumerable<INdm> crackedNdms;
|
||||
private IEnumerable<INdm> elasticNdms;
|
||||
@@ -42,12 +43,19 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public TupleCrackCalculator(ICheckInputDataLogic<TupleCrackInputData> checkInputDataLogic)
|
||||
public TupleCrackCalculator(ICheckInputDataLogic<TupleCrackInputData> checkInputDataLogic,
|
||||
ILengthBetweenCracksLogic lengthLogic, ICrackedSectionTriangulationLogic triangulationLogic, ITupleRebarsCrackSolver solver)
|
||||
{
|
||||
this.checkInputDataLogic = checkInputDataLogic;
|
||||
this.lengthLogic = lengthLogic;
|
||||
this.triangulationLogic = triangulationLogic;
|
||||
this.solver = solver;
|
||||
}
|
||||
|
||||
public TupleCrackCalculator() : this (new CheckTupleCalculatorInputDataLogic())
|
||||
public TupleCrackCalculator() : this (new CheckTupleCalculatorInputDataLogic(),
|
||||
new LengthBetweenCracksLogicSP63(),
|
||||
new CrackedSectionTriangulationLogic(),
|
||||
new TupleRebarsCrackSolver())
|
||||
{
|
||||
|
||||
}
|
||||
@@ -134,7 +142,6 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
private void SolveRebarResult()
|
||||
{
|
||||
result.RebarResults.Clear();
|
||||
ITupleRebarsCrackSolver solver = new TupleRebarsCrackSolver();
|
||||
solver.Rebars = rebarPrimitives;
|
||||
solver.InputData = InputData;
|
||||
solver.LongLength = longLength;
|
||||
@@ -177,13 +184,10 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
private double GetLengthBetweenCracks(StrainTuple strainTuple)
|
||||
{
|
||||
var logic = new LengthBetweenCracksLogicSP63()
|
||||
{
|
||||
NdmCollection = elasticNdms,
|
||||
TraceLogger = TraceLogger
|
||||
};
|
||||
logic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
||||
return logic.GetLength();
|
||||
lengthLogic.NdmCollection = elasticNdms;
|
||||
lengthLogic.TraceLogger = TraceLogger;
|
||||
lengthLogic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
||||
return lengthLogic.GetLength();
|
||||
}
|
||||
|
||||
private void Triangulate()
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
private IRebarCalulatorsFactory calculatorsFactory;
|
||||
|
||||
public IEnumerable<RebarPrimitive> Rebars { get; set; }
|
||||
public IEnumerable<IRebarPrimitive> Rebars { get; set; }
|
||||
public TupleCrackInputData InputData { get; set; }
|
||||
public double LongLength { get; set; }
|
||||
public double ShortLength { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user