Change beam shear calculator

This commit is contained in:
RedikultsevEvg
2025-08-09 17:33:08 +05:00
parent b34618e8a4
commit 3d8ac6f0c4
22 changed files with 372 additions and 198 deletions

View File

@@ -6,7 +6,7 @@ namespace DataAccess.DTOs
{ {
internal class PrimitiveVisualPropertyFromDTOConvertStrategy : ConvertStrategy<PrimitiveVisualProperty, PrimitiveVisualPropertyDTO> internal class PrimitiveVisualPropertyFromDTOConvertStrategy : ConvertStrategy<PrimitiveVisualProperty, PrimitiveVisualPropertyDTO>
{ {
private IUpdateStrategy<IPrimitiveVisualProperty> _updateStrategy; private IUpdateStrategy<IPrimitiveVisualProperty> updateStrategy;
public PrimitiveVisualPropertyFromDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger) : base(referenceDictionary, traceLogger) public PrimitiveVisualPropertyFromDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger) : base(referenceDictionary, traceLogger)
{ {
@@ -14,9 +14,10 @@ namespace DataAccess.DTOs
public override PrimitiveVisualProperty GetNewItem(PrimitiveVisualPropertyDTO source) public override PrimitiveVisualProperty GetNewItem(PrimitiveVisualPropertyDTO source)
{ {
_updateStrategy ??= new PrimitiveVisualPropertyUpdateStrategy(); updateStrategy ??= new PrimitiveVisualPropertyUpdateStrategy();
ChildClass = this; ChildClass = this;
NewItem = new(source.Id); NewItem = new(source.Id);
updateStrategy.Update(NewItem, source);
return NewItem; return NewItem;
} }
} }

View File

@@ -19,6 +19,7 @@ namespace DataAccess.DTOs
_updateStrategy ??= new PrimitiveVisualPropertyUpdateStrategy(); _updateStrategy ??= new PrimitiveVisualPropertyUpdateStrategy();
ChildClass = this; ChildClass = this;
NewItem = new(source.Id); NewItem = new(source.Id);
_updateStrategy.Update(NewItem, source);
return NewItem; return NewItem;
} }
} }

View File

