Crack Calculator was added
This commit is contained in:
@@ -1,33 +1,26 @@
|
||||
using LoaderCalculator;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.SourceData;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Sections;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Calculations;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperCommon.Services.Sections;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using StructureHelperLogics.NdmCalculations.Buckling;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ForceCalculator : IForceCalculator
|
||||
{
|
||||
static readonly ForceCalculatorUpdateStrategy updateStrategy = new();
|
||||
public string Name { get; set; }
|
||||
public List<LimitStates> LimitStatesList { get; }
|
||||
public List<CalcTerms> CalcTermsList { get; }
|
||||
public List<IForceAction> ForceActions { get; }
|
||||
public List<INdmPrimitive> Primitives { get; }
|
||||
public INdmResult Result { get; private set; }
|
||||
public IResult Result { get; private set; }
|
||||
public ICompressedMember CompressedMember { get; }
|
||||
public IAccuracy Accuracy { get; set; }
|
||||
public List<IForceCombinationList> ForceCombinationLists { get; private set; }
|
||||
@@ -184,16 +177,9 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
IForceCalculator target = new ForceCalculator { Name = Name + " copy"};
|
||||
target.LimitStatesList.Clear();
|
||||
target.LimitStatesList.AddRange(LimitStatesList);
|
||||
target.CalcTermsList.Clear();
|
||||
target.CalcTermsList.AddRange(CalcTermsList);
|
||||
AccuracyService.CopyProperties(Accuracy, target.Accuracy);
|
||||
CompressedMemberServices.CopyProperties(CompressedMember, target.CompressedMember);
|
||||
target.Primitives.AddRange(Primitives);
|
||||
target.ForceActions.AddRange(ForceActions);
|
||||
return target;
|
||||
var newCalculator = new ForceCalculator();
|
||||
updateStrategy.Update(newCalculator, this);
|
||||
return newCalculator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public class ForceTupleCalculator : IForceTupleCalculator
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public INdmResult Result { get; private set; }
|
||||
public IResult Result { get; private set; }
|
||||
|
||||
private IForceTupleInputData inputData;
|
||||
|
||||
|
||||
@@ -4,12 +4,10 @@ using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Sections;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IForceCalculator : INdmCalculator, IHasPrimitives, IHasForceCombinations
|
||||
public interface IForceCalculator : ICalculator, IHasPrimitives, IHasForceCombinations
|
||||
{
|
||||
List<CalcTerms> CalcTermsList { get; }
|
||||
List<LimitStates> LimitStatesList { get; }
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IForceTupleCalculator : INdmCalculator
|
||||
public interface IForceTupleCalculator : ICalculator
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IForcesResults : INdmResult
|
||||
public interface IForcesResults : IResult
|
||||
{
|
||||
string Description { get; set; }
|
||||
List<IForcesTupleResult> ForcesResultList { get; }
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using LoaderCalculator.Data.ResultData;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IForcesTupleResult : INdmResult
|
||||
public interface IForcesTupleResult : IResult
|
||||
{
|
||||
IDesignForceTuple DesignForceTuple { get; set; }
|
||||
ILoaderResults LoaderResults { get; set; }
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Sections;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
|
||||
{
|
||||
public class ForceCalculatorUpdateStrategy : IUpdateStrategy<IForceCalculator>
|
||||
{
|
||||
static readonly AccuracyUpdateStrategy accuracyUpdateStrategy = new();
|
||||
static readonly CompressedMemberUpdateStrategy compressedMemberUpdateStrategy = new();
|
||||
public void Update(IForceCalculator targetObject, IForceCalculator sourceObject)
|
||||
{
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.LimitStatesList.Clear();
|
||||
targetObject.LimitStatesList.AddRange(sourceObject.LimitStatesList);
|
||||
targetObject.CalcTermsList.Clear();
|
||||
targetObject.CalcTermsList.AddRange(sourceObject.CalcTermsList);
|
||||
accuracyUpdateStrategy.Update(targetObject.Accuracy, sourceObject.Accuracy);
|
||||
compressedMemberUpdateStrategy.Update(targetObject.CompressedMember, sourceObject.CompressedMember);
|
||||
targetObject.Primitives.Clear();
|
||||
targetObject.Primitives.AddRange(sourceObject.Primitives);
|
||||
targetObject.ForceActions.Clear();
|
||||
targetObject.ForceActions.AddRange(sourceObject.ForceActions);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -15,7 +16,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Geometry
|
||||
IGeometryResult geometryResult;
|
||||
public string Name { get; set; }
|
||||
|
||||
public INdmResult Result => geometryResult;
|
||||
public IResult Result => geometryResult;
|
||||
|
||||
public GeometryCalculator(IEnumerable<INdm> ndms, IStrainMatrix strainMatrix)
|
||||
{
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.Geometry
|
||||
{
|
||||
public interface IGeometryCalculator : INdmCalculator
|
||||
public interface IGeometryCalculator : ICalculator
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.Geometry
|
||||
{
|
||||
public interface IGeometryResult : INdmResult
|
||||
public interface IGeometryResult : IResult
|
||||
{
|
||||
List<IValueParameter<string>> TextParameters { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using TaskManager;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||
{
|
||||
public interface INdmCalculator : ICloneable
|
||||
{
|
||||
string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Method for calculating
|
||||
/// </summary>
|
||||
void Run();
|
||||
/// <summary>
|
||||
/// Result of Calculations
|
||||
/// </summary>
|
||||
INdmResult Result { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||
{
|
||||
public interface INdmResult
|
||||
{
|
||||
/// <summary>
|
||||
/// True if result of calculation is valid
|
||||
/// </summary>
|
||||
bool IsValid { get; set; }
|
||||
string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Services;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.Logics
|
||||
{
|
||||
public class CalculatorUpdateStrategy : IUpdateStrategy<ICalculator>
|
||||
{
|
||||
public void Update(ICalculator targetObject, ICalculator sourceObject)
|
||||
{
|
||||
CheckObject.CompareTypes(targetObject, sourceObject);
|
||||
if (targetObject is IForceCalculator force)
|
||||
{
|
||||
new ForceCalculatorUpdateStrategy().Update(force, (IForceCalculator)sourceObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorCommonProcessor.ObjectTypeIsUnknown(typeof(INdmPrimitive), sourceObject.GetType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
public static class InputDataFactory
|
||||
{
|
||||
private static IStressLogic stressLogic => new StressLogic();
|
||||
public static IAnchorageInputData GetInputData(ReinforcementPrimitive ndmPrimitive, IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, double lappedCountRate)
|
||||
public static IAnchorageInputData GetInputData(RebarPrimitive ndmPrimitive, IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, double lappedCountRate)
|
||||
{
|
||||
var inputData = new AnchorageInputData();
|
||||
inputData.ConcreteStrength = GetConcreteStrength(limitState, calcTerm, ndmPrimitive);
|
||||
@@ -43,7 +43,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
return inputData;
|
||||
}
|
||||
|
||||
private static double GetConcreteStrength(LimitStates limitState, CalcTerms calcTerm, ReinforcementPrimitive primitive)
|
||||
private static double GetConcreteStrength(LimitStates limitState, CalcTerms calcTerm, RebarPrimitive primitive)
|
||||
{
|
||||
if (primitive.HostPrimitive is not null)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": host material is incorrect or null");
|
||||
}
|
||||
|
||||
private static double GetReinforcementStrength(LimitStates limitState, CalcTerms calcTerm, ReinforcementPrimitive primitive)
|
||||
private static double GetReinforcementStrength(LimitStates limitState, CalcTerms calcTerm, RebarPrimitive primitive)
|
||||
{
|
||||
if (primitive.HeadMaterial.HelperMaterial is IReinforcementLibMaterial)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user