Settting for prestress has been fixed

This commit is contained in:
Evgeny Redikultsev
2023-03-23 21:04:27 +05:00
parent 9e7962fc3f
commit a88fa40f29
23 changed files with 286 additions and 120 deletions

View File

@@ -7,17 +7,17 @@ using System.Threading.Tasks;
namespace StructureHelper.Infrastructure.UI.DataContexts
{
public class ReinforcementViewPrimitive : PointViewPrimitive, IHasSurroundingPrimitive
public class ReinforcementViewPrimitive : PointViewPrimitive, IHasHostPrimitive
{
ReinforcementPrimitive primitive;
public INdmPrimitive SurroundingPrimitive
public INdmPrimitive HostPrimitive
{
get => primitive.SurroundingPrimitive;
get => primitive.HostPrimitive;
set
{
primitive.SurroundingPrimitive = value;
OnPropertyChanged(nameof(SurroundingPrimitive));
primitive.HostPrimitive = value;
OnPropertyChanged(nameof(HostPrimitive));
}
}

View File

@@ -0,0 +1,71 @@
using LoaderCalculator.Data.Materials;
using LoaderCalculator.Data.Matrix;
using LoaderCalculator.Logics;
using StructureHelper.Infrastructure.UI.DataContexts;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Strings;
using StructureHelperLogics.Models.Materials;
using StructureHelperLogics.Models.Primitives;
using StructureHelperLogics.NdmCalculations.Analyses.RC;
using StructureHelperLogics.NdmCalculations.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Services.ResultViewers
{
public static class ShowAnchorageResult
{
private static IStressLogic stressLogic => new StressLogic();
public static void ShowAnchorageField (IStrainMatrix strainMatrix, LimitStates limitState, CalcTerms calcTerm, IEnumerable<PrimitiveBase> primitives)
{
foreach (var item in primitives)
{
if (item is ReinforcementViewPrimitive)
{
var primitive = item as ReinforcementViewPrimitive;
var ndmPrimitive = primitive.GetNdmPrimitive() as ReinforcementPrimitive;
var inputData = new AnchorageInputData();
inputData.ConcreteStrength = GetConcreteStrength(limitState, calcTerm, ndmPrimitive);
inputData.ReinforcementStrength = GetReinforcementStrength(limitState, calcTerm, ndmPrimitive);
inputData.CrossSectionArea = ndmPrimitive.Area;
var diameter = Math.Sqrt(ndmPrimitive.Area / Math.PI) * 2d;
inputData.CrossSectionPerimeter = Math.PI * diameter;
var material = ndmPrimitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
var ndm = ndmPrimitive.GetNdms(material).Single();
inputData.ReinforcementStress = stressLogic.GetStress(strainMatrix, ndm);
inputData.LappedCountRate = 0.5d;
}
}
}
private static double GetConcreteStrength(LimitStates limitState, CalcTerms calcTerm, ReinforcementPrimitive primitive)
{
if (primitive.HostPrimitive is not null)
{
var host = primitive.HostPrimitive;
var hostMaterial = host.HeadMaterial.HelperMaterial;
if (hostMaterial is IConcreteLibMaterial)
{
var concreteMaterial = hostMaterial as IConcreteLibMaterial;
var concreteStrength = concreteMaterial.GetStrength(limitState, calcTerm).Tensile;
return concreteStrength;
}
}
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": host's material is incorrect or null");
}
private static double GetReinforcementStrength(LimitStates limitState, CalcTerms calcTerm, ReinforcementPrimitive primitive)
{
if (primitive.HeadMaterial.HelperMaterial is IReinforcementLibMaterial)
{
var material = primitive.HeadMaterial.HelperMaterial as IReinforcementLibMaterial;
var strength = material.GetStrength(limitState, calcTerm).Tensile;
return strength;
}
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": host's material is incorrect or null");
}
}
}

View File

