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