Icons for force result were added

This commit is contained in:
Evgeny Redikultsev
2023-11-26 20:33:48 +05:00
parent b4b1720c70
commit 01e6f97429
41 changed files with 678 additions and 273 deletions

View File

@@ -11,12 +11,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
{
public class RCSectionsTest
{
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, -0.00062729176929923703d, -0.0029292919541166911d, 0.00035383082501577246d)]
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 3, 2, false, -0.00046857734823565632d, -0.0025101896869558888d, 0.00027185795017719519d)]
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, false, -0.00081656737668168479d, -0.00081656737668168414d, 0.00011865117209051567d)]
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00081971887286298598d, -0.00081971887286298544d, 0.00011922273439756063d)]
[TestCase(0.5d, 0.6d, 0.025d, 0.025d, 3, 3, true, -0.00048146233319312662d, -0.00077822315770951882d, 0.00010599549196849429d)]
[TestCase(0.6d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00077822315770951947d, -0.00048146233319312478d, 0.00010599549196849413d)]
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, -0.00068654617067958799d, -0.0030411189808055242d, 0.00034289928716916179d)]
public void Run_ShouldPass(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, bool isBuckling, double expectedKx, double expectedKy, double expectedEpsZ)
{
//Arrange

View File

@@ -1,106 +0,0 @@
using LoaderCalculator;
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.Ndms;
using LoaderCalculator.Data.SourceData;
using LoaderCalculator.Tests.Infrastructures.Logics;
using NUnit.Framework;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System.Collections.Generic;
using System.Threading;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.Models.Materials;
using StructureHelperLogics.Models.Primitives;
using StructureHelperCommon.Infrastructures.Settings;
namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
{
public class RCSectionTest
{
//Theoretical limit momemt Mx = 43kN*m
[TestCase(0.000113, 0.000494, 10e3, 0d, 0d, 0.00084665917358052976d, 0.0d, 0.00020754144937701132d)]
[TestCase(0.000113, 0.000494, 40e3, 0d, 0d, 0.0033939850380287412d, 0d, 0.00082989880025069202d)]
[TestCase(0.000113, 0.000494, 42e3, 0d, 0d, 0.0056613831873867241d, 0d, 0.0014291081844183839d)]
//Theoretical limit momemt Mx = -187kN*m
[TestCase(0.000113, 0.000494, -50e3, 0d, 0d, -0.0011229555729294297d, 0d, 0.00021353225742956321d)]
[TestCase(0.000113, 0.000494, -180e3, 0d, 0d, -0.0098365950945499738d, 0d, 0.0022035516889170013d)]
[TestCase(0.000113, 0.000494, -183e3, 0d, 0d, -0.021718635290382458d, 0d, 0.0053526701372818789d)]
public void Run_ShouldPass(double topArea, double bottomArea, double mx, double my, double nz, double expectedKx, double expectedKy, double expectedEpsilonZ)
{
//Arrange
ProgramSetting.NatSystem = NatSystems.EU;
double width = 0.4;
double height = 0.6;
var ndmCollection = new List<INdm>();
ITriangulationOptions options = new TriangulationOptions { LimiteState = LimitStates.ULS, CalcTerm = CalcTerms.ShortTerm };
var primitives = new List<INdmPrimitive>();
primitives.AddRange(GetConcreteNdms(width, height));
primitives.AddRange(GetReinforcementNdms(width, height, topArea, bottomArea));
ndmCollection.AddRange(primitives.SelectMany(x => x.GetNdms(options)));
var loaderData = new LoaderOptions
{
Preconditions = new Preconditions
{
ConditionRate = 0.01,
MaxIterationCount = 100,
StartForceMatrix = new ForceMatrix { Mx = mx, My = my, Nz = nz }
},
NdmCollection = ndmCollection
};
var calculator = new Calculator();
//Act
calculator.Run(loaderData, new CancellationToken());
var results = calculator.Result;
//Assert
Assert.NotNull(results);
var strainMatrix = results.StrainMatrix;
Assert.NotNull(strainMatrix);
Assert.AreEqual(expectedKx, strainMatrix.Kx, ExpectedProcessor.GetAccuracyForExpectedValue(expectedKx));
Assert.AreEqual(expectedKy, strainMatrix.Ky, ExpectedProcessor.GetAccuracyForExpectedValue(expectedKy));
Assert.AreEqual(expectedEpsilonZ, strainMatrix.EpsZ, ExpectedProcessor.GetAccuracyForExpectedValue(expectedEpsilonZ));
}
private IEnumerable<INdmPrimitive> GetConcreteNdms(double width, double height)
{
var material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Concrete40);
var primitive = new RectanglePrimitive(material) {Width = width, Height = height, NdmMaxSize = 1, NdmMinDivision = 20 };
List<INdmPrimitive> primitives = new List<INdmPrimitive> {primitive};
return primitives;
}
private IEnumerable<INdmPrimitive> GetReinforcementNdms(double width, double height, double topArea, double bottomArea)
{
double gap = 0.05d;
var material = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Reinforcement400);
IPoint2D centerRT = new Point2D { X = width / 2 - gap, Y = height / 2 - gap };
IPoint2D centerLT = new Point2D { X = - (width / 2 - gap), Y = height / 2 - gap };
IPoint2D centerRB = new Point2D { X = width / 2 - gap, Y = - (height / 2 - gap) };
IPoint2D centerLB = new Point2D { X = -(width / 2 - gap), Y = - (height / 2 - gap) };
List<INdmPrimitive> primitives = new List<INdmPrimitive>();
INdmPrimitive primitive;
//Right top bar
primitive = new PointPrimitive(material) { Area = topArea};
primitive.Center.X = centerRT.X;
primitive.Center.Y = centerRT.Y;
primitives.Add(primitive);
//Left top bar
primitive = new PointPrimitive(material) { Area = topArea};
primitive.Center.X = centerLT.X;
primitive.Center.Y = centerLT.Y;
primitives.Add(primitive);
//Right bottom bar
primitive = new PointPrimitive(material) { Area = bottomArea};
primitive.Center.X = centerRB.X;
primitive.Center.Y = centerRB.Y;
primitives.Add(primitive);
//Left bottom bar
primitive = new PointPrimitive(material) {Area = bottomArea };
primitive.Center.X = centerLB.X;
primitive.Center.Y = centerLB.Y;
primitives.Add(primitive);
return primitives;
}
}
}

