Add trace crack result
This commit is contained in:
@@ -5,6 +5,8 @@ using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -14,6 +16,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class CrackCalculator : ICrackCalculator
|
||||
{
|
||||
const LimitStates limitState = LimitStates.SLS;
|
||||
@@ -73,11 +76,11 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
PrepareNewResult();
|
||||
CheckInputData();
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
TraceInputData();
|
||||
try
|
||||
{
|
||||
ProcessCalculations();
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculationHasDone);
|
||||
TraceResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -87,6 +90,31 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
}
|
||||
}
|
||||
|
||||
private void TraceResult()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculationHasDone);
|
||||
ITraceEntityLogic traceLogic = new TraceCrackResultLogic()
|
||||
{
|
||||
Collection = result.TupleResults
|
||||
};
|
||||
traceLogic.AddEntriesToTraceLogger(TraceLogger);
|
||||
}
|
||||
|
||||
private void TraceInputData()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
ITraceEntityLogic traceLogic = new TracePrimitiveFactory()
|
||||
{
|
||||
Collection = InputData.Primitives
|
||||
};
|
||||
traceLogic.AddEntriesToTraceLogger(TraceLogger);
|
||||
traceLogic = new TraceMaterialsFactory()
|
||||
{
|
||||
Collection = InputData.Primitives.Select(x => x.NdmElement.HeadMaterial).Distinct()
|
||||
};
|
||||
traceLogic.AddEntriesToTraceLogger(TraceLogger);
|
||||
}
|
||||
|
||||
private void CheckInputData()
|
||||
{
|
||||
checkInputDataLogic.InputData = InputData;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public List<TupleCrackResult> TupleResults {get;set;}
|
||||
public List<ITupleCrackResult> TupleResults {get;set;}
|
||||
public CrackResult()
|
||||
{
|
||||
TupleResults = new();
|
||||
|
||||
@@ -2,8 +2,14 @@
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Calculates width of cracks for cross-section by collection of combination of forces
|
||||
/// </summary>
|
||||
public interface ICrackCalculator : ICalculator
|
||||
{
|
||||
/// <summary>
|
||||
/// Input data for crack calculations
|
||||
/// </summary>
|
||||
ICrackCalculatorInputData InputData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,19 @@ using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Input data for crack calculator
|
||||
/// </summary>
|
||||
public interface ICrackCalculatorInputData : IInputData, IHasPrimitives, IHasForceActions, ISaveable
|
||||
{
|
||||
List<IForceAction> ForceActions { get; }
|
||||
List<INdmPrimitive> Primitives { get; }
|
||||
/// <summary>
|
||||
/// Used difined data for crack width calculation
|
||||
/// </summary>
|
||||
IUserCrackInputData UserCrackInputData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Result of calculation of crack for specific result
|
||||
/// </summary>
|
||||
public interface IRebarCrackResult : IResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Specific rebar primitive
|
||||
/// </summary>
|
||||
IRebarNdmPrimitive? RebarPrimitive { get; set; }
|
||||
/// <summary>
|
||||
/// Result of calculation of crack for long term
|
||||
/// </summary>
|
||||
CrackWidthRebarTupleResult? LongTermResult { get; set; }
|
||||
/// <summary>
|
||||
/// Result of calculation of crack for short term
|
||||
/// </summary>
|
||||
CrackWidthRebarTupleResult? ShortTermResult { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Result of crack calculation for specific force tuple
|
||||
/// </summary>
|
||||
public interface ITupleCrackResult : IResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference to input data for calculation
|
||||
/// </summary>
|
||||
TupleCrackInputData? InputData { get; set; }
|
||||
/// <summary>
|
||||
/// True if cross-section has been cracked under specific force combination
|
||||
/// </summary>
|
||||
bool IsCracked { get; set; }
|
||||
/// <summary>
|
||||
/// Result of calculation of crack width for long term force combination
|
||||
/// </summary>
|
||||
CrackWidthRebarTupleResult? LongTermResult { get; set; }
|
||||
/// <summary>
|
||||
/// Collection of resuls for specific rebars
|
||||
/// </summary>
|
||||
List<IRebarCrackResult>? RebarResults { get; }
|
||||
/// <summary>
|
||||
/// Result of calculation of crack width for short term force combination
|
||||
/// </summary>
|
||||
CrackWidthRebarTupleResult? ShortTermResult { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,26 +8,18 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Result of calculation of crack for specific result
|
||||
/// </summary>
|
||||
public class RebarCrackResult : IResult
|
||||
/// <inheritdoc/>
|
||||
public class RebarCrackResult : IRebarCrackResult
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool IsValid { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// Specific rebar primitive
|
||||
/// </summary>
|
||||
public IRebarNdmPrimitive RebarPrimitive { get; set; }
|
||||
/// <summary>
|
||||
/// Result of calculation of crack for long term
|
||||
/// </summary>
|
||||
public CrackWidthRebarTupleResult LongTermResult { get; set; }
|
||||
/// <summary>
|
||||
/// Result of calculation of crack for short term
|
||||
/// </summary>
|
||||
public CrackWidthRebarTupleResult ShortTermResult { get; set; }
|
||||
public string? Description { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public IRebarNdmPrimitive? RebarPrimitive { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public CrackWidthRebarTupleResult? LongTermResult { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public CrackWidthRebarTupleResult? ShortTermResult { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,29 +6,27 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2024 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Result of crack calculation for specific force tuple
|
||||
/// </summary>
|
||||
public class TupleCrackResult : IResult
|
||||
/// <inheritdoc/>
|
||||
public class TupleCrackResult : ITupleCrackResult
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool IsValid { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public string Description { get; set; }
|
||||
public TupleCrackInputData InputData { get; set; }
|
||||
public string? Description { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public TupleCrackInputData? InputData { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public bool IsCracked { get; set; }
|
||||
public List<RebarCrackResult> RebarResults { get; private set; }
|
||||
public CrackWidthRebarTupleResult LongTermResult { get; set; }
|
||||
public CrackWidthRebarTupleResult ShortTermResult { get; set; }
|
||||
|
||||
public TupleCrackResult()
|
||||
{
|
||||
RebarResults = new ();
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public List<IRebarCrackResult>? RebarResults { get; private set; } = new();
|
||||
/// <inheritdoc/>
|
||||
public CrackWidthRebarTupleResult? LongTermResult { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public CrackWidthRebarTupleResult? ShortTermResult { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user