Tuple crack calculator was changed
This commit is contained in:
@@ -40,7 +40,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
var checkResult = CheckInputData();
|
||||
if (checkResult != "")
|
||||
if (checkResult != string.Empty)
|
||||
{
|
||||
Result = new ForcesResults()
|
||||
{
|
||||
@@ -49,11 +49,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
};
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetCombinations();
|
||||
CalculateResult();
|
||||
}
|
||||
GetCombinations();
|
||||
CalculateResult();
|
||||
}
|
||||
|
||||
private void CalculateResult()
|
||||
@@ -199,18 +196,10 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
private string CheckInputData()
|
||||
{
|
||||
string result = "";
|
||||
try
|
||||
string result = string.Empty;
|
||||
if (! Primitives.Any())
|
||||
{
|
||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
||||
{
|
||||
Primitives = Primitives
|
||||
};
|
||||
triangulateLogic.CheckPrimitives(Primitives);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result += ex;
|
||||
result += "Calculator does not contain any primitives \n";
|
||||
}
|
||||
if (ForceActions.Count == 0)
|
||||
{
|
||||
@@ -222,8 +211,20 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
}
|
||||
if (CalcTermsList.Count == 0)
|
||||
{
|
||||
result += "Calculator does not contain any duration \n";
|
||||
result += "Calculator does not contain any calc term \n";
|
||||
}
|
||||
//try
|
||||
//{
|
||||
// triangulateLogic = new TriangulatePrimitiveLogic()
|
||||
// {
|
||||
// Primitives = Primitives
|
||||
// };
|
||||
// triangulateLogic.CheckPrimitives(Primitives);
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// result += ex;
|
||||
//}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -11,22 +13,30 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public class AverageDiameterLogic : IAverageDiameterLogic
|
||||
{
|
||||
public IEnumerable<RebarNdm> Rebars { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public double GetAverageDiameter()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
Check();
|
||||
var rebarArea = Rebars
|
||||
.Sum(x => x.Area);
|
||||
TraceLogger?.AddMessage($"Summary rebar area As = {rebarArea}");
|
||||
var rebarCount = Rebars.Count();
|
||||
TraceLogger?.AddMessage($"Rebar count n = {rebarCount}");
|
||||
var averageArea = rebarArea / rebarCount;
|
||||
TraceLogger?.AddMessage($"Average rebar area As = {averageArea}");
|
||||
var diameter = Math.Sqrt(averageArea / Math.PI);
|
||||
TraceLogger?.AddMessage($"Average rebar diameter ds = {diameter}");
|
||||
return diameter;
|
||||
}
|
||||
private void Check()
|
||||
{
|
||||
if (!Rebars.Any())
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": rebars count must be greater then zero");
|
||||
string errorString = ErrorStrings.DataIsInCorrect + $": rebars count must be greater then zero";
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -11,9 +13,12 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
CrackWidthLogicInputDataSP63 inputData;
|
||||
public ICrackWidthLogicInputData InputData {get;set;}
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public double GetCrackWidth()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage("Method of crack width calculation based on SP 63.13330.2018");
|
||||
CheckOptions();
|
||||
//check if strain of concrete greater than strain of rebar
|
||||
if (inputData.ConcreteStrain > inputData.RebarStrain) { return 0d; }
|
||||
@@ -24,31 +29,42 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
private void CheckOptions()
|
||||
{
|
||||
string errorString = string.Empty;
|
||||
if (InputData is not CrackWidthLogicInputDataSP63)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(CrackWidthLogicInputDataSP63), InputData.GetType()));
|
||||
errorString = ErrorStrings.ExpectedWas(typeof(CrackWidthLogicInputDataSP63), InputData.GetType());
|
||||
}
|
||||
inputData = InputData as CrackWidthLogicInputDataSP63;
|
||||
if (inputData.Length <=0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": length between cracks L={inputData.Length} must be greate than zero");
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": length between cracks L={inputData.Length} must be greate than zero";
|
||||
}
|
||||
if (inputData.TermFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Term factor {inputData.TermFactor} must be greate than zero");
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Term factor {inputData.TermFactor} must be greate than zero";
|
||||
|
||||
}
|
||||
if (inputData.BondFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Bond factor {inputData.BondFactor} must be greate than zero");
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor {inputData.BondFactor} must be greate than zero";
|
||||
|
||||
}
|
||||
if (inputData.StressStateFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Bond factor {inputData.StressStateFactor} must be greate than zero");
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": Bond factor {inputData.StressStateFactor} must be greate than zero";
|
||||
|
||||
}
|
||||
if (inputData.PsiSFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": PsiS factor {inputData.PsiSFactor} must be greate than zero");
|
||||
errorString = ErrorStrings.DataIsInCorrect + $": PsiS factor {inputData.PsiSFactor} must be greate than zero";
|
||||
|
||||
}
|
||||
if (errorString != string.Empty)
|
||||
{
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackedSectionTriangulationLogic : ICrackedSectionTriangulationLogic
|
||||
{
|
||||
const LimitStates limitState = LimitStates.SLS;
|
||||
const CalcTerms shortTerm = CalcTerms.ShortTerm;
|
||||
|
||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||
private string ndmPrimitiveCountMessage;
|
||||
|
||||
public IEnumerable<INdmPrimitive> NdmPrimitives { get; private set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public CrackedSectionTriangulationLogic(IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
NdmPrimitives = ndmPrimitives;
|
||||
ndmPrimitiveCountMessage = $"Source collection containes {NdmPrimitives.Count()} primitives";
|
||||
triangulateLogic = new TriangulatePrimitiveLogic
|
||||
{
|
||||
Primitives = NdmPrimitives,
|
||||
LimitState = limitState,
|
||||
CalcTerm = shortTerm,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
}
|
||||
public List<INdm> GetNdmCollection()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(ndmPrimitiveCountMessage, TraceLogStatuses.Debug);
|
||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
||||
{
|
||||
LimitState = limitState,
|
||||
CalcTerm = shortTerm,
|
||||
Primitives = NdmPrimitives,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
return triangulateLogic.GetNdms();
|
||||
}
|
||||
public List<INdm> GetCrackedNdmCollection()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(ndmPrimitiveCountMessage, TraceLogStatuses.Debug);
|
||||
triangulateLogic = new TriangulatePrimitiveLogic(new MeshCrackedConcreteLogic())
|
||||
{
|
||||
LimitState = limitState,
|
||||
CalcTerm = shortTerm,
|
||||
Primitives = NdmPrimitives,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
return triangulateLogic.GetNdms();
|
||||
}
|
||||
|
||||
public List<RebarPrimitive> GetRebarPrimitives()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(ndmPrimitiveCountMessage, TraceLogStatuses.Debug);
|
||||
List<RebarPrimitive> rebarPrimitives = new();
|
||||
foreach (var item in NdmPrimitives)
|
||||
{
|
||||
if (item is RebarPrimitive rebar)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Primitive {rebar.Name} is rebar primitive", TraceLogStatuses.Service);
|
||||
rebarPrimitives.Add(rebar);
|
||||
}
|
||||
}
|
||||
TraceLogger?.AddMessage($"Obtained {rebarPrimitives.Count} rebar primitives");
|
||||
return rebarPrimitives;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface IAverageDiameterLogic
|
||||
public interface IAverageDiameterLogic : ILogic
|
||||
{
|
||||
IEnumerable<RebarNdm> Rebars { get; set; }
|
||||
double GetAverageDiameter();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -9,7 +10,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <summary>
|
||||
/// Logic for calculating width of crack
|
||||
/// </summary>
|
||||
public interface ICrackWidthLogic
|
||||
public interface ICrackWidthLogic : ILogic
|
||||
{
|
||||
ICrackWidthLogicInputData InputData { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Logic for obtaining of collection of nms elementary part for regular and fully cracked section
|
||||
/// </summary>
|
||||
public interface ICrackedSectionTriangulationLogic : ILogic
|
||||
{
|
||||
/// <summary>
|
||||
/// Source collection of ndm primitives
|
||||
/// </summary>
|
||||
IEnumerable<INdmPrimitive> NdmPrimitives { get; }
|
||||
/// <summary>
|
||||
/// Returns collection of ndm elementary parts
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<INdm> GetNdmCollection();
|
||||
/// <summary>
|
||||
/// Returns collection of ndm elementary parts where concrete doesn't work in tension
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<INdm> GetCrackedNdmCollection();
|
||||
/// <summary>
|
||||
/// Return collection of primitives which contain only rebars
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<RebarPrimitive> GetRebarPrimitives();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -12,7 +13,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
/// <summary>
|
||||
/// Logic fo calculating of tensile area of RC crosssection
|
||||
/// </summary>
|
||||
public interface ITensileAreaLogic
|
||||
public interface ITensileAreaLogic : ILogic
|
||||
{
|
||||
IEnumerable<INdm> NdmCollection { get; set; }
|
||||
IStrainMatrix StrainMatrix { get; set; }
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -18,6 +22,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
readonly IAverageDiameterLogic diameterLogic;
|
||||
readonly ITensileAreaLogic tensileAreaLogic;
|
||||
IStressLogic stressLogic;
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public IStrainMatrix StrainMatrix { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
@@ -26,6 +31,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
this.diameterLogic = diameterLogic;
|
||||
this.tensileAreaLogic = tensileAreaLogic;
|
||||
stressLogic = new StressLogic();
|
||||
}
|
||||
public LengthBetweenCracksLogicSP63() :
|
||||
this
|
||||
@@ -34,18 +40,43 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{ }
|
||||
public double GetLength()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
var rebars = NdmCollection
|
||||
.Where(x => x is RebarNdm)
|
||||
.Where(x => x is RebarNdm & stressLogic.GetTotalStrain(StrainMatrix, x) > 0d)
|
||||
.Select(x => x as RebarNdm);
|
||||
if (! rebars.Any())
|
||||
{
|
||||
string errorString = ErrorStrings.DataIsInCorrect + ": Collection of rebars does not contain any tensile rebars";
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
if (TraceLogger is not null)
|
||||
{
|
||||
TraceService.TraceNdmCollection(TraceLogger, rebars);
|
||||
}
|
||||
var rebarArea = rebars.Sum(x => x.Area * x.StressScale);
|
||||
TraceLogger?.AddMessage($"Summary rebar area As = {rebarArea}");
|
||||
diameterLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||
diameterLogic.Rebars = rebars;
|
||||
var rebarDiameter = diameterLogic.GetAverageDiameter();
|
||||
TraceLogger?.AddMessage($"Average rebar diameter ds = {rebarDiameter}");
|
||||
tensileAreaLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||
tensileAreaLogic.NdmCollection = NdmCollection;
|
||||
tensileAreaLogic.StrainMatrix = StrainMatrix;
|
||||
var concreteArea = tensileAreaLogic.GetTensileArea();
|
||||
TraceLogger?.AddMessage($"Concrete effective area Ac,eff = {concreteArea}(m^2)");
|
||||
var length = concreteArea / rebarArea * rebarDiameter;
|
||||
length = new List<double> { length, minDiameterFactor * rebarDiameter, minLength }.Max();
|
||||
length = new List<double> { length, maxDiameterFactor * rebarDiameter, maxLength }.Min();
|
||||
TraceLogger?.AddMessage($"Base length between cracks Lcrc = {concreteArea} / {rebarArea} * {rebarDiameter} = {length}(m)");
|
||||
double minLengthByDiameter = minDiameterFactor * rebarDiameter;
|
||||
TraceLogger?.AddMessage($"Minimum length by diameter Lcrc = {minDiameterFactor} * {rebarDiameter} = {minLengthByDiameter}(m)");
|
||||
TraceLogger?.AddMessage($"Minimum length Lcrc = {minLength}");
|
||||
length = new List<double> { length, minLengthByDiameter, minLength }.Max();
|
||||
TraceLogger?.AddMessage($"Minimum length Lcrc = max({length}, {minLengthByDiameter}, {minLength}) = {length}(m)");
|
||||
double maxLengthByDiameter = maxDiameterFactor * rebarDiameter;
|
||||
TraceLogger?.AddMessage($"Maximum length by diameter Lcrc = {maxDiameterFactor} * {rebarDiameter} = {maxLengthByDiameter}(m)");
|
||||
TraceLogger?.AddMessage($"Maximum length Lcrc = {maxLength}");
|
||||
length = new List<double> { length, maxLengthByDiameter, maxLength }.Min();
|
||||
TraceLogger?.AddMessage($"Maximun length Lcrc = min({length}, {maxLengthByDiameter}, {maxLength}) = {length}(m)");
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -16,29 +18,44 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
const double maxConcreteFactor = 0.5d;
|
||||
const double minConcreteFactor = 0.1d;
|
||||
const double minRebarFactor = 3d;
|
||||
const double minRebarFactor = 9d;
|
||||
private static IStressLogic stressLogic => new StressLogic();
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public IStrainMatrix StrainMatrix { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public double GetTensileArea()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
|
||||
var rebarCollection = NdmCollection
|
||||
.Where(x => x is RebarNdm);
|
||||
.Where(x => x is RebarNdm & stressLogic.GetTotalStrain(StrainMatrix, x) > 0d);
|
||||
var rebarArea = rebarCollection.
|
||||
Sum(x => x.Area * x.StressScale);
|
||||
TraceLogger?.AddMessage($"Summary rebar area As = {rebarArea}");
|
||||
var concreteCollection = NdmCollection
|
||||
.Where(x => x.Material is ConcreteMaterial);
|
||||
var concreteArea = concreteCollection
|
||||
.Sum(x => x.Area * x.StressScale);
|
||||
TraceLogger?.AddMessage($"Concrete area Ac = {concreteArea}");
|
||||
var concreteTensileArea = concreteCollection
|
||||
.Where(x => stressLogic.GetTotalStrainWithPrestrain(StrainMatrix, x) > 0d)
|
||||
.Sum(x => x.Area * x.StressScale);
|
||||
|
||||
concreteTensileArea = Math.Max(concreteTensileArea, rebarArea * minRebarFactor);
|
||||
concreteTensileArea = Math.Max(concreteTensileArea, concreteArea * minConcreteFactor);
|
||||
concreteTensileArea = Math.Min(concreteTensileArea, concreteArea * maxConcreteFactor);
|
||||
TraceLogger?.AddMessage($"Concrete tensile area Ac,t = {concreteTensileArea}");
|
||||
|
||||
double areaByRebar = rebarArea * minRebarFactor;
|
||||
TraceLogger?.AddMessage($"Concrete area is considered not less than {minRebarFactor} of area of rebars");
|
||||
TraceLogger?.AddMessage($"Minimum concrete effective area from area of rebar Ac,eff = {rebarArea} * {minRebarFactor} = {areaByRebar}");
|
||||
concreteTensileArea = Math.Max(concreteTensileArea, areaByRebar);
|
||||
double areaByMinConcreteFactor = concreteArea * minConcreteFactor;
|
||||
TraceLogger?.AddMessage($"Concrete area is considered not less than {minConcreteFactor} of area of rebars");
|
||||
TraceLogger?.AddMessage($"Minimum concrete effective area Ac,eff = {concreteArea} * {minConcreteFactor} = {areaByMinConcreteFactor}");
|
||||
concreteTensileArea = Math.Max(concreteTensileArea, areaByMinConcreteFactor);
|
||||
double areaByMaxConcreteFactor = concreteArea * maxConcreteFactor;
|
||||
TraceLogger?.AddMessage($"Concrete area is considered not greater than {maxConcreteFactor} of area of rebars");
|
||||
TraceLogger?.AddMessage($"Maximum concrete effective area Ac,eff = {concreteArea} * {maxConcreteFactor} = {areaByMaxConcreteFactor}");
|
||||
concreteTensileArea = Math.Min(concreteTensileArea, areaByMaxConcreteFactor);
|
||||
TraceLogger?.AddMessage($"Concrete effective area Ac,eff = {concreteTensileArea}");
|
||||
return concreteTensileArea;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,13 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
private static readonly ILengthBetweenCracksLogic lengthLogic = new LengthBetweenCracksLogicSP63();
|
||||
private TupleCrackResult result;
|
||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
||||
private ICrackedSectionTriangulationLogic triangulationLogic;
|
||||
private List<RebarPrimitive>? rebarPrimitives;
|
||||
private IEnumerable<INdm> defaultNdm;
|
||||
private IEnumerable<INdm> fulyCrackedNdm;
|
||||
private IEnumerable<INdm> defaultNdms;
|
||||
private IEnumerable<INdm> fulyCrackedNdms;
|
||||
private CrackForceResult crackForceResult;
|
||||
private StrainTuple strainTuple;
|
||||
private StrainTuple longDefaultStrainTuple;
|
||||
private StrainTuple shortDefaultStrainTuple;
|
||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||
|
||||
public string Name { get; set; }
|
||||
@@ -37,6 +39,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
try
|
||||
{
|
||||
TraceLogger?.AddMessage($"Calculation of crack width by force combination");
|
||||
ProcessCalculations();
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculationHasDone);
|
||||
|
||||
@@ -46,7 +49,6 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
result.IsValid = false;
|
||||
result.Description += ex;
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculationError + ex, TraceLogStatuses.Error);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,7 +66,10 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
CheckInputData();
|
||||
Triangulate();
|
||||
CalcStrainMatrix();
|
||||
longDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple, defaultNdms);
|
||||
shortDefaultStrainTuple = CalcStrainMatrix(InputData.LongTermTuple, defaultNdms);
|
||||
var longLength = GetLengthBetweenCracks(longDefaultStrainTuple);
|
||||
var shortLength = GetLengthBetweenCracks(shortDefaultStrainTuple);
|
||||
CalcCrackForce();
|
||||
var crackInputData = GetCrackInputData();
|
||||
var calculator = new RebarCrackCalculator
|
||||
@@ -77,63 +82,69 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
crackInputData.RebarPrimitive = item;
|
||||
calculator.Run();
|
||||
var rebarResult = calculator.Result as RebarCrackResult;
|
||||
//if (crackForceResult.IsSectionCracked == false)
|
||||
//{
|
||||
// rebarResult.CrackWidth = 0d;
|
||||
//}
|
||||
result.RebarResults.Add(rebarResult);
|
||||
}
|
||||
}
|
||||
|
||||
private void CalcStrainMatrix()
|
||||
private StrainTuple CalcStrainMatrix(IForceTuple forceTuple, IEnumerable<INdm> ndms)
|
||||
{
|
||||
IForceTupleInputData inputData = new ForceTupleInputData() { NdmCollection = defaultNdm, Tuple = InputData.LongTermTuple};
|
||||
IForceTupleCalculator calculator = new ForceTupleCalculator() { InputData = inputData };
|
||||
IForceTupleInputData inputData = new ForceTupleInputData()
|
||||
{
|
||||
NdmCollection = ndms,
|
||||
Tuple = forceTuple
|
||||
};
|
||||
IForceTupleCalculator calculator = new ForceTupleCalculator()
|
||||
{
|
||||
InputData = inputData,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
calculator.Run();
|
||||
var forceResult = calculator.Result as IForcesTupleResult;
|
||||
strainTuple = TupleConverter.ConvertToStrainTuple(forceResult.LoaderResults.StrainMatrix);
|
||||
var strain = TupleConverter.ConvertToStrainTuple(forceResult.LoaderResults.StrainMatrix);
|
||||
return strain;
|
||||
}
|
||||
|
||||
private RebarCrackInputData GetCrackInputData()
|
||||
{
|
||||
lengthLogic.NdmCollection = defaultNdm;
|
||||
lengthLogic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
||||
lengthLogic.NdmCollection = defaultNdms;
|
||||
lengthLogic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(longDefaultStrainTuple);
|
||||
var length = lengthLogic.GetLength();
|
||||
var crackInputData = new RebarCrackInputData
|
||||
{
|
||||
PsiSFactor = crackForceResult.PsiS,
|
||||
Length = length,
|
||||
StrainTuple = strainTuple
|
||||
StrainTuple = longDefaultStrainTuple
|
||||
};
|
||||
return crackInputData;
|
||||
}
|
||||
|
||||
private double GetLengthBetweenCracks(StrainTuple strainTuple)
|
||||
{
|
||||
var logic = new LengthBetweenCracksLogicSP63()
|
||||
{
|
||||
NdmCollection = defaultNdms,
|
||||
TraceLogger = TraceLogger
|
||||
};
|
||||
logic.StrainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(strainTuple);
|
||||
return logic.GetLength();
|
||||
}
|
||||
|
||||
private void Triangulate()
|
||||
{
|
||||
ndmPrimitives = InputData.NdmPrimitives;
|
||||
rebarPrimitives = new List<RebarPrimitive>();
|
||||
foreach (var item in ndmPrimitives)
|
||||
triangulationLogic = new CrackedSectionTriangulationLogic(InputData.NdmPrimitives)
|
||||
{
|
||||
if (item is RebarPrimitive)
|
||||
{
|
||||
rebarPrimitives.Add(item as RebarPrimitive);
|
||||
}
|
||||
}
|
||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
||||
{
|
||||
Primitives = ndmPrimitives,
|
||||
LimitState = LimitStates.SLS,
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
defaultNdm = triangulateLogic.GetNdms();
|
||||
};
|
||||
rebarPrimitives = triangulationLogic.GetRebarPrimitives();
|
||||
defaultNdms = triangulationLogic.GetNdmCollection();
|
||||
fulyCrackedNdms = triangulationLogic.GetCrackedNdmCollection();
|
||||
}
|
||||
|
||||
private void CalcCrackForce()
|
||||
{
|
||||
var calculator = new CrackForceCalculator();
|
||||
calculator.EndTuple = InputData.LongTermTuple;
|
||||
calculator.NdmCollection = defaultNdm;
|
||||
calculator.NdmCollection = defaultNdms;
|
||||
calculator.Run();
|
||||
crackForceResult = calculator.Result as CrackForceResult;
|
||||
}
|
||||
|
||||
@@ -14,18 +14,42 @@ using StructureHelperCommon.Models.Parameters;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
/// <summary>
|
||||
/// Geometrical primitive which generates ndm elemtntary part
|
||||
/// </summary>
|
||||
public interface INdmPrimitive : ISaveable, ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of primitive
|
||||
/// </summary>
|
||||
string? Name { get; set; }
|
||||
/// <summary>
|
||||
/// Base point of primitive
|
||||
/// </summary>
|
||||
IPoint2D Center { get; }
|
||||
/// <summary>
|
||||
/// Host cross-section for primitive
|
||||
/// </summary>
|
||||
ICrossSection? CrossSection { get; set; }
|
||||
/// <summary>
|
||||
/// Material of primitive
|
||||
/// </summary>
|
||||
IHeadMaterial? HeadMaterial { get; set; }
|
||||
/// <summary>
|
||||
/// Flag of triangulation
|
||||
/// </summary>
|
||||
bool Triangulate { get; set; }
|
||||
/// <summary>
|
||||
/// Prestrain assigned from user
|
||||
/// </summary>
|
||||
StrainTuple UsersPrestrain { get; }
|
||||
/// <summary>
|
||||
/// Prestrain assigned from calculations
|
||||
/// </summary>
|
||||
StrainTuple AutoPrestrain { get; }
|
||||
/// <summary>
|
||||
/// Visual settings
|
||||
/// </summary>
|
||||
IVisualProperty VisualProperty {get; }
|
||||
|
||||
IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions);
|
||||
|
||||
@@ -9,10 +9,22 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
public interface IVisualProperty
|
||||
{
|
||||
/// <summary>
|
||||
/// Flag of visibility
|
||||
/// </summary>
|
||||
bool IsVisible { get; set; }
|
||||
Color Color { get; set; }
|
||||
/// <summary>
|
||||
/// Flag of assigning of color from material or from primitive's settings
|
||||
/// </summary>
|
||||
bool SetMaterialColor { get; set; }
|
||||
/// <summary>
|
||||
/// Index by z-coordinate
|
||||
/// </summary>
|
||||
int ZIndex { get; set; }
|
||||
/// <summary>
|
||||
/// Opacity of filling
|
||||
/// </summary>
|
||||
double Opacity { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,13 +68,35 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
|
||||
{
|
||||
List<INdm> ndms = new()
|
||||
{
|
||||
GetConcreteNdm(triangulationOptions),
|
||||
GetRebarNdm(triangulationOptions)
|
||||
};
|
||||
return ndms;
|
||||
}
|
||||
|
||||
public RebarNdm GetRebarNdm(ITriangulationOptions triangulationOptions)
|
||||
{
|
||||
var options = new RebarTriangulationLogicOptions(this)
|
||||
{
|
||||
triangulationOptions = triangulationOptions
|
||||
};
|
||||
var logic = new RebarTriangulationLogic(options);
|
||||
return logic.GetNdmCollection();
|
||||
var rebar = logic.GetRebarNdm();
|
||||
return rebar;
|
||||
}
|
||||
|
||||
public Ndm GetConcreteNdm(ITriangulationOptions triangulationOptions)
|
||||
{
|
||||
var options = new RebarTriangulationLogicOptions(this)
|
||||
{
|
||||
triangulationOptions = triangulationOptions
|
||||
};
|
||||
var logic = new RebarTriangulationLogic(options);
|
||||
var concrete = logic.GetConcreteNdm();
|
||||
return concrete;
|
||||
}
|
||||
|
||||
public List<INamedAreaPoint> GetValuePoints()
|
||||
|
||||
@@ -3,8 +3,10 @@ using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.Ndms.Transformations;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.Models.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -23,14 +25,20 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
}
|
||||
public IEnumerable<INdm> GetNdmCollection()
|
||||
{
|
||||
var concreteNdm = new Ndm
|
||||
List<INdm> ndmCollection = new();
|
||||
if (options.HostPrimitive is not null)
|
||||
{
|
||||
CenterX = options.Center.X,
|
||||
CenterY = options.Center.Y,
|
||||
Area = options.Area,
|
||||
Material = options.HostMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm),
|
||||
StressScale = -1d
|
||||
};
|
||||
var concreteNdm = GetConcreteNdm();
|
||||
ndmCollection.Add(concreteNdm);
|
||||
}
|
||||
|
||||
var rebarNdm = GetRebarNdm();
|
||||
ndmCollection.Add(rebarNdm);
|
||||
return ndmCollection;
|
||||
}
|
||||
|
||||
public RebarNdm GetRebarNdm()
|
||||
{
|
||||
var rebarNdm = new RebarNdm
|
||||
{
|
||||
CenterX = options.Center.X,
|
||||
@@ -38,9 +46,32 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
Area = options.Area,
|
||||
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
|
||||
};
|
||||
List<INdm> ndmCollection = new() { concreteNdm, rebarNdm};
|
||||
NdmTransform.SetPrestrain(ndmCollection, TupleConverter.ConvertToLoaderStrainMatrix(options.Prestrain));
|
||||
return ndmCollection;
|
||||
;
|
||||
NdmTransform.SetPrestrain(rebarNdm, TupleConverter.ConvertToLoaderStrainMatrix(options.Prestrain));
|
||||
return rebarNdm;
|
||||
}
|
||||
|
||||
public Ndm GetConcreteNdm()
|
||||
{
|
||||
var hostPrimitive = options.HostPrimitive;
|
||||
var material = hostPrimitive
|
||||
.HeadMaterial
|
||||
.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm);
|
||||
|
||||
var prestrain = ForceTupleService.SumTuples(hostPrimitive.UsersPrestrain,
|
||||
hostPrimitive.AutoPrestrain)
|
||||
as StrainTuple;
|
||||
|
||||
var concreteNdm = new Ndm
|
||||
{
|
||||
CenterX = options.Center.X,
|
||||
CenterY = options.Center.Y,
|
||||
Area = options.Area,
|
||||
Material = material,
|
||||
StressScale = -1d
|
||||
};
|
||||
NdmTransform.SetPrestrain(concreteNdm, TupleConverter.ConvertToLoaderStrainMatrix(prestrain));
|
||||
return concreteNdm;
|
||||
}
|
||||
|
||||
public void ValidateOptions(ITriangulationLogicOptions options)
|
||||
|
||||
@@ -22,7 +22,8 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
public double Area { get; }
|
||||
public StrainTuple Prestrain { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; set; }
|
||||
public IHeadMaterial HostMaterial { get; set; }
|
||||
public INdmPrimitive HostPrimitive { get; set; }
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public RebarTriangulationLogicOptions(RebarPrimitive primitive)
|
||||
@@ -30,7 +31,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
Center = primitive.Center.Clone() as Point2D;
|
||||
Area = primitive.Area;
|
||||
HeadMaterial = primitive.HeadMaterial;
|
||||
HostMaterial = primitive.HostPrimitive.HeadMaterial;
|
||||
HostPrimitive = primitive.HostPrimitive;
|
||||
Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user