Add cylinders to 3dLogic
This commit is contained in:
@@ -10,6 +10,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
|
||||
public List<INdmPrimitive> Primitives { get; } = [];
|
||||
public IDeflectionFactor DeflectionFactor { get; set; } = new DeflectionFactor(Guid.NewGuid());
|
||||
public bool ConsiderSofteningFactor { get; set; } = false;
|
||||
|
||||
public CurvatureCalculatorInputData(Guid id)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
@@ -36,16 +38,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
PrepareResult();
|
||||
try
|
||||
{
|
||||
if (CheckForCracks(InputData.ForcePair.FullForceTuple, CalcTerms.ShortTerm) || CheckForCracks(InputData.ForcePair.LongForceTuple, CalcTerms.ShortTerm))
|
||||
{
|
||||
TraceLogger?.AddMessage($"Section is cracked");
|
||||
calculator = new CurvatureTermCrackedCalculator(TraceLogger) { InputData = InputData };
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage($"Section is not cracked");
|
||||
calculator = new CurvatureTermUncrackedCalculator(TraceLogger) { InputData = InputData };
|
||||
}
|
||||
GetCaclculator();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -64,7 +57,26 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
result.SectionResult = calcResult;
|
||||
}
|
||||
|
||||
private bool CheckForCracks(IForceTuple forceTuple, CalcTerms calcTerm)
|
||||
private void GetCaclculator()
|
||||
{
|
||||
if (InputData.ConsiderSofteningFactor == false)
|
||||
{
|
||||
calculator = new CurvatureTermUncrackedCalculator(TraceLogger) { InputData = InputData };
|
||||
return;
|
||||
}
|
||||
if (IsSectionCracked(InputData.ForcePair.FullForceTuple, CalcTerms.ShortTerm) || IsSectionCracked(InputData.ForcePair.LongForceTuple, CalcTerms.ShortTerm))
|
||||
{
|
||||
TraceLogger?.AddMessage($"Section is cracked");
|
||||
calculator = new CurvatureTermCrackedCalculator(TraceLogger) { InputData = InputData };
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage($"Section is not cracked");
|
||||
calculator = new CurvatureTermUncrackedCalculator(TraceLogger) { InputData = InputData };
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsSectionCracked(IForceTuple forceTuple, CalcTerms calcTerm)
|
||||
{
|
||||
var triangulateLogic = new TriangulatePrimitiveLogic()
|
||||
{
|
||||
@@ -74,6 +86,10 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
TraceLogger = TraceLogger
|
||||
};
|
||||
var ndms = triangulateLogic.GetNdms();
|
||||
if (!ndms.Where(x => x.Material is ICrackMaterial).Any())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var logic = new IsSectionCrackedByForceLogic()
|
||||
{
|
||||
ForceTuple = forceTuple,
|
||||
|
||||
@@ -8,5 +8,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
public IDesignForcePair ForcePair { get; set; }
|
||||
public List<INdmPrimitive> Primitives { get; set; } = [];
|
||||
public IDeflectionFactor DeflectionFactor { get; set; }
|
||||
public bool ConsiderSofteningFactor { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
public interface ICurvatureCalculatorInputData : IInputData, ISaveable, IHasForceActions, IHasPrimitives
|
||||
{
|
||||
IDeflectionFactor DeflectionFactor { get; set; }
|
||||
bool ConsiderSofteningFactor { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
{
|
||||
IDesignForcePair ForcePair {get;set;}
|
||||
IDeflectionFactor DeflectionFactor { get; set; }
|
||||
bool ConsiderSofteningFactor { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
|
||||
if (ReferenceEquals(target, source))
|
||||
return;
|
||||
|
||||
target.ConsiderSofteningFactor = source.ConsiderSofteningFactor;
|
||||
if (UpdateChildren)
|
||||
{
|
||||
ValidateChildProperties(target, source);
|
||||
|
||||
@@ -71,7 +71,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
|
||||
{
|
||||
ForcePair = pair,
|
||||
Primitives = InputData.Primitives,
|
||||
DeflectionFactor = InputData.DeflectionFactor
|
||||
DeflectionFactor = InputData.DeflectionFactor,
|
||||
ConsiderSofteningFactor = InputData.ConsiderSofteningFactor,
|
||||
};
|
||||
ForceCalculator.InputData = forceInputData;
|
||||
ForceCalculator.Run();
|
||||
|
||||
Reference in New Issue
Block a user