Change excel reading process
This commit is contained in:
@@ -7,12 +7,15 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
internal class ElasticMaterialLogic : IElasticMaterialLogic
|
||||
{
|
||||
private List<double> parameters;
|
||||
private double modulusOfElasticity;
|
||||
private double compressiveStrength;
|
||||
private double tensileStrength;
|
||||
|
||||
public IMaterial GetLoaderMaterial(IElasticMaterial elasticMaterial, LimitStates limitState, CalcTerms calcTerm, double factor = 1d)
|
||||
{
|
||||
@@ -20,23 +23,16 @@ namespace StructureHelperLogics.Models.Materials
|
||||
material.InitModulus = elasticMaterial.Modulus;
|
||||
IMaterialFactorLogic factorLogic = new MaterialFactorLogic(elasticMaterial.SafetyFactors);
|
||||
var factors = factorLogic.GetTotalFactor(limitState, calcTerm);
|
||||
parameters = new List<double>()
|
||||
{
|
||||
elasticMaterial.Modulus,
|
||||
elasticMaterial.CompressiveStrength * factors.Compressive * factor,
|
||||
elasticMaterial.TensileStrength * factors.Tensile * factor
|
||||
};
|
||||
material.DiagramParameters = parameters;
|
||||
material.Diagram = GetStressByStrain;
|
||||
return material;
|
||||
modulusOfElasticity = elasticMaterial.Modulus;
|
||||
compressiveStrength = (-1d) * elasticMaterial.CompressiveStrength * factors.Compressive * factor;
|
||||
tensileStrength = elasticMaterial.TensileStrength * factors.Tensile * factor;
|
||||
material.Diagram = GetStressByStrain;
|
||||
return material;
|
||||
}
|
||||
|
||||
private double GetStressByStrain(IEnumerable<double> parameters1, double strain)
|
||||
private double GetStressByStrain(double strain)
|
||||
{
|
||||
double modulus = parameters.First();
|
||||
double stress = modulus * strain;
|
||||
double compressiveStrength = (-1d) * parameters.ElementAt(1);
|
||||
double tensileStrength = parameters.ElementAt(2);
|
||||
double stress = modulusOfElasticity * strain;
|
||||
if (stress > tensileStrength || stress < compressiveStrength) { return 0d; }
|
||||
else { return stress; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user