Carbon Fiber Material was Added
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
{
|
||||
public enum CodeTypes
|
||||
{
|
||||
SP63_13330_2018,
|
||||
EuroCode_2_1990
|
||||
SP63_2018,
|
||||
EuroCode_2_1990,
|
||||
SP164_2014,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
Concrete,
|
||||
Reinforcement,
|
||||
//Steel,
|
||||
//CarbonFiber,
|
||||
CarbonFiber,
|
||||
GlassFiber,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ namespace StructureHelperCommon.Infrastructures.Settings
|
||||
{
|
||||
public static class ProgramSetting
|
||||
{
|
||||
public static CodeTypes CodeType => CodeTypes.SP63_13330_2018;
|
||||
public static CodeTypes CodeType => CodeTypes.SP63_2018;
|
||||
public static CodeTypes FRCodeType => CodeTypes.SP164_2014;
|
||||
public static CrossSectionAxisNames CrossSectionAxisNames => new CrossSectionAxisNames();
|
||||
public static LimitStatesList LimitStatesList => new LimitStatesList();
|
||||
public static CalcTermList CalcTermList => new CalcTermList();
|
||||
|
||||
36
StructureHelperCommon/Models/Forces/DesignForcePair.cs
Normal file
36
StructureHelperCommon/Models/Forces/DesignForcePair.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class DesignForcePair : IDesignForcePair
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public IPoint2D ForcePoint { get; set; }
|
||||
public bool SetInGravityCenter { get; set; }
|
||||
public LimitStates LimitState { get; set; }
|
||||
public IForceTuple LongForceTuple { get; set; }
|
||||
public IForceTuple FullForceTuple { get; set; }
|
||||
|
||||
public DesignForcePair()
|
||||
{
|
||||
LongForceTuple = new ForceTuple();
|
||||
FullForceTuple = new ForceTuple();
|
||||
}
|
||||
|
||||
public IForceCombinationList GetCombinations()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public LimitStates LimitState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public IForceTuple ForceTuple { get; set; }
|
||||
public ForceTuple ForceTuple { get; set; }
|
||||
|
||||
public DesignForceTuple(LimitStates limitState, CalcTerms calcTerm) : this()
|
||||
{
|
||||
@@ -22,7 +22,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
public object Clone()
|
||||
{
|
||||
var newTuple = new DesignForceTuple(this.LimitState, this.CalcTerm);
|
||||
newTuple.ForceTuple = this.ForceTuple.Clone() as IForceTuple;
|
||||
newTuple.ForceTuple = this.ForceTuple.Clone() as ForceTuple;
|
||||
return newTuple;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
var termFactor = calcTerm is CalcTerms.ShortTerm ? 1d : LongTermFactor;
|
||||
var designForceTuple = new DesignForceTuple() { LimitState = limitState, CalcTerm = calcTerm };
|
||||
designForceTuple.ForceTuple = ForceTupleService.MultiplyTuples(FullSLSForces, stateFactor * termFactor);
|
||||
designForceTuple.ForceTuple = ForceTupleService.MultiplyTuples(FullSLSForces, stateFactor * termFactor) as ForceTuple;
|
||||
result.DesignForces.Add(designForceTuple);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
var forceTupleList = DesignForces.Where(x => x.LimitState == limitState & x.CalcTerm == calcTerm);
|
||||
foreach (var item in forceTupleList)
|
||||
{
|
||||
designForceTuple.ForceTuple = ForceTupleService.SumTuples(designForceTuple.ForceTuple, item.ForceTuple);
|
||||
designForceTuple.ForceTuple = ForceTupleService.SumTuples(designForceTuple.ForceTuple, item.ForceTuple) as ForceTuple;
|
||||
}
|
||||
result.DesignForces.Add(designForceTuple);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
@@ -21,20 +22,13 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
IForceTuple forceTuple = new ForceTuple() { Mx = Mx, My = My, Nz = Nz, Qx = Qx, Qy = Qy, Mz = Mz};
|
||||
ForceTuple forceTuple = new ForceTuple() { Mx = Mx, My = My, Nz = Nz, Qx = Qx, Qy = Qy, Mz = Mz};
|
||||
return forceTuple;
|
||||
}
|
||||
public static ForceTuple operator +(ForceTuple first) => first;
|
||||
public static ForceTuple operator +(ForceTuple first, ForceTuple second)
|
||||
{
|
||||
var result = new ForceTuple();
|
||||
result.Mx += first.Mx + second.Mx;
|
||||
result.My += first.My + second.My;
|
||||
result.Mz += first.Mz + second.Mz;
|
||||
result.Qx += first.Qx + second.Qx;
|
||||
result.Qy += first.Qy + second.Qy;
|
||||
result.Nz += first.Nz + second.Nz;
|
||||
return result;
|
||||
return ForceTupleService.SumTuples(first, second) as ForceTuple;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
StructureHelperCommon/Models/Forces/IDesignForcePair.cs
Normal file
16
StructureHelperCommon/Models/Forces/IDesignForcePair.cs
Normal file
@@ -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.Forces
|
||||
{
|
||||
public interface IDesignForcePair : IForceAction
|
||||
{
|
||||
LimitStates LimitState { get; set; }
|
||||
IForceTuple LongForceTuple { get; set; }
|
||||
IForceTuple FullForceTuple { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
LimitStates LimitState { get; set; }
|
||||
CalcTerms CalcTerm { get; set; }
|
||||
IForceTuple ForceTuple { get; set; }
|
||||
|
||||
ForceTuple ForceTuple { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
33
StructureHelperCommon/Models/Forces/StrainTuple.cs
Normal file
33
StructureHelperCommon/Models/Forces/StrainTuple.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class StrainTuple : IForceTuple
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public double Mx { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double My { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double Nz { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double Qx { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double Qy { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double Mz { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
StrainTuple forceTuple = new StrainTuple() { Mx = Mx, My = My, Nz = Nz, Qx = Qx, Qy = Qy, Mz = Mz };
|
||||
return forceTuple;
|
||||
}
|
||||
public static StrainTuple operator +(StrainTuple first) => first;
|
||||
public static StrainTuple operator +(StrainTuple first, ForceTuple second)
|
||||
{
|
||||
return ForceTupleService.SumTuples(first, second) as StrainTuple;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for generic curvature for beams
|
||||
/// </summary>
|
||||
public interface IStrainTuple : ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Curvature about x-axis
|
||||
/// </summary>
|
||||
double Kx { get; set; }
|
||||
/// <summary>
|
||||
/// Curvature about y-axis
|
||||
/// </summary>
|
||||
double Ky { get; set; }
|
||||
/// <summary>
|
||||
/// Strain along z-axis
|
||||
/// </summary>
|
||||
double EpsZ { get; set; }
|
||||
/// <summary>
|
||||
/// Screw along x-axis
|
||||
/// </summary>
|
||||
double Gx { get; set; }
|
||||
/// <summary>
|
||||
/// Screw along y-axis
|
||||
/// </summary>
|
||||
double Gy { get; set; }
|
||||
/// <summary>
|
||||
/// Twisting about z-axis
|
||||
/// </summary>
|
||||
double Gz { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class StrainTuple : IStrainTuple
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public double Kx { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double Ky { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double EpsZ { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double Gx { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double Gy { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public double Gz { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var target = new StrainTuple();
|
||||
StrainTupleService.CopyProperties(this, target);
|
||||
return target;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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 FactorLogic : IFactorLogic
|
||||
{
|
||||
public List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
public (double Compressive, double Tensile) GetTotalFactor(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
double compressionVal = 1d;
|
||||
double tensionVal = 1d;
|
||||
foreach (var item in SafetyFactors.Where(x => x.Take == true))
|
||||
{
|
||||
compressionVal *= item.GetFactor(StressStates.Compression, calcTerm, limitState);
|
||||
tensionVal *= item.GetFactor(StressStates.Tension, calcTerm, limitState);
|
||||
}
|
||||
return (compressionVal, tensionVal);
|
||||
}
|
||||
public FactorLogic(List<IMaterialSafetyFactor> safetyFactors)
|
||||
{
|
||||
SafetyFactors = safetyFactors;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using StructureHelperCommon.Infrastructures.Strings;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public enum FactorType
|
||||
public enum ConcreteFactorType
|
||||
{
|
||||
LongTermFactor,
|
||||
BleedingFactor,
|
||||
@@ -13,11 +13,11 @@ namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
|
||||
public static class ConcreteFactorsFactory
|
||||
{
|
||||
public static IMaterialSafetyFactor GetFactor(FactorType factorType)
|
||||
public static IMaterialSafetyFactor GetFactor(ConcreteFactorType factorType)
|
||||
{
|
||||
if (factorType == FactorType.LongTermFactor) { return LongTerm(); }
|
||||
else if (factorType == FactorType.BleedingFactor) { return Bleeding(); }
|
||||
else if (factorType == FactorType.PlainConcreteFactor) { return PlainConcrete(); }
|
||||
if (factorType == ConcreteFactorType.LongTermFactor) { return LongTerm(); }
|
||||
else if (factorType == ConcreteFactorType.BleedingFactor) { return Bleeding(); }
|
||||
else if (factorType == ConcreteFactorType.PlainConcreteFactor) { return PlainConcrete(); }
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
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 FRFactorType
|
||||
{
|
||||
ConditionFactor,
|
||||
CohesionFactor,
|
||||
LongTermFactor,
|
||||
}
|
||||
public static class FRFactorsFactory
|
||||
{
|
||||
const string gammaf1Name = "Gamma_f1";
|
||||
const string gammaf1Description = "Coefficient for considering environment";
|
||||
const string gammaf2Name = "Gamma_f2";
|
||||
const string gammaf2Description = "Coefficient for considering cohesion";
|
||||
const string gammaf3Name = "Gamma_f3";
|
||||
const string gammaf3Description = "Coefficient for considering long term calculations";
|
||||
public static IMaterialSafetyFactor GetCarbonFactor(FRFactorType factorType)
|
||||
{
|
||||
if (factorType == FRFactorType.LongTermFactor) { return LongTerm(1d / 1.2d,0.8d); }
|
||||
else if (factorType == FRFactorType.ConditionFactor) { return Condition(gammaf1Name, gammaf1Description , 0.9d); }
|
||||
else if (factorType == FRFactorType.CohesionFactor) { return Condition(gammaf2Name, gammaf2Description, 0.9d); }
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown);
|
||||
}
|
||||
public static IMaterialSafetyFactor GetGlassFactor(FRFactorType factorType)
|
||||
{
|
||||
if (factorType == FRFactorType.LongTermFactor) { return LongTerm(1d / 1.8d, 0.3d); }
|
||||
else if (factorType == FRFactorType.ConditionFactor) { return Condition(gammaf1Name, gammaf1Description, 0.7d); }
|
||||
else if (factorType == FRFactorType.CohesionFactor) { return Condition(gammaf2Name, gammaf2Description, 0.9d); }
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown);
|
||||
}
|
||||
|
||||
private static IMaterialSafetyFactor Condition(string name, string description, double value)
|
||||
{
|
||||
IMaterialSafetyFactor safetyFactor = new MaterialSafetyFactor()
|
||||
{
|
||||
Name = name,
|
||||
Description = description,
|
||||
};
|
||||
IMaterialPartialFactor partialFactor;
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Tension,
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = value
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = value
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Tension,
|
||||
CalcTerm = CalcTerms.LongTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = value
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.LongTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = value
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
return safetyFactor;
|
||||
}
|
||||
|
||||
private static IMaterialSafetyFactor LongTerm(double shortValue, double longValue)
|
||||
{
|
||||
IMaterialSafetyFactor safetyFactor = new MaterialSafetyFactor()
|
||||
{
|
||||
Name = gammaf3Name,
|
||||
Description = gammaf3Description,
|
||||
};
|
||||
IMaterialPartialFactor partialFactor;
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Tension,
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = shortValue
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.ShortTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = shortValue
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Tension,
|
||||
CalcTerm = CalcTerms.LongTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = longValue
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
partialFactor = new MaterialPartialFactor
|
||||
{
|
||||
StressState = StressStates.Compression,
|
||||
CalcTerm = CalcTerms.LongTerm,
|
||||
LimitState = LimitStates.ULS,
|
||||
FactorValue = longValue
|
||||
};
|
||||
safetyFactor.PartialFactors.Add(partialFactor);
|
||||
return safetyFactor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
}
|
||||
private static IEnumerable<ILibMaterialEntity> GetConcreteSP63()
|
||||
{
|
||||
var code = CodeTypes.SP63_13330_2018;
|
||||
var code = CodeTypes.SP63_2018;
|
||||
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B5", MainStrength = 5e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B7,5", MainStrength = 7.5e6 });
|
||||
@@ -57,7 +57,7 @@ namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
}
|
||||
private static IEnumerable<ILibMaterialEntity> GetReinforcementSP63()
|
||||
{
|
||||
var code = CodeTypes.SP63_13330_2018;
|
||||
var code = CodeTypes.SP63_2018;
|
||||
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
|
||||
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "A240", MainStrength = 240e6 });
|
||||
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "A400", MainStrength = 400e6 });
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
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 IFactorLogic
|
||||
{
|
||||
List<IMaterialSafetyFactor> SafetyFactors { get; }
|
||||
(double Compressive, double Tensile) GetTotalFactor(LimitStates limitState, CalcTerms calcTerm);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
namespace StructureHelperCommon.Models.Shapes
|
||||
using System;
|
||||
|
||||
namespace StructureHelperCommon.Models.Shapes
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for point of center of some shape
|
||||
/// Интерфейс для точки центра некоторой формы
|
||||
/// </summary>
|
||||
public interface IPoint2D
|
||||
public interface IPoint2D : ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Coordinate of center of rectangle by local axis X, m
|
||||
|
||||
@@ -7,5 +7,11 @@
|
||||
public double X { get; set; }
|
||||
/// <inheritdoc />
|
||||
public double Y { get; set; }
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var point = new Point2D() { X = X, Y = Y };
|
||||
return point;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -17,5 +21,82 @@ namespace StructureHelperCommon.Services.Forces
|
||||
target.ForcePoint.X = source.ForcePoint.X;
|
||||
target.ForcePoint.Y = source.ForcePoint.Y;
|
||||
}
|
||||
|
||||
public static List<IDesignForcePair> ConvertCombinationToPairs(IForceCombinationList combinations)
|
||||
{
|
||||
var resultList = new List<IDesignForcePair>();
|
||||
var limitStates = new List<LimitStates>() { LimitStates.ULS, LimitStates.SLS };
|
||||
var calcTerms = new List<CalcTerms>() { CalcTerms.ShortTerm, CalcTerms.LongTerm };
|
||||
foreach (var limitState in limitStates)
|
||||
{
|
||||
var tuples = new IForceTuple[2];
|
||||
for (int i = 0; i < calcTerms.Count; i++)
|
||||
{
|
||||
var forceTupleList = combinations.DesignForces.Where(x => x.LimitState == limitState && x.CalcTerm == calcTerms[i]).Select(x => x.ForceTuple);
|
||||
var sumLongTuple = ForceTupleService.MergeTupleCollection(forceTupleList);
|
||||
tuples[i] = sumLongTuple;
|
||||
}
|
||||
var pair = new DesignForcePair()
|
||||
{
|
||||
Name = combinations.Name,
|
||||
ForcePoint = (IPoint2D)combinations.ForcePoint.Clone(),
|
||||
SetInGravityCenter = combinations.SetInGravityCenter,
|
||||
LimitState = limitState,
|
||||
FullForceTuple = tuples[0],
|
||||
LongForceTuple = tuples[1]
|
||||
};
|
||||
resultList.Add(pair);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
public static List<IDesignForcePair> ConvertCombinationToPairs(IForceCombinationByFactor combinations)
|
||||
{
|
||||
var resultList = new List<IDesignForcePair>();
|
||||
var limitStates = new List<LimitStates>() { LimitStates.ULS, LimitStates.SLS };
|
||||
var calcTerms = new List<CalcTerms>() { CalcTerms.ShortTerm, CalcTerms.LongTerm };
|
||||
foreach (var limitState in limitStates)
|
||||
{
|
||||
var tuples = new IForceTuple[2];
|
||||
for (int i = 0; i < calcTerms.Count; i++)
|
||||
{
|
||||
var stateFactor = limitState is LimitStates.SLS ? 1d : combinations.ULSFactor;
|
||||
var termFactor = calcTerms[i] == CalcTerms.ShortTerm ? 1d : combinations.LongTermFactor;
|
||||
var forceTupleList = ForceTupleService.MultiplyTuples(combinations.FullSLSForces, stateFactor * termFactor);
|
||||
tuples[i] = forceTupleList;
|
||||
}
|
||||
var pair = new DesignForcePair()
|
||||
{
|
||||
Name = combinations.Name,
|
||||
ForcePoint = (IPoint2D)combinations.ForcePoint.Clone(),
|
||||
SetInGravityCenter = combinations.SetInGravityCenter,
|
||||
LimitState = limitState,
|
||||
FullForceTuple = tuples[0],
|
||||
LongForceTuple = tuples[1]
|
||||
};
|
||||
resultList.Add(pair);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public static List<IDesignForcePair> ConvertCombinationToPairs(IForceAction forceAction)
|
||||
{
|
||||
var resultList = new List<IDesignForcePair>();
|
||||
if (forceAction is IForceCombinationList)
|
||||
{
|
||||
var item = forceAction as IForceCombinationList;
|
||||
resultList.AddRange(ConvertCombinationToPairs(item));
|
||||
}
|
||||
else if (forceAction is IForceCombinationByFactor)
|
||||
{
|
||||
var item = forceAction as IForceCombinationByFactor;
|
||||
resultList.AddRange(ConvertCombinationToPairs(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $": expected {typeof(IForceAction)}, but was {forceAction.GetType()}");
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
@@ -8,6 +9,12 @@ namespace StructureHelperCommon.Services.Forces
|
||||
{
|
||||
public static class ForceTupleService
|
||||
{
|
||||
public static void CopyProperties(IForceTuple source, IForceTuple target, double factor = 1d)
|
||||
{
|
||||
CheckTuples(source, target);
|
||||
SumTupleToTarget(source, target, 0);
|
||||
SumTupleToTarget(source, target, factor);
|
||||
}
|
||||
public static IForceTuple MoveTupleIntoPoint(IForceTuple forceTuple, IPoint2D point2D)
|
||||
{
|
||||
var newTuple = forceTuple.Clone() as IForceTuple;
|
||||
@@ -15,44 +22,37 @@ namespace StructureHelperCommon.Services.Forces
|
||||
newTuple.My -= newTuple.Nz * point2D.X;
|
||||
return newTuple;
|
||||
}
|
||||
public static IForceTuple SumTuples(IForceTuple first, IForceTuple second)
|
||||
public static IForceTuple SumTuples(IForceTuple first, IForceTuple second, double factor = 1d)
|
||||
{
|
||||
var result = new ForceTuple();
|
||||
result.Mx += first.Mx + second.Mx;
|
||||
result.My += first.My + second.My;
|
||||
result.Mz += first.Mz + second.Mz;
|
||||
result.Qx += first.Qx + second.Qx;
|
||||
result.Qy += first.Qy + second.Qy;
|
||||
result.Nz += first.Nz + second.Nz;
|
||||
CheckTuples(first, second);
|
||||
IForceTuple result = GetNewTupleSameType(first);
|
||||
SumTupleToTarget(first, result, 1d);
|
||||
SumTupleToTarget(second, result, factor);
|
||||
return result;
|
||||
}
|
||||
public static IForceTuple MergeTupleCollection(IEnumerable<IForceTuple> tupleCollection)
|
||||
{
|
||||
CheckTupleCollection(tupleCollection);
|
||||
var result = GetNewTupleSameType(tupleCollection.First());
|
||||
foreach (var item in tupleCollection)
|
||||
{
|
||||
SumTuples(result, item);
|
||||
};
|
||||
return result;
|
||||
}
|
||||
public static IForceTuple MultiplyTuples(IForceTuple first, double factor)
|
||||
{
|
||||
var result = new ForceTuple();
|
||||
result.Mx += first.Mx * factor;
|
||||
result.My += first.My * factor;
|
||||
result.Mz += first.Mz * factor;
|
||||
result.Qx += first.Qx * factor;
|
||||
result.Qy += first.Qy * factor;
|
||||
result.Nz += first.Nz * factor;
|
||||
var result = GetNewTupleSameType(first);
|
||||
CopyProperties(first, result, factor);
|
||||
return result;
|
||||
}
|
||||
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;
|
||||
dNz = endTuple.Nz - startTuple.Nz;
|
||||
return new ForceTuple()
|
||||
{
|
||||
Mx = startTuple.Mx + dMx * coefficient,
|
||||
My = startTuple.My + dMy * coefficient,
|
||||
Nz = startTuple.Nz + dNz * coefficient
|
||||
};
|
||||
if (startTuple is null) startTuple = GetNewTupleSameType(endTuple);
|
||||
else { CheckTuples(startTuple, endTuple); }
|
||||
var deltaTuple = SumTuples(endTuple, startTuple, -1d);
|
||||
return SumTuples(startTuple, deltaTuple, coefficient);
|
||||
}
|
||||
|
||||
|
||||
public static List<IDesignForceTuple> InterpolateDesignTuple(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce = null, int stepCount = 10)
|
||||
{
|
||||
if (startDesignForce.LimitState != finishDesignForce.LimitState) throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid);
|
||||
@@ -61,11 +61,50 @@ namespace StructureHelperCommon.Services.Forces
|
||||
double step = 1d / stepCount;
|
||||
for (int i = 0; i <= stepCount; i++)
|
||||
{
|
||||
var currentTuple = InterpolateTuples(finishDesignForce.ForceTuple, startDesignForce.ForceTuple, i * step);
|
||||
var currentTuple = InterpolateTuples(finishDesignForce.ForceTuple, startDesignForce.ForceTuple, i * step) as ForceTuple;
|
||||
var currentDesignTuple = new DesignForceTuple() { LimitState = finishDesignForce.LimitState, CalcTerm = finishDesignForce.CalcTerm, ForceTuple = currentTuple };
|
||||
tuples.Add(currentDesignTuple);
|
||||
}
|
||||
return tuples;
|
||||
}
|
||||
private static void SumTupleToTarget(IForceTuple source, IForceTuple target, double factor = 1d)
|
||||
{
|
||||
target.Mx += source.Mx * factor;
|
||||
target.My += source.My * factor;
|
||||
target.Nz += source.Nz * factor;
|
||||
target.Qx += source.Qx * factor;
|
||||
target.Qy += source.Qy * factor;
|
||||
target.Mz += source.Mz * factor;
|
||||
}
|
||||
private static void CheckTuples(IForceTuple first, IForceTuple second)
|
||||
{
|
||||
if (first.GetType() != second.GetType())
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect +
|
||||
$": Type of first parameter (type = {first.GetType()}) doesn't corespond second parameter type ({second.GetType()})");
|
||||
}
|
||||
}
|
||||
private static void CheckTupleCollection(IEnumerable<IForceTuple> tupleCollection)
|
||||
{
|
||||
if (tupleCollection.Count() == 0)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Collection is Empty");
|
||||
}
|
||||
foreach (var item in tupleCollection)
|
||||
{
|
||||
CheckTuples(tupleCollection.First(), item);
|
||||
}
|
||||
}
|
||||
private static IForceTuple GetNewTupleSameType(IForceTuple first)
|
||||
{
|
||||
IForceTuple result;
|
||||
if (first is ForceTuple) { result = new ForceTuple(); }
|
||||
else if (first is StrainTuple) { result = new StrainTuple(); }
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,25 +5,15 @@ namespace StructureHelperCommon.Services.Forces
|
||||
{
|
||||
public static class StrainTupleService
|
||||
{
|
||||
public static void CopyProperties (IStrainTuple source, IStrainTuple target, double factor = 1 )
|
||||
public static IStrainMatrix ConvertToLoaderStrainMatrix(StrainTuple strainTuple)
|
||||
{
|
||||
target.Kx = source.Kx * factor;
|
||||
target.Ky = source.Ky * factor;
|
||||
target.EpsZ = source.EpsZ * factor;
|
||||
target.Gx = source.Gx * factor;
|
||||
target.Gy = source.Gy * factor;
|
||||
target.Gz = source.Gz * factor;
|
||||
}
|
||||
|
||||
public static IStrainMatrix ConvertToLoaderStrainMatrix(IStrainTuple strainTuple)
|
||||
{
|
||||
IStrainMatrix strainMatrix = new StrainMatrix() { Kx = strainTuple.EpsZ, Ky = strainTuple.Ky, EpsZ = strainTuple.EpsZ };
|
||||
IStrainMatrix strainMatrix = new StrainMatrix() { Kx = strainTuple.Nz, Ky = strainTuple.My, EpsZ = strainTuple.Nz };
|
||||
return strainMatrix;
|
||||
}
|
||||
|
||||
public static IStrainTuple ConvertToStrainTuple(IStrainMatrix strainMatrix)
|
||||
public static StrainTuple ConvertToStrainTuple(IStrainMatrix strainMatrix)
|
||||
{
|
||||
IStrainTuple strainTuple = new StrainTuple() { Kx = strainMatrix.Kx, Ky = strainMatrix.Ky, EpsZ = strainMatrix.EpsZ };
|
||||
StrainTuple strainTuple = new StrainTuple() { Mx = strainMatrix.Kx, My = strainMatrix.Ky, Nz = strainMatrix.EpsZ };
|
||||
return strainTuple;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user