@@ -13,6 +13,10 @@ namespace DataAccess.DTOs
public double RelativeEffectiveDepthRangeValue { get; set; } = 3.3; public double RelativeEffectiveDepthRangeValue { get; set; } = 3.3;
[JsonProperty("StepCount")] [JsonProperty("StepCount")]
public int StepCount { get; set; } = 55; public int StepCount { get; set; } = 55;
[JsonProperty("SectionLengthMaxValue")]
public double RelativeEffectiveDepthSectionLengthMaxValue { get; set; } = 3;
[JsonProperty("LengthMinValue")]
public double RelativeEffectiveDepthSectionLengthMinValue { get; set; } = 0;
public BeamShearDesignRangePropertyDTO(Guid id) public BeamShearDesignRangePropertyDTO(Guid id)
{ {

View File

@@ -9,16 +9,21 @@ namespace StructureHelper.Infrastructure.UI.GraphicalPrimitives
{ {
private IBeamShearSectionLogicResult source; private IBeamShearSectionLogicResult source;
private IInclinedSection inclinedSection => source.InputData.InclinedSection; private IInclinedSection inclinedSection => source.InputData.InclinedSection;
private IInclinedSection inclinedCrack => source.InputData.InclinedCrack;
public double SectionStartX => inclinedSection.StartCoord; public double SectionStartX => inclinedSection.StartCoord;
public double SectionEndX => inclinedSection.EndCoord; public double SectionEndX => inclinedSection.EndCoord;
public double SectionStartY => inclinedSection.FullDepth - inclinedSection.EffectiveDepth; public double SectionStartY => inclinedSection.FullDepth - inclinedSection.EffectiveDepth;
public double SectionEndY => inclinedSection.FullDepth; public double SectionEndY => inclinedSection.FullDepth;
public double CrackStartX => inclinedCrack.StartCoord;
public double FactorOfUsing => Math.Round(source.FactorOfUsing, 4); public double FactorOfUsing => Math.Round(source.FactorOfUsing, 4);
public double EffectiveDepth => Math.Round(inclinedSection.EffectiveDepth, 3); public double EffectiveDepth => Math.Round(inclinedSection.EffectiveDepth, 3);
public double SpanRatio => (inclinedSection.EndCoord - inclinedSection.StartCoord) / inclinedSection.EffectiveDepth; public double SpanRatio => (inclinedSection.EndCoord - inclinedSection.StartCoord) / inclinedSection.EffectiveDepth;
public double CrackSpanRatio => (inclinedCrack.EndCoord - inclinedCrack.StartCoord) / inclinedSection.EffectiveDepth;
public double ActualShearForce => Math.Round(source.InputData.ForceTuple.Qy); public double ActualShearForce => Math.Round(source.InputData.ForceTuple.Qy);
public double UltimateShearForce => Math.Round(source.TotalStrength); public double UltimateShearForce => Math.Round(source.TotalStrength);
public double ConcreteShearForce => Math.Round(source.ConcreteStrength);
public double StirrupShearForce => Math.Round(source.StirrupStrength);
public double CenterX => 0; public double CenterX => 0;
public double CenterY => 0; public double CenterY => 0;

View File

@@ -24,12 +24,12 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="Beam shear section: "/> <TextBlock Margin="0,0,0,2" Text="Beam shear section: "/>
<TextBlock Grid.Column="1" Text="{Binding BeamShearSection.Name}"/> <TextBlock Grid.Column="1" Text="{Binding BeamShearSection.Name}"/>
<TextBlock Grid.Row="1" Text="Depth: "/> <TextBlock Grid.Row="1" Text="Depth: "/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding FullDepth, Converter={StaticResource LengthConverter}}"/> <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding FullDepth, Converter={StaticResource LengthConverter}}"/>
@@ -85,12 +85,14 @@
<DataTemplate x:Key="InclinedSectionPrimitiveTemplate" <DataTemplate x:Key="InclinedSectionPrimitiveTemplate"
DataType="primitives:InclinedSectionPrimitive"> DataType="primitives:InclinedSectionPrimitive">
<Canvas> <Canvas>
<!--InclinedSection-->
<Line <Line
X1="{Binding SectionStartX}" X1="{Binding SectionStartX}"
X2="{Binding SectionEndX}" X2="{Binding SectionEndX}"
Y1="{Binding SectionStartY}" Y1="{Binding SectionStartY}"
Y2="{Binding SectionEndY}" Y2="{Binding SectionEndY}"
StrokeThickness="0.01" StrokeThickness="0.01"
StrokeDashArray="0.05 0.02"
> >
<Line.Stroke> <Line.Stroke>
<SolidColorBrush Color="{Binding VisualProperty.Color}" Opacity="{Binding VisualProperty.Opacity}"/> <SolidColorBrush Color="{Binding VisualProperty.Color}" Opacity="{Binding VisualProperty.Opacity}"/>
@@ -102,16 +104,16 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="Inclinated section"/> <TextBlock Margin="0,0,0,2" Text="Inclined section"/>
<TextBlock Grid.Row="1" Text="Start coordinate: "/> <TextBlock Grid.Row="1" Text="Start coordinate: "/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding SectionStartX, Converter={StaticResource LengthConverter}}"/> <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding SectionStartX, Converter={StaticResource LengthConverter}}"/>
<TextBlock Grid.Row="2" Text="End coordinate: "/> <TextBlock Grid.Row="2" Text="End coordinate: "/>
@@ -126,7 +128,6 @@
<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding EffectiveDepth, Converter={StaticResource LengthConverter}}"/> <TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding EffectiveDepth, Converter={StaticResource LengthConverter}}"/>
<TextBlock Grid.Row="7" Text="Span c/d ratio: "/> <TextBlock Grid.Row="7" Text="Span c/d ratio: "/>
<TextBlock Grid.Row="7" Grid.Column="1" Text="{Binding SpanRatio, Converter={StaticResource PlainDouble}}"/> <TextBlock Grid.Row="7" Grid.Column="1" Text="{Binding SpanRatio, Converter={StaticResource PlainDouble}}"/>
</Grid> </Grid>
</Line.ToolTip> </Line.ToolTip>
</Line> </Line>
@@ -141,6 +142,48 @@
<SolidColorBrush Color="{Binding VisualProperty.Color}" Opacity="{Binding VisualProperty.Opacity}"/> <SolidColorBrush Color="{Binding VisualProperty.Color}" Opacity="{Binding VisualProperty.Opacity}"/>
</Line.Stroke> </Line.Stroke>
</Line> </Line>
<!--InclinedCrack-->
<Line
X1="{Binding CrackStartX}"
X2="{Binding SectionEndX}"
Y1="{Binding SectionStartY}"
Y2="{Binding SectionEndY}"
StrokeThickness="0.02"
>
<Line.Stroke>
<SolidColorBrush Color="{Binding VisualProperty.Color}" Opacity="{Binding VisualProperty.Opacity}"/>
</Line.Stroke>
<Line.ToolTip>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Margin="0,0,0,2" Text="Inclined crack"/>
<TextBlock Grid.Row="1" Text="Start coordinate: "/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding CrackStartX, Converter={StaticResource LengthConverter}}"/>
<TextBlock Grid.Row="2" Text="End coordinate: "/>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding SectionEndX, Converter={StaticResource LengthConverter}}"/>
<TextBlock Grid.Row="3" Text="Ultimate shear force: "/>
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding UltimateShearForce, Converter={StaticResource ForceConverter}}"/>
<TextBlock Grid.Row="4" Text="Concrete shear force: "/>
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding ConcreteShearForce, Converter={StaticResource ForceConverter}}"/>
<TextBlock Grid.Row="5" Text="Stirrup shear force: "/>
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding StirrupShearForce, Converter={StaticResource ForceConverter}}"/>
<TextBlock Grid.Row="6" Text="Crack span c0/d ratio: "/>
<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding CrackSpanRatio, Converter={StaticResource PlainDouble}}"/>
</Grid>
</Line.ToolTip>
</Line>
</Canvas> </Canvas>
</DataTemplate> </DataTemplate>
@@ -167,14 +210,14 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="23"/> <RowDefinition/>
<RowDefinition Height="23"/> <RowDefinition/>
<RowDefinition Height="23"/> <RowDefinition/>
<RowDefinition Height="23"/> <RowDefinition/>
<RowDefinition Height="23"/> <RowDefinition/>
<RowDefinition Height="23"/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="Stirrup by rebar: "/> <TextBlock Margin="0,0,0,2" Text="Stirrup by rebar: "/>
<TextBlock Grid.Column="1" Text="{Binding StirrupByRebar.Name}"/> <TextBlock Grid.Column="1" Text="{Binding StirrupByRebar.Name}"/>
<TextBlock Grid.Row="1" Text="Diameter: "/> <TextBlock Grid.Row="1" Text="Diameter: "/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding StirrupByRebar.Diameter, Converter={StaticResource LengthConverter}}"/> <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding StirrupByRebar.Diameter, Converter={StaticResource LengthConverter}}"/>
@@ -215,10 +258,10 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="23"/> <RowDefinition/>
<RowDefinition Height="23"/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="Stirrup by density: "/> <TextBlock Margin="0,0,0,2" Text="Stirrup by density: "/>
<TextBlock Grid.Column="1" Text="{Binding StirrupByDensity.Name}"/> <TextBlock Grid.Column="1" Text="{Binding StirrupByDensity.Name}"/>
<TextBlock Grid.Row="1" Text="Density: "/> <TextBlock Grid.Row="1" Text="Density: "/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding StirrupByDensity.StirrupDensity, Converter={StaticResource DistributedLoadConverter}}"/> <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding StirrupByDensity.StirrupDensity, Converter={StaticResource DistributedLoadConverter}}"/>
@@ -248,13 +291,14 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition Height="25"/> <RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="Inclinated rebar: "/> <TextBlock Margin="0,0,0,2" Text="Inclinated rebar: "/>
<TextBlock Grid.Column="1" Text="{Binding StirrupByInclinedRebar.Name}"/> <TextBlock Grid.Column="1" Text="{Binding StirrupByInclinedRebar.Name}"/>
<TextBlock Grid.Row="1" Text="Diameter: "/> <TextBlock Grid.Row="1" Text="Diameter: "/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding StirrupByInclinedRebar.RebarSection.Diameter, Converter={StaticResource LengthConverter}}"/> <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding StirrupByInclinedRebar.RebarSection.Diameter, Converter={StaticResource LengthConverter}}"/>
@@ -262,8 +306,10 @@
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding StirrupByInclinedRebar.RebarSection.Material.MaterialEntity.Name}"/> <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding StirrupByInclinedRebar.RebarSection.Material.MaterialEntity.Name}"/>
<TextBlock Grid.Row="3" Text="Start coordinate: "/> <TextBlock Grid.Row="3" Text="Start coordinate: "/>
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding StirrupByInclinedRebar.StartCoordinate, Converter={StaticResource LengthConverter}}"/> <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding StirrupByInclinedRebar.StartCoordinate, Converter={StaticResource LengthConverter}}"/>
<TextBlock Grid.Row="4" Text="Angle of inclination: "/> <TextBlock Grid.Row="4" Text="End coordinate: "/>
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding StirrupByInclinedRebar.AngleOfInclination, Converter={StaticResource PlainDouble}}"/> <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding EndPointX, Converter={StaticResource LengthConverter}}"/>
<TextBlock Grid.Row="5" Text="Angle of inclination: "/>
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding StirrupByInclinedRebar.AngleOfInclination, Converter={StaticResource PlainDouble}}"/>
</Grid> </Grid>
</Line.ToolTip> </Line.ToolTip>
</Line> </Line>

