Surrounding property was added

This commit is contained in:
Evgeny Redikultsev
2023-03-19 17:38:01 +05:00
parent edb8afe321
commit 9e7962fc3f
47 changed files with 716 additions and 261 deletions

View File

@@ -13,14 +13,14 @@ namespace StructureHelperLogics.Models.CrossSections
{
public class CrossSectionRepository : ICrossSectionRepository
{
public List<IForceCombinationList> ForceCombinationLists { get; private set; }
public List<IForceAction> ForceActions { get; private set; }
public List<IHeadMaterial> HeadMaterials { get; private set; }
public List<INdmPrimitive> Primitives { get; }
public List<INdmCalculator> CalculatorsList { get; private set; }
public CrossSectionRepository()
{
ForceCombinationLists = new List<IForceCombinationList>();
ForceActions = new List<IForceAction>();
HeadMaterials = new List<IHeadMaterial>();
Primitives = new List<INdmPrimitive>();
CalculatorsList = new List<INdmCalculator>();

View File

@@ -14,7 +14,7 @@ namespace StructureHelperLogics.Models.CrossSections
{
public interface ICrossSectionRepository : IHasHeadMaterials, IHasPrimitives
{
List<IForceCombinationList> ForceCombinationLists { get; }
List<IForceAction> ForceActions { get; }
List<INdmCalculator> CalculatorsList { get; }
}
}

View File

@@ -13,7 +13,7 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
public class CircleGeometryLogic : IRCGeometryLogic
{
ICircleTemplate template;
CirclePrimitive concreteBlock;
public IEnumerable<IHeadMaterial> HeadMaterials { get; set; }
@@ -35,8 +35,8 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
var diameter = template.Shape.Diameter;
var concreteMaterial = HeadMaterials.ToList()[0];
var primitives = new List<INdmPrimitive>();
var rectangle = new CirclePrimitive() { Diameter = diameter, Name = "Concrete block", HeadMaterial = concreteMaterial };
primitives.Add(rectangle);
concreteBlock = new CirclePrimitive() { Diameter = diameter, Name = "Concrete block", HeadMaterial = concreteMaterial };
primitives.Add(concreteBlock);
return primitives;
}
@@ -52,7 +52,13 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
var angle = i * dAngle;
var x = radius * Math.Sin(angle);
var y = radius * Math.Cos(angle);
var point = new PointPrimitive() { CenterX = x, CenterY = y, Area = barArea, Name = "Left bottom point", HeadMaterial = reinforcementMaterial };
var point = new ReinforcementPrimitive()
{ CenterX = x,
CenterY = y,
Area = barArea,
Name = "Left bottom point",
HeadMaterial = reinforcementMaterial,
SurroundingPrimitive=concreteBlock };
primitives.Add(point);
}
return primitives;

View File

@@ -17,6 +17,7 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
IRectangleBeamTemplate template;
IHeadMaterial concrete => HeadMaterials.ToList()[0];
IHeadMaterial reinforcement => HeadMaterials.ToList()[1];
RectanglePrimitive concreteBlock;
RectangleShape rect => template.Shape as RectangleShape;
double width => rect.Width;
@@ -47,8 +48,8 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
private IEnumerable<INdmPrimitive> GetConcretePrimitives()
{
var primitives = new List<INdmPrimitive>();
var rectangle = new RectanglePrimitive(concrete) { Width = width, Height = height, Name = "Concrete block" };
primitives.Add(rectangle);
concreteBlock = new RectanglePrimitive(concrete) { Width = width, Height = height, Name = "Concrete block" };
primitives.Add(concreteBlock);
return primitives;
}
@@ -58,13 +59,13 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
double[] ys = new double[] { -height / 2 + gap, height / 2 - gap };
List<INdmPrimitive> primitives = new List<INdmPrimitive>();
var point = new PointPrimitive(reinforcement) { CenterX = xs[0], CenterY = ys[0], Area = area1, Name = "Left bottom point" };
var point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[0], Area = area1, Name = "Left bottom point", HeadMaterial = reinforcement, SurroundingPrimitive=concreteBlock };
primitives.Add(point);
point = new PointPrimitive(reinforcement) { CenterX = xs[1], CenterY = ys[0], Area = area1, Name = "Right bottom point" };
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[0], Area = area1, Name = "Right bottom point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
primitives.Add(point);
point = new PointPrimitive(reinforcement) { CenterX = xs[0], CenterY = ys[1], Area = area2, Name = "Left top point" };
point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[1], Area = area2, Name = "Left top point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
primitives.Add(point);
point = new PointPrimitive(reinforcement) { CenterX = xs[1], CenterY = ys[1], Area = area2, Name = "Right top point" };
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[1], Area = area2, Name = "Right top point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
primitives.Add(point);
return primitives;
}
@@ -82,9 +83,9 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
double dist = (xs[1] - xs[0]) / count;
for (int i = 1; i < count; i++)
{
point = new PointPrimitive(reinforcement) { CenterX = xs[0] + dist * i, CenterY = ys[0], Area = area1, Name = $"Bottom point {i}" };
point = new ReinforcementPrimitive() { CenterX = xs[0] + dist * i, CenterY = ys[0], Area = area1, Name = $"Bottom point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
primitives.Add(point);
point = new PointPrimitive(reinforcement) { CenterX = xs[0] + dist * i, CenterY = ys[1], Area = area2, Name = $"Top point {i}" };
point = new ReinforcementPrimitive() { CenterX = xs[0] + dist * i, CenterY = ys[1], Area = area2, Name = $"Top point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
primitives.Add(point);
}
}
@@ -94,9 +95,9 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
double dist = (ys[1] - ys[0]) / count;
for (int i = 1; i < count; i++)
{
point = new PointPrimitive(reinforcement) { CenterX = xs[0], CenterY = ys[0] + dist * i, Area = area1, Name = $"Left point {i}" };
point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[0] + dist * i, Area = area1, Name = $"Left point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
primitives.Add(point);
point = new PointPrimitive(reinforcement) { CenterX = xs[1], CenterY = ys[0] + dist * i, Area = area1, Name = $"Right point {i}" };
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[0] + dist * i, Area = area1, Name = $"Right point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
primitives.Add(point);
}
}

