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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,8 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="FunctionalTests\RCs\Anchorage\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
|
||||
namespace StructureHelperTests.UnitTests.MaterialTests
|
||||
{
|
||||
public class MaterialStrengthTest
|
||||
{
|
||||
[TestCase(HeadmaterialType.Reinforecement400, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.ShortTerm, 347826086.95652175d, 347826086.95652175d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement400, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.ShortTerm, 400000000d, 400000000d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement500, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.ShortTerm, 400000000.0d, 434782608.69565225d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement500, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.LongTerm, 434782608.69565225d, 434782608.69565225d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement500, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.ShortTerm, 5e8d, 5e8d)]
|
||||
[TestCase(HeadmaterialType.Reinforecement500, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.ShortTerm, 5e8d, 5e8d)]
|
||||
[TestCase(HeadmaterialType.Concrete40, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.ShortTerm, 22461538.46153846d, 1395297.0017909051d)]
|
||||
[TestCase(HeadmaterialType.Concrete40, CodeTypes.SP63_13330_2018, LimitStates.ULS, CalcTerms.LongTerm, 20215384.615384616d, 1255767.3016118146d)]
|
||||
[TestCase(HeadmaterialType.Concrete40, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.ShortTerm, 29200000.0d, 2092945.5026863578d)]
|
||||
[TestCase(HeadmaterialType.Concrete40, CodeTypes.SP63_13330_2018, LimitStates.SLS, CalcTerms.LongTerm, 29200000.0d, 2092945.5026863578d)]
|
||||
public void Run_ShouldPass(HeadmaterialType headmaterialType, CodeTypes code, LimitStates limitState, CalcTerms calcTerm, double expectedCompressive, double expectedTensile)
|
||||
{
|
||||
//Arrange
|
||||
var material = HeadMaterialFactory.GetHeadMaterial(headmaterialType, code);
|
||||
var libMaterial = material.HelperMaterial as ILibMaterial;
|
||||
//Act
|
||||
var compressive = libMaterial.GetStrength(limitState, calcTerm).Compressive;
|
||||
var tensile = libMaterial.GetStrength(limitState, calcTerm).Tensile;
|
||||
//Assert
|
||||
Assert.AreEqual(expectedCompressive, compressive, 1d);
|
||||
Assert.AreEqual(expectedTensile, tensile, 1d);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user