Library material was added
This commit is contained in:
@@ -2,5 +2,8 @@
|
||||
{
|
||||
public interface ITriangulationLogicOptions
|
||||
{
|
||||
double PrestrainKx { get;}
|
||||
double PrestrainKy { get;}
|
||||
double PrestrainEpsZ { get;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms.Transformations;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
@@ -23,6 +25,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
List<INdm> ndmCollection = new List<INdm>();
|
||||
INdm ndm = new Ndm { CenterX = center.X, CenterY = center.Y, Area = area, Material = material };
|
||||
ndmCollection.Add(ndm);
|
||||
NdmTransform.SetPrestrain(ndmCollection, new StrainMatrix() { Kx = Options.PrestrainKx, Ky = Options.PrestrainKy, EpsZ = Options.PrestrainEpsZ });
|
||||
return ndmCollection;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Entities;
|
||||
using StructureHelperCommon.Models.NdmPrimitives;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
@@ -11,13 +15,31 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
///
|
||||
/// </summary>
|
||||
public ICenter Center { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public double Area { get; }
|
||||
/// <inheritdoc />
|
||||
public double PrestrainKx { get; }
|
||||
/// <inheritdoc />
|
||||
public double PrestrainKy { get; }
|
||||
/// <inheritdoc />
|
||||
public double PrestrainEpsZ { get; }
|
||||
|
||||
public PointTriangulationLogicOptions(ICenter center, double area)
|
||||
{
|
||||
Center = center;
|
||||
Area = area;
|
||||
}
|
||||
|
||||
public PointTriangulationLogicOptions(INdmPrimitive primitive)
|
||||
{
|
||||
if (!(primitive.Shape is IPoint)) { throw new StructureHelperException(ErrorStrings.ShapeIsNotCorrect); }
|
||||
Center = primitive.Center;
|
||||
IPoint point = primitive.Shape as IPoint;
|
||||
Center = primitive.Center;
|
||||
Area = point.Area;
|
||||
PrestrainKx = primitive.PrestrainKx;
|
||||
PrestrainKy = primitive.PrestrainKy;
|
||||
PrestrainEpsZ = primitive.PrestrainEpsZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using LoaderCalculator.Data.Ndms.Transformations;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
@@ -25,6 +26,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
NdmTransform.Move(ndmCollection, dX, dY);
|
||||
double angle = rectangleOptions.Rectangle.Angle;
|
||||
NdmTransform.Rotate(ndmCollection, angle);
|
||||
NdmTransform.SetPrestrain(ndmCollection, new StrainMatrix() { Kx = Options.PrestrainKx, Ky = Options.PrestrainKy, EpsZ = Options.PrestrainEpsZ });
|
||||
return ndmCollection;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Entities;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
@@ -15,6 +17,12 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
public double NdmMaxSize { get; }
|
||||
/// <inheritdoc />
|
||||
public int NdmMinDivision { get; }
|
||||
/// <inheritdoc />
|
||||
public double PrestrainKx { get;}
|
||||
/// <inheritdoc />
|
||||
public double PrestrainKy { get; }
|
||||
/// <inheritdoc />
|
||||
public double PrestrainEpsZ { get;}
|
||||
|
||||
public RectangleTriangulationLogicOptions(ICenter center, IRectangle rectangle, double ndmMaxSize, int ndmMinDivision)
|
||||
{
|
||||
@@ -26,11 +34,14 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
|
||||
public RectangleTriangulationLogicOptions(INdmPrimitive primitive)
|
||||
{
|
||||
if (! (primitive.Shape is IRectangle)) { throw new Exception("Shape type is not valid"); }
|
||||
if (! (primitive.Shape is IRectangle)) { throw new StructureHelperException(ErrorStrings.ShapeIsNotCorrect); }
|
||||
Center = primitive.Center;
|
||||
Rectangle = primitive.Shape as IRectangle;
|
||||
NdmMaxSize = primitive.NdmMaxSize;
|
||||
NdmMinDivision = primitive.NdmMinDivision;
|
||||
PrestrainKx = primitive.PrestrainKx;
|
||||
PrestrainKy = primitive.PrestrainKy;
|
||||
PrestrainEpsZ = primitive.PrestrainEpsZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ using System.Collections.Generic;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Entities;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
@@ -67,12 +70,11 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
}
|
||||
else if (shape is IPoint)
|
||||
{
|
||||
IPoint point = shape as IPoint;
|
||||
options = new PointTriangulationLogicOptions(primitive.Center, point.Area);
|
||||
options = new PointTriangulationLogicOptions(primitive);
|
||||
IPointTriangulationLogic logic = new PointTriangulationLogic(options);
|
||||
ndms.AddRange(logic.GetNdmCollection(material));
|
||||
}
|
||||
else { throw new Exception("Primitive type is not valid"); }
|
||||
else { throw new StructureHelperException($"{ErrorStrings.ShapeIsNotCorrect} :{nameof(primitive.Shape)}"); }
|
||||
return ndms;
|
||||
}
|
||||
|
||||
@@ -81,7 +83,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
IMaterial material;
|
||||
if (primitiveMaterial.MaterialType == MaterialTypes.Concrete) { material = GetConcreteMaterial(primitiveMaterial, options); }
|
||||
else if (primitiveMaterial.MaterialType == MaterialTypes.Reinforcement) { material = GetReinforcementMaterial(primitiveMaterial, options); }
|
||||
else { throw new Exception("Material type is invalid"); }
|
||||
else { throw new StructureHelperException(ErrorStrings.MaterialTypeIsUnknown); }
|
||||
return material;
|
||||
}
|
||||
|
||||
@@ -106,14 +108,22 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
private static void SetMaterialOptions(IMaterialOptions materialOptions, IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
{
|
||||
materialOptions.Strength = primitiveMaterial.Strength;
|
||||
materialOptions.CodesType = CodesType.EC2_1990;
|
||||
if (primitiveMaterial.CodeType == CodeTypes.EuroCode_2_1990)
|
||||
{
|
||||
materialOptions.CodesType = CodesType.EC2_1990;
|
||||
}
|
||||
else if (primitiveMaterial.CodeType == CodeTypes.SP63_13330_2018)
|
||||
{
|
||||
materialOptions.CodesType = CodesType.SP63_2018;
|
||||
}
|
||||
else { throw new StructureHelperException($"{ErrorStrings.ObjectTypeIsUnknown} : {primitiveMaterial.CodeType}"); }
|
||||
if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.Collapse) { materialOptions.LimitState = LimitStates.Collapse; }
|
||||
else if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.ServiceAbility) { materialOptions.LimitState = LimitStates.ServiceAbility; }
|
||||
else if (options.LimiteState == Infrastructures.CommonEnums.LimitStates.Special) { materialOptions.LimitState = LimitStates.Special; }
|
||||
else { throw new Exception("LimitStateType is not valid"); }
|
||||
else { throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid); }
|
||||
if (options.CalcTerm == Infrastructures.CommonEnums.CalcTerms.ShortTerm) { materialOptions.IsShortTerm = true; }
|
||||
else if (options.CalcTerm == Infrastructures.CommonEnums.CalcTerms.LongTerm) { materialOptions.IsShortTerm = false; }
|
||||
else { throw new Exception("Calculation term is not valid"); }
|
||||
else { throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user