@@ -1,43 +0,0 @@
<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculationResultWindow.CalculationResultView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculationResultWindow"
xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Calculations.CalculationResult"
d:DataContext="{d:DesignInstance vm:CalculationResultViewModel}"
mc:Ignorable="d"
Title="Results of calculations" Height="400" Width="800" MinHeight="400" MinWidth="600">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<DataGrid x:Name="ResultGrid" IsReadOnly="True" AutoGenerateColumns="False" ItemsSource="{Binding CalculationResults}" SelectedItem="{Binding SelectedResult}" >
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding IsValid}" Value="false">
<Setter Property="Background" Value="Pink"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridCheckBoxColumn Header="Valid" Binding="{Binding Path=IsValid}"/>
<DataGridTextColumn Header="Moment Mx" Width="90" Binding="{Binding Path=LoaderResults.ForceStrainPair.ForceMatrix.Mx, Converter={StaticResource MomentConverter}}"/>
<DataGridTextColumn Header="Moment My" Width="90" Binding="{Binding Path=LoaderResults.ForceStrainPair.ForceMatrix.My, Converter={StaticResource MomentConverter}}"/>
<DataGridTextColumn Header="Force Nz" Width="90" Binding="{Binding Path=LoaderResults.ForceStrainPair.ForceMatrix.Nz, Converter={StaticResource ForceConverter}}"/>
<DataGridTextColumn Header="Accuracy" Width="90" Binding="{Binding Path=LoaderResults.AccuracyRate}"/>
<DataGridTextColumn Header="Max Iteration" Width="90" Binding="{Binding Path=LoaderResults.IterationCounter}"/>
<DataGridTextColumn Header="Description" Width="300" Binding="{Binding Path=Desctription}"/>
<DataGridTextColumn Header="Kx" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.Kx}"/>
<DataGridTextColumn Header="Ky" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.Ky}"/>
<DataGridTextColumn Header="EpsZ" Width="90" Binding="{Binding LoaderResults.ForceStrainPair.StrainMatrix.EpsZ}"/>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Column="1">
<Button Margin="3" Content="Graphic" Command="{Binding ShowIsoFieldCommand}"/>
</StackPanel>
</Grid>
</Window>

View File

@@ -1,31 +0,0 @@
using StructureHelper.Windows.ViewModels.Calculations.CalculationResult;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace StructureHelper.Windows.CalculationWindows.CalculationResultWindow
{
/// <summary>
/// Логика взаимодействия для CalculationResultView.xaml
/// </summary>
public partial class CalculationResultView : Window
{
private CalculationResultViewModel viewModel;
public CalculationResultView(CalculationResultViewModel resultViewModel)
{
InitializeComponent();
viewModel = resultViewModel;
this.DataContext = viewModel;
}
}
}

View File

@@ -43,6 +43,7 @@
<Button Margin="3" Content="Interpolate" ToolTip="Create analysis by substep" Command="{Binding InterpolateCommand}"/>
<Button Margin="3" Content="Export" ToolTip="Export results to *.csv" Command="{Binding ExportToCSVCommand}"/>
<Button Margin="3" Content="Set Prestrain" ToolTip="Set strains as auto prestrain" Command="{Binding SetPrestrainCommand}"/>
<Button Margin="3" Content="Anchorage" ToolTip="Set strains as auto prestrain" Command="{Binding ShowAnchorageCommand}"/>
</StackPanel>
</Grid>
</Window>

View File

@@ -67,8 +67,8 @@
<ColumnDefinition Width="100"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Text="Inside of"/>
<ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding SurroundingPrimitives}" SelectedItem="{Binding SurroundingPrimitive}">
<TextBlock Grid.Row="0" Text="Host"/>
<ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding HostPrimitives}" SelectedItem="{Binding HostPrimitive}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid>

View File

