LinePrimitive and RectanglePrimitive was added
This commit is contained in:
@@ -12,12 +12,14 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public class ElasticMaterial : IElasticMaterial
|
||||
{
|
||||
public double Modulus { get; set; }
|
||||
public double CompressiveStrength { get; set; }
|
||||
public double TensileStrength { get; set; }
|
||||
|
||||
public IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
IMaterial material = new Material();
|
||||
material.InitModulus = Modulus;
|
||||
IEnumerable<double> parameters = new List<double>() { Modulus};
|
||||
IEnumerable<double> parameters = new List<double>() { Modulus, CompressiveStrength, TensileStrength};
|
||||
material.DiagramParameters = parameters;
|
||||
material.Diagram = GetStress;
|
||||
return material;
|
||||
@@ -25,12 +27,17 @@ namespace StructureHelperLogics.Models.Materials
|
||||
|
||||
private double GetStress (IEnumerable<double> parameters, double strain)
|
||||
{
|
||||
return parameters.First() * strain;
|
||||
double modulus = parameters.First();
|
||||
double stress = modulus * strain;
|
||||
double compressiveStrength = (-1d) * parameters.ElementAt(1);
|
||||
double tensileStrength = parameters.ElementAt(2);
|
||||
if (stress > tensileStrength || stress < compressiveStrength) { return 0d; }
|
||||
else { return stress; }
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return new ElasticMaterial() { Modulus = Modulus };
|
||||
return new ElasticMaterial() { Modulus = Modulus, CompressiveStrength = CompressiveStrength, TensileStrength = TensileStrength };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public interface IElasticMaterial : IHelperMaterial
|
||||
{
|
||||
double Modulus { get; set; }
|
||||
double CompressiveStrength { get; set; }
|
||||
double TensileStrength { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
20
StructureHelperLogics/Models/Primitives/IPrimitive.cs
Normal file
20
StructureHelperLogics/Models/Primitives/IPrimitive.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Primitives
|
||||
{
|
||||
public interface IPrimitive : ISaveable, ICloneable
|
||||
{
|
||||
string Name { get; set; }
|
||||
ICenter Center { get; }
|
||||
IShape Shape { get; }
|
||||
|
||||
IEnumerable<INdmPrimitive> GetNdmPrimitives();
|
||||
}
|
||||
}
|
||||
37
StructureHelperLogics/Models/Primitives/LinePrimitive.cs
Normal file
37
StructureHelperLogics/Models/Primitives/LinePrimitive.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.Models.Primitives
|
||||
{
|
||||
public class LinePrimitive : IPrimitive
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public ICenter Center { get; set; }
|
||||
public IShape Shape { get; }
|
||||
|
||||
public LinePrimitive()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<INdmPrimitive> GetNdmPrimitives()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace StructureHelperLogics.Models.Templates.RCs
|
||||
|
||||
public RectangleBeamTemplate()
|
||||
{
|
||||
Shape = new Rectangle() { Width = 0.4d, Height = 0.6d };
|
||||
Shape = new RectangleShape() { Width = 0.4d, Height = 0.6d };
|
||||
CoverGap = 0.05d;
|
||||
TopDiameter = 0.016d;
|
||||
BottomDiameter = 0.025d;
|
||||
@@ -28,7 +28,7 @@ namespace StructureHelperLogics.Models.Templates.RCs
|
||||
|
||||
public RectangleBeamTemplate(double width, double height)
|
||||
{
|
||||
Shape = new Rectangle() { Width = width, Height = height };
|
||||
Shape = new RectangleShape() { Width = width, Height = height };
|
||||
CoverGap = 0.05d;
|
||||
TopDiameter = 0.016d;
|
||||
BottomDiameter = 0.025d;
|
||||
|
||||
Reference in New Issue
Block a user