View File

@@ -12,7 +12,15 @@ namespace StructureHelperCommon.Models.Calculators
{ {
public class FindParameterCalculator : IFindParameterCalculator public class FindParameterCalculator : IFindParameterCalculator
{ {
FindParameterResult result; private double start, end;
private Predicate<double> predicate;
private FindParameterResult result;
private double precision;
private int maxIterationCount;
private double current;
private double step;
private int iterationNum;
public string Name { get; set; } public string Name { get; set; }
public IFindParameterCalculatorInputData InputData { get; set; } public IFindParameterCalculatorInputData InputData { get; set; }
public IAccuracy Accuracy { get; set; } public IAccuracy Accuracy { get; set; }
@@ -43,7 +51,10 @@ namespace StructureHelperCommon.Models.Calculators
result = new(); result = new();
try try
{ {
FindMinimumValue(InputData.StartValue, InputData.EndValue, InputData.Predicate); start = InputData.StartValue;
end = InputData.EndValue;
predicate = InputData.Predicate;
FindMinimumValue();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -56,7 +67,7 @@ namespace StructureHelperCommon.Models.Calculators
throw new NotImplementedException(); throw new NotImplementedException();
} }
private void FindMinimumValue(double start, double end, Predicate<double> predicate) private void FindMinimumValue()
{ {
TraceLogger?.AddMessage($"Calculating parameter by iterations is started,\nrequired precision {Accuracy.IterationAccuracy}"); TraceLogger?.AddMessage($"Calculating parameter by iterations is started,\nrequired precision {Accuracy.IterationAccuracy}");
if (predicate(end) == false) if (predicate(end) == false)
@@ -64,41 +75,14 @@ namespace StructureHelperCommon.Models.Calculators
TraceLogger?.AddMessage($"Predicate for end value must be true", TraceLogStatuses.Error); TraceLogger?.AddMessage($"Predicate for end value must be true", TraceLogStatuses.Error);
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": predicate for end value must be true"); throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": predicate for end value must be true");
} }
double precision = Accuracy.IterationAccuracy; precision = Accuracy.IterationAccuracy;
int maxIterationCount = Accuracy.MaxIterationCount; maxIterationCount = Accuracy.MaxIterationCount;
double current = start; current = start;
double step = (end - start) / 2d; step = (end - start) / 2d;
int iterationNum = 0; iterationNum = 0;
while (step > precision) while (step > precision)
{ {
TraceLogger?.AddMessage($"Iteration number {iterationNum} is started", TraceLogStatuses.Debug); ProcessIteration();
if (predicate(current) == true)
{
TraceLogger?.AddMessage($"Predicate value in {current} is true", TraceLogStatuses.Debug, 50);
end = current;
}
else
{
TraceLogger?.AddMessage($"Predicate value in {current} is false", TraceLogStatuses.Debug, 50);
start = current;
}
current = (start + end) / 2d;
TraceLogger?.AddMessage($"New current value Cur=({start}+{end})/2={current}", TraceLogStatuses.Debug);
step = (end - start) / 2d;
TraceLogger?.AddMessage($"New step S={current}", TraceLogStatuses.Debug, 50);
iterationNum++;
result.IsValid = false;
result.IterationNumber = iterationNum;
result.CurrentAccuracy = step;
ActionToOutputResults?.Invoke(result);
if (iterationNum > maxIterationCount)
{
TraceLogger?.AddMessage($"Recuired precision was not achieved, current step {step}, required precision {precision}", TraceLogStatuses.Error);
result.Description = "Parameter was not found succefully: \n";
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": violation of iteration count");
}
} }
TraceLogger?.AddMessage($"Parameter value Cur={current} was found,\nCalculation has finished succefully"); TraceLogger?.AddMessage($"Parameter value Cur={current} was found,\nCalculation has finished succefully");
result.Parameter = current; result.Parameter = current;
@@ -106,5 +90,37 @@ namespace StructureHelperCommon.Models.Calculators
result.IsValid = true; result.IsValid = true;
ActionToOutputResults?.Invoke(result); ActionToOutputResults?.Invoke(result);
} }
private void ProcessIteration()
{
TraceLogger?.AddMessage($"Iteration number {iterationNum} is started", TraceLogStatuses.Debug);
if (predicate(current) == true)
{
TraceLogger?.AddMessage($"Predicate value in {current} is true", TraceLogStatuses.Debug, 50);
end = current;
}
else
{
TraceLogger?.AddMessage($"Predicate value in {current} is false", TraceLogStatuses.Debug, 50);
start = current;
}
current = (start + end) / 2d;
TraceLogger?.AddMessage($"New current value Cur=({start}+{end})/2={current}", TraceLogStatuses.Debug);
step = (end - start) / 2d;
TraceLogger?.AddMessage($"New step S={current}", TraceLogStatuses.Debug, 50);
iterationNum++;
result.IsValid = false;
result.IterationNumber = iterationNum;
result.CurrentAccuracy = step;
ActionToOutputResults?.Invoke(result);
if (iterationNum > maxIterationCount)
{
TraceLogger?.AddMessage($"Recuired precision was not achieved, current step {step}, required precision {precision}", TraceLogStatuses.Error);
result.Description = "Parameter was not found succefully: \n";
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": violation of iteration count");
}
}
} }
} }

View File