@@ -47,6 +47,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
private RelayCommand exportToCSVCommand;
private RelayCommand interpolateCommand;
private RelayCommand setPrestrainCommand;
private ICommand showAnchorageCommand;
public IForcesResults ForcesResults
{
@@ -193,6 +194,24 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
}
}
public ICommand ShowAnchorageCommand
{
get
{
return showAnchorageCommand??
(showAnchorageCommand = new RelayCommand(o =>
{
showAnchorage();
}, o => SelectedResult != null
));
}
}
private void showAnchorage()
{
throw new NotImplementedException();
}
public ForcesResultsViewModel(IForceCalculator forceCalculator)
{
this.forceCalculator = forceCalculator;

View File

@@ -136,10 +136,10 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
}
foreach (var primitive in repository.Primitives)
{
if (primitive is IHasSurroundingPrimitive)
if (primitive is IHasHostPrimitive)
{
var sPrimitive = primitive as IHasSurroundingPrimitive;
if (sPrimitive.SurroundingPrimitive == ndmPrimitive) { sPrimitive.SurroundingPrimitive = null; }
var sPrimitive = primitive as IHasHostPrimitive;
if (sPrimitive.HostPrimitive == ndmPrimitive) { sPrimitive.HostPrimitive = null; }
}
}
Items.Remove(SelectedItem);

View File

@@ -36,7 +36,7 @@ namespace StructureHelper.Windows.ViewModels.PrimitiveProperties
public ICommand EditMaterialCommand { get; private set; }
public ObservableCollection<IHeadMaterial> HeadMaterials { get; private set; }
public ObservableCollection<PrimitiveBase> SurroundingPrimitives { get; private set; }
public ObservableCollection<PrimitiveBase> HostPrimitives { get; private set; }
public string Name
{
@@ -60,19 +60,19 @@ namespace StructureHelper.Windows.ViewModels.PrimitiveProperties
}
}
}
public PrimitiveBase? SurroundingPrimitive
public PrimitiveBase? HostPrimitive
{
get
{
if (primitive is not IHasSurroundingPrimitive)
if (primitive is not IHasHostPrimitive)
{
return null;
}
else
{
var sPrimitive = ((IHasSurroundingPrimitive)primitive).SurroundingPrimitive;
var sPrimitive = ((IHasHostPrimitive)primitive).HostPrimitive;
if (sPrimitive is null) { return null; }
foreach (var item in SurroundingPrimitives)
foreach (var item in HostPrimitives)
{
if (item.GetNdmPrimitive() == sPrimitive)
{
@@ -86,11 +86,11 @@ namespace StructureHelper.Windows.ViewModels.PrimitiveProperties
{
if (value is not null)
{
if (primitive is IHasSurroundingPrimitive)
if (primitive is IHasHostPrimitive)
{
var sPrimitive = value.GetNdmPrimitive();
((IHasSurroundingPrimitive)primitive).SurroundingPrimitive = sPrimitive;
OnPropertyChanged(nameof(SurroundingPrimitive));
((IHasHostPrimitive)primitive).HostPrimitive = sPrimitive;
OnPropertyChanged(nameof(HostPrimitive));
}
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $", Actual type: {value.GetType()}");
}
@@ -310,11 +310,11 @@ namespace StructureHelper.Windows.ViewModels.PrimitiveProperties
}
EditColorCommand = new RelayCommand(o => EditColor(), o => !SetMaterialColor);
EditMaterialCommand = new RelayCommand(o => EditMaterial());
SurroundingPrimitives = new ObservableCollection<PrimitiveBase>();
HostPrimitives = new ObservableCollection<PrimitiveBase>();
foreach (var item in sectionRepository.Primitives)
{
if (item is RectanglePrimitive || item is CirclePrimitive)
{SurroundingPrimitives.Add(PrimitiveOperations.ConvertNdmPrimitiveToPrimitiveBase(item));}
{HostPrimitives.Add(PrimitiveOperations.ConvertNdmPrimitiveToPrimitiveBase(item));}
}
}

View File

@@ -10,6 +10,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StructureHelperCommon.Infrastructures.Settings;
using LCMBML = LoaderCalculator.Data.Materials.MaterialBuilders.MaterialLogics;
namespace StructureHelperLogics.Models.Materials
{
@@ -21,12 +22,15 @@ namespace StructureHelperLogics.Models.Materials
public bool TensionForSLS { get; set; }
private IMaterialOptionLogic optionLogic;
private LCMBML.ITrueStrengthLogic strengthLogic;
public ConcreteLibMaterial()
{
SafetyFactors = new List<IMaterialSafetyFactor>();
SafetyFactors.AddRange(PartialCoefficientFactory.GetDefaultConcreteSafetyFactors(ProgramSetting.CodeType));
optionLogic = new MaterialOptionLogic(new LCMB.ConcreteOptions());
TensionForULS = false;
TensionForSLS = true;
}
public object Clone()
@@ -36,7 +40,26 @@ namespace StructureHelperLogics.Models.Materials
public LCM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
{
var materialOptions = optionLogic.SetMaterialOptions(MaterialEntity, limitState, calcTerm);
var materialOptions = optionLogic.SetMaterialOptions(MaterialEntity, limitState, calcTerm) as LCMB.ConcreteOptions;
materialOptions.WorkInTension = false;
if (limitState == LimitStates.ULS & TensionForULS == true)
{
materialOptions.WorkInTension = true;
}
if (limitState == LimitStates.SLS & TensionForSLS == true)
{
materialOptions.WorkInTension = true;
}
var strength = GetStrengthFactors(limitState, calcTerm);
materialOptions.ExternalFactor.Compressive = strength.Compressive;
materialOptions.ExternalFactor.Tensile = strength.Tensile;
LCMB.IMaterialBuilder builder = new LCMB.ConcreteBuilder(materialOptions);
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
return director.BuildMaterial();
}
public (double Compressive, double Tensile) GetStrengthFactors(LimitStates limitState, CalcTerms calcTerm)
{
double compressionVal = 1d;
double tensionVal = 1d;
foreach (var item in SafetyFactors.Where(x => x.Take == true))
@@ -44,11 +67,14 @@ namespace StructureHelperLogics.Models.Materials
compressionVal *= item.GetFactor(StressStates.Compression, calcTerm, limitState);
tensionVal *= item.GetFactor(StressStates.Tension, calcTerm, limitState);
}
materialOptions.ExternalFactor.Compressive = compressionVal;
materialOptions.ExternalFactor.Tensile = tensionVal;
LCMB.IMaterialBuilder builder = new LCMB.ConcreteBuilder(materialOptions);
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
return director.BuildMaterial();
return (compressionVal, tensionVal);
}
public (double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm)
{
strengthLogic = new LCMBML.TrueStrengthConcreteLogicSP63_2018(MaterialEntity.MainStrength);
var strength = strengthLogic.GetTrueStrength();
return (strength.Comressive, strength.Tensile);
}
}
}

View File

@@ -11,5 +11,6 @@ namespace StructureHelperLogics.Models.Materials
{
ILibMaterialEntity MaterialEntity { get; set; }
List<IMaterialSafetyFactor> SafetyFactors { get; }
(double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm);
}
}

