Interpolation View for calculation result was added
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user