View File

@@ -1,91 +0,0 @@
using LoaderCalculator;
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Data.SourceData;
using LoaderCalculator.Tests.Infrastructures.Logics;
using NUnit.Framework;
using StructureHelperLogics.NdmCalculations.Triangulations;
using System.Collections.Generic;
using System.Threading;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperLogics.Models.Materials;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelper.Models.Materials;
namespace StructureHelperTests.FunctionalTests.Ndms.SteelSections
{
public class ReinforcementTest
{
[TestCase(0.3, 0.6, 4e8, 0, 0, 1800000, 0d, 0d, 5e-5d)]
[TestCase(0.3, 0.6, 4e8, 0, 0, -1800000, 0d, 0d, -5e-5d)]
[TestCase(0.3, 0.6, 4e8, 7000000, 0, 0, 0.0065882684745345067d, 0d, 0d)]
//[TestCase(0.3, 0.6, 6e8, 10000000, 0, 0, 0.010485801788961743d, 0d, -0.00011114996218404612d)]
public void Run_ShouldPass_Rectangle(double width, double height, double strength, double mx, double my, double nz, double expectedKx, double expectedKy, double expectedEpsilonZ)
{
//Arrange
ProgramSetting.NatSystem = NatSystems.EU;
var headMaterial = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Reinforcement400);
var options = new TriangulationOptions { LimiteState = LimitStates.ULS, CalcTerm = CalcTerms.ShortTerm };
var primitive = new RectanglePrimitive { Width = width, Height = height, HeadMaterial = headMaterial, NdmMaxSize = 1, NdmMinDivision = 100 };
var primitives = new List<INdmPrimitive>() { primitive};
var ndmCollection = primitives.SelectMany(x => x.GetNdms(options));
var loaderData = new LoaderOptions
{
Preconditions = new Preconditions
{
ConditionRate = 0.01,
MaxIterationCount = 100,
StartForceMatrix = new ForceMatrix { Mx = mx, My = my, Nz = nz }
},
NdmCollection = ndmCollection
};
var calculator = new Calculator();
//Act
calculator.Run(loaderData, new CancellationToken());
var results = calculator.Result;
//Assert
Assert.NotNull(results);
var strainMatrix = results.StrainMatrix;
Assert.NotNull(strainMatrix);
Assert.AreEqual(expectedKx, strainMatrix.Kx, ExpectedProcessor.GetAccuracyForExpectedValue(expectedKx));
Assert.AreEqual(expectedKy, strainMatrix.Ky, ExpectedProcessor.GetAccuracyForExpectedValue(expectedKy));
Assert.AreEqual(expectedEpsilonZ, strainMatrix.EpsZ, ExpectedProcessor.GetAccuracyForExpectedValue(expectedEpsilonZ));
}
[TestCase(0.3, 4e8, 0, 0, 706850.84713269188d, 0d, 0d, 5e-5d)]
[TestCase(0.3, 4e8, 0, 0, -706850.84713269188d, 0d, 0d, -5e-5d)]
[TestCase(0.3, 4e8, 700000, 0, 0, 0.0088353506243542181d, 0d, 0d)]
public void Run_ShouldPass_Circle(double diameter, double strength, double mx, double my, double nz, double expectedKx, double expectedKy, double expectedEpsilonZ)
{
//Arrange
ProgramSetting.NatSystem = NatSystems.EU;
var headMaterial = HeadMaterialFactory.GetHeadMaterial(HeadmaterialType.Reinforcement400);
var options = new TriangulationOptions { LimiteState = LimitStates.ULS, CalcTerm = CalcTerms.ShortTerm };
var primitive = new CirclePrimitive { Diameter = diameter, HeadMaterial = headMaterial, NdmMaxSize = 1, NdmMinDivision = 100 };
var primitives = new List<INdmPrimitive>() { primitive };
var ndmCollection = primitives.SelectMany(x => x.GetNdms(options));
var loaderData = new LoaderOptions
{
Preconditions = new Preconditions
{
ConditionRate = 0.01,
MaxIterationCount = 100,
StartForceMatrix = new ForceMatrix { Mx = mx, My = my, Nz = nz }
},
NdmCollection = ndmCollection
};
var calculator = new Calculator();
//Act
calculator.Run(loaderData, new CancellationToken());
var results = calculator.Result;
//Assert
Assert.NotNull(results);
var strainMatrix = results.StrainMatrix;
Assert.NotNull(strainMatrix);
Assert.AreEqual(expectedKx, strainMatrix.Kx, ExpectedProcessor.GetAccuracyForExpectedValue(expectedKx));
Assert.AreEqual(expectedKy, strainMatrix.Ky, ExpectedProcessor.GetAccuracyForExpectedValue(expectedKy));
Assert.AreEqual(expectedEpsilonZ, strainMatrix.EpsZ, ExpectedProcessor.GetAccuracyForExpectedValue(expectedEpsilonZ));
}
}
}