View File

@@ -87,5 +87,10 @@ namespace StructureHelperLogics.Models.Materials
{
return new LibMaterial(this.MaterialType, this.codeType, this.Name, this.MainStrength);
}
public (double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm)
{
throw new NotImplementedException();
}
}
}

View File

@@ -7,6 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using LCM = LoaderCalculator.Data.Materials;
using LCMB = LoaderCalculator.Data.Materials.MaterialBuilders;
using LCMBML = LoaderCalculator.Data.Materials.MaterialBuilders.MaterialLogics;
namespace StructureHelperLogics.Models.Materials
{
@@ -16,6 +17,7 @@ namespace StructureHelperLogics.Models.Materials
public List<IMaterialSafetyFactor> SafetyFactors { get; }
private IMaterialOptionLogic optionLogic;
private LCMBML.ITrueStrengthLogic strengthLogic;
public ReinforcementLibMaterial()
{
@@ -31,6 +33,16 @@ namespace StructureHelperLogics.Models.Materials
public LCM.IMaterial GetLoaderMaterial(LimitStates limitState, CalcTerms calcTerm)
{
var materialOptions = optionLogic.SetMaterialOptions(MaterialEntity, limitState, calcTerm);
var strength = GetStrengthFactors(limitState, calcTerm);
materialOptions.ExternalFactor.Compressive = strength.Compressive;
materialOptions.ExternalFactor.Tensile = strength.Tensile;
LCMB.IMaterialBuilder builder = new LCMB.ReinforcementBuilder(materialOptions);
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
return director.BuildMaterial();
}
public (double Compressive, double Tensile) GetStrengthFactors(LimitStates limitState, CalcTerms calcTerm)
{
double compressionVal = 1d;
double tensionVal = 1d;
foreach (var item in SafetyFactors.Where(x => x.Take == true))
@@ -38,11 +50,14 @@ namespace StructureHelperLogics.Models.Materials
compressionVal *= item.GetFactor(StressStates.Compression, calcTerm, limitState);
tensionVal *= item.GetFactor(StressStates.Tension, calcTerm, limitState);
}
materialOptions.ExternalFactor.Compressive = compressionVal;
materialOptions.ExternalFactor.Tensile = tensionVal;
LCMB.IMaterialBuilder builder = new LCMB.ReinforcementBuilder(materialOptions);
LCMB.IBuilderDirector director = new LCMB.BuilderDirector(builder);
return director.BuildMaterial();
return (compressionVal, tensionVal);
}
public (double Compressive, double Tensile) GetStrength(LimitStates limitState, CalcTerms calcTerm)
{
strengthLogic = new LCMBML.TrueStrengthReinforcementLogic(MaterialEntity.MainStrength);
var strength = strengthLogic.GetTrueStrength();
return (strength.Comressive, strength.Tensile);
}
}
}

