Impliment IOneVaribleFunction to delegate
This commit is contained in:
@@ -7,6 +7,7 @@ using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Services.ColorServices;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -174,7 +175,7 @@ namespace StructureHelper.Windows.Graphs
|
||||
for (double s = minValue; s < maxValue; s += step)
|
||||
{
|
||||
double strain = s * factor;
|
||||
double diagramValue = loaderMaterial.Diagram.Invoke(loaderMaterial.DiagramParameters, strain) * factor;
|
||||
double diagramValue = loaderMaterial.Diagram.Invoke(loaderMaterial.DiagramParameters, strain) * factor; //!!!!!!!!!!!!!!!!!!!!
|
||||
StressEntity stressEntity = new()
|
||||
{
|
||||
LimitState = limitState,
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
private static IHeadMaterial GetFunction()
|
||||
{
|
||||
var material = new HeadMaterial();
|
||||
material.HelperMaterial = new ReinforcementLibMaterial();
|
||||
material.HelperMaterial = new FunctionMaterial() { Modulus = 2e11d, CompressiveStrength = 4e8d, TensileStrength = 4e8d };
|
||||
return material;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using StructureHelperLogics.Models.Materials.Logics;
|
||||
using System;
|
||||
@@ -17,6 +18,7 @@ namespace StructureHelperLogics.Models.Materials
|
||||
public double CompressiveStrength { get; set; }
|
||||
public double TensileStrength { get; set; }
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; } = new();
|
||||
public IOneVariableFunction Function { get; set; }
|
||||
|
||||
public Guid Id { get; }
|
||||
|
||||
@@ -33,7 +35,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
var material = functionMaterialLogic.GetLoaderMaterial(this, limitState, calcTerm);
|
||||
return material;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var newItem = new FunctionMaterial();
|
||||
@@ -41,7 +42,6 @@ namespace StructureHelperLogics.Models.Materials
|
||||
updateStrategy.Update(newItem, this);
|
||||
return newItem;
|
||||
}
|
||||
|
||||
public IMaterial GetCrackedLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
return GetLoaderMaterial(limitState, calcTerm);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -8,6 +10,10 @@ namespace StructureHelperLogics.Models.Materials
|
||||
{
|
||||
internal interface IFunctionMaterial : IHelperMaterial
|
||||
{
|
||||
|
||||
double Modulus { get; set; }
|
||||
double CompressiveStrength { get; set; }
|
||||
double TensileStrength { get; set; }
|
||||
List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
public IOneVariableFunction Function { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,14 @@ namespace StructureHelperLogics.Models.Materials.Logics
|
||||
internal class FunctionMaterialLogic : IFunctionMaterialLogic
|
||||
{
|
||||
private List<double> parameters;
|
||||
private IFunctionMaterial functionMaterial;
|
||||
public IMaterial GetLoaderMaterial(IFunctionMaterial functionMaterial, LimitStates limitState, CalcTerms calcTerm, double factor = 1d)
|
||||
{
|
||||
IMaterial material = new Material();
|
||||
/*material.InitModulus = functionMaterial.Modulus;
|
||||
material.InitModulus = functionMaterial.Modulus;
|
||||
IFactorLogic factorLogic = new FactorLogic(functionMaterial.SafetyFactors);
|
||||
var factors = factorLogic.GetTotalFactor(limitState, calcTerm);
|
||||
this.functionMaterial = functionMaterial;
|
||||
parameters = new List<double>()
|
||||
{
|
||||
functionMaterial.Modulus,
|
||||
@@ -25,17 +27,12 @@ namespace StructureHelperLogics.Models.Materials.Logics
|
||||
functionMaterial.TensileStrength * factors.Tensile * factor
|
||||
};
|
||||
material.DiagramParameters = parameters;
|
||||
material.Diagram = GetStressByStrain;*/
|
||||
material.Diagram = GetStressByStrain;
|
||||
return material;
|
||||
}
|
||||
private double GetStressByStrain(IEnumerable<double> parameters1, double 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; }
|
||||
return functionMaterial.Function.GetByX(strain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<FileName>Models\Materials\IConcreteLibMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IElasticMaterial" Collapsed="true">
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IElasticMaterial">
|
||||
<Position X="3.25" Y="2" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAgAEAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
@@ -69,7 +69,7 @@
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IHelperMaterial" Collapsed="true">
|
||||
<Position X="4.25" Y="0.5" Width="1.5" />
|
||||
<Position X="3.25" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAQAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IHelperMaterial.cs</FileName>
|
||||
@@ -89,7 +89,7 @@
|
||||
<FileName>Models\Materials\IMaterialOptionLogic.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IReinforcementLibMaterial" Collapsed="true">
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IReinforcementLibMaterial">
|
||||
<Position X="5" Y="5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
@@ -106,7 +106,7 @@
|
||||
<Interface Name="StructureHelperLogics.Models.Materials.IFunctionMaterial">
|
||||
<Position X="0.75" Y="2" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<HashCode>AAAAAAAAgAEAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Materials\IFunctionMaterial.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
|
||||
Reference in New Issue
Block a user