Add option of strain control in force calculator

This commit is contained in:
ear
2025-10-08 19:19:42 +05:00
parent 292e7bac74
commit 8d4c788a7e
18 changed files with 39 additions and 14 deletions

View File

@@ -24,6 +24,8 @@ namespace DataAccess.DTOs
public IAccuracy Accuracy { get; set; } public IAccuracy Accuracy { get; set; }
[JsonProperty("CompressedMember")] [JsonProperty("CompressedMember")]
public ICompressedMember CompressedMember { get; set; } = new CompressedMemberDTO(); public ICompressedMember CompressedMember { get; set; } = new CompressedMemberDTO();
[JsonProperty("CheckStrainLimit")]
public bool CheckStrainLimit { get; set; } = true;
public ForceCalculatorInputDataDTO(Guid id) public ForceCalculatorInputDataDTO(Guid id)
{ {

View File

@@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -2,7 +2,7 @@
"$id": "1", "$id": "1",
"$type": "RootObject", "$type": "RootObject",
"FileVersion": { "FileVersion": {
"Id": "24d6a33c-a189-4b16-9d14-00e18b022698", "Id": "0e4e721a-1df3-4693-999d-3670b14f7113",
"VersionNumber": 1, "VersionNumber": 1,
"SubVersionNumber": 4 "SubVersionNumber": 4
}, },

View File

@@ -6,10 +6,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup> <PropertyGroup>
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Any CPU</Platform> <Platform>Any CPU</Platform>
<PublishDir>bin\Release\net6.0-windows7.0\win-x64\publish\win-x64\</PublishDir> <PublishDir>bin\Release\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol> <PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId> <_TargetId>Folder</_TargetId>
<TargetFramework>net6.0-windows7.0</TargetFramework> <TargetFramework>net9.0-windows7.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained> <SelfContained>true</SelfContained>
<PublishReadyToRun>false</PublishReadyToRun> <PublishReadyToRun>false</PublishReadyToRun>

View File

@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<History>True|2025-09-01T13:13:26.2156933Z||;True|2025-09-01T10:22:19.7113160+05:00||;True|2025-07-21T11:22:35.9564230+05:00||;True|2025-01-27T14:32:31.9770658+05:00||;True|2024-12-29T20:48:11.7280613+05:00||;True|2024-12-27T13:24:44.0055462+05:00||;True|2024-11-13T09:16:22.8894163+05:00||;True|2024-08-13T14:00:35.8311260+05:00||;True|2024-08-12T12:59:16.1785759+05:00||;True|2024-03-11T20:33:14.1457807+05:00||;True|2024-03-10T19:11:27.6834663+05:00||;True|2024-02-02T12:22:50.1454015+05:00||;True|2023-02-25T13:37:39.2738786+05:00||;False|2023-02-25T13:37:24.0284261+05:00||;True|2023-02-25T13:34:01.6858860+05:00||;True|2023-02-25T13:31:18.8295711+05:00||;False|2023-02-25T13:25:21.5807199+05:00||;False|2023-02-25T13:24:41.7164398+05:00||;</History> <History>True|2025-10-08T10:12:30.5384948Z||;False|2025-10-08T15:11:01.2672591+05:00||;True|2025-10-08T09:15:32.2315891+05:00||;False|2025-10-08T09:11:08.2259505+05:00||;False|2025-10-08T09:10:40.2008110+05:00||;False|2025-10-08T09:09:13.4947353+05:00||;True|2025-09-01T18:13:26.2156933+05:00||;True|2025-09-01T10:22:19.7113160+05:00||;True|2025-07-21T11:22:35.9564230+05:00||;True|2025-01-27T14:32:31.9770658+05:00||;True|2024-12-29T20:48:11.7280613+05:00||;True|2024-12-27T13:24:44.0055462+05:00||;True|2024-11-13T09:16:22.8894163+05:00||;True|2024-08-13T14:00:35.8311260+05:00||;True|2024-08-12T12:59:16.1785759+05:00||;True|2024-03-11T20:33:14.1457807+05:00||;True|2024-03-10T19:11:27.6834663+05:00||;True|2024-02-02T12:22:50.1454015+05:00||;True|2023-02-25T13:37:39.2738786+05:00||;False|2023-02-25T13:37:24.0284261+05:00||;True|2023-02-25T13:34:01.6858860+05:00||;True|2023-02-25T13:31:18.8295711+05:00||;False|2023-02-25T13:25:21.5807199+05:00||;False|2023-02-25T13:24:41.7164398+05:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -68,7 +68,7 @@
<PackageReference Include="LiveCharts.Wpf.Core" Version="0.9.8" /> <PackageReference Include="LiveCharts.Wpf.Core" Version="0.9.8" />
<PackageReference Include="LiveCharts.Wpf.NetCore3" Version="0.9.8" /> <PackageReference Include="LiveCharts.Wpf.NetCore3" Version="0.9.8" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" /> <PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="System.Windows.Interactivity.WPF" Version="2.0.20525" /> <PackageReference Include="System.Windows.Interactivity.WPF" Version="2.0.20525" />
</ItemGroup> </ItemGroup>

View File

@@ -7,7 +7,7 @@
xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Calculations.Calculators" xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Calculations.Calculators"
d:DataContext="{d:DesignInstance vm:ForceCalculatorViewModel}" d:DataContext="{d:DesignInstance vm:ForceCalculatorViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
Title="Analysis by forces" Height="300" Width="400" MinHeight="300" MinWidth="400" WindowStartupLocation="CenterScreen" Closing="Window_Closing"> Title="Analysis by forces" Height="350" Width="400" MinHeight="350" MinWidth="400" WindowStartupLocation="CenterScreen" Closing="Window_Closing">
<Window.Resources> <Window.Resources>
<Style x:Key="cbStyle" TargetType="CheckBox"> <Style x:Key="cbStyle" TargetType="CheckBox">
<Setter Property="Margin" Value="0,5,0,5"/> <Setter Property="Margin" Value="0,5,0,5"/>
@@ -28,6 +28,7 @@
<CheckBox Style="{StaticResource cbStyle}" Content="Long Term" IsChecked="{Binding LongTerm}"/> <CheckBox Style="{StaticResource cbStyle}" Content="Long Term" IsChecked="{Binding LongTerm}"/>
</StackPanel> </StackPanel>
</GroupBox> </GroupBox>
<CheckBox Content="Check strain limit" IsChecked="{Binding CheckStrainLimit}"/>
</StackPanel> </StackPanel>
</TabItem> </TabItem>
<TabItem Header="Forces"> <TabItem Header="Forces">
@@ -78,6 +79,7 @@
<TextBox Style="{StaticResource ValidatedError}" Grid.Column="2" Grid.Row="1" Margin="5,5,5,5" Text="{Binding MaxIterationCount, ValidatesOnDataErrors=True}"/> <TextBox Style="{StaticResource ValidatedError}" Grid.Column="2" Grid.Row="1" Margin="5,5,5,5" Text="{Binding MaxIterationCount, ValidatesOnDataErrors=True}"/>
</Grid> </Grid>
</TabItem> </TabItem>
</TabControl> </TabControl>
</DataTemplate> </DataTemplate>
</Window.Resources> </Window.Resources>

View File

@@ -17,6 +17,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
{ {
private IForceCalculatorInputData inputData; private IForceCalculatorInputData inputData;
SecondOrderViewModel secondOrderViewModel; SecondOrderViewModel secondOrderViewModel;
private bool checkStrainLimit;
public double IterationAccuracy public double IterationAccuracy
{ {
@@ -36,6 +37,15 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
public bool SLS { get; set; } public bool SLS { get; set; }
public bool ShortTerm { get; set; } public bool ShortTerm { get; set; }
public bool LongTerm { get; set; } public bool LongTerm { get; set; }
public bool CheckStrainLimit
{
get => inputData.CheckStrainLimit;
set
{
inputData.CheckStrainLimit = value;
OnPropertyChanged(nameof(CheckStrainLimit));
}
}
public SourceTargetVM<IForceAction> CombinationViewModel { get; } public SourceTargetVM<IForceAction> CombinationViewModel { get; }
public SourceTargetVM<PrimitiveBase> PrimitivesViewModel { get; private set; } public SourceTargetVM<PrimitiveBase> PrimitivesViewModel { get; private set; }

View File

@@ -10,8 +10,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ExcelDataReader" Version="3.7.0" /> <PackageReference Include="ExcelDataReader" Version="3.8.0" />
<PackageReference Include="NLog" Version="6.0.3" /> <PackageReference Include="NLog" Version="6.0.4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -15,6 +15,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public List<INdmPrimitive> Primitives { get; private set; } = new(); public List<INdmPrimitive> Primitives { get; private set; } = new();
public ICompressedMember CompressedMember { get; set; } = new CompressedMember() { Buckling = false}; public ICompressedMember CompressedMember { get; set; } = new CompressedMember() { Buckling = false};
public IAccuracy Accuracy { get; set; } = new Accuracy() {IterationAccuracy = 0.001d, MaxIterationCount = 1000}; public IAccuracy Accuracy { get; set; } = new Accuracy() {IterationAccuracy = 0.001d, MaxIterationCount = 1000};
public bool CheckStrainLimit { get; set; } = true;
//public List<IForceCombinationList> ForceCombinationLists { get; set; } //public List<IForceCombinationList> ForceCombinationLists { get; set; }
public ForceCalculatorInputData(Guid id) public ForceCalculatorInputData(Guid id)

View File

@@ -44,6 +44,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
CheckObject.IsNull(targetObject, sourceObject, "Force calculator input data"); CheckObject.IsNull(targetObject, sourceObject, "Force calculator input data");
if (ReferenceEquals(targetObject, sourceObject)) { return; } if (ReferenceEquals(targetObject, sourceObject)) { return; }
targetObject.Accuracy ??= new Accuracy(); targetObject.Accuracy ??= new Accuracy();
targetObject.CheckStrainLimit = sourceObject.CheckStrainLimit;
accuracyUpdateStrategy.Update(targetObject.Accuracy, sourceObject.Accuracy); accuracyUpdateStrategy.Update(targetObject.Accuracy, sourceObject.Accuracy);
targetObject.CompressedMember ??= new CompressedMember(); targetObject.CompressedMember ??= new CompressedMember();
compressedMemberUpdateStrategy.Update(targetObject.CompressedMember, sourceObject.CompressedMember); compressedMemberUpdateStrategy.Update(targetObject.CompressedMember, sourceObject.CompressedMember);

View File

@@ -223,7 +223,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
{ {
NdmCollection = ndmCollection, NdmCollection = ndmCollection,
ForceTuple = tuple, ForceTuple = tuple,
Accuracy = accuracy Accuracy = accuracy,
CheckStrainLimit = InputData.CheckStrainLimit,
}; };
var calculator = new ForceTupleCalculator(); var calculator = new ForceTupleCalculator();
calculator.InputData = inputData; calculator.InputData = inputData;

View File

@@ -18,6 +18,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public IForceTuple ForceTuple { get; set; } public IForceTuple ForceTuple { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
public IAccuracy Accuracy { get; set; } public IAccuracy Accuracy { get; set; }
public bool CheckStrainLimit { get; set; }
public ForceTupleInputData() public ForceTupleInputData()
{ {

View File

@@ -28,5 +28,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
/// Settings for calculating of stability fo compressed members /// Settings for calculating of stability fo compressed members
/// </summary> /// </summary>
ICompressedMember CompressedMember { get; set; } ICompressedMember CompressedMember { get; set; }
bool CheckStrainLimit { get; set; }
} }
} }

View File

@@ -26,5 +26,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
/// Settings of iteration /// Settings of iteration
/// </summary> /// </summary>
IAccuracy Accuracy { get; set; } IAccuracy Accuracy { get; set; }
bool CheckStrainLimit { get; set; }
} }
} }

View File

@@ -123,8 +123,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
TraceLogger = TraceLogger TraceLogger = TraceLogger
}; };
forceTupleTraceResultLogic.TraceResult(result); forceTupleTraceResultLogic.TraceResult(result);
if (InputData.CheckStrainLimit == true)
{
CheckOverStrainedNdms(); CheckOverStrainedNdms();
} }
}
private bool CheckOverStrainedNdms() private bool CheckOverStrainedNdms()
{ {

View File

@@ -19,6 +19,7 @@ namespace StructureHelperLogics.Services.NdmCalculations
calculator.InputData.Accuracy = source.InputData.Accuracy; calculator.InputData.Accuracy = source.InputData.Accuracy;
calculator.InputData.Primitives.AddRange(source.InputData.Primitives); calculator.InputData.Primitives.AddRange(source.InputData.Primitives);
calculator.InputData.ForceActions.Clear(); calculator.InputData.ForceActions.Clear();
calculator.InputData.CheckStrainLimit = source.InputData.CheckStrainLimit;
var forceTuples = ForceTupleService.InterpolateDesignTuple(interpolateTuplesResult.FinishTuple, interpolateTuplesResult.StartTuple, interpolateTuplesResult.StepCount); var forceTuples = ForceTupleService.InterpolateDesignTuple(interpolateTuplesResult.FinishTuple, interpolateTuplesResult.StartTuple, interpolateTuplesResult.StepCount);
foreach (var forceTuple in forceTuples) foreach (var forceTuple in forceTuples)
{ {

View File

@@ -10,10 +10,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Castle.Core" Version="5.2.1" /> <PackageReference Include="Castle.Core" Version="5.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Moq" Version="4.20.72" /> <PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.4.0" /> <PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" /> <PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>