View File

@@ -58,7 +58,7 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
Area = barArea,
Name = "Left bottom point",
HeadMaterial = reinforcementMaterial,
SurroundingPrimitive=concreteBlock };
HostPrimitive=concreteBlock };
primitives.Add(point);
}
return primitives;

View File

@@ -59,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 ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[0], Area = area1, Name = "Left bottom point", HeadMaterial = reinforcement, SurroundingPrimitive=concreteBlock };
var point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[0], Area = area1, Name = "Left bottom point", HeadMaterial = reinforcement, HostPrimitive=concreteBlock };
primitives.Add(point);
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[0], Area = area1, Name = "Right bottom point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[0], Area = area1, Name = "Right bottom point", HeadMaterial = reinforcement, HostPrimitive = concreteBlock };
primitives.Add(point);
point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[1], Area = area2, Name = "Left top point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[1], Area = area2, Name = "Left top point", HeadMaterial = reinforcement, HostPrimitive = concreteBlock };
primitives.Add(point);
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[1], Area = area2, Name = "Right top point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[1], Area = area2, Name = "Right top point", HeadMaterial = reinforcement, HostPrimitive = concreteBlock };
primitives.Add(point);
return primitives;
}
@@ -83,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 ReinforcementPrimitive() { CenterX = xs[0] + dist * i, CenterY = ys[0], Area = area1, Name = $"Bottom point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
point = new ReinforcementPrimitive() { CenterX = xs[0] + dist * i, CenterY = ys[0], Area = area1, Name = $"Bottom point {i}", HeadMaterial = reinforcement, HostPrimitive = concreteBlock };
primitives.Add(point);
point = new ReinforcementPrimitive() { CenterX = xs[0] + dist * i, CenterY = ys[1], Area = area2, Name = $"Top point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
point = new ReinforcementPrimitive() { CenterX = xs[0] + dist * i, CenterY = ys[1], Area = area2, Name = $"Top point {i}", HeadMaterial = reinforcement, HostPrimitive = concreteBlock };
primitives.Add(point);
}
}
@@ -95,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 ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[0] + dist * i, Area = area1, Name = $"Left point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[0] + dist * i, Area = area1, Name = $"Left point {i}", HeadMaterial = reinforcement, HostPrimitive = concreteBlock };
primitives.Add(point);
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[0] + dist * i, Area = area1, Name = $"Right point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[0] + dist * i, Area = area1, Name = $"Right point {i}", HeadMaterial = reinforcement, HostPrimitive = concreteBlock };
primitives.Add(point);
}
}

