Fix BeamShearCalculatorLogic

This commit is contained in:
Evgeny Redikultsev
2025-05-11 22:00:22 +05:00
parent 2269b2ea07
commit b38bad251d
26 changed files with 244 additions and 58 deletions

View File

@@ -11,7 +11,7 @@ namespace StructureHelperCommon.Models.Forces
{
readonly IUpdateStrategy<IForceFactoredList> updateStrategy = new ForceFactoredListUpdateStrategy();
private List<IForceCombinationList> result;
private IGetCombinationByFactoredTupleLogic getCombinationLogic = new GetCombinationByFactoredTupleLogic();
private IGetCombinationsByFactoredTupleLogic getCombinationLogic = new GetCombinationsByFactoredTupleLogic();
/// <inheritdoc/>
public Guid Id { get; }

View File

@@ -2,6 +2,7 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Calculators;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using System;
using System.Collections.Generic;
@@ -9,9 +10,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
//All rights reserved.
namespace StructureHelperCommon.Models.Forces.Logics
{
public class GetCombinationByFactoredTupleLogic : IGetCombinationByFactoredTupleLogic
public class GetCombinationsByFactoredTupleLogic : IGetCombinationsByFactoredTupleLogic
{
private ForceCombinationList? result;
private IForceTuple? fullSLSTuple;
@@ -20,7 +24,7 @@ namespace StructureHelperCommon.Models.Forces.Logics
public IForceTuple? SourceForceTuple { get; set; }
public IFactoredCombinationProperty? CombinationProperty { get; set; }
public IForceActionProperty? ForceActionProperty { get; set; }
public IForceActionProperty? ForceActionProperty { get; set; } = new ForceActionProperty() { ForcePoint = new Point2D(), SetInGravityCenter = false };
public IForceCombinationList GetCombinationList()
{
Check();

View File

@@ -5,6 +5,7 @@
namespace StructureHelperCommon.Models.Forces.Logics
{
/// <inheritdoc/>
public class GetFactorByFactoredCombinationProperty : IGetLoadFactor
{
private const double defaultSLSfactor = 1d;
@@ -13,7 +14,7 @@ namespace StructureHelperCommon.Models.Forces.Logics
public IFactoredCombinationProperty CombinationProperty { get; set; }
public LimitStates LimitState { get; set; }
public CalcTerms CalcTerm { get; set; }
/// <inheritdoc/>
public double GetFactor()
{
double stateFactor = CombinationProperty.LimitState is LimitStates.SLS ? defaultSLSfactor : (1d / CombinationProperty.ULSFactor);

View File

@@ -0,0 +1,42 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Calculators;
using StructureHelperCommon.Services.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces.Logics
{
public class GetForceTupleByFactoredTupleLogic : IGetForceTupleByFactoredTupleLogic
{
private IGetLoadFactor getFactorLogic;
public GetForceTupleByFactoredTupleLogic(IGetLoadFactor getFactorLogic)
{
this.getFactorLogic = getFactorLogic;
}
public GetForceTupleByFactoredTupleLogic()
{
}
public IFactoredForceTuple FactoredForceTuple { get; set; }
public LimitStates LimitState { get; set; }
public CalcTerms CalcTerm { get; set; }
public IForceTuple GetForceTuple()
{
getFactorLogic ??= new GetFactorByFactoredCombinationProperty()
{
CombinationProperty = FactoredForceTuple.CombinationProperty,
LimitState = LimitState,
CalcTerm = CalcTerm
};
double factor = getFactorLogic.GetFactor();
return ForceTupleService.MultiplyTupleByFactor(FactoredForceTuple.ForceTuple, factor);
}
}
}

View File

@@ -1,16 +1,18 @@
namespace StructureHelperCommon.Models.Forces.Logics
{
/// <summary>
/// Return combinations for source combination and properties
/// Returns combinations for source combination and properties
/// </summary>
public interface IGetCombinationByFactoredTupleLogic
{
/// <summary>
public interface IGetCombinationsByFactoredTupleLogic
{ /// <summary>
/// Source combination of forces
/// </summary>
IForceTuple? SourceForceTuple { get; set; }
/// <inheritdoc/>
/// <summary>
/// Properties of combination for source combination of force
/// </summary>
IFactoredCombinationProperty? CombinationProperty { get; set; }
/// <inheritdoc/>
IForceActionProperty? ForceActionProperty { get; set; }
/// <summary>

View File

@@ -0,0 +1,11 @@
using StructureHelperCommon.Infrastructures.Enums;
namespace StructureHelperCommon.Models.Forces.Logics
{
public interface IGetForceTupleByFactoredTupleLogic : IGetForceTupleLogic
{
IFactoredForceTuple FactoredForceTuple { get; set; }
LimitStates LimitState { get; set; }
CalcTerms CalcTerm { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using StructureHelperCommon.Infrastructures.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces.Logics
{
public interface IGetForceTupleLogic
{
/// <summary>
/// Calculates force tuple
/// </summary>
/// <returns></returns>
IForceTuple GetForceTuple();
}
}

View File

@@ -8,6 +8,10 @@ namespace StructureHelperCommon.Models.Forces
/// </summary>
public interface IGetLoadFactor
{
/// <summary>
/// Returns factor for load
/// </summary>
/// <returns>Factor for load</returns>
double GetFactor();
}
}