Interpolation View for calculation result was added
This commit is contained in:
14
StructureHelperCommon/Infrastructures/Enums/StressStates.cs
Normal file
14
StructureHelperCommon/Infrastructures/Enums/StressStates.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Infrastructures.Enums
|
||||
{
|
||||
public enum StressStates
|
||||
{
|
||||
Tension,
|
||||
Compression
|
||||
}
|
||||
}
|
||||
@@ -19,5 +19,6 @@ namespace StructureHelperCommon.Infrastructures.Strings
|
||||
public static string FileCantBeDeleted => "#0008: File can't be deleted";
|
||||
public static string FileCantBeSaved => "#0009: File can't be saved";
|
||||
public static string VisualPropertyIsNotRight => "#0010: VisualPropertyIsNotRight";
|
||||
public static string FactorMustBeGraterThanZero => "#0011: Partial factor must not be less than zero";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public enum FactorType
|
||||
{
|
||||
LongTermFactor,
|
||||
BleedingFactor,
|
||||
PlainConcreteFactor
|
||||
}
|
||||
|
||||
public static class ConcreteFactorsFactory
|
||||
{
|
||||
public static IMaterialSafetyFactor GetFactor(FactorType factorType)
|
||||
{
|
||||
if (factorType == FactorType.LongTermFactor) { return LongTerm(); }
|
||||
else if (factorType == FactorType.BleedingFactor) { return Bleeding(); }
|
||||
else if (factorType == FactorType.PlainConcreteFactor) { return PlainConcrete(); }
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown);
|
||||
}
|
||||
|
||||
private static IMaterialSafetyFactor LongTerm()
|
||||
{
|
||||
IMaterialSafetyFactor safetyFactor = new MaterialSafetyFactor()
|
||||
{
|
||||
Name = "Gamma_b1",
|
||||
Description = "Coefficient for considering long term calculations",
|
||||
};
|
||||
IMaterialPartialFactor partialFactor;
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Tension,
|
||||
CalcTerm = CalcTerms.LongTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = 0.9d
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.LongTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = 0.9d
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
return safetyFactor;
|
||||
}
|
||||
|
||||
private static IMaterialSafetyFactor Bleeding()
|
||||
{
|
||||
IMaterialSafetyFactor safetyFactor = new MaterialSafetyFactor()
|
||||
{
|
||||
Name = "Gamma_b3",
|
||||
Description = "Coefficient for considering bleeding in vertical placement conditionals",
|
||||
};
|
||||
IMaterialPartialFactor partialFactor;
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = 0.85d
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.LongTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = 0.85d
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
return safetyFactor;
|
||||
}
|
||||
|
||||
private static IMaterialSafetyFactor PlainConcrete()
|
||||
{
|
||||
IMaterialSafetyFactor safetyFactor = new MaterialSafetyFactor()
|
||||
{
|
||||
Name = "Gamma_b2",
|
||||
Description = "Coefficient for plain concrete structures",
|
||||
};
|
||||
IMaterialPartialFactor partialFactor;
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = 0.9d
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.LongTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = 0.9d
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
return safetyFactor;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public interface IMaterialPartialFactor : IPartialFactor
|
||||
{
|
||||
StressStates StressState { get; set; }
|
||||
CalcTerms CalcTerm { get; set; }
|
||||
LimitStates LimitState { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public interface IMaterialSafetyFactor : ICloneable
|
||||
{
|
||||
string Name { get; set; }
|
||||
bool Take { get; set; }
|
||||
string Description { get; set; }
|
||||
List<IMaterialPartialFactor> PartialFactors { get; }
|
||||
double GetFactor(StressStates stressState, CalcTerms calcTerm, LimitStates limitStates);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public interface IPartialFactor : ICloneable
|
||||
{
|
||||
double FactorValue {get;set;}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public class MaterialPartialFactor : IMaterialPartialFactor
|
||||
{
|
||||
private double factorValue;
|
||||
|
||||
public StressStates StressState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public LimitStates LimitState { get; set; }
|
||||
public double FactorValue
|
||||
{
|
||||
get => factorValue;
|
||||
set
|
||||
{
|
||||
if (value < 0 )
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.FactorMustBeGraterThanZero);
|
||||
}
|
||||
factorValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public MaterialPartialFactor()
|
||||
{
|
||||
StressState = StressStates.Compression;
|
||||
LimitState = LimitStates.ULS;
|
||||
CalcTerm = CalcTerms.LongTerm;
|
||||
FactorValue = 1d;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var newItem = new MaterialPartialFactor()
|
||||
{
|
||||
StressState = StressState,
|
||||
CalcTerm = CalcTerm,
|
||||
LimitState = LimitState,
|
||||
FactorValue = FactorValue,
|
||||
};
|
||||
return newItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public class MaterialSafetyFactor : IMaterialSafetyFactor
|
||||
{
|
||||
public string Name {get; set; }
|
||||
public bool Take { get; set; }
|
||||
public string Description { get; set; }
|
||||
public List<IMaterialPartialFactor> PartialFactors { get; }
|
||||
|
||||
public MaterialSafetyFactor()
|
||||
{
|
||||
Take = true;
|
||||
Name = "New factor";
|
||||
Description = "Material safety factor for ...";
|
||||
PartialFactors = new List<IMaterialPartialFactor>();
|
||||
}
|
||||
|
||||
public double GetFactor(StressStates stressState, CalcTerms calcTerm, LimitStates limitStates)
|
||||
{
|
||||
double result = 1d;
|
||||
var coefficients = PartialFactors.Where(x => (x.StressState == stressState & x.CalcTerm == calcTerm & x.LimitState == limitStates));
|
||||
foreach (var item in coefficients) { result *= item.FactorValue;}
|
||||
return result;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var newItem = new MaterialSafetyFactor();
|
||||
newItem.Take = Take;
|
||||
newItem.Name = Name;
|
||||
newItem.Description = Description;
|
||||
foreach (var item in PartialFactors)
|
||||
{
|
||||
newItem.PartialFactors.Add(item.Clone() as IMaterialPartialFactor);
|
||||
}
|
||||
return newItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -18,8 +20,9 @@ namespace StructureHelperCommon.Services.Forces
|
||||
return newTuple;
|
||||
}
|
||||
|
||||
public static IForceTuple InterpolateTuples(IForceTuple startTuple, IForceTuple endTuple, double coefficient)
|
||||
public static IForceTuple InterpolateTuples(IForceTuple endTuple, IForceTuple startTuple = null, double coefficient = 0.5d)
|
||||
{
|
||||
if (startTuple == null) startTuple = new ForceTuple();
|
||||
double dMx, dMy, dNz;
|
||||
dMx = endTuple.Mx - startTuple.Mx;
|
||||
dMy = endTuple.My - startTuple.My;
|
||||
@@ -32,20 +35,17 @@ namespace StructureHelperCommon.Services.Forces
|
||||
};
|
||||
}
|
||||
|
||||
public static IForceTuple InterpolateTuples(IForceTuple endTuple, double coefficient)
|
||||
{
|
||||
IForceTuple startTuple = new ForceTuple();
|
||||
return InterpolateTuples(startTuple, endTuple, coefficient);
|
||||
}
|
||||
|
||||
public static List<IDesignForceTuple> InterpolateDesignTuple(IDesignForceTuple endTuple, int stepCount)
|
||||
public static List<IDesignForceTuple> InterpolateDesignTuple(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce = null, int stepCount = 10)
|
||||
{
|
||||
if (startDesignForce.LimitState != finishDesignForce.LimitState) throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid);
|
||||
if (startDesignForce.CalcTerm != finishDesignForce.CalcTerm) throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid);
|
||||
var tuples =new List<IDesignForceTuple>();
|
||||
double step = 1d / stepCount;
|
||||
for (int i = 0; i <= stepCount; i++)
|
||||
{
|
||||
var currentTuple = InterpolateTuples(endTuple.ForceTuple, i * step);
|
||||
var currentDesignTuple = new DesignForceTuple() { LimitState = endTuple.LimitState, CalcTerm = endTuple.CalcTerm, ForceTuple = currentTuple };
|
||||
var currentTuple = InterpolateTuples(finishDesignForce.ForceTuple, startDesignForce.ForceTuple, i * step);
|
||||
var currentDesignTuple = new DesignForceTuple() { LimitState = finishDesignForce.LimitState, CalcTerm = finishDesignForce.CalcTerm, ForceTuple = currentTuple };
|
||||
tuples.Add(currentDesignTuple);
|
||||
}
|
||||
return tuples;
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<Compile Include="Infrastructures\Enums\CalcTerms.cs" />
|
||||
<Compile Include="Infrastructures\Enums\CodeTypes.cs" />
|
||||
<Compile Include="Infrastructures\Enums\LimitStates.cs" />
|
||||
<Compile Include="Infrastructures\Enums\StressStates.cs" />
|
||||
<Compile Include="Infrastructures\Enums\UnitTypes.cs" />
|
||||
<Compile Include="Infrastructures\Exceptions\StructureHelperException.cs" />
|
||||
<Compile Include="Infrastructures\Interfaces\IHasForceCombinations.cs" />
|
||||
@@ -68,11 +69,17 @@
|
||||
<Compile Include="Models\Forces\IForceRepository.cs" />
|
||||
<Compile Include="Models\Forces\IForceTuple.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\ConcreteMaterialEntity.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\Factories\ConcreteFactorsFactory.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\Factories\LibMaterialFactory.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\IConcreteMaterialEntity.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\ILibMaterialEntity.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\IMaterialPartialFactor.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\IMaterialSafetyFactor.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\IPartialFactor.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\IReinforcementMaterialEntity.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\LibMaterialPepository.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\MaterialPartialFactor.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\MaterialSafetyFactor.cs" />
|
||||
<Compile Include="Models\Materials\Libraries\ReinforcementMaterialEntity.cs" />
|
||||
<Compile Include="Models\Shapes\Point2D.cs" />
|
||||
<Compile Include="Models\Shapes\IPoint2D.cs" />
|
||||
|
||||
Reference in New Issue
Block a user