View File

@@ -0,0 +1,50 @@
using LoaderCalculator.Logics.ConcreteCalculations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Analyses.RC
{
public class AnchorageCalculator : IAnchorageCalculator
{
private IAnchorageInputData inputData;
private IAnchorage anchorage;
public string Name { get; set; }
public AnchorageCalculator(IAnchorageInputData inputData)
{
this.inputData = inputData;
IAnchorageOptions anchorageOptions = GetAnchorageOptions();
anchorage = new AnchorageSP632018Rev3(anchorageOptions);
}
public double GetBaseDevLength()
{
return anchorage.GetBaseDevLength();
}
public double GetDevLength()
{
return anchorage.GetDevLength();
}
public double GetLapLength()
{
return anchorage.GetLapLength();
}
private IAnchorageOptions GetAnchorageOptions()
{
var anchorageOptions = new AnchorageOptionsSP63();
anchorageOptions.ConcreteStrength = inputData.ConcreteStrength;
anchorageOptions.ReinforcementStrength = inputData.ReinforcementStrength;
anchorageOptions.ReinforcementStress = inputData.ReinforcementStress;
anchorageOptions.CrossSectionArea = inputData.CrossSectionArea;
anchorageOptions.CrossSectionPerimeter = inputData.CrossSectionPerimeter;
anchorageOptions.LappedCountRate = inputData.LappedCountRate;
return anchorageOptions;
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Analyses.RC
{
public class AnchorageInputData : IAnchorageInputData
{
public double ConcreteStrength { get; set; }
public double ReinforcementStrength { get; set; }
public double CrossSectionArea { get; set; }
public double CrossSectionPerimeter { get; set; }
public double ReinforcementStress { get; set; }
public double LappedCountRate { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Analyses.RC
{
public interface IAnchorageCalculator
{
double GetBaseDevLength();
double GetDevLength();
double GetLapLength();
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Analyses.RC
{
public interface IAnchorageInputData
{
double ConcreteStrength { get; set; }
double ReinforcementStrength { get; set; }
double CrossSectionArea { get; set; }
double CrossSectionPerimeter { get; set; }
double ReinforcementStress { get; set; }
double LappedCountRate { get; set; }
}
}

View File

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

View File

@@ -16,7 +16,7 @@ using System.Windows.Media.Media3D;
namespace StructureHelperLogics.NdmCalculations.Primitives
{
/// <inheritdoc/>
public class ReinforcementPrimitive : IPointPrimitive, IHasSurroundingPrimitive
public class ReinforcementPrimitive : IPointPrimitive, IHasHostPrimitive
{
/// <inheritdoc/>
public string Name { get; set; }
@@ -36,7 +36,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public int Id { get; set; }
public double Area { get; set; }
public INdmPrimitive SurroundingPrimitive { get; set; }
public INdmPrimitive HostPrimitive { get; set; }
public ICrossSection? CrossSection { get; set; }
public ReinforcementPrimitive()
@@ -54,7 +54,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
var primitive = new ReinforcementPrimitive();
NdmPrimitivesService.CopyNdmProperties(this, primitive);
primitive.Area = Area;
primitive.SurroundingPrimitive = SurroundingPrimitive;
primitive.HostPrimitive = HostPrimitive;
return primitive;
}

View File

@@ -15,7 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
{
public static void SetPrestrain(IEnumerable<INdm> ndmCollection, IStrainTuple strainTuple)
{
NdmTransform.SetPrestrain(ndmCollection, new StrainMatrix() { Kx = strainTuple.Kx, Ky = strainTuple.Kx, EpsZ = strainTuple.Kx });
NdmTransform.SetPrestrain(ndmCollection, new StrainMatrix() { Kx = strainTuple.Kx, Ky = strainTuple.Ky, EpsZ = strainTuple.EpsZ });
}
public static void CommonTransform(IEnumerable<INdm> ndmCollection, IShapeTriangulationLogicOptions options)