Add cylinders to 3dLogic

This commit is contained in:
Evgeny Redikultsev
2025-12-06 20:30:51 +05:00
parent 7594872a41
commit 70bfd065c4
32 changed files with 459 additions and 184 deletions

View File

@@ -67,7 +67,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
var exitMx = stiffness[0, 0] * strain.Kx + stiffness[0, 1] * strain.Ky + stiffness[0, 2] * strain.EpsZ;
var exitMy = stiffness[1, 0] * strain.Kx + stiffness[1, 1] * strain.Ky + stiffness[1, 2] * strain.EpsZ;
var exitNz = stiffness[2, 0] * strain.Kx + stiffness[2, 1] * strain.Ky + stiffness[2, 2] * strain.EpsZ;
var PrestressMatrix = new ForceLogic()
var PrestressMatrix = new CalculateForceMatrixLogic()
.GetPrestressMatrix(new StiffnessLogic(), ndmCollection, strain);
double mx = exitMx + PrestressMatrix.Mx;
double my = exitMy + PrestressMatrix.My;

View File

@@ -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)
{

View File

@@ -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,

View File

@@ -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; }
}
}

View File

@@ -11,5 +11,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
public interface ICurvatureCalculatorInputData : IInputData, ISaveable, IHasForceActions, IHasPrimitives
{
IDeflectionFactor DeflectionFactor { get; set; }
bool ConsiderSofteningFactor { get; set; }
}
}

View File

@@ -8,5 +8,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
{
IDesignForcePair ForcePair {get;set;}
IDeflectionFactor DeflectionFactor { get; set; }
bool ConsiderSofteningFactor { get; set; }
}
}

View File

@@ -46,7 +46,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Curvatures
if (ReferenceEquals(target, source))
return;
target.ConsiderSofteningFactor = source.ConsiderSofteningFactor;
if (UpdateChildren)
{
ValidateChildProperties(target, source);

View File

@@ -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();

View File

@@ -1,4 +1,5 @@
using LoaderCalculator.Data.Matrix;
using LoaderCalculator;
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using LoaderCalculator.Logics;
using StructureHelperCommon.Infrastructures.Enums;
@@ -6,11 +7,6 @@ using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperLogics.Models.Materials;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Analyses.RC
{
@@ -42,7 +38,9 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
{
inputData.ReinforcementStress = inputData.ReinforcementStrength;
}
inputData.IsPrestressed = ndm.PrestrainLogic.GetByType(PrestrainTypes.Prestrain).Sum(x => x.PrestrainValue) > 0.0005d ? true : false;
var prestrainLogic = new GetNdmPrestrainLogic();
var prestrainValue = prestrainLogic.GetPrestrainValueAtCenter(ndm);
inputData.IsPrestressed = prestrainValue > 0.0005d ? true : false;
inputData.LappedCountRate = lappedCountRate;
return inputData;
}