@@ -10,6 +10,8 @@ namespace StructureHelperLogics.Models.BeamShears
private double absoluteRangeValue = 0.0; private double absoluteRangeValue = 0.0;
private double relativeEffectiveDepthRangeValue = 3.3; private double relativeEffectiveDepthRangeValue = 3.3;
private int stepCount = 55; private int stepCount = 55;
private double relativeEffectiveDepthSectionLengthMaxValue = 3;
private double relativeEffectiveDepthSectionLengthMinValue = 0;
/// <inheritdoc> /// <inheritdoc>
public Guid Id { get; } public Guid Id { get; }
@@ -56,6 +58,33 @@ namespace StructureHelperLogics.Models.BeamShears
stepCount = value; stepCount = value;
} }
} }
public double RelativeEffectiveDepthSectionLengthMaxValue
{
get => relativeEffectiveDepthSectionLengthMaxValue;
set
{
if (value <= 0)
{
throw new StructureHelperException($"Maximum inclined section factor must be greater than zero, but was {value}");
}
relativeEffectiveDepthSectionLengthMaxValue = value;
}
}
public double RelativeEffectiveDepthSectionLengthMinValue
{
get => relativeEffectiveDepthSectionLengthMinValue;
set
{
if (value < 0)
{
throw new StructureHelperException($"Maximum inclined section factor must be greater than zero, but was {value}");
}
relativeEffectiveDepthSectionLengthMinValue = value;
}
}
public BeamShearDesignRangeProperty(Guid id) public BeamShearDesignRangeProperty(Guid id)
{ {
Id = id; Id = id;

View File

@@ -14,6 +14,8 @@ namespace StructureHelperLogics.Models.BeamShears
/// <inheritdoc/> /// <inheritdoc/>
public IInclinedSection InclinedSection { get; set; } public IInclinedSection InclinedSection { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
public IInclinedSection InclinedCrack { get; set; }
/// <inheritdoc/>
public IStirrup Stirrup { get; set; } public IStirrup Stirrup { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
public LimitStates LimitState { get; set; } public LimitStates LimitState { get; set; }
@@ -21,6 +23,10 @@ namespace StructureHelperLogics.Models.BeamShears
public CalcTerms CalcTerm { get; set; } public CalcTerms CalcTerm { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
public IForceTuple ForceTuple { get; set; } public IForceTuple ForceTuple { get; set; }
/// <inheritdoc/>
public IBeamShearAction BeamShearAction { get; set; }
/// <inheritdoc/>
public IBeamShearSection BeamShearSection { get; set; }
public BeamShearSectionLogicInputData(Guid id) public BeamShearSectionLogicInputData(Guid id)
{ {

View File

@@ -21,6 +21,14 @@ namespace StructureHelperLogics.Models.BeamShears
/// </summary> /// </summary>
double RelativeEffectiveDepthRangeValue { get; set; } double RelativeEffectiveDepthRangeValue { get; set; }
/// <summary> /// <summary>
/// Relative value of inclination length as factor of effective depth of cross-section
/// </summary>
double RelativeEffectiveDepthSectionLengthMaxValue { get; set; }
/// <summary>
/// Relative value of inclination length as factor of effective depth of cross-section
/// </summary>
double RelativeEffectiveDepthSectionLengthMinValue { get; set; }
/// <summary>
/// Number of step of solvation /// Number of step of solvation
/// </summary> /// </summary>
int StepCount { get; set; } int StepCount { get; set; }

View File

@@ -13,10 +13,13 @@ namespace StructureHelperLogics.Models.BeamShears
/// </summary> /// </summary>
public interface IBeamShearSectionLogicInputData : IInputData, ISaveable public interface IBeamShearSectionLogicInputData : IInputData, ISaveable
{ {
IBeamShearAction BeamShearAction { get; set; }
IBeamShearSection BeamShearSection { get; set; }
/// <summary> /// <summary>
/// Properties of RC cross-section /// Properties of RC cross-section
/// </summary> /// </summary>
IInclinedSection InclinedSection { get; set; } IInclinedSection InclinedSection { get; set; }
IInclinedSection InclinedCrack { get; set; }
/// <summary> /// <summary>
/// Properties of stirrups in cross-section /// Properties of stirrups in cross-section
/// </summary> /// </summary>

View File

@@ -2,22 +2,23 @@
using StructureHelperCommon.Infrastructures.Enums; using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Interfaces; using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models; using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Calculators;
using StructureHelperCommon.Models.Forces; using StructureHelperCommon.Models.Forces;
using StructureHelperCommon.Models.Loggers; using StructureHelperCommon.Models.Loggers;
using StructureHelperLogics.Models.Materials; using StructureHelperLogics.Models.Materials;
using StructureHelperLogics.NdmCalculations.Primitives;
namespace StructureHelperLogics.Models.BeamShears namespace StructureHelperLogics.Models.BeamShears
{ {
public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult> public class BeamShearCalculatorLogic : IGetResultByInputDataLogic<IBeamShearCalculatorInputData, IBeamShearCalculatorResult>
{ {
private const LimitStates CollapseLimitState = LimitStates.ULS; private const LimitStates CollapseLimitState = LimitStates.ULS;
private readonly List<CalcTerms> calcTerms = new() { CalcTerms.LongTerm, CalcTerms.ShortTerm };
private IBeamShearCalculatorResult result; private IBeamShearCalculatorResult result;
private IBeamShearSectionLogic beamShearSectionLogic;
private List<IBeamShearActionResult> actionResults; private List<IBeamShearActionResult> actionResults;
private IBeamShearCalculatorInputData inputData; private IBeamShearCalculatorInputData inputData;
private readonly List<CalcTerms> calcTerms = new() { CalcTerms.LongTerm, CalcTerms.ShortTerm }; private List<IInclinedSection> inclinedSections;
private IBeamShearSectionLogic beamShearSectionLogic;
private IGetBeamShearSectionIputDatasLogic getBeamShearSectionIputDatasLogic;
private IGetInclinedSectionListLogic getInclinedSectionListLogic;
public IShiftTraceLogger? TraceLogger { get; set; } public IShiftTraceLogger? TraceLogger { get; set; }
@@ -36,7 +37,7 @@ namespace StructureHelperLogics.Models.BeamShears
InitializeStrategies(); InitializeStrategies();
try try
{ {
GetSections(); GetActionResults();
result.ActionResults = actionResults; result.ActionResults = actionResults;
} }
catch (Exception ex) catch (Exception ex)
@@ -82,6 +83,8 @@ namespace StructureHelperLogics.Models.BeamShears
private void InitializeStrategies() private void InitializeStrategies()
{ {
beamShearSectionLogic ??= new BeamShearSectionLogic(TraceLogger); beamShearSectionLogic ??= new BeamShearSectionLogic(TraceLogger);
getInclinedSectionListLogic ??= new GetInclinedSectionListLogic(null);
getBeamShearSectionIputDatasLogic ??= new GetBeamShearSectionIputDatasLogic();
} }
private void PrepareNewResult() private void PrepareNewResult()
@@ -93,7 +96,7 @@ namespace StructureHelperLogics.Models.BeamShears
}; };
} }
private void GetSections() private void GetActionResults()
{ {
actionResults = new(); actionResults = new();
List<IStirrup> stirrups = inputData.Stirrups.ToList(); List<IStirrup> stirrups = inputData.Stirrups.ToList();
@@ -103,17 +106,24 @@ namespace StructureHelperLogics.Models.BeamShears
} }
foreach (var beamShearAction in inputData.Actions) foreach (var beamShearAction in inputData.Actions)
{ {
getBeamShearSectionIputDatasLogic.Action = beamShearAction;
foreach (var calcTerm in calcTerms) foreach (var calcTerm in calcTerms)
{ {
getBeamShearSectionIputDatasLogic.CalcTerm = calcTerm;
foreach (var section in inputData.Sections) foreach (var section in inputData.Sections)
{ {
getInclinedSectionListLogic.BeamShearSection = section;
getInclinedSectionListLogic.DesignRangeProperty = inputData.DesignRangeProperty;
inclinedSections = getInclinedSectionListLogic.GetInclinedSections();
getBeamShearSectionIputDatasLogic.Section = section;
getBeamShearSectionIputDatasLogic.InclinedSectionList = inclinedSections;
TraceLogger?.AddMessage($"Analysis for action: {beamShearAction.Name}, section: {section.Name}, calc turm {calcTerm} has been started"); TraceLogger?.AddMessage($"Analysis for action: {beamShearAction.Name}, section: {section.Name}, calc turm {calcTerm} has been started");
TraceSection(section); TraceSection(section);
foreach (var stirrup in stirrups) foreach (var stirrup in stirrups)
{ {
List<IInclinedSection> inclinedSections = GetInclinedSections(section); getBeamShearSectionIputDatasLogic.Stirrup = stirrup;
List<IBeamShearSectionLogicInputData> sectionInputDatas = GetSectionInputDatas(beamShearAction, calcTerm, section, stirrup, inclinedSections); List<IBeamShearSectionLogicInputData> sectionInputDatas = getBeamShearSectionIputDatasLogic.GetBeamShearSectionInputDatas();
List<IBeamShearSectionLogicResult> sectionResults = GetSectionResults(sectionInputDatas); List<IBeamShearSectionLogicResult> sectionResults = GetInclinedSectionResults(sectionInputDatas);
BeamShearActionResult actionResult = GetActionResult(beamShearAction, calcTerm, section, stirrup, sectionResults); BeamShearActionResult actionResult = GetActionResult(beamShearAction, calcTerm, section, stirrup, sectionResults);
actionResults.Add(actionResult); actionResults.Add(actionResult);
} }
@@ -139,7 +149,7 @@ namespace StructureHelperLogics.Models.BeamShears
return actionResult; return actionResult;
} }
private List<IBeamShearSectionLogicResult> GetSectionResults(List<IBeamShearSectionLogicInputData> sectionInputDatas) private List<IBeamShearSectionLogicResult> GetInclinedSectionResults(List<IBeamShearSectionLogicInputData> sectionInputDatas)
{ {
List<IBeamShearSectionLogicResult> sectionResults = new(); List<IBeamShearSectionLogicResult> sectionResults = new();
foreach (var item in sectionInputDatas) foreach (var item in sectionInputDatas)
@@ -147,42 +157,9 @@ namespace StructureHelperLogics.Models.BeamShears
IBeamShearSectionLogicResult sectionResult = CalculateInclinedSectionResult(item); IBeamShearSectionLogicResult sectionResult = CalculateInclinedSectionResult(item);
sectionResults.Add(sectionResult); sectionResults.Add(sectionResult);
} }
return sectionResults; return sectionResults;
} }
private List<IBeamShearSectionLogicInputData> GetSectionInputDatas(IBeamShearAction beamShearAction, CalcTerms calcTerm, IBeamShearSection section, IStirrup stirrup, List<IInclinedSection> inclinedSections)
{
List<IBeamShearSectionLogicInputData> sectionInputDatas = new();
var material = section.ConcreteMaterial;
var strength = material.GetStrength(CollapseLimitState, calcTerm);
foreach (var inclinedSection in inclinedSections)
{
inclinedSection.LimitState = CollapseLimitState;
inclinedSection.CalcTerm = calcTerm;
inclinedSection.ConcreteCompressionStrength = strength.Compressive;
inclinedSection.ConcreteTensionStrength = strength.Tensile;
DirectShearForceLogicInputData inputData = new()
{
BeamShearAction = beamShearAction,
InclinedSection = inclinedSection,
LimitState = CollapseLimitState,
CalcTerm = calcTerm,
};
IForceTuple forceTuple = GetForceTupleByShearAction(inputData);
BeamShearSectionLogicInputData newInputData = new(Guid.NewGuid())
{
InclinedSection = inclinedSection,
Stirrup = stirrup,
ForceTuple = forceTuple,
LimitState = CollapseLimitState,
CalcTerm = calcTerm
};
sectionInputDatas.Add(newInputData);
}
return sectionInputDatas;
}
private static BeamShearActionResult PrepareNewActionResult(IBeamShearAction beamShearAction, CalcTerms calcTerm, IBeamShearSection section, IStirrup stirrup) private static BeamShearActionResult PrepareNewActionResult(IBeamShearAction beamShearAction, CalcTerms calcTerm, IBeamShearSection section, IStirrup stirrup)
{ {
@@ -197,19 +174,5 @@ namespace StructureHelperLogics.Models.BeamShears
Stirrup = stirrup Stirrup = stirrup
}; };
} }
private List<IInclinedSection> GetInclinedSections(IBeamShearSection beamShearSection)
{
IGetInclinedSectionListInputData inclinedSectionInputDataLogic = new GetInclinedSectionListInputData(inputData.DesignRangeProperty, beamShearSection);
//IGetInclinedSectionListLogic getInclinedSectionListLogic = new GetInclinedSectionListLogic(inclinedSectionInputDataLogic, TraceLogger);
IGetInclinedSectionListLogic getInclinedSectionListLogic = new GetInclinedSectionListLogic(inclinedSectionInputDataLogic, null);
return getInclinedSectionListLogic.GetInclinedSections();
}
private IForceTuple GetForceTupleByShearAction(IDirectShearForceLogicInputData inputData)
{
IGetDirectShearForceLogic getDirectShearForceLogic = new GetDirectShearForceLogic(inputData, null);
return getDirectShearForceLogic.CalculateShearForceTuple();
}
} }
} }

View File

@@ -17,6 +17,8 @@ namespace StructureHelperLogics.Models.BeamShears
private IGetLongitudinalForceFactorLogic getLongitudinalForceFactorLogic; private IGetLongitudinalForceFactorLogic getLongitudinalForceFactorLogic;
private string sectionMessage; private string sectionMessage;
private ICheckInputDataLogic<IBeamShearSectionLogicInputData> checkInputDataLogic; private ICheckInputDataLogic<IBeamShearSectionLogicInputData> checkInputDataLogic;
private double concreteStrength;
private double stirrupStrength;
private ShiftTraceLogger? localTraceLogger { get; set; } private ShiftTraceLogger? localTraceLogger { get; set; }
@@ -41,6 +43,7 @@ namespace StructureHelperLogics.Models.BeamShears
InitializeStrategies(); InitializeStrategies();
try try
{ {
AddInclinedCrackToInputData();
CalculateResult(); CalculateResult();
} }
catch (Exception ex) catch (Exception ex)
@@ -50,6 +53,20 @@ namespace StructureHelperLogics.Models.BeamShears
} }
} }
private void AddInclinedCrackToInputData()
{
InclinedSection newSection = new();
var updateStrategy = new InclinedSectionUpdateStrategy();
updateStrategy.Update(newSection, InputData.InclinedSection);
double crackLength = newSection.EndCoord - newSection.StartCoord;
double maxCrackLength = 2 * newSection.EffectiveDepth;
if (crackLength > maxCrackLength)
{
newSection.StartCoord = newSection.EndCoord - maxCrackLength;
}
InputData.InclinedCrack = newSection;
}
private bool Check() private bool Check()
{ {
bool checkResult = true; bool checkResult = true;
@@ -71,8 +88,8 @@ namespace StructureHelperLogics.Models.BeamShears
SetLongitudinalForce(); SetLongitudinalForce();
double factorOfLongitudinalForce = getLongitudinalForceFactorLogic.GetFactor(); double factorOfLongitudinalForce = getLongitudinalForceFactorLogic.GetFactor();
localTraceLogger?.AddMessage($"Factor of longitudinal force = {factorOfLongitudinalForce}, (dimensionless)"); localTraceLogger?.AddMessage($"Factor of longitudinal force = {factorOfLongitudinalForce}, (dimensionless)");
double concreteStrength = concreteLogic.GetShearStrength(); concreteStrength = concreteLogic.GetShearStrength();
double stirrupStrength = stirrupLogic.GetShearStrength(); stirrupStrength = stirrupLogic.GetShearStrength();
if (stirrupStrength > concreteStrength) if (stirrupStrength > concreteStrength)
{ {
localTraceLogger?.AddMessage($"Shear reinforcement strength Qsw = {stirrupStrength} is greater than concrete strength for shear Qb = {concreteStrength}, shear reinforcement strength has to be restricted."); localTraceLogger?.AddMessage($"Shear reinforcement strength Qsw = {stirrupStrength} is greater than concrete strength for shear Qb = {concreteStrength}, shear reinforcement strength has to be restricted.");
@@ -113,6 +130,7 @@ namespace StructureHelperLogics.Models.BeamShears
}; };
double stirrupStrength = logic.GetShearStrength(); double stirrupStrength = logic.GetShearStrength();
localTraceLogger?.AddMessage($"Stirrup strength was restricted as Qsw,restricted = {stirrupStrength}(N)"); localTraceLogger?.AddMessage($"Stirrup strength was restricted as Qsw,restricted = {stirrupStrength}(N)");
InputData.InclinedCrack = logic.InclinedCrack;
return stirrupStrength; return stirrupStrength;
} }

View File

@@ -0,0 +1,71 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Forces;
namespace StructureHelperLogics.Models.BeamShears
{
public class GetBeamShearSectionIputDatasLogic : IGetBeamShearSectionIputDatasLogic
{
private const LimitStates CollapseLimitState = LimitStates.ULS;
private IDirectShearForceLogicInputData directShearForceLogicInputData;
private (double Compressive, double Tensile) strength;
public IBeamShearAction Action { get; set; }
public CalcTerms CalcTerm { get; set; }
public IBeamShearSection Section { get; set; }
public IStirrup Stirrup { get; set; }
public List<IInclinedSection> InclinedSectionList { get; set; }
public List<IBeamShearSectionLogicInputData> GetBeamShearSectionInputDatas()
{
List<IBeamShearSectionLogicInputData> sectionInputDatas = new();
var material = Section.ConcreteMaterial;
strength = material.GetStrength(CollapseLimitState, CalcTerm);
foreach (var inclinedSection in InclinedSectionList)
{
PrepareInclinedSection(inclinedSection);
BeamShearSectionLogicInputData newInputData = GetNewInputData(inclinedSection);
sectionInputDatas.Add(newInputData);
}
return sectionInputDatas;
}
private void PrepareInclinedSection(IInclinedSection inclinedSection)
{
inclinedSection.LimitState = CollapseLimitState;
inclinedSection.CalcTerm = CalcTerm;
inclinedSection.ConcreteCompressionStrength = strength.Compressive;
inclinedSection.ConcreteTensionStrength = strength.Tensile;
}
private BeamShearSectionLogicInputData GetNewInputData(IInclinedSection inclinedSection)
{
IForceTuple forceTuple = GetForceTupleByShearAction(inclinedSection);
BeamShearSectionLogicInputData beamShearSectionLogicInputData = new(Guid.NewGuid())
{
InclinedSection = inclinedSection,
BeamShearAction = Action,
BeamShearSection = Section,
Stirrup = Stirrup,
ForceTuple = forceTuple,
LimitState = CollapseLimitState,
CalcTerm = CalcTerm
};
BeamShearSectionLogicInputData newInputData = beamShearSectionLogicInputData;
return newInputData;
}
private IForceTuple GetForceTupleByShearAction(IInclinedSection inclinedSection)
{
directShearForceLogicInputData = new DirectShearForceLogicInputData()
{
BeamShearAction = Action,
InclinedSection = inclinedSection,
LimitState = CollapseLimitState,
CalcTerm = CalcTerm,
};
IGetDirectShearForceLogic getDirectShearForceLogic = new GetDirectShearForceLogic(directShearForceLogicInputData, null);
return getDirectShearForceLogic.CalculateShearForceTuple();
}
}
}

View File

@@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.BeamShears
{
/// <inheritdoc/>
public class GetInclinedSectionListInputData : IGetInclinedSectionListInputData
{
public IBeamShearDesignRangeProperty DesignRangeProperty { get; }
public IGetInclinedSectionLogic? GetInclinedSectionLogic { get; set; }
public IBeamShearSection BeamShearSection { get; set; }
public GetInclinedSectionListInputData(IBeamShearDesignRangeProperty designRangeProperty, IBeamShearSection beamShearSection)
{
DesignRangeProperty = designRangeProperty;
BeamShearSection = beamShearSection;
}
}
}

View File

@@ -7,19 +7,18 @@ namespace StructureHelperLogics.Models.BeamShears
{ {
public class GetInclinedSectionListLogic : IGetInclinedSectionListLogic public class GetInclinedSectionListLogic : IGetInclinedSectionListLogic
{ {
private readonly IGetInclinedSectionListInputData inputData;
private IGetInclinedSectionLogic inclinedSectionLogic; private IGetInclinedSectionLogic inclinedSectionLogic;
private double depth; private double depth;
private double effectiveDepth; private double effectiveDepth;
private List<IInclinedSection> inclinedSections; private List<IInclinedSection> inclinedSections;
private List<double> coordinates; private List<double> coordinates;
public IBeamShearDesignRangeProperty DesignRangeProperty { get; set; }
public IBeamShearSection BeamShearSection { get; set; }
public IShiftTraceLogger? TraceLogger { get; set; } public IShiftTraceLogger? TraceLogger { get; set; }
public GetInclinedSectionListLogic( public GetInclinedSectionListLogic(IShiftTraceLogger? traceLogger)
IGetInclinedSectionListInputData inputData,
IShiftTraceLogger? traceLogger)
{ {
this.inputData = inputData;
TraceLogger = traceLogger; TraceLogger = traceLogger;
} }
@@ -29,14 +28,20 @@ namespace StructureHelperLogics.Models.BeamShears
Check(); Check();
GetShapeParameters(); GetShapeParameters();
GetCoordinates(); GetCoordinates();
double minSectionLength = DesignRangeProperty.RelativeEffectiveDepthSectionLengthMinValue * effectiveDepth;
double maxSectionLength = DesignRangeProperty.RelativeEffectiveDepthSectionLengthMaxValue * effectiveDepth;
foreach (var startCoord in coordinates) foreach (var startCoord in coordinates)
{ {
var endCoordinates = coordinates.Where(x => x >= startCoord); var endCoordinates = coordinates.Where(x => x >= startCoord);
foreach (var endCoord in endCoordinates) foreach (var endCoord in endCoordinates)
{ {
inclinedSectionLogic = InitializeInclinedSectionLogic(startCoord, endCoord); double sectionLength = endCoord - startCoord;
IInclinedSection inclinedSection = inclinedSectionLogic.GetInclinedSection(); if (sectionLength >= minSectionLength & sectionLength <= maxSectionLength)
inclinedSections.Add(inclinedSection); {
inclinedSectionLogic = new GetInclinedSectionLogic(BeamShearSection, startCoord, endCoord, TraceLogger);
IInclinedSection inclinedSection = inclinedSectionLogic.GetInclinedSection();
inclinedSections.Add(inclinedSection);
}
} }
} }
return inclinedSections; return inclinedSections;
@@ -44,8 +49,8 @@ namespace StructureHelperLogics.Models.BeamShears
private void GetCoordinates() private void GetCoordinates()
{ {
double maxSectionLength = GetMaxSectionLength(); double maxSectionLength = GetMaxLengthOfInclinedSection();
int stepCount = inputData.DesignRangeProperty.StepCount; int stepCount = DesignRangeProperty.StepCount;
double step = maxSectionLength / stepCount; double step = maxSectionLength / stepCount;
inclinedSections = new(); inclinedSections = new();
coordinates = new(); coordinates = new();
@@ -57,41 +62,36 @@ namespace StructureHelperLogics.Models.BeamShears
} }
} }
private double GetMaxSectionLength() private double GetMaxLengthOfInclinedSection()
{ {
double relativeLength = inputData.DesignRangeProperty.RelativeEffectiveDepthRangeValue * effectiveDepth; double minimumRelativeLength = DesignRangeProperty.RelativeEffectiveDepthRangeValue * effectiveDepth;
double length = Math.Max(relativeLength, inputData.DesignRangeProperty.AbsoluteRangeValue); double minimumAbsoluteLength = DesignRangeProperty.AbsoluteRangeValue;
double length = Math.Max(minimumRelativeLength, minimumAbsoluteLength);
return length; return length;
} }
private void Check() private void Check()
{ {
CheckObject.IsNull(inputData); CheckObject.IsNull(BeamShearSection);
CheckObject.IsNull(inputData.BeamShearSection); CheckObject.IsNull(DesignRangeProperty);
}
private IGetInclinedSectionLogic InitializeInclinedSectionLogic(double startCoord, double endCoord)
{
if (inputData.GetInclinedSectionLogic is not null)
{
return inputData.GetInclinedSectionLogic;
}
return new GetInclinedSectionLogic(inputData.BeamShearSection, startCoord, endCoord, TraceLogger);
} }
private void GetShapeParameters() private void GetShapeParameters()
{ {
if (inputData.BeamShearSection.Shape is IRectangleShape rectangle) if (BeamShearSection.Shape is IRectangleShape rectangle)
{ {
depth = rectangle.Height; depth = rectangle.Height;
} }
else if (inputData.BeamShearSection.Shape is ICircleShape circle) else if (BeamShearSection.Shape is ICircleShape circle)
{ {
depth = circle.Diameter; depth = circle.Diameter;
} }
else else
{ {
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(inputData.BeamShearSection.Shape)); throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(BeamShearSection.Shape));
} }
effectiveDepth = depth - inputData.BeamShearSection.CenterCover; double coverLayerOfConcrete = BeamShearSection.CenterCover;
effectiveDepth = depth - coverLayerOfConcrete;
} }
} }
} }

