Anchoring isofields has been added
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.RC;
|
||||
|
||||
namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.AnchorageCalculatorTest
|
||||
{
|
||||
public class AnchorageCalculatorTest
|
||||
{
|
||||
[TestCase(0.012d, 0d, 0.416d)]
|
||||
[TestCase(0.025d, 0d, 0.867d)]
|
||||
[TestCase(0.032d, 0d, 1.110d)]
|
||||
[TestCase(0.036d, 0d, 1.388d)]
|
||||
public void Run_ShouldPass(double diameter, double stress, double expectedBaseDevLength)
|
||||
{
|
||||
//Arrange
|
||||
var inputData = new AnchorageInputData();
|
||||
inputData.ConcreteStrength = 1e6; //Pa
|
||||
inputData.ReinforcementStrength = 347e6; //Pa
|
||||
inputData.FactorEta1 = 2.5d;
|
||||
inputData.CrossSectionArea = Math.PI * diameter * diameter / 4d;
|
||||
inputData.CrossSectionPerimeter = Math.PI * diameter;
|
||||
inputData.ReinforcementStress = stress;
|
||||
var calculator = new AnchorageCalculator(inputData);
|
||||
//Act
|
||||
var baseLength = calculator.GetBaseDevLength();
|
||||
//Assert
|
||||
Assert.AreEqual(expectedBaseDevLength, baseLength, 0.001d);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user