View File

@@ -37,10 +37,14 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
var materials = materialLogic.GetHeadMaterials();
geometryLogic.HeadMaterials = materials;
primitives = geometryLogic.GetNdmPrimitives();
foreach (var primitive in primitives)
{
primitive.CrossSection = section;
}
repository.HeadMaterials.AddRange(materials);
repository.Primitives.AddRange(primitives);
combinations = forceLogic.GetCombinationList();
repository.ForceCombinationLists.AddRange(combinations);
repository.ForceActions.AddRange(combinations);
calculators = calculatorLogic.GetNdmCalculators();
AddAllForcesToCalculators();
AddAllPrimitivesToCalculator();
@@ -55,7 +59,7 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
if (calculator is IHasForceCombinations)
{
var forceCalculator = calculator as IHasForceCombinations;
forceCalculator.ForceCombinationLists.AddRange(combinations);
forceCalculator.ForceActions.AddRange(combinations);
}
}
}

View File

@@ -25,12 +25,12 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public string Name { get; set; }
public List<LimitStates> LimitStatesList { get; }
public List<CalcTerms> CalcTermsList { get; }
public List<IForceCombinationList> ForceCombinationLists { get; }
public List<IForceAction> ForceActions { get; }
public List<INdmPrimitive> Primitives { get; }
public INdmResult Result { get; private set; }
public ICompressedMember CompressedMember { get; }
public IAccuracy Accuracy { get; set; }
public List<IForceCombinationList> ForceCombinationLists { get; private set; }
public void Run()
{
var checkResult = CheckInputData();
@@ -39,7 +39,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
Result = new ForcesResults() { IsValid = false, Desctription = checkResult };
return;
}
else { CalculateResult(); }
else
{
GetCombinations();
CalculateResult();
}
}
private void CalculateResult()
@@ -103,6 +107,15 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
Result = ndmResult;
}
private void GetCombinations()
{
ForceCombinationLists = new List<IForceCombinationList>();
foreach (var item in ForceActions)
{
ForceCombinationLists.Add(item.GetCombinations());
}
}
private IForceTuple GetLongTuple(List<IDesignForceTuple> designForces, LimitStates limitState)
{
IForceTuple longTuple;
@@ -143,7 +156,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
{
string result = "";
NdmPrimitivesService.CheckPrimitives(Primitives);
if (ForceCombinationLists.Count == 0) { result += "Calculator does not contain any forces \n"; }
if (ForceActions.Count == 0) { result += "Calculator does not contain any forces \n"; }
if (LimitStatesList.Count == 0) { result += "Calculator does not contain any limit states \n"; }
if (CalcTermsList.Count == 0) { result += "Calculator does not contain any duration \n"; }
return result;
@@ -151,7 +164,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public ForceCalculator()
{
ForceCombinationLists = new List<IForceCombinationList>();
ForceActions = new List<IForceAction>();
Primitives = new List<INdmPrimitive>();
CompressedMember = new CompressedMember() { Buckling = false };
Accuracy = new Accuracy() { IterationAccuracy = 0.001d, MaxIterationCount = 1000 };
@@ -177,7 +190,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
AccuracyService.CopyProperties(Accuracy, target.Accuracy);
CompressedMemberServices.CopyProperties(CompressedMember, target.CompressedMember);
target.Primitives.AddRange(Primitives);
target.ForceCombinationLists.AddRange(ForceCombinationLists);
target.ForceActions.AddRange(ForceActions);
return target;
}
}

View File

@@ -15,5 +15,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
List<LimitStates> LimitStatesList { get; }
ICompressedMember CompressedMember { get; }
IAccuracy Accuracy { get; set; }
List<IForceCombinationList> ForceCombinationLists { get;}
}
}

