Anchoring isofields has been added

This commit is contained in:
Evgeny Redikultsev
2023-03-25 19:38:40 +05:00
parent a88fa40f29
commit 3d22c3440e
23 changed files with 599 additions and 112 deletions

View File

@@ -1,9 +1,11 @@
using LoaderCalculator.Tests.Infrastructures.Logics;
using Moq;
using NUnit.Framework;
using StructureHelperCommon.Services.Forces;
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
using StructureHelperLogics.Models.Templates.RCs;
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Primitives;
namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorTests
{
@@ -55,5 +57,37 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
Assert.True(calcResult == result.IsValid);
Assert.True(firstForceResult == result.ForcesResultList[0].IsValid);
}
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, 0d, 0d, 0d)]
public void Run_ShouldPassPrestrain(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, double expectedKx, double expectedKy, double expectedEpsZ)
{
//Arrange
var template = new RectangleBeamTemplate(width, height) { TopDiameter = topDiametr, BottomDiameter = bottomDiametr, WidthCount = widthCount, HeightCount = heightCount };
var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection();
var calculator = newSection.SectionRepository.CalculatorsList[0] as IForceCalculator;
calculator.CompressedMember.Buckling = false;
calculator.Run();
var ndmPrimitives = newSection.SectionRepository.Primitives;
var result = calculator.Result as IForcesResults;
var strainMatrix = result.ForcesResultList[0].LoaderResults.StrainMatrix;
var source = StrainTupleService.ConvertToStrainTuple(strainMatrix);
//Act
foreach (var item in ndmPrimitives)
{
StrainTupleService.CopyProperties(source, item.AutoPrestrain);
}
calculator.Run();
var result2 = calculator.Result as IForcesResults;
//Assert
Assert.IsNotNull(result2);
Assert.IsTrue(result2.IsValid);
var strainMatrix2 = result2.ForcesResultList[0].LoaderResults.StrainMatrix;
var kx = strainMatrix2.Kx;
var ky = strainMatrix2.Ky;
var epsz = strainMatrix2.EpsZ;
Assert.AreEqual(expectedKx, kx, 1e-10);
Assert.AreEqual(expectedKy, ky, 1e-10);
Assert.AreEqual(expectedEpsZ, epsz, 1e-10);
}
}
}