View File

@@ -0,0 +1,16 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Forces;
namespace StructureHelperLogics.Models.BeamShears
{
public interface IGetBeamShearSectionIputDatasLogic
{
public IBeamShearAction Action { get; set; }
public CalcTerms CalcTerm { get; set; }
public IBeamShearSection Section { get; set; }
public IStirrup Stirrup { get; set; }
public List<IInclinedSection> InclinedSectionList { get; set; }
List<IBeamShearSectionLogicInputData> GetBeamShearSectionInputDatas();
}
}

View File

@@ -1,11 +0,0 @@
using StructureHelperCommon.Models.Calculators;
namespace StructureHelperLogics.Models.BeamShears
{
public interface IGetInclinedSectionListInputData : IInputData
{
IBeamShearDesignRangeProperty DesignRangeProperty { get; }
IGetInclinedSectionLogic? GetInclinedSectionLogic { get; set; }
IBeamShearSection BeamShearSection { get; set; }
}
}

View File

@@ -7,6 +7,8 @@ namespace StructureHelperLogics.Models.BeamShears
/// </summary> /// </summary>
public interface IGetInclinedSectionListLogic : ILogic public interface IGetInclinedSectionListLogic : ILogic
{ {
public IBeamShearDesignRangeProperty DesignRangeProperty { get; set; }
public IBeamShearSection BeamShearSection { get; set; }
List<IInclinedSection> GetInclinedSections(); List<IInclinedSection> GetInclinedSections();
} }
} }

