Change force tuple calculator result
This commit is contained in:
@@ -26,9 +26,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
static readonly CrackForceBynarySearchCalculator calculator = new();
|
||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||
|
||||
private List<IForcesTupleResult> ValidTupleList { get; set; }
|
||||
private List<IExtendedForceTupleCalculatorResult> ValidTupleList { get; set; }
|
||||
ArrayParameter<double> arrayParameter;
|
||||
private IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||
private IEnumerable<IExtendedForceTupleCalculatorResult> TupleList { get; set; }
|
||||
private IEnumerable<INdmPrimitive> NdmPrimitives { get; set; }
|
||||
|
||||
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||
@@ -40,7 +40,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public CrackDiagramLogic(IEnumerable<IForcesTupleResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
public CrackDiagramLogic(IEnumerable<IExtendedForceTupleCalculatorResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
TupleList = tupleList;
|
||||
NdmPrimitives = ndmPrimitives;
|
||||
@@ -92,20 +92,20 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
"Errors appeared during showing a graph, see detailed information");
|
||||
}
|
||||
|
||||
private void CalculateWithCrack(List<IForcesTupleResult> validTupleList, IEnumerable<INdmPrimitive> ndmPrimitives, IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
|
||||
private void CalculateWithCrack(List<IExtendedForceTupleCalculatorResult> validTupleList, IEnumerable<INdmPrimitive> ndmPrimitives, IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
|
||||
{
|
||||
var data = arrayParameter.Data;
|
||||
for (int i = 0; i < validTupleList.Count(); i++)
|
||||
{
|
||||
var valueList = new List<double>
|
||||
{
|
||||
validTupleList[i].DesignForceTuple.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||
validTupleList[i].DesignForceTuple.ForceTuple.My * unitMoment.Multiplyer,
|
||||
validTupleList[i].DesignForceTuple.ForceTuple.Nz * unitForce.Multiplyer
|
||||
validTupleList[i].ForcesTupleResult.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||
validTupleList[i].ForcesTupleResult.ForceTuple.My * unitMoment.Multiplyer,
|
||||
validTupleList[i].ForcesTupleResult.ForceTuple.Nz * unitForce.Multiplyer
|
||||
};
|
||||
calculator.InputData.EndTuple = validTupleList[i].DesignForceTuple.ForceTuple;
|
||||
var limitState = validTupleList[i].DesignForceTuple.LimitState;
|
||||
var calcTerm = validTupleList[i].DesignForceTuple.CalcTerm;
|
||||
calculator.InputData.EndTuple = validTupleList[i].ForcesTupleResult.ForceTuple;
|
||||
var limitState = validTupleList[i].StateCalcTermPair.LimitState;
|
||||
var calcTerm = validTupleList[i].StateCalcTermPair.CalcTerm;
|
||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
||||
{
|
||||
Primitives = ndmPrimitives,
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
|
||||
@@ -21,14 +21,14 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
/// <summary>
|
||||
/// Collection of force results
|
||||
/// </summary>
|
||||
public List<IForcesTupleResult> TupleList { get; set; }
|
||||
public List<IExtendedForceTupleCalculatorResult> TupleResultList { get; set; }
|
||||
|
||||
//public Action<int> SetProgress { get; set; }
|
||||
|
||||
public ArrayParameter<double> GetCommonArray()
|
||||
{
|
||||
var labels = LabelsFactory.GetCommonLabels();
|
||||
arrayParameter = new ArrayParameter<double>(TupleList.Count(), labels);
|
||||
arrayParameter = new ArrayParameter<double>(TupleResultList.Count(), labels);
|
||||
Calculate();
|
||||
return arrayParameter;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
private void Calculate()
|
||||
{
|
||||
var data = arrayParameter.Data;
|
||||
for (int i = 0; i < TupleList.Count(); i++)
|
||||
for (int i = 0; i < TupleResultList.Count(); i++)
|
||||
{
|
||||
var valueList = ProcessResult(i);
|
||||
for (int j = 0; j < valueList.Count; j++)
|
||||
@@ -56,12 +56,12 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
|
||||
return new List<double>
|
||||
{
|
||||
TupleList[i].DesignForceTuple.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||
TupleList[i].DesignForceTuple.ForceTuple.My * unitMoment.Multiplyer,
|
||||
TupleList[i].DesignForceTuple.ForceTuple.Nz * unitForce.Multiplyer,
|
||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.Kx * unitCurvature.Multiplyer,
|
||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.Ky * unitCurvature.Multiplyer,
|
||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.EpsZ
|
||||
TupleResultList[i].ForcesTupleResult.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.ForceTuple.My * unitMoment.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.ForceTuple.Nz * unitForce.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.Kx * unitCurvature.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.Ky * unitCurvature.Multiplyer,
|
||||
TupleResultList[i].ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.EpsZ
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
public interface IValuePointDiagramLogic
|
||||
{
|
||||
ForceCalculator Calculator { get; set; }
|
||||
IForceCalculator Calculator { get; set; }
|
||||
PointPrimitiveLogic PrimitiveLogic { get; set; }
|
||||
IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||
IEnumerable<IExtendedForceTupleCalculatorResult> TupleList { get; set; }
|
||||
ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
||||
|
||||
GenericResult<ArrayParameter<double>> GetArrayParameter();
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
||||
{
|
||||
@@ -21,9 +18,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
private ValuePointsInterpolateViewModel viewModel;
|
||||
private IResult result;
|
||||
private ValuePointsInterpolationInputData inputData;
|
||||
public IForcesTupleResult SelectedResult { get; set; }
|
||||
public IExtendedForceTupleCalculatorResult SelectedResult { get; set; }
|
||||
public IEnumerable<INdmPrimitive> NdmPrimitives { get; set; }
|
||||
public ForceCalculator ForceCalculator { get; set; }
|
||||
public IForceCalculator ForceCalculator { get; set; }
|
||||
|
||||
|
||||
public ILongProcessLogic ProgressLogic { get; set; }
|
||||
@@ -31,20 +28,20 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public void InterpolateValuePoints()
|
||||
{
|
||||
var tuple = SelectedResult.DesignForceTuple ?? throw new StructureHelperException(ErrorStrings.NullReference + ": Design force combination");
|
||||
var tuple = SelectedResult.ForcesTupleResult.ForceTuple ?? throw new StructureHelperException(ErrorStrings.NullReference + ": Design force combination");
|
||||
PrepareInputData(tuple);
|
||||
viewModel = new ValuePointsInterpolateViewModel(inputData);
|
||||
if (ShowDialog() == false) { return; };
|
||||
ShowDiagram(result);
|
||||
}
|
||||
|
||||
private void PrepareInputData(IDesignForceTuple tuple)
|
||||
private void PrepareInputData(IForceTuple endTuple)
|
||||
{
|
||||
inputData = new ValuePointsInterpolationInputData()
|
||||
{
|
||||
FinishDesignForce = tuple.Clone() as IDesignForceTuple,
|
||||
LimitState = tuple.LimitState,
|
||||
CalcTerm = tuple.CalcTerm,
|
||||
StartForceTuple = new ForceTuple(),
|
||||
FinishForceTuple = endTuple.Clone() as IForceTuple,
|
||||
StateCalcTermPair = SelectedResult.StateCalcTermPair,
|
||||
};
|
||||
inputData.PrimitiveBases.AddRange(PrimitiveOperations.ConvertNdmPrimitivesToPrimitiveBase(NdmPrimitives));
|
||||
}
|
||||
@@ -54,7 +51,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
var wnd = new ValuePointsInterpolateView(viewModel);
|
||||
wnd.ShowDialog();
|
||||
if (wnd.DialogResult != true) { return false; }
|
||||
interpolationLogic = new InterpolationProgressLogic(ForceCalculator, viewModel.ForceInterpolationViewModel.Result);
|
||||
interpolationLogic = new InterpolationProgressLogic(ForceCalculator, SelectedResult.StateCalcTermPair, viewModel.ForceInterpolationViewModel.Result);
|
||||
ProgressLogic = interpolationLogic;
|
||||
ShowProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
@@ -68,17 +65,17 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
private void ShowDiagram(IResult result)
|
||||
{
|
||||
if (result.IsValid == false) { return; }
|
||||
if (result is not IForcesResults)
|
||||
if (result is not IForceCalculatorResult)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(IForcesResults), result));
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(IForceCalculatorResult), result));
|
||||
}
|
||||
var tupleResult = result as IForcesResults;
|
||||
var tupleResult = result as IForceCalculatorResult;
|
||||
var pointGraphLogic = new ShowValuePointDiagramLogic()
|
||||
{
|
||||
Calculator = interpolationLogic.InterpolateCalculator,
|
||||
PrimitiveLogic = viewModel.PrimitiveLogic,
|
||||
ValueDelegatesLogic = viewModel.ValueDelegatesLogic,
|
||||
TupleList = tupleResult.ForcesResultList
|
||||
TupleResultList = tupleResult.ForcesResultList
|
||||
};
|
||||
pointGraphLogic.ShowWindow();
|
||||
}
|
||||
|
||||
@@ -25,15 +25,15 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public IForceTuple ForceTuple { get; set; }
|
||||
public IEnumerable<INdmPrimitive> ndmPrimitives { get; set; }
|
||||
public void Show(IDesignForceTuple finishDesignTuple)
|
||||
public void Show(IForceTuple finishDesignTuple)
|
||||
{
|
||||
var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
|
||||
var viewModel = new InterpolateTuplesViewModel(new ForceTuple(), finishDesignTuple, 100);
|
||||
viewModel.ForceInterpolationViewModel.StepCountVisible = false;
|
||||
var wndTuples = new InterpolateTuplesView(viewModel);
|
||||
wndTuples.ShowDialog();
|
||||
if (wndTuples.DialogResult != true) return;
|
||||
var startDesignTuple = viewModel.ForceInterpolationViewModel.StartDesignForce.ForceTuple;
|
||||
var endDesignTuple = viewModel.ForceInterpolationViewModel.FinishDesignForce.ForceTuple;
|
||||
var startDesignTuple = viewModel.ForceInterpolationViewModel.StartDesignForce;
|
||||
var endDesignTuple = viewModel.ForceInterpolationViewModel.FinishDesignForce;
|
||||
FindCrackFactor(endDesignTuple, startDesignTuple);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
using StructureHelper.Windows.Graphs;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Services.Units;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
@@ -19,9 +16,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
internal class ShowDiagramLogic : ILongProcessLogic
|
||||
{
|
||||
private ArrayParameter<double> arrayParameter;
|
||||
private IEnumerable<IForcesTupleResult> tupleList;
|
||||
private IEnumerable<IExtendedForceTupleCalculatorResult> tupleList;
|
||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
||||
private List<IForcesTupleResult> validTupleList;
|
||||
private List<IExtendedForceTupleCalculatorResult> validTupleList;
|
||||
|
||||
public int StepCount => validTupleList.Count();
|
||||
|
||||
@@ -60,13 +57,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
var factory = new DiagramFactory()
|
||||
{
|
||||
TupleList = validTupleList,
|
||||
TupleResultList = validTupleList,
|
||||
//SetProgress = SetProgress,
|
||||
};
|
||||
arrayParameter = factory.GetCommonArray();
|
||||
}
|
||||
|
||||
public ShowDiagramLogic(IEnumerable<IForcesTupleResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
public ShowDiagramLogic(IEnumerable<IExtendedForceTupleCalculatorResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||
{
|
||||
this.tupleList = tupleList;
|
||||
this.ndmPrimitives = ndmPrimitives;
|
||||
|
||||
@@ -1,27 +1,12 @@
|
||||
using LoaderCalculator.Data.Materials.MaterialBuilders;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic;
|
||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelper.Windows.Graphs;
|
||||
using StructureHelper.Windows.ViewModels.Errors;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Parameters;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
@@ -33,8 +18,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
private ArrayParameter<double> arrayParameter;
|
||||
private IValuePointDiagramLogic pointDiagramLogic;
|
||||
|
||||
public IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||
public ForceCalculator Calculator { get; set; }
|
||||
public IEnumerable<IExtendedForceTupleCalculatorResult> TupleResultList { get; set; }
|
||||
public IForceCalculator Calculator { get; set; }
|
||||
public PointPrimitiveLogic PrimitiveLogic { get; set; }
|
||||
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
||||
|
||||
@@ -77,7 +62,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
||||
|
||||
private GenericResult<ArrayParameter<double>> GetResult()
|
||||
{
|
||||
pointDiagramLogic.TupleList = TupleList;
|
||||
pointDiagramLogic.TupleList = TupleResultList;
|
||||
pointDiagramLogic.PrimitiveLogic = PrimitiveLogic;
|
||||
pointDiagramLogic.Calculator = Calculator;
|
||||
pointDiagramLogic.ValueDelegatesLogic = ValueDelegatesLogic;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelper.Windows.Forces;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
@@ -10,9 +9,6 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
||||
{
|
||||
@@ -20,13 +16,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
private ArrayParameter<double> arrayParameter;
|
||||
private List<(INamedAreaPoint areaPoint, INdmPrimitive ndmPrimitive)> pointCollection;
|
||||
private List<IForcesTupleResult> validTuplesList;
|
||||
private List<IExtendedForceTupleCalculatorResult> validTuplesList;
|
||||
private ArrayParameter<double> arrayOfValuesByPoint;
|
||||
private IEnumerable<ForceResultFunc> selectedDelegates;
|
||||
private string exceptionMessage;
|
||||
|
||||
public IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||
public ForceCalculator Calculator { get; set; }
|
||||
public IEnumerable<IExtendedForceTupleCalculatorResult> TupleList { get; set; }
|
||||
public IForceCalculator Calculator { get; set; }
|
||||
public PointPrimitiveLogic PrimitiveLogic { get; set; }
|
||||
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
||||
|
||||
@@ -106,14 +102,14 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ProcessPointByTuple(IForcesTupleResult tuple, int i)
|
||||
private void ProcessPointByTuple(IExtendedForceTupleCalculatorResult tupleResult, int i)
|
||||
{
|
||||
var values = new List<double>();
|
||||
var strainMatrix = tuple.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var strainMatrix = tupleResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
|
||||
foreach (var valuePoint in pointCollection)
|
||||
{
|
||||
var ndm = GetMockNdm(valuePoint, tuple);
|
||||
var ndm = GetMockNdm(valuePoint, tupleResult);
|
||||
|
||||
foreach (var valDelegate in selectedDelegates)
|
||||
{
|
||||
@@ -127,7 +123,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
var factory = new DiagramFactory()
|
||||
{
|
||||
TupleList = validTuplesList,
|
||||
TupleResultList = validTuplesList,
|
||||
//SetProgress = SetProgress,
|
||||
};
|
||||
arrayParameter = factory.GetCommonArray();
|
||||
@@ -135,10 +131,10 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
var labels = GetValueLabels(selectedDelegates);
|
||||
arrayOfValuesByPoint = new ArrayParameter<double>(validTuplesList.Count(), labels);
|
||||
}
|
||||
private INdm GetMockNdm((INamedAreaPoint areaPoint, INdmPrimitive ndmPrimitive) valuePoint, IForcesTupleResult tuple)
|
||||
private INdm GetMockNdm((INamedAreaPoint areaPoint, INdmPrimitive ndmPrimitive) valuePoint, IExtendedForceTupleCalculatorResult tupleResult)
|
||||
{
|
||||
var limitState = tuple.DesignForceTuple.LimitState;
|
||||
var calcTerm = tuple.DesignForceTuple.CalcTerm;
|
||||
var limitState = tupleResult.StateCalcTermPair.LimitState;
|
||||
var calcTerm = tupleResult.StateCalcTermPair.CalcTerm;
|
||||
var material = valuePoint.ndmPrimitive.NdmElement.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
|
||||
var userPrestrain = valuePoint.ndmPrimitive.NdmElement.UsersPrestrain;
|
||||
var autoPrestrain = valuePoint.ndmPrimitive.NdmElement.AutoPrestrain;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<ToolBar Name="CrackResult">
|
||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowCrackResultCommand}">
|
||||
<Button.ToolTip>
|
||||
<uc:ButtonToolTipEh HeaderText="Show result step by step"
|
||||
<uc:ButtonToolTipEh HeaderText="Show crack result step by step"
|
||||
IconContent="{StaticResource CrackForces}"
|
||||
DescriptionText="Show proportional combination of forces where cracks are appeared"/>
|
||||
</Button.ToolTip>
|
||||
@@ -164,17 +164,17 @@
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Header="Valid" Binding="{Binding Path=IsValid}"/>
|
||||
<DataGridTextColumn Header="LimitState" Width="70" Binding="{Binding DesignForceTuple.LimitState}"/>
|
||||
<DataGridTextColumn Header="Duration" Width="70" Binding="{Binding DesignForceTuple.CalcTerm}"/>
|
||||
<DataGridTextColumn Header="Moment Mx" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.Mx, Converter={StaticResource MomentConverter}}"/>
|
||||
<DataGridTextColumn Header="Moment My" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.My, Converter={StaticResource MomentConverter}}"/>
|
||||
<DataGridTextColumn Header="Force Nz" Width="90" Binding="{Binding DesignForceTuple.ForceTuple.Nz, Converter={StaticResource ForceConverter}}"/>
|
||||
<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}"/>
|
||||
<DataGridTextColumn Header="Accuracy" Width="90" Binding="{Binding LoaderResults.AccuracyRate}"/>
|
||||
<DataGridTextColumn Header="Max Iteration" Width="90" Binding="{Binding LoaderResults.IterationCounter}"/>
|
||||
<DataGridTextColumn Header="Description" Width="300" Binding="{Binding Description}"/>
|
||||
<DataGridTextColumn Header="LimitState" Width="70" Binding="{Binding StateCalcTermPair.LimitState}"/>
|
||||
<DataGridTextColumn Header="Duration" Width="70" Binding="{Binding StateCalcTermPair.CalcTerm}"/>
|
||||
<DataGridTextColumn Header="Moment Mx" Width="90" Binding="{Binding ForcesTupleResult.InputData.ForceTuple.Mx, Converter={StaticResource MomentConverter}}"/>
|
||||
<DataGridTextColumn Header="Moment My" Width="90" Binding="{Binding ForcesTupleResult.InputData.ForceTuple.My, Converter={StaticResource MomentConverter}}"/>
|
||||
<DataGridTextColumn Header="Force Nz" Width="90" Binding="{Binding ForcesTupleResult.InputData.ForceTuple.Nz, Converter={StaticResource ForceConverter}}"/>
|
||||
<DataGridTextColumn Header="Kx" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.Kx}"/>
|
||||
<DataGridTextColumn Header="Ky" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.Ky}"/>
|
||||
<DataGridTextColumn Header="EpsZ" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix.EpsZ}"/>
|
||||
<DataGridTextColumn Header="Accuracy" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.AccuracyRate}"/>
|
||||
<DataGridTextColumn Header="Max Iteration" Width="90" Binding="{Binding ForcesTupleResult.LoaderResults.IterationCounter}"/>
|
||||
<DataGridTextColumn Header="Description" Width="300" Binding="{Binding ForcesTupleResult.Description}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource ResultValidness}" Content="{Binding ValidResultCounter}"/>
|
||||
|
||||
@@ -18,7 +18,6 @@ using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Exports;
|
||||
using StructureHelperCommon.Services.Exports.Factories;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses;
|
||||
@@ -42,13 +41,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
public class ForcesResultsViewModel : ViewModelBase
|
||||
{
|
||||
private ShowDiagramLogic showDiagramLogic;
|
||||
private ForceCalculator forceCalculator;
|
||||
private IForceCalculator forceCalculator;
|
||||
private ILongProcessLogic progressLogic;
|
||||
private ShowProgressLogic showProgressLogic;
|
||||
private InteractionDiagramLogic interactionDiagramLogic;
|
||||
private static readonly ShowCrackResultLogic showCrackResultLogic = new();
|
||||
//private static readonly ShowCrackWidthLogic showCrackWidthLogic = new();
|
||||
private IForcesResults resultModel;
|
||||
private IForceCalculatorResult resultModel;
|
||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
||||
private IEnumerable<INdmPrimitive> selectedNdmPrimitives;
|
||||
private IEnumerable<INdm> ndms;
|
||||
@@ -56,7 +55,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||
|
||||
public IForcesTupleResult? SelectedResult { get; set; }
|
||||
public IExtendedForceTupleCalculatorResult? SelectedResult { get; set; }
|
||||
private ICommand? showIsoFieldCommand;
|
||||
private ICommand? exportToCSVCommand;
|
||||
private ICommand? interpolateCommand;
|
||||
@@ -73,7 +72,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
public ValidResultCounterVM ValidResultCounter { get; }
|
||||
|
||||
public IForcesResults ForcesResults
|
||||
public IForceCalculatorResult ForcesResults
|
||||
{
|
||||
get => resultModel;
|
||||
}
|
||||
@@ -149,7 +148,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
ShowInterpolationWindow(out interpolateTuplesViewModel, out wndTuples);
|
||||
if (wndTuples.DialogResult != true) return;
|
||||
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interpolateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, SelectedResult.StateCalcTermPair, interpolateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
showProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
WindowTitle = "Interpolate forces"
|
||||
@@ -157,9 +156,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
showProgressLogic.Show();
|
||||
|
||||
var result = interpolationLogic.InterpolateCalculator.Result;
|
||||
if (result is IForcesResults)
|
||||
if (result is IForceCalculatorResult)
|
||||
{
|
||||
var tupleResult = result as IForcesResults;
|
||||
var tupleResult = result as IForceCalculatorResult;
|
||||
var diagramLogic = new ShowDiagramLogic(tupleResult.ForcesResultList, ndmPrimitives);
|
||||
showProgressLogic = new(diagramLogic)
|
||||
{
|
||||
@@ -179,7 +178,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
||||
if (wndTuples.DialogResult != true) return;
|
||||
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, SelectedResult.StateCalcTermPair, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
showProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
WindowTitle = "Interpolate forces"
|
||||
@@ -187,9 +186,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
showProgressLogic.Show();
|
||||
|
||||
var result = interpolationLogic.InterpolateCalculator.Result;
|
||||
if (result is IForcesResults)
|
||||
if (result is IForceCalculatorResult)
|
||||
{
|
||||
var tupleResult = result as IForcesResults;
|
||||
var tupleResult = result as IForceCalculatorResult;
|
||||
var diagramLogic = new CrackDiagramLogic(tupleResult.ForcesResultList, ndmPrimitives);
|
||||
showProgressLogic = new(diagramLogic)
|
||||
{
|
||||
@@ -209,11 +208,11 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
private void ShowCrackResult()
|
||||
{
|
||||
showCrackResultLogic.LimitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
showCrackResultLogic.CalcTerm = CalcTerms.ShortTerm; //= SelectedResult.DesignForceTuple.CalcTerm;
|
||||
showCrackResultLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple;
|
||||
showCrackResultLogic.LimitState = SelectedResult.StateCalcTermPair.LimitState;
|
||||
showCrackResultLogic.CalcTerm = CalcTerms.ShortTerm;
|
||||
showCrackResultLogic.ForceTuple = SelectedResult.ForcesTupleResult.InputData.ForceTuple;
|
||||
showCrackResultLogic.ndmPrimitives = ndmPrimitives;
|
||||
showCrackResultLogic.Show(SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple);
|
||||
showCrackResultLogic.Show(SelectedResult.ForcesTupleResult.InputData.ForceTuple.Clone() as IForceTuple);
|
||||
}
|
||||
|
||||
public ICommand InterpolateCommand
|
||||
@@ -235,7 +234,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
||||
if (wndTuples.DialogResult != true) return;
|
||||
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, SelectedResult.StateCalcTermPair, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
||||
progressLogic = interpolationLogic;
|
||||
showProgressLogic = new(interpolationLogic)
|
||||
{
|
||||
@@ -276,8 +275,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
|
||||
private void ShowInterpolationWindow(out InterpolateTuplesViewModel interploateTuplesViewModel, out InterpolateTuplesView wndTuples)
|
||||
{
|
||||
IDesignForceTuple finishDesignTuple = SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple;
|
||||
interploateTuplesViewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
|
||||
ForceTuple startTuple = new();
|
||||
IForceTuple endTuple = SelectedResult.ForcesTupleResult.InputData.ForceTuple.Clone() as IForceTuple;
|
||||
interploateTuplesViewModel = new InterpolateTuplesViewModel(startTuple, endTuple, 100);
|
||||
wndTuples = new InterpolateTuplesView(interploateTuplesViewModel);
|
||||
wndTuples.ShowDialog();
|
||||
}
|
||||
@@ -308,7 +308,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
private void SetPrestrain()
|
||||
{
|
||||
var source = TupleConverter.ConvertToStrainTuple(SelectedResult.LoaderResults.StrainMatrix);
|
||||
var source = TupleConverter.ConvertToStrainTuple(SelectedResult.ForcesTupleResult.LoaderResults.StrainMatrix);
|
||||
var vm = new SetPrestrainViewModel(source);
|
||||
var wnd = new SetPrestrainView(vm);
|
||||
wnd.ShowDialog();
|
||||
@@ -336,9 +336,9 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var limitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
var calcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||
var strainMatrix = SelectedResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var limitState = SelectedResult.StateCalcTermPair.LimitState;
|
||||
var calcTerm = SelectedResult.StateCalcTermPair.CalcTerm;
|
||||
|
||||
var primitiveSets = ShowAnchorageResult.GetPrimitiveSets(strainMatrix, limitState, calcTerm, ndmPrimitives);
|
||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
||||
@@ -363,7 +363,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var strainMatrix = SelectedResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var textParametrsLogic = new GeometryParametersLogic(ndms, strainMatrix);
|
||||
var calculator = new GeometryCalculator(textParametrsLogic);
|
||||
calculator.Run();
|
||||
@@ -392,7 +392,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
try
|
||||
{
|
||||
var strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var strainMatrix = SelectedResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var textParametrsLogic = new ForcesParametersLogic(ndms, strainMatrix);
|
||||
var calculator = new GeometryCalculator(textParametrsLogic);
|
||||
calculator.Run();
|
||||
@@ -412,10 +412,10 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
}
|
||||
|
||||
public ForcesResultsViewModel(ForceCalculator forceCalculator)
|
||||
public ForcesResultsViewModel(IForceCalculator forceCalculator)
|
||||
{
|
||||
this.forceCalculator = forceCalculator;
|
||||
resultModel = forceCalculator.Result as IForcesResults;
|
||||
resultModel = forceCalculator.Result as IForceCalculatorResult;
|
||||
ValidResultCounter = new(resultModel.ForcesResultList);
|
||||
ndmPrimitives = forceCalculator.InputData.Primitives;
|
||||
}
|
||||
@@ -424,7 +424,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
{
|
||||
try
|
||||
{
|
||||
IStrainMatrix strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
IStrainMatrix strainMatrix = SelectedResult.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
var primitiveSets = ShowIsoFieldResult.GetPrimitiveSets(strainMatrix, ndms, ForceResultFuncFactory.GetResultFuncs());
|
||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
||||
isoFieldReport.Show();
|
||||
@@ -441,9 +441,12 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
||||
}
|
||||
private void GetNdms()
|
||||
{
|
||||
var limitState = SelectedResult.DesignForceTuple.LimitState;
|
||||
var calcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||
var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
|
||||
var limitState = SelectedResult.StateCalcTermPair.LimitState;
|
||||
var calcTerm = SelectedResult.StateCalcTermPair.CalcTerm;
|
||||
var triangulationOptions = new TriangulationOptions()
|
||||
{
|
||||
LimiteState = limitState,
|
||||
CalcTerm = calcTerm };
|
||||
var orderedNdmPrimitives = ndmPrimitives.OrderBy(x => x.VisualProperty.ZIndex);
|
||||
var ndmRange = new List<INdm>();
|
||||
foreach (var item in orderedNdmPrimitives)
|
||||
|
||||
@@ -41,16 +41,16 @@ namespace StructureHelper.Windows.Forces
|
||||
private void StartValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var tmpTuple = ForceTupleService.MultiplyTupleByFactor(Properties.StartDesignForce.ForceTuple, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, Properties.StartDesignForce.ForceTuple, 1d);
|
||||
var tmpTuple = ForceTupleService.MultiplyTupleByFactor(Properties.StartDesignForce, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, Properties.StartDesignForce, 1d);
|
||||
Properties.RefreshStartTuple();
|
||||
}
|
||||
|
||||
private void FinishValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var obj = (MultiplyDouble)sender;
|
||||
var tmpTuple = ForceTupleService.MultiplyTupleByFactor(Properties.FinishDesignForce.ForceTuple, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, Properties.FinishDesignForce.ForceTuple, 1d);
|
||||
var tmpTuple = ForceTupleService.MultiplyTupleByFactor(Properties.FinishDesignForce, obj.DoubleFactor);
|
||||
ForceTupleService.CopyProperties(tmpTuple, Properties.FinishDesignForce, 1d);
|
||||
Properties.RefreshFinishTuple();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
@@ -16,21 +10,21 @@ namespace StructureHelper.Windows.Forces
|
||||
private RelayCommand copyToStartCommand;
|
||||
private RelayCommand copyToFinishCommand;
|
||||
private int stepCount;
|
||||
private IDesignForceTuple startDesignForce;
|
||||
private IDesignForceTuple finishDesignForce;
|
||||
private IForceTuple startForceTuple;
|
||||
private IForceTuple endForceTuple;
|
||||
|
||||
public IDesignForceTuple StartDesignForce
|
||||
public IForceTuple StartDesignForce
|
||||
{
|
||||
get => startDesignForce; set
|
||||
get => startForceTuple; set
|
||||
{
|
||||
startDesignForce = value;
|
||||
startForceTuple = value;
|
||||
}
|
||||
}
|
||||
public IDesignForceTuple FinishDesignForce
|
||||
public IForceTuple FinishDesignForce
|
||||
{
|
||||
get => finishDesignForce; set
|
||||
get => endForceTuple; set
|
||||
{
|
||||
finishDesignForce = value;
|
||||
endForceTuple = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,55 +35,55 @@ namespace StructureHelper.Windows.Forces
|
||||
public bool StepCountVisible { get; set; }
|
||||
public double StartMx
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.Mx;
|
||||
get => StartDesignForce.Mx;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.Mx = value;
|
||||
StartDesignForce.Mx = value;
|
||||
OnPropertyChanged(nameof(StartMx));
|
||||
}
|
||||
}
|
||||
public double StartMy
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.My;
|
||||
get => StartDesignForce.My;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.My = value;
|
||||
StartDesignForce.My = value;
|
||||
OnPropertyChanged(nameof(StartMy));
|
||||
}
|
||||
}
|
||||
public double StartNz
|
||||
{
|
||||
get => StartDesignForce.ForceTuple.Nz;
|
||||
get => StartDesignForce.Nz;
|
||||
set
|
||||
{
|
||||
StartDesignForce.ForceTuple.Nz = value;
|
||||
StartDesignForce.Nz = value;
|
||||
OnPropertyChanged(nameof(StartNz));
|
||||
}
|
||||
}
|
||||
public double FinishMx
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.Mx;
|
||||
get => FinishDesignForce.Mx;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.Mx = value;
|
||||
FinishDesignForce.Mx = value;
|
||||
OnPropertyChanged(nameof(FinishMx));
|
||||
}
|
||||
}
|
||||
public double FinishMy
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.My;
|
||||
get => FinishDesignForce.My;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.My = value;
|
||||
FinishDesignForce.My = value;
|
||||
OnPropertyChanged(nameof(FinishMy));
|
||||
}
|
||||
}
|
||||
public double FinishNz
|
||||
{
|
||||
get => FinishDesignForce.ForceTuple.Nz;
|
||||
get => FinishDesignForce.Nz;
|
||||
set
|
||||
{
|
||||
FinishDesignForce.ForceTuple.Nz = value;
|
||||
FinishDesignForce.Nz = value;
|
||||
OnPropertyChanged(nameof(FinishNz));
|
||||
}
|
||||
}
|
||||
@@ -126,7 +120,7 @@ namespace StructureHelper.Windows.Forces
|
||||
|
||||
private void InvertForces()
|
||||
{
|
||||
var tmpForce = StartDesignForce.Clone() as IDesignForceTuple;
|
||||
var tmpForce = StartDesignForce.Clone() as IForceTuple;
|
||||
StartDesignForce = FinishDesignForce;
|
||||
FinishDesignForce = tmpForce;
|
||||
StepCountVisible = true;
|
||||
@@ -136,13 +130,13 @@ namespace StructureHelper.Windows.Forces
|
||||
|
||||
private void CopyStartToFinish()
|
||||
{
|
||||
FinishDesignForce = StartDesignForce.Clone() as IDesignForceTuple;
|
||||
FinishDesignForce = StartDesignForce.Clone() as IForceTuple;
|
||||
RefreshFinishTuple();
|
||||
}
|
||||
|
||||
private void CopyFinishToStart()
|
||||
{
|
||||
StartDesignForce = FinishDesignForce.Clone() as IDesignForceTuple;
|
||||
StartDesignForce = FinishDesignForce.Clone() as IForceTuple;
|
||||
RefreshStartTuple();
|
||||
}
|
||||
|
||||
@@ -162,18 +156,10 @@ namespace StructureHelper.Windows.Forces
|
||||
OnPropertyChanged(nameof(StartNz));
|
||||
}
|
||||
|
||||
public ForceTupleInterpolationViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce = null, int stepCount = 100)
|
||||
public ForceTupleInterpolationViewModel(IForceTuple startForceTuple, IForceTuple endForceTuple, int stepCount = 100)
|
||||
{
|
||||
if (startDesignForce != null)
|
||||
{
|
||||
CheckDesignForces(finishDesignForce, startDesignForce);
|
||||
StartDesignForce = startDesignForce;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetNewDesignForce(finishDesignForce);
|
||||
}
|
||||
FinishDesignForce = finishDesignForce;
|
||||
this.startForceTuple = startForceTuple;
|
||||
this.endForceTuple = endForceTuple;
|
||||
StepCount = stepCount;
|
||||
StepCountVisible = true;
|
||||
}
|
||||
@@ -181,32 +167,5 @@ namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private static void CheckDesignForces(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce)
|
||||
{
|
||||
if (startDesignForce.LimitState != finishDesignForce.LimitState)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid);
|
||||
}
|
||||
if (startDesignForce.CalcTerm != finishDesignForce.CalcTerm)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid);
|
||||
}
|
||||
}
|
||||
|
||||
private void GetNewDesignForce(IDesignForceTuple finishDesignForce)
|
||||
{
|
||||
StartDesignForce = new DesignForceTuple()
|
||||
{
|
||||
CalcTerm = finishDesignForce.CalcTerm,
|
||||
LimitState = finishDesignForce.LimitState,
|
||||
ForceTuple = new ForceTuple()
|
||||
{
|
||||
Mx = 0,
|
||||
My = 0,
|
||||
Nz = 0
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelper.Windows.ViewModels;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
@@ -10,9 +7,9 @@ namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public ForceTupleInterpolationViewModel ForceInterpolationViewModel { get; set; }
|
||||
|
||||
public InterpolateTuplesViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce=null, int stepCount = 100)
|
||||
public InterpolateTuplesViewModel(IForceTuple startTuple, IForceTuple endTuple, int stepCount = 100)
|
||||
{
|
||||
ForceInterpolationViewModel = new(finishDesignForce, startDesignForce, stepCount);
|
||||
ForceInterpolationViewModel = new(startTuple, endTuple, stepCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace StructureHelper.Windows.Forces
|
||||
public ValuePointsInterpolateViewModel(ValuePointsInterpolationInputData inputData)
|
||||
{
|
||||
this.inputData = inputData;
|
||||
ForceInterpolationViewModel = new(this.inputData.FinishDesignForce, this.inputData.StartDesignForce, this.inputData.StepCount);
|
||||
ForceInterpolationViewModel = new(this.inputData.StartForceTuple, this.inputData.FinishForceTuple, this.inputData.StepCount);
|
||||
PrimitiveLogic = new PointPrimitiveLogic(inputData.PrimitiveBases);
|
||||
ValueDelegatesLogic = new();
|
||||
}
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using StructureHelperCommon.Models.States;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.Forces
|
||||
{
|
||||
public class ValuePointsInterpolationInputData
|
||||
{
|
||||
public IDesignForceTuple FinishDesignForce { get; set; }
|
||||
public IDesignForceTuple StartDesignForce { get; set; }
|
||||
public IForceTuple FinishForceTuple { get; set; }
|
||||
public IForceTuple StartForceTuple { get; set; }
|
||||
public int StepCount { get; set; }
|
||||
public List<PrimitiveBase> PrimitiveBases { get; private set; }
|
||||
public LimitStates LimitState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public IStateCalcTermPair StateCalcTermPair { get; set; }
|
||||
|
||||
public ValuePointsInterpolationInputData()
|
||||
{
|
||||
|
||||
@@ -5,13 +5,8 @@ using StructureHelper.Services.Reports;
|
||||
using StructureHelper.Services.Reports.CalculationReports;
|
||||
using StructureHelper.Services.ResultViewers;
|
||||
using StructureHelperLogics.Models.Calculations.CalculationsResults;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.Calculations.CalculationResult
|
||||
{
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
{
|
||||
public class InterpolateTuplesResult
|
||||
{
|
||||
public IDesignForceTuple StartTuple { get; set; }
|
||||
public IDesignForceTuple FinishTuple { get; set; }
|
||||
public IForceTuple StartTuple { get; set; }
|
||||
public IForceTuple FinishTuple { get; set; }
|
||||
public int StepCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,14 +50,27 @@ namespace StructureHelperCommon.Services.Forces
|
||||
CopyProperties(forceTuple, result, factor);
|
||||
return result;
|
||||
}
|
||||
public static IForceTuple InterpolateTuples(IForceTuple endTuple, IForceTuple startTuple = null, double coefficient = 0.5d)
|
||||
public static IForceTuple InterpolateTuples(IForceTuple startTuple, IForceTuple endTuple, double coefficient = 0.5d)
|
||||
{
|
||||
if (startTuple is null) startTuple = GetNewTupleSameType(endTuple);
|
||||
else { CheckTuples(startTuple, endTuple); }
|
||||
var deltaTuple = SumTuples(endTuple, startTuple, -1d);
|
||||
return SumTuples(startTuple, deltaTuple, coefficient);
|
||||
}
|
||||
public static List<IDesignForceTuple> InterpolateDesignTuple(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce = null, int stepCount = 10)
|
||||
|
||||
public static List<IForceTuple> InterpolateTuples(IForceTuple startTuple, IForceTuple endTuple, int stepCount)
|
||||
{
|
||||
var tuples = new List<IForceTuple>();
|
||||
double step = 1d / stepCount;
|
||||
for (int i = 0; i <= stepCount; i++)
|
||||
{
|
||||
var interpolatedTuple = InterpolateTuples(startTuple, endTuple, i * step);
|
||||
tuples.Add(interpolatedTuple);
|
||||
}
|
||||
return tuples;
|
||||
}
|
||||
|
||||
public static List<IDesignForceTuple> InterpolateDesignTuple(IDesignForceTuple startDesignForce, IDesignForceTuple finishDesignForce, int stepCount = 10)
|
||||
{
|
||||
if (startDesignForce.LimitState != finishDesignForce.LimitState) throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid);
|
||||
if (startDesignForce.CalcTerm != finishDesignForce.CalcTerm) throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid);
|
||||
@@ -65,8 +78,12 @@ namespace StructureHelperCommon.Services.Forces
|
||||
double step = 1d / stepCount;
|
||||
for (int i = 0; i <= stepCount; i++)
|
||||
{
|
||||
var currentTuple = InterpolateTuples(finishDesignForce.ForceTuple, startDesignForce.ForceTuple, i * step) as ForceTuple;
|
||||
var currentDesignTuple = new DesignForceTuple() { LimitState = finishDesignForce.LimitState, CalcTerm = finishDesignForce.CalcTerm, ForceTuple = currentTuple };
|
||||
var currentTuple = InterpolateTuples(startDesignForce.ForceTuple, finishDesignForce.ForceTuple, i * step);
|
||||
var currentDesignTuple = new DesignForceTuple()
|
||||
{
|
||||
LimitState = finishDesignForce.LimitState,
|
||||
CalcTerm = finishDesignForce.CalcTerm,
|
||||
ForceTuple = currentTuple };
|
||||
tuples.Add(currentDesignTuple);
|
||||
}
|
||||
return tuples;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using StructureHelperCommon.Models.States;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ExtendedForceTupleCalculatorResult : IExtendedForceTupleCalculatorResult
|
||||
{
|
||||
public IStateCalcTermPair StateCalcTermPair { get; set; } = new StateCalcTermPair();
|
||||
public IForceTupleCalculatorResult ForcesTupleResult { get; set; }
|
||||
public bool IsValid { get; set; } = true;
|
||||
public string? Description { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using StructureHelperCommon.Models.States;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ExtendedForceTupleResult : IExtendedForceTupleResult
|
||||
{
|
||||
public IStateCalcTermPair StateCalcTermPair { get; set; } = new StateCalcTermPair();
|
||||
public IForcesTupleResult ForcesTupleResut { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
checkInputDataLogic.TraceLogger = TraceLogger;
|
||||
if (checkInputDataLogic.Check() != true)
|
||||
{
|
||||
Result = new ForcesResults()
|
||||
Result = new ForceCalculatorResult()
|
||||
{
|
||||
IsValid = false,
|
||||
Description = checkInputDataLogic.CheckResult
|
||||
@@ -72,11 +72,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
Result = forceCalculatorLogic.GetForcesResults();
|
||||
}
|
||||
|
||||
private void GetResult()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var newCalculator = new ForceCalculator();
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
/// <inheritdoc/>
|
||||
public class ForceCalculatorLogic : IForceCalculatorLogic
|
||||
{
|
||||
private ForcesResults result;
|
||||
private ForceCalculatorResult result;
|
||||
private IProcessorLogic<IForceTuple> eccentricityLogic;
|
||||
private ForceTupleBucklingLogic bucklingLogic;
|
||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||
@@ -28,7 +28,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
|
||||
|
||||
public ForcesResults GetForcesResults()
|
||||
public ForceCalculatorResult GetForcesResults()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
TraceInputData();
|
||||
@@ -67,7 +67,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
private void CalculateResult()
|
||||
{
|
||||
result = new ForcesResults()
|
||||
result = new ForceCalculatorResult()
|
||||
{
|
||||
IsValid = true
|
||||
};
|
||||
@@ -80,30 +80,30 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
if (InputData.LimitStatesList.Contains(limitState) & InputData.CalcTermsList.Contains(calcTerm))
|
||||
{
|
||||
|
||||
IForcesTupleResult tupleResult;
|
||||
ExtendedForceTupleCalculatorResult extendedResult = new();
|
||||
extendedResult.StateCalcTermPair.LimitState = limitState;
|
||||
extendedResult.StateCalcTermPair.CalcTerm = calcTerm;
|
||||
try
|
||||
{
|
||||
tupleResult = ProcessNdmResult(combination, tuple);
|
||||
IForceTupleCalculatorResult tupleResult = ProcessNdmResult(combination, tuple);
|
||||
extendedResult.IsValid = tupleResult.IsValid;
|
||||
extendedResult.ForcesTupleResult = tupleResult;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tupleResult = new ForcesTupleResult()
|
||||
{
|
||||
IsValid = false,
|
||||
Description = string.Empty + ex,
|
||||
DesignForceTuple = tuple
|
||||
};
|
||||
extendedResult.IsValid = false;
|
||||
extendedResult.Description += ex.Message;
|
||||
}
|
||||
result.ForcesResultList.Add(tupleResult);
|
||||
result.ForcesResultList.Add(extendedResult);
|
||||
ActionToOutputResults?.Invoke(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IForcesTupleResult ProcessNdmResult(IForceCombinationList combination, IDesignForceTuple tuple)
|
||||
private IForceTupleCalculatorResult ProcessNdmResult(IForceCombinationList combination, IDesignForceTuple tuple)
|
||||
{
|
||||
IForcesTupleResult tupleResult;
|
||||
IForceTupleCalculatorResult tupleResult;
|
||||
LimitStates limitState = tuple.LimitState;
|
||||
CalcTerms calcTerm = tuple.CalcTerm;
|
||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
||||
@@ -130,7 +130,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
if (newTuple.Nz >= 0d)
|
||||
{
|
||||
TraceLogger?.AddMessage(string.Format("Second order effect is not considered as Nz={0} >= 0", newTuple.Nz));
|
||||
tupleResult = GetForceResult(limitState, calcTerm, ndms, newTuple);
|
||||
tupleResult = GetForceResult(ndms, newTuple);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -144,14 +144,14 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
string message = string.Format("Second order effect is not considered, despite force Nz={0}", newTuple.Nz);
|
||||
TraceLogger?.AddMessage(message, TraceLogStatuses.Warning);
|
||||
}
|
||||
tupleResult = GetForceResult(limitState, calcTerm, ndms, newTuple);
|
||||
tupleResult = GetForceResult(ndms, newTuple);
|
||||
}
|
||||
return tupleResult;
|
||||
}
|
||||
|
||||
private IForcesTupleResult ProcessCompressedMember(IForceCombinationList combination, IDesignForceTuple tuple, List<INdm> ndms, IForceTuple newTuple)
|
||||
private IForceTupleCalculatorResult ProcessCompressedMember(IForceCombinationList combination, IDesignForceTuple tuple, List<INdm> ndms, IForceTuple newTuple)
|
||||
{
|
||||
IForcesTupleResult tupleResult;
|
||||
IForceTupleCalculatorResult tupleResult;
|
||||
LimitStates limitState = tuple.LimitState;
|
||||
CalcTerms calcTerm = tuple.CalcTerm;
|
||||
|
||||
@@ -183,27 +183,24 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ForcesTupleResult()
|
||||
return new ForceTupleCalculatorResult()
|
||||
{
|
||||
IsValid = false,
|
||||
DesignForceTuple = tuple,
|
||||
ForceTuple = tuple.ForceTuple,
|
||||
Description = buckResult.Description,
|
||||
};
|
||||
}
|
||||
|
||||
string message = string.Intern("Result of second order was obtained successfully, new force combination was obtained");
|
||||
TraceLogger?.AddMessage(message);
|
||||
tupleResult = GetForceResult(limitState, calcTerm, ndms, newTuple);
|
||||
tupleResult = GetForceResult(ndms, newTuple);
|
||||
return tupleResult;
|
||||
}
|
||||
|
||||
private IForcesTupleResult GetForceResult(LimitStates limitState, CalcTerms calcTerm, List<INdm> ndms, IForceTuple newTuple)
|
||||
private IForceTupleCalculatorResult GetForceResult(List<INdm> ndms, IForceTuple newTuple)
|
||||
{
|
||||
TraceLogger?.AddMessage("Calculation of cross-section is started");
|
||||
var tupleResult = GetPrimitiveStrainMatrix(ndms, newTuple, InputData.Accuracy);
|
||||
tupleResult.DesignForceTuple.LimitState = limitState;
|
||||
tupleResult.DesignForceTuple.CalcTerm = calcTerm;
|
||||
tupleResult.DesignForceTuple.ForceTuple = newTuple;
|
||||
return tupleResult;
|
||||
}
|
||||
|
||||
@@ -217,7 +214,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
}
|
||||
}
|
||||
|
||||
private IForcesTupleResult GetPrimitiveStrainMatrix(IEnumerable<INdm> ndmCollection, IForceTuple tuple, IAccuracy accuracy)
|
||||
private IForceTupleCalculatorResult GetPrimitiveStrainMatrix(IEnumerable<INdm> ndmCollection, IForceTuple tuple, IAccuracy accuracy)
|
||||
{
|
||||
var inputData = new ForceTupleInputData()
|
||||
{
|
||||
@@ -233,7 +230,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
calculator.TraceLogger = TraceLogger.GetSimilarTraceLogger();
|
||||
}
|
||||
calculator.Run();
|
||||
return calculator.Result as IForcesTupleResult;
|
||||
return calculator.Result as IForceTupleCalculatorResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ForceCalculatorResult : IForceCalculatorResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string Description { get; set; }
|
||||
public List<IExtendedForceTupleCalculatorResult> ForcesResultList { get; } = [];
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
/// <inheritdoc/>
|
||||
public class ForceTupleCalculator : IForceTupleCalculator
|
||||
{
|
||||
IForcesTupleResult result;
|
||||
IForceTupleCalculatorResult result;
|
||||
private ICheckInputDataLogic<IForceTupleInputData> checkInputDataLogic;
|
||||
private IForceTupleCalcLogic calcLogic;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
private void PrepareNewResult()
|
||||
{
|
||||
result = new ForcesTupleResult()
|
||||
result = new ForceTupleCalculatorResult()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
|
||||
@@ -9,10 +9,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ForcesTupleResult : IForcesTupleResult
|
||||
public class ForceTupleCalculatorResult : IForceTupleCalculatorResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public IDesignForceTuple DesignForceTuple { get; set; }
|
||||
public IForceTuple ForceTuple { get; set; } = new ForceTuple(Guid.NewGuid());
|
||||
/// <summary>
|
||||
/// Text of result of calculations
|
||||
/// </summary>
|
||||
@@ -23,10 +23,5 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public ILoaderResults LoaderResults { get; set; }
|
||||
|
||||
public IForceTupleInputData InputData { get; set; }
|
||||
|
||||
public ForcesTupleResult()
|
||||
{
|
||||
DesignForceTuple = new DesignForceTuple();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ForcesResults : IForcesResults
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public List<IForcesTupleResult> ForcesResultList { get; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public ForcesResults()
|
||||
{
|
||||
ForcesResultList = new List<IForcesTupleResult>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.States;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IExtendedForceTupleCalculatorResult : IResult
|
||||
{
|
||||
IStateCalcTermPair StateCalcTermPair { get; set; }
|
||||
IForceTupleCalculatorResult ForcesTupleResult { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using StructureHelperCommon.Models.States;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IExtendedForceTupleResult
|
||||
{
|
||||
IStateCalcTermPair StateCalcTermPair { get; set; }
|
||||
IForcesTupleResult ForcesTupleResut { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public interface IForceCalculatorLogic : ILogic, IHasActionByResult
|
||||
{
|
||||
IForceCalculatorInputData InputData { get; set; }
|
||||
ForcesResults GetForcesResults();
|
||||
ForceCalculatorResult GetForcesResults();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using System.Collections.Generic;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IForcesResults : IResult
|
||||
public interface IForceCalculatorResult : IResult
|
||||
{
|
||||
string Description { get; set; }
|
||||
List<IForcesTupleResult> ForcesResultList { get; }
|
||||
bool IsValid { get; set; }
|
||||
string Description { get; set; }
|
||||
List<IExtendedForceTupleCalculatorResult> ForcesResultList { get; }
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,10 @@ using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public interface IForcesTupleResult : IResult
|
||||
public interface IForceTupleCalculatorResult : IResult
|
||||
{
|
||||
IForceTupleInputData InputData { get; set; }
|
||||
IDesignForceTuple DesignForceTuple { get; set; }
|
||||
IForceTuple ForceTuple { get; set; }
|
||||
ILoaderResults LoaderResults { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public class ForceTupleCalcLogic : IForceTupleCalcLogic
|
||||
{
|
||||
private IForcesTupleResult result;
|
||||
private IForceTupleCalculatorResult result;
|
||||
private ForceTupleTraceResultLogic forceTupleTraceResultLogic;
|
||||
private LoaderOptions loaderData;
|
||||
private Calculator calculator;
|
||||
@@ -27,7 +27,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
public IForceTupleInputData InputData { get; set; }
|
||||
|
||||
public IForcesTupleResult Result => result;
|
||||
public IForceTupleCalculatorResult Result => result;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public Action<IResult> ActionToOutputResults { get; set; }
|
||||
@@ -40,7 +40,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
private void PrepareNewResult()
|
||||
{
|
||||
result = new ForcesTupleResult()
|
||||
result = new ForceTupleCalculatorResult()
|
||||
{
|
||||
IsValid = true,
|
||||
Description = string.Empty,
|
||||
@@ -117,6 +117,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
private void ProcessCorrectLoaderResult()
|
||||
{
|
||||
result.IsValid = true;
|
||||
result.ForceTuple = InputData.ForceTuple;
|
||||
result.Description = LoggerStrings.CalculationHasDone;
|
||||
result.LoaderResults = calcResult;
|
||||
forceTupleTraceResultLogic = new ForceTupleTraceResultLogic(InputData.NdmCollection)
|
||||
|
||||
@@ -24,11 +24,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
|
||||
public void TraceResult(IResult result)
|
||||
{
|
||||
if (result is not IForcesTupleResult)
|
||||
if (result is not IForceTupleCalculatorResult)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(result));
|
||||
}
|
||||
calcResult = ((IForcesTupleResult)result).LoaderResults;
|
||||
calcResult = ((IForceTupleCalculatorResult)result).LoaderResults;
|
||||
TraceLogger?.AddMessage($"Analysis of internal forces is done succsesfully");
|
||||
TraceLogger?.AddMessage($"Current accuracy {calcResult.AccuracyRate} has achieved in {calcResult.IterationCounter} iteration", TraceLogStatuses.Debug);
|
||||
var strainMatrix = calcResult.ForceStrainPair.StrainMatrix;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public interface IForceTupleCalcLogic: ILogic, IHasActionByResult
|
||||
{
|
||||
IForceTupleInputData InputData { get; set; }
|
||||
IForcesTupleResult Result { get; }
|
||||
IForceTupleCalculatorResult Result { get; }
|
||||
void Calculate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public interface IProcessTupleLogic : ILogic
|
||||
{
|
||||
IForceTupleInputData InputData { get; set; }
|
||||
IForcesTupleResult ProcessNdmResult();
|
||||
IForceTupleCalculatorResult ProcessNdmResult();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.States;
|
||||
using StructureHelperLogics.Services.NdmCalculations;
|
||||
using System.ComponentModel;
|
||||
|
||||
@@ -9,12 +10,13 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
|
||||
{
|
||||
public class InterpolationProgressLogic : ILongProcessLogic
|
||||
{
|
||||
private ForceCalculator forceCalculator;
|
||||
private IForceCalculator forceCalculator;
|
||||
private IStateCalcTermPair stateCalcTermPair;
|
||||
private InterpolateTuplesResult interpolateTuplesResult;
|
||||
|
||||
public Action<int> SetProgress { get; set; }
|
||||
|
||||
public ForceCalculator InterpolateCalculator { get; private set; }
|
||||
public IForceCalculator InterpolateCalculator { get; private set; }
|
||||
public bool Result { get; set; }
|
||||
|
||||
public int StepCount => interpolateTuplesResult.StepCount + 1;
|
||||
@@ -23,7 +25,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
|
||||
|
||||
public void WorkerDoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
InterpolateCalculator = InterpolateService.InterpolateForceCalculator(forceCalculator, interpolateTuplesResult);
|
||||
InterpolateCalculator = InterpolateService.InterpolateForceCalculator(forceCalculator, stateCalcTermPair, interpolateTuplesResult);
|
||||
InterpolateCalculator.ActionToOutputResults = ShowProgressResult;
|
||||
InterpolateCalculator.Run();
|
||||
}
|
||||
@@ -38,17 +40,18 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
|
||||
//nothing to do
|
||||
}
|
||||
|
||||
public InterpolationProgressLogic(ForceCalculator forceCalculator, InterpolateTuplesResult interpolateTuplesResult)
|
||||
public InterpolationProgressLogic(IForceCalculator forceCalculator, IStateCalcTermPair stateCalcTermPair, InterpolateTuplesResult interpolateTuplesResult)
|
||||
{
|
||||
this.forceCalculator = forceCalculator;
|
||||
this.stateCalcTermPair = stateCalcTermPair;
|
||||
this.interpolateTuplesResult = interpolateTuplesResult;
|
||||
}
|
||||
|
||||
private void ShowProgressResult(IResult result)
|
||||
{
|
||||
if (result is ForcesResults)
|
||||
if (result is ForceCalculatorResult)
|
||||
{
|
||||
var forceResult = result as ForcesResults;
|
||||
var forceResult = result as ForceCalculatorResult;
|
||||
SetProgress?.Invoke(forceResult.ForcesResultList.Count());
|
||||
Result = forceResult.IsValid;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
IForceTupleInputData IProcessTupleLogic.InputData { get; set; }
|
||||
|
||||
public IForcesTupleResult ProcessNdmResult()
|
||||
public IForceTupleCalculatorResult ProcessNdmResult()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
/// <summary>
|
||||
/// Provides trace logger inforvation for collection of force tuple results
|
||||
/// </summary>
|
||||
public class TraceForcesResultLogic : ITraceCollectionLogic<IForcesTupleResult>
|
||||
public class TraceForcesResultLogic : ITraceCollectionLogic<IExtendedForceTupleCalculatorResult>
|
||||
{
|
||||
const int rowSize = 4;
|
||||
private List<ITraceLoggerEntry> traceLoggerEntries;
|
||||
public IEnumerable<IForcesTupleResult>? Collection { get; set; }
|
||||
public IEnumerable<IExtendedForceTupleCalculatorResult>? Collection { get; set; }
|
||||
public int Priority { get; set; } = LoggerService.GetPriorityByStatus(TraceLogStatuses.Info);
|
||||
|
||||
public List<ITraceLoggerEntry> GetTraceEntries()
|
||||
@@ -51,7 +51,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
traceLoggerEntries.Add(table);
|
||||
}
|
||||
|
||||
private IEnumerable<IShTableRow<ITraceLoggerEntry>> ProcessForceTupleResult(IForcesTupleResult item)
|
||||
private IEnumerable<IShTableRow<ITraceLoggerEntry>> ProcessForceTupleResult(IExtendedForceTupleCalculatorResult item)
|
||||
{
|
||||
List<IShTableRow<ITraceLoggerEntry>> rows = new();
|
||||
int priority = Priority;
|
||||
@@ -63,19 +63,19 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
ndmRow = new(rowSize);
|
||||
ndmRow.Elements[0].Value = new StringLogEntry()
|
||||
{
|
||||
Message = TraceStringService.GetLimitStateAndCalctTerm(item.DesignForceTuple),
|
||||
Message = TraceStringService.GetLimitStateAndCalctTerm(item.StateCalcTermPair),
|
||||
Priority = priority
|
||||
};
|
||||
ndmRow.Elements[1].Value = new StringLogEntry()
|
||||
{
|
||||
Message = TraceStringService.GetForces(item.DesignForceTuple.ForceTuple),
|
||||
Message = TraceStringService.GetForces(item.ForcesTupleResult.ForceTuple),
|
||||
Priority = priority
|
||||
};
|
||||
if (item.LoaderResults is not null)
|
||||
if (item.ForcesTupleResult.LoaderResults is not null)
|
||||
{
|
||||
ndmRow.Elements[2].Value = new StringLogEntry()
|
||||
{
|
||||
Message = TraceStringService.GetCuvatures(item.LoaderResults.ForceStrainPair.StrainMatrix),
|
||||
Message = TraceStringService.GetCuvatures(item.ForcesTupleResult.LoaderResults.ForceStrainPair.StrainMatrix),
|
||||
Priority = priority
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.States;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -10,11 +12,21 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
{
|
||||
public static class TraceStringService
|
||||
{
|
||||
public static string GetLimitStateAndCalctTerm(LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
string s = "Limit state: " + limitState.ToString();
|
||||
s += ", Calculation term: " + calcTerm.ToString();
|
||||
return s;
|
||||
}
|
||||
|
||||
public static string GetLimitStateAndCalctTerm(IDesignForceTuple designForceTuple)
|
||||
{
|
||||
string s = "Limit state: " + designForceTuple.LimitState.ToString();
|
||||
s += ", Calculation term: " + designForceTuple.CalcTerm;
|
||||
return s;
|
||||
return GetLimitStateAndCalctTerm(designForceTuple.LimitState, designForceTuple.CalcTerm);
|
||||
}
|
||||
|
||||
public static string GetLimitStateAndCalctTerm(IStateCalcTermPair stateCalcTermPair)
|
||||
{
|
||||
return GetLimitStateAndCalctTerm(stateCalcTermPair.LimitState, stateCalcTermPair.CalcTerm);
|
||||
}
|
||||
|
||||
public static string GetForces(IForceTuple forceTuple)
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||
public class ExportForcesResultToCSVLogic : ExportToCSVLogicBase
|
||||
{
|
||||
private const string errorString = "-error-";
|
||||
IForcesResults results;
|
||||
IForceCalculatorResult results;
|
||||
|
||||
public ExportForcesResultToCSVLogic(IForcesResults results)
|
||||
public ExportForcesResultToCSVLogic(IForceCalculatorResult results)
|
||||
{
|
||||
this.results = results;
|
||||
}
|
||||
@@ -34,11 +34,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||
{
|
||||
//if (item.IsValid == true)
|
||||
{
|
||||
var tuple = item.DesignForceTuple.ForceTuple;
|
||||
var tuple = item.ForcesTupleResult.ForceTuple;
|
||||
LoaderCalculator.Data.Matrix.IStrainMatrix strainMatrix = null;
|
||||
try
|
||||
{
|
||||
strainMatrix = item.LoaderResults.StrainMatrix;
|
||||
strainMatrix = item.ForcesTupleResult.LoaderResults.StrainMatrix;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -46,8 +46,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses
|
||||
}
|
||||
string[] newLine =
|
||||
{
|
||||
item.DesignForceTuple.LimitState.ToString() ?? errorString,
|
||||
item.DesignForceTuple.CalcTerm.ToString() ?? errorString,
|
||||
item.StateCalcTermPair.LimitState.ToString() ?? errorString,
|
||||
item.StateCalcTermPair.CalcTerm.ToString() ?? errorString,
|
||||
tuple.Mx.ToString() ?? errorString,
|
||||
tuple.My.ToString() ?? errorString,
|
||||
tuple.Nz.ToString() ?? errorString,
|
||||
|
||||
@@ -8,6 +8,6 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||
{
|
||||
IValueDiagramCalculatorInputData? InputData { get; set; }
|
||||
List<IPoint2D> Points { get; set; }
|
||||
List<IForcesTupleResult> ForceTupleResults { get; set; }
|
||||
List<IForceTupleCalculatorResult> ForceTupleResults { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ValueDiagrams
|
||||
|
||||
public List<IPoint2D> Points { get; set; } = [];
|
||||
|
||||
public List<IForcesTupleResult> ForceTupleResults { get; set; } = [];
|
||||
public List<IForceTupleCalculatorResult> ForceTupleResults { get; set; } = [];
|
||||
|
||||
public bool IsValid { get; set; } = true;
|
||||
public string? Description { get; set; } = string.Empty;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
private List<INdm> ndmCollection;
|
||||
private List<INdm> concreteNdms;
|
||||
private List<INdm> otherNdms;
|
||||
IForcesTupleResult forcesResults;
|
||||
IForceTupleCalculatorResult forcesResults;
|
||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
||||
|
||||
public IResult Result { get; private set; }
|
||||
@@ -242,7 +242,7 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
}
|
||||
IForceTupleCalculator calculator = GetForceCalculator();
|
||||
calculator.Run();
|
||||
forcesResults = calculator.Result as IForcesTupleResult;
|
||||
forcesResults = calculator.Result as IForceTupleCalculatorResult;
|
||||
if (forcesResults.IsValid != true)
|
||||
{
|
||||
result += "Bearind capacity of cross-section is not enough for initial forces\n";
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
}
|
||||
softeningLogic.ForceRatio = factorOfCrackAppearance;
|
||||
var psiS = softeningLogic.GetSofteningFactor();
|
||||
var tupleOfCrackApeearence = ForceTupleService.InterpolateTuples(InputData.EndTuple, InputData.StartTuple, factorOfCrackAppearance);
|
||||
var tupleOfCrackApeearence = ForceTupleService.InterpolateTuples(InputData.StartTuple, InputData.EndTuple, factorOfCrackAppearance);
|
||||
TraceLogger?.AddMessage($"Crack is appeared in force combination");
|
||||
TraceLogger?.AddEntry(new TraceTablesFactory().GetByForceTuple(tupleOfCrackApeearence));
|
||||
var reducedStrainTuple = GetReducedStrainTuple(factorOfCrackAppearance, psiS);
|
||||
@@ -158,7 +158,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
private StrainTuple GetReducedStrainTuple(double factorOfCrackAppearance, double softeningFactor)
|
||||
{
|
||||
const double notCrackedForceFactor = 0.99d;
|
||||
var notCrackedForceTuple = ForceTupleService.InterpolateTuples(InputData.EndTuple, InputData.StartTuple, factorOfCrackAppearance * notCrackedForceFactor) as ForceTuple;
|
||||
var notCrackedForceTuple = ForceTupleService.InterpolateTuples(InputData.StartTuple, InputData.EndTuple, factorOfCrackAppearance * notCrackedForceFactor) as ForceTuple;
|
||||
var crackAppearanceStrainTuple = GetStrainTuple(notCrackedForceTuple);
|
||||
var actualStrainTuple = GetStrainTuple(InputData.EndTuple);
|
||||
crackStrainLogic.BeforeCrackingTuple = crackAppearanceStrainTuple;
|
||||
@@ -197,7 +197,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
inputData.ForceTuple = forceTuple;
|
||||
forceTupleCalculator.InputData = inputData;
|
||||
forceTupleCalculator.Run();
|
||||
var result = forceTupleCalculator.Result as IForcesTupleResult;
|
||||
var result = forceTupleCalculator.Result as IForceTupleCalculatorResult;
|
||||
var loaderStrainMatrix = result.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||
StrainTuple strainTuple = TupleConverter.ConvertToStrainTuple(loaderStrainMatrix);
|
||||
return strainTuple;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
|
||||
public StrainTuple GetCrackedStrainTuple()
|
||||
{
|
||||
var strainTuple = ForceTupleService.InterpolateTuples(AfterCrackingTuple, BeforeCrackingTuple, SofteningFactor) as StrainTuple;
|
||||
var strainTuple = ForceTupleService.InterpolateTuples(BeforeCrackingTuple, AfterCrackingTuple, SofteningFactor) as StrainTuple;
|
||||
return strainTuple;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
public bool IsSectionCracked(double factor)
|
||||
{
|
||||
IsSectionCrackedByForceLogic.TraceLogger ??= TraceLogger?.GetSimilarTraceLogger(50);
|
||||
var actualTuple = ForceTupleService.InterpolateTuples(EndTuple, StartTuple, factor);
|
||||
var actualTuple = ForceTupleService.InterpolateTuples(StartTuple, EndTuple, factor);
|
||||
IsSectionCrackedByForceLogic.Tuple = actualTuple;
|
||||
return IsSectionCrackedByForceLogic.IsSectionCracked();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
calculator.TraceLogger = TraceLogger.GetSimilarTraceLogger(50);
|
||||
}
|
||||
calculator.Run();
|
||||
var calcResult = calculator.Result as ForcesTupleResult;
|
||||
var calcResult = calculator.Result as ForceTupleCalculatorResult;
|
||||
if (calcResult.IsValid == false)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Result of calculation is not valid {calcResult.Description}", TraceLogStatuses.Error);
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
//TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
calculator.Run();
|
||||
var forceResult = calculator.Result as IForcesTupleResult;
|
||||
var forceResult = calculator.Result as IForceTupleCalculatorResult;
|
||||
if (forceResult.IsValid == false)
|
||||
{
|
||||
//TraceLogger?.AddMessage(LoggerStrings.CalculationError + $": {forceResult.Description}", TraceLogStatuses.Error);
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
//TraceLogger = TraceLogger?.GetSimilarTraceLogger(50)
|
||||
};
|
||||
calculator.Run();
|
||||
var forceResult = calculator.Result as IForcesTupleResult;
|
||||
var forceResult = calculator.Result as IForceTupleCalculatorResult;
|
||||
if (forceResult.IsValid == false)
|
||||
{
|
||||
result.IsValid = false;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Sections;
|
||||
using StructureHelperCommon.Models.States;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
|
||||
@@ -8,19 +9,19 @@ namespace StructureHelperLogics.Services.NdmCalculations
|
||||
public static class InterpolateService
|
||||
{
|
||||
static readonly CompressedMemberUpdateStrategy compressedMemberUpdateStrategy = new();
|
||||
public static ForceCalculator InterpolateForceCalculator(ForceCalculator source, InterpolateTuplesResult interpolateTuplesResult)
|
||||
public static ForceCalculator InterpolateForceCalculator(IForceCalculator source, IStateCalcTermPair stateCalcTermPair, InterpolateTuplesResult interpolateTuplesResult)
|
||||
{
|
||||
ForceCalculator calculator = new ForceCalculator();
|
||||
calculator.InputData.LimitStatesList.Clear();
|
||||
calculator.InputData.LimitStatesList.Add(interpolateTuplesResult.StartTuple.LimitState);
|
||||
calculator.InputData.LimitStatesList.Add(stateCalcTermPair.LimitState);
|
||||
calculator.InputData.CalcTermsList.Clear();
|
||||
calculator.InputData.CalcTermsList.Add(interpolateTuplesResult.FinishTuple.CalcTerm);
|
||||
calculator.InputData.CalcTermsList.Add(stateCalcTermPair.CalcTerm);
|
||||
compressedMemberUpdateStrategy.Update(calculator.InputData.CompressedMember, source.InputData.CompressedMember);
|
||||
calculator.InputData.Accuracy = source.InputData.Accuracy;
|
||||
calculator.InputData.Primitives.AddRange(source.InputData.Primitives);
|
||||
calculator.InputData.ForceActions.Clear();
|
||||
calculator.InputData.CheckStrainLimit = source.InputData.CheckStrainLimit;
|
||||
var forceTuples = ForceTupleService.InterpolateDesignTuple(interpolateTuplesResult.FinishTuple, interpolateTuplesResult.StartTuple, interpolateTuplesResult.StepCount);
|
||||
var forceTuples = ForceTupleService.InterpolateTuples(interpolateTuplesResult.StartTuple, interpolateTuplesResult.FinishTuple, interpolateTuplesResult.StepCount);
|
||||
foreach (var forceTuple in forceTuples)
|
||||
{
|
||||
var combination = new ForceCombinationList()
|
||||
@@ -29,7 +30,13 @@ namespace StructureHelperLogics.Services.NdmCalculations
|
||||
SetInGravityCenter = false
|
||||
};
|
||||
combination.DesignForces.Clear();
|
||||
combination.DesignForces.Add(forceTuple);
|
||||
DesignForceTuple designForceTuple = new()
|
||||
{
|
||||
LimitState = stateCalcTermPair.LimitState,
|
||||
CalcTerm = stateCalcTermPair.CalcTerm,
|
||||
ForceTuple = forceTuple,
|
||||
};
|
||||
combination.DesignForces.Add(designForceTuple);
|
||||
combination.ForcePoint.X = 0;
|
||||
combination.ForcePoint.Y = 0;
|
||||
calculator.InputData.ForceActions.Add(combination);
|
||||
|
||||
@@ -27,11 +27,11 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
|
||||
calculator.InputData.CompressedMember.Buckling = isBuckling;
|
||||
//Act
|
||||
calculator.Run();
|
||||
var result = calculator.Result as IForcesResults;
|
||||
var result = calculator.Result as IForceCalculatorResult;
|
||||
//Assert
|
||||
Assert.That(result, Is.Not.Null);
|
||||
Assert.That(result.IsValid, Is.True);
|
||||
var strainMatrix = result.ForcesResultList[0].LoaderResults.StrainMatrix;
|
||||
var strainMatrix = result.ForcesResultList[0].ForcesTupleResult.LoaderResults.StrainMatrix;
|
||||
var kx = strainMatrix.Kx;
|
||||
var ky = strainMatrix.Ky;
|
||||
var epsz = strainMatrix.EpsZ;
|
||||
@@ -52,7 +52,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
|
||||
calculator.InputData.CompressedMember.Buckling = isBuckling;
|
||||
//Act
|
||||
calculator.Run();
|
||||
var result = calculator.Result as IForcesResults;
|
||||
var result = calculator.Result as IForceCalculatorResult;
|
||||
//Assert
|
||||
Assert.That(result, Is.Not.Null);
|
||||
Assert.That(calcResult == result.IsValid, Is.True);
|
||||
@@ -69,8 +69,8 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
|
||||
calculator.InputData.CompressedMember.Buckling = false;
|
||||
calculator.Run();
|
||||
var ndmPrimitives = newSection.SectionRepository.Primitives;
|
||||
var result = calculator.Result as IForcesResults;
|
||||
var strainMatrix = result.ForcesResultList[0].LoaderResults.StrainMatrix;
|
||||
var result = calculator.Result as IForceCalculatorResult;
|
||||
var strainMatrix = result.ForcesResultList[0].ForcesTupleResult.LoaderResults.StrainMatrix;
|
||||
var source = TupleConverter.ConvertToStrainTuple(strainMatrix);
|
||||
//Act
|
||||
foreach (var item in ndmPrimitives)
|
||||
@@ -78,11 +78,11 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
|
||||
ForceTupleService.CopyProperties(source, item.NdmElement.AutoPrestrain);
|
||||
}
|
||||
calculator.Run();
|
||||
var result2 = calculator.Result as IForcesResults;
|
||||
var result2 = calculator.Result as IForceCalculatorResult;
|
||||
//Assert
|
||||
Assert.That(result2, Is.Not.Null);
|
||||
Assert.That(result2.IsValid, Is.True);
|
||||
var strainMatrix2 = result2.ForcesResultList[0].LoaderResults.StrainMatrix;
|
||||
var strainMatrix2 = result2.ForcesResultList[0].ForcesTupleResult.LoaderResults.StrainMatrix;
|
||||
var kx = strainMatrix2.Kx;
|
||||
var ky = strainMatrix2.Ky;
|
||||
var epsz = strainMatrix2.EpsZ;
|
||||
|
||||
Reference in New Issue
Block a user