View File

@@ -4,6 +4,7 @@ using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.ShapeServices;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmPrimitives;
using System;
@@ -29,6 +30,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public int NdmMinDivision { get; set; }
public bool ClearUnderlying { get; set; }
public bool Triangulate { get; set; }
public ICrossSection? CrossSection { get; set; }
public CirclePrimitive()
{

View File

@@ -6,8 +6,8 @@ using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Primitives
{
public interface IHasSorroundingPrimitive
public interface IHasSurroundingPrimitive
{
INdmPrimitive SorroundingPrimitive { get; set; }
INdmPrimitive? SurroundingPrimitive { get; set; }
}
}

View File

@@ -8,6 +8,7 @@ using System.Collections.Generic;
using StructureHelperCommon.Infrastructures.Interfaces;
using System;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.Models.CrossSections;
namespace StructureHelperLogics.NdmCalculations.Primitives
{
@@ -16,6 +17,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
string? Name { get; set; }
double CenterX { get; set; }
double CenterY { get; set; }
ICrossSection? CrossSection { get; set; }
IHeadMaterial? HeadMaterial { get; set; }
/// <summary>
/// Flag of triangulation

View File

@@ -10,6 +10,7 @@ using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmPrimitives;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.Models.CrossSections;
namespace StructureHelperLogics.Models.Primitives
{
@@ -28,6 +29,7 @@ namespace StructureHelperLogics.Models.Primitives
public IVisualProperty VisualProperty { get; }
public bool Triangulate { get; set; }
public ICrossSection? CrossSection { get; set; }
public PointPrimitive()
{

View File

@@ -5,6 +5,7 @@ using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.ShapeServices;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.Models.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmPrimitives;
@@ -33,7 +34,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public bool ClearUnderlying { get; set; }
public bool Triangulate { get; set; }
public IVisualProperty VisualProperty { get; }
public ICrossSection? CrossSection { get; set; }
public RectanglePrimitive()
{

View File

@@ -2,6 +2,7 @@
using LoaderCalculator.Data.Ndms;
using StructureHelper.Models.Materials;
using StructureHelperCommon.Models.Forces;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.Models.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmPrimitives;
@@ -15,7 +16,7 @@ using System.Windows.Media.Media3D;
namespace StructureHelperLogics.NdmCalculations.Primitives
{
/// <inheritdoc/>
public class ReinforcementPrimitive : IPointPrimitive, IHasSorroundingPrimitive
public class ReinforcementPrimitive : IPointPrimitive, IHasSurroundingPrimitive
{
/// <inheritdoc/>
public string Name { get; set; }
@@ -35,7 +36,8 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public int Id { get; set; }
public double Area { get; set; }
public INdmPrimitive SorroundingPrimitive { get; set; }
public INdmPrimitive SurroundingPrimitive { get; set; }
public ICrossSection? CrossSection { get; set; }
public ReinforcementPrimitive()
{
@@ -52,7 +54,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
var primitive = new ReinforcementPrimitive();
NdmPrimitivesService.CopyNdmProperties(this, primitive);
primitive.Area = Area;
primitive.SorroundingPrimitive = this.SorroundingPrimitive;
primitive.SurroundingPrimitive = SurroundingPrimitive;
return primitive;
}

View File

@@ -23,17 +23,21 @@ namespace StructureHelperLogics.Services.NdmCalculations
CompressedMemberServices.CopyProperties(source.CompressedMember, calculator.CompressedMember);
calculator.Accuracy = source.Accuracy;
calculator.Primitives.AddRange(source.Primitives);
calculator.ForceCombinationLists.Clear();
var combination = new ForceCombinationList()
calculator.ForceActions.Clear();
var forceTuples = ForceTupleService.InterpolateDesignTuple(finishDesignForce, startDesignForce, stepCount);
foreach (var forceTuple in forceTuples)
{
Name = "New combination",
SetInGravityCenter = false
};
combination.DesignForces.Clear();
combination.DesignForces.AddRange(ForceTupleService.InterpolateDesignTuple(finishDesignForce, startDesignForce, stepCount));
combination.ForcePoint.X = 0;
combination.ForcePoint.Y = 0;
calculator.ForceCombinationLists.Add(combination);
var combination = new ForceCombinationList()
{
Name = "New combination",
SetInGravityCenter = false
};
combination.DesignForces.Clear();
combination.DesignForces.Add(forceTuple);
combination.ForcePoint.X = 0;
combination.ForcePoint.Y = 0;
calculator.ForceActions.Add(combination);
}
return calculator;
}
}