View File

@@ -8,7 +8,10 @@ namespace StructureHelperLogics.Models.BeamShears
{ {
private ConcreteStrengthLogic concreteLogic; private ConcreteStrengthLogic concreteLogic;
private StirrupStrengthLogic stirrupLogic; private StirrupStrengthLogic stirrupLogic;
private IFindParameterCalculator parameterCalculator;
public IShiftTraceLogger? TraceLogger { get; set; } public IShiftTraceLogger? TraceLogger { get; set; }
public IInclinedSection InclinedCrack { get; private set; }
public IBeamShearSectionLogicInputData InputData { get; internal set; } public IBeamShearSectionLogicInputData InputData { get; internal set; }
public ISectionEffectiveness SectionEffectiveness { get; internal set; } public ISectionEffectiveness SectionEffectiveness { get; internal set; }
public StirrupBySearchLogic(IShiftTraceLogger? traceLogger) public StirrupBySearchLogic(IShiftTraceLogger? traceLogger)
@@ -20,6 +23,7 @@ namespace StructureHelperLogics.Models.BeamShears
{ {
double parameter = GetCrackLengthRatio(); double parameter = GetCrackLengthRatio();
BeamShearSectionLogicInputData newInputData = GetNewInputDataByCrackLengthRatio(parameter); BeamShearSectionLogicInputData newInputData = GetNewInputDataByCrackLengthRatio(parameter);
InclinedCrack = newInputData.InclinedCrack;
TraceLogger?.AddMessage($"New value of dangerous inclinated crack has been obtained: start point Xstart = {newInputData.InclinedSection.StartCoord}(m), end point Xend = {newInputData.InclinedSection.EndCoord}(m)"); TraceLogger?.AddMessage($"New value of dangerous inclinated crack has been obtained: start point Xstart = {newInputData.InclinedSection.StartCoord}(m), end point Xend = {newInputData.InclinedSection.EndCoord}(m)");
stirrupLogic = new(newInputData, TraceLogger); stirrupLogic = new(newInputData, TraceLogger);
double stirrupStrength = stirrupLogic.GetShearStrength(); double stirrupStrength = stirrupLogic.GetShearStrength();
@@ -33,14 +37,18 @@ namespace StructureHelperLogics.Models.BeamShears
/// <exception cref="StructureHelperException"></exception> /// <exception cref="StructureHelperException"></exception>
private double GetCrackLengthRatio() private double GetCrackLengthRatio()
{ {
var parameterCalculator = new FindParameterCalculator(); if (GetPredicate(1) == false)
{
return 1;
}
parameterCalculator = new FindParameterCalculator();
parameterCalculator.InputData.Predicate = GetPredicate; parameterCalculator.InputData.Predicate = GetPredicate;
parameterCalculator.Accuracy.IterationAccuracy = 0.0001d; parameterCalculator.Accuracy.IterationAccuracy = 0.0001d;
parameterCalculator.Accuracy.MaxIterationCount = 1000; parameterCalculator.Accuracy.MaxIterationCount = 1000;
parameterCalculator.Run(); parameterCalculator.Run();
if (parameterCalculator.Result.IsValid == false) if (parameterCalculator.Result.IsValid == false)
{ {
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": predicate error"); throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Binary search error {parameterCalculator.Result.Description}");
} }
var result = parameterCalculator.Result as FindParameterResult; var result = parameterCalculator.Result as FindParameterResult;
var crackLengthRatio = result.Parameter; var crackLengthRatio = result.Parameter;
@@ -59,25 +67,32 @@ namespace StructureHelperLogics.Models.BeamShears
private bool GetPredicate(double crackLengthRatio) private bool GetPredicate(double crackLengthRatio)
{ {
BeamShearSectionLogicInputData newInputData = GetNewInputDataByCrackLengthRatio(crackLengthRatio); BeamShearSectionLogicInputData newInputData = GetNewInputDataByCrackLengthRatio(crackLengthRatio);
concreteLogic = new(SectionEffectiveness, newInputData.InclinedSection, null); concreteLogic = new(SectionEffectiveness, newInputData.InclinedCrack, null);
stirrupLogic = new(newInputData, null); stirrupLogic = new(newInputData, null);
double concreteStrength = concreteLogic.GetShearStrength(); double concreteStrength = concreteLogic.GetShearStrength();
double stirrupStrength = stirrupLogic.GetShearStrength(); double stirrupStrength = stirrupLogic.GetShearStrength();
return stirrupStrength > concreteStrength; bool predicateResult = stirrupStrength > concreteStrength;
if (crackLengthRatio == 1 & predicateResult == false)
{
}
return predicateResult;
} }
private BeamShearSectionLogicInputData GetNewInputDataByCrackLengthRatio(double crackLengthRatio) private BeamShearSectionLogicInputData GetNewInputDataByCrackLengthRatio(double crackLengthRatio)
{ {
double sourceCrackLength = InputData.InclinedSection.EndCoord - InputData.InclinedSection.StartCoord; IInclinedSection inclinedSection = InputData.InclinedCrack;
double sourceCrackLength = inclinedSection.EndCoord - inclinedSection.StartCoord;
double newCrackLength = sourceCrackLength * crackLengthRatio; double newCrackLength = sourceCrackLength * crackLengthRatio;
double newStartCoord = InputData.InclinedSection.EndCoord - newCrackLength; double newStartCoord = inclinedSection.EndCoord - newCrackLength;
InclinedSection newSection = new(); InclinedSection newSection = new();
var updateStrategy = new InclinedSectionUpdateStrategy(); var updateStrategy = new InclinedSectionUpdateStrategy();
updateStrategy.Update(newSection, InputData.InclinedSection); updateStrategy.Update(newSection, inclinedSection);
newSection.StartCoord = newStartCoord; newSection.StartCoord = newStartCoord;
BeamShearSectionLogicInputData newInputData = new(Guid.Empty) BeamShearSectionLogicInputData newInputData = new(Guid.Empty)
{ {
InclinedSection = newSection, InclinedSection = newSection,
InclinedCrack = newSection,
LimitState = InputData.LimitState, LimitState = InputData.LimitState,
CalcTerm = InputData.CalcTerm, CalcTerm = InputData.CalcTerm,
Stirrup = InputData.Stirrup, Stirrup = InputData.Stirrup,

View File

@@ -8,7 +8,7 @@ namespace StructureHelperLogics.Models.BeamShears
{ {
private readonly IBeamShearSectionLogicInputData inputData; private readonly IBeamShearSectionLogicInputData inputData;
private IStirrup stirrup => inputData.Stirrup; private IStirrup stirrup => inputData.Stirrup;
private IInclinedSection inclinedSection => inputData.InclinedSection; private IInclinedSection inclinedSection => inputData.InclinedCrack;
private IBeamShearStrenghLogic stirrupByDensityStrengthLogic; private IBeamShearStrenghLogic stirrupByDensityStrengthLogic;
private IBeamShearStrenghLogic stirrupGroupStrengthLogic; private IBeamShearStrenghLogic stirrupGroupStrengthLogic;
private IBeamShearStrenghLogic stirrupByInclinedRebarStrengthLogic; private IBeamShearStrenghLogic stirrupByInclinedRebarStrengthLogic;

View File

@@ -14,6 +14,8 @@ namespace StructureHelperLogics.Models.BeamShears
targetObject.AbsoluteRangeValue = sourceObject.AbsoluteRangeValue; targetObject.AbsoluteRangeValue = sourceObject.AbsoluteRangeValue;
targetObject.RelativeEffectiveDepthRangeValue = sourceObject.RelativeEffectiveDepthRangeValue; targetObject.RelativeEffectiveDepthRangeValue = sourceObject.RelativeEffectiveDepthRangeValue;
targetObject.StepCount = sourceObject.StepCount; targetObject.StepCount = sourceObject.StepCount;
targetObject.RelativeEffectiveDepthSectionLengthMaxValue = sourceObject.RelativeEffectiveDepthSectionLengthMaxValue;
targetObject.RelativeEffectiveDepthSectionLengthMinValue = sourceObject.RelativeEffectiveDepthSectionLengthMinValue;
} }
} }
} }

View File

@@ -12,6 +12,7 @@ namespace StructureHelperLogics.Models.BeamShears
CheckObject.IsNull(targetObject, ErrorStrings.TargetObject); CheckObject.IsNull(targetObject, ErrorStrings.TargetObject);
if (ReferenceEquals(targetObject, sourceObject)) { return; } if (ReferenceEquals(targetObject, sourceObject)) { return; }
targetObject.InclinedSection = sourceObject.InclinedSection; targetObject.InclinedSection = sourceObject.InclinedSection;
targetObject.InclinedCrack = sourceObject.InclinedCrack;
targetObject.Stirrup = sourceObject.Stirrup; targetObject.Stirrup = sourceObject.Stirrup;
targetObject.LimitState = sourceObject.LimitState; targetObject.LimitState = sourceObject.LimitState;
targetObject.CalcTerm = sourceObject.CalcTerm; targetObject.CalcTerm = sourceObject.CalcTerm;