Add stirrup update strategy
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class BeamShearAction : IBeamShearAction
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearAction> updateStrategy;
|
||||
/// <inheritdoc/>
|
||||
public Guid Id { get; }
|
||||
/// <inheritdoc/>
|
||||
public string Name { get; set; }
|
||||
public IBeamShearAxisAction XAxisShearAction { get; } = new BeamShearAxisAction(Guid.NewGuid());
|
||||
|
||||
public IBeamShearAxisAction YAxisShearAction { get; } = new BeamShearAxisAction(Guid.NewGuid());
|
||||
/// <inheritdoc/>
|
||||
public IFactoredForceTuple ExternalForce { get; } = new FactoredForceTuple(Guid.NewGuid());
|
||||
/// <inheritdoc/>
|
||||
public IBeamShearAxisAction SupportAction { get; } = new BeamShearAxisAction(Guid.NewGuid());
|
||||
|
||||
public BeamShearAction(Guid id)
|
||||
{
|
||||
|
||||
@@ -12,12 +12,9 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeStrategies();
|
||||
CheckObject.IsNull(targetObject.XAxisShearAction);
|
||||
CheckObject.IsNull(sourceObject.XAxisShearAction);
|
||||
axisActionUpdateStrategy.Update(targetObject.XAxisShearAction, sourceObject.XAxisShearAction);
|
||||
CheckObject.IsNull(sourceObject.YAxisShearAction);
|
||||
CheckObject.IsNull(targetObject.YAxisShearAction);
|
||||
axisActionUpdateStrategy.Update(targetObject.YAxisShearAction, sourceObject.YAxisShearAction);
|
||||
CheckObject.IsNull(sourceObject.SupportAction);
|
||||
CheckObject.IsNull(targetObject.SupportAction);
|
||||
axisActionUpdateStrategy.Update(targetObject.SupportAction, sourceObject.SupportAction);
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
|
||||
@@ -16,12 +16,9 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
///<inheritdoc/>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
///<inheritdoc/>
|
||||
public double SupportShearForce { get; set; }
|
||||
public IFactoredForceTuple SupportForce { get; set; } = new FactoredForceTuple(Guid.NewGuid());
|
||||
///<inheritdoc/>
|
||||
public IFactoredCombinationProperty FactoredCombinationProperty { get; } = new FactoredCombinationProperty(Guid.NewGuid());
|
||||
///<inheritdoc/>
|
||||
public List<IBeamShearLoad> ShearLoads { get; } = new();
|
||||
|
||||
public List<IBeamSpanLoad> ShearLoads { get; } = new();
|
||||
|
||||
public BeamShearAxisAction(Guid id)
|
||||
{
|
||||
|
||||
@@ -19,16 +19,16 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeStrategies();
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.SupportShearForce = sourceObject.SupportShearForce;
|
||||
CheckObject.IsNull(targetObject.FactoredCombinationProperty);
|
||||
CheckObject.IsNull(sourceObject.FactoredCombinationProperty);
|
||||
combinationUpdateStrategy.Update(targetObject.FactoredCombinationProperty, sourceObject.FactoredCombinationProperty);
|
||||
targetObject.SupportForce = sourceObject.SupportForce;
|
||||
CheckObject.IsNull(targetObject.SupportForce.CombinationProperty);
|
||||
CheckObject.IsNull(sourceObject.SupportForce.CombinationProperty);
|
||||
combinationUpdateStrategy.Update(targetObject.SupportForce.CombinationProperty, sourceObject.SupportForce.CombinationProperty);
|
||||
CheckObject.IsNull(targetObject.ShearLoads);
|
||||
targetObject.ShearLoads.Clear();
|
||||
CheckObject.IsNull(sourceObject.ShearLoads);
|
||||
foreach (var item in sourceObject.ShearLoads)
|
||||
{
|
||||
IBeamShearLoad beamShearLoad = item.Clone() as IBeamShearLoad;
|
||||
IBeamSpanLoad beamShearLoad = item.Clone() as IBeamSpanLoad;
|
||||
targetObject.ShearLoads.Add(beamShearLoad);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class BeamShearLoadBaseUpdateStrategy : IUpdateStrategy<IBeamShearLoad>
|
||||
public class BeamShearLoadBaseUpdateStrategy : IUpdateStrategy<IBeamSpanLoad>
|
||||
{
|
||||
public void Update(IBeamShearLoad targetObject, IBeamShearLoad sourceObject)
|
||||
public void Update(IBeamSpanLoad targetObject, IBeamSpanLoad sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
|
||||
@@ -9,11 +9,11 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class BeamShearLoadUpdateStrategy : IUpdateStrategy<IBeamShearLoad>
|
||||
public class BeamShearLoadUpdateStrategy : IUpdateStrategy<IBeamSpanLoad>
|
||||
{
|
||||
private IUpdateStrategy<IConcentratedForce> concentratedForceUpdateStrategy;
|
||||
private IUpdateStrategy<IDistributedLoad> distributedLoadUpdateStrategy;
|
||||
public void Update(IBeamShearLoad targetObject, IBeamShearLoad sourceObject)
|
||||
public void Update(IBeamSpanLoad targetObject, IBeamSpanLoad sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
@@ -22,7 +22,7 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
UpdateObjects(targetObject, sourceObject);
|
||||
}
|
||||
|
||||
private void UpdateObjects(IBeamShearLoad targetObject, IBeamShearLoad sourceObject)
|
||||
private void UpdateObjects(IBeamSpanLoad targetObject, IBeamSpanLoad sourceObject)
|
||||
{
|
||||
if (sourceObject is IDistributedLoad distributedSource)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class ConcentratedForceUpdateStrategy : IUpdateStrategy<IConcentratedForce>
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearLoad> baseUpdateStrategy;
|
||||
private IUpdateStrategy<IBeamSpanLoad> baseUpdateStrategy;
|
||||
public void Update(IConcentratedForce targetObject, IConcentratedForce sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
public class DistributedLoadUpdateStrategy : IUpdateStrategy<IDistributedLoad>
|
||||
{
|
||||
private IUpdateStrategy<IBeamShearLoad> baseUpdateStrategy;
|
||||
private IUpdateStrategy<IBeamSpanLoad> baseUpdateStrategy;
|
||||
public void Update(IDistributedLoad targetObject, IDistributedLoad sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -37,28 +38,34 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
{
|
||||
Name = "Beam shear action"
|
||||
};
|
||||
SetAction(beamShearAction.XAxisShearAction, 0);
|
||||
SetFactors(beamShearAction.XAxisShearAction);
|
||||
beamShearAction.XAxisShearAction.ShearLoads.Clear();
|
||||
SetExternalForceFactors(beamShearAction.ExternalForce.CombinationProperty);
|
||||
|
||||
SetAction(beamShearAction.YAxisShearAction, 1e5);
|
||||
SetFactors(beamShearAction.YAxisShearAction);
|
||||
SetAction(beamShearAction.SupportAction, 1e5);
|
||||
SetFactors(beamShearAction.SupportAction);
|
||||
return beamShearAction;
|
||||
}
|
||||
|
||||
private static void SetExternalForceFactors(IFactoredCombinationProperty combinationProperty)
|
||||
{
|
||||
combinationProperty.CalcTerm = CalcTerms.ShortTerm;
|
||||
combinationProperty.LimitState = LimitStates.ULS;
|
||||
combinationProperty.LongTermFactor = 1;
|
||||
combinationProperty.ULSFactor = 1;
|
||||
}
|
||||
|
||||
private static void SetAction(IBeamShearAxisAction beamShearAxisAction, double supportForce)
|
||||
{
|
||||
beamShearAxisAction.SupportShearForce = 1e5;
|
||||
IBeamShearLoad distributedLoad = BeamShearLoadFactory.GetBeamShearLoad(ShearLoadTypes.DistributedLoad);
|
||||
beamShearAxisAction.SupportForce.ForceTuple.Qy = supportForce;
|
||||
IBeamSpanLoad distributedLoad = BeamShearLoadFactory.GetBeamShearLoad(ShearLoadTypes.DistributedLoad);
|
||||
beamShearAxisAction.ShearLoads.Add(distributedLoad);
|
||||
}
|
||||
|
||||
private static void SetFactors(IBeamShearAxisAction beamShearAxisAction)
|
||||
{
|
||||
beamShearAxisAction.FactoredCombinationProperty.LimitState = Infrastructures.Enums.LimitStates.ULS;
|
||||
beamShearAxisAction.FactoredCombinationProperty.CalcTerm = Infrastructures.Enums.CalcTerms.ShortTerm;
|
||||
beamShearAxisAction.FactoredCombinationProperty.LongTermFactor = 0.95;
|
||||
beamShearAxisAction.FactoredCombinationProperty.ULSFactor = 1.2;
|
||||
beamShearAxisAction.SupportForce.CombinationProperty.LimitState = LimitStates.ULS;
|
||||
beamShearAxisAction.SupportForce.CombinationProperty.CalcTerm = CalcTerms.ShortTerm;
|
||||
beamShearAxisAction.SupportForce.CombinationProperty.LongTermFactor = 0.95;
|
||||
beamShearAxisAction.SupportForce.CombinationProperty.ULSFactor = 1.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace StructureHelperCommon.Models.Forces.BeamShearActions
|
||||
}
|
||||
public static class BeamShearLoadFactory
|
||||
{
|
||||
public static IBeamShearLoad GetBeamShearLoad(ShearLoadTypes loadType)
|
||||
public static IBeamSpanLoad GetBeamShearLoad(ShearLoadTypes loadType)
|
||||
{
|
||||
if (loadType == ShearLoadTypes.DistributedLoad)
|
||||
{
|
||||
|
||||
@@ -4,11 +4,23 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements properties of force at the and of bar
|
||||
/// </summary>
|
||||
public interface IBeamShearAction : IAction
|
||||
{
|
||||
IBeamShearAxisAction XAxisShearAction { get; }
|
||||
IBeamShearAxisAction YAxisShearAction { get; }
|
||||
/// <summary>
|
||||
/// External force at the end of bar
|
||||
/// </summary>
|
||||
IFactoredForceTuple ExternalForce { get; }
|
||||
/// <summary>
|
||||
/// Internal loads on bar
|
||||
/// </summary>
|
||||
IBeamShearAxisAction SupportAction { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,16 +12,12 @@ namespace StructureHelperCommon.Models.Forces
|
||||
public interface IBeamShearAxisAction : IAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Shear force at support point, N
|
||||
/// Internal force at support point
|
||||
/// </summary>
|
||||
double SupportShearForce { get; set; }
|
||||
/// <summary>
|
||||
/// Properties of combination of forces
|
||||
/// </summary>
|
||||
IFactoredCombinationProperty FactoredCombinationProperty { get; }
|
||||
IFactoredForceTuple SupportForce { get; set; }
|
||||
/// <summary>
|
||||
/// Collection of loads which are applyed on beam at its span
|
||||
/// </summary>
|
||||
List<IBeamShearLoad> ShearLoads {get;}
|
||||
List<IBeamSpanLoad> ShearLoads {get;}
|
||||
}
|
||||
}
|
||||
|
||||
25
StructureHelperCommon/Models/Forces/FactoredForceTuple.cs
Normal file
25
StructureHelperCommon/Models/Forces/FactoredForceTuple.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class FactoredForceTuple : IFactoredForceTuple
|
||||
{
|
||||
public Guid Id { get; }
|
||||
public IForceTuple ForceTuple { get; set; } = new ForceTuple();
|
||||
public IFactoredCombinationProperty CombinationProperty { get; set; } = new FactoredCombinationProperty(Guid.NewGuid());
|
||||
|
||||
public FactoredForceTuple(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// <summary>
|
||||
/// Implement properties for shear beam load
|
||||
/// </summary>
|
||||
public interface IBeamShearLoad : IAction
|
||||
public interface IBeamSpanLoad : IAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Value of level where action is applyied at, 0.5 is top surface of beam, -0.5 is bottom surface of beam
|
||||
@@ -9,7 +9,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
/// <summary>
|
||||
/// Implement properties for concentrated load in beam
|
||||
/// </summary>
|
||||
public interface IConcentratedForce : IBeamShearLoad
|
||||
public interface IConcentratedForce : IBeamSpanLoad
|
||||
{
|
||||
/// <summary>
|
||||
/// Coordinate of location of force along beam, m
|
||||
@@ -3,7 +3,7 @@
|
||||
/// <summary>
|
||||
/// Implement properties of
|
||||
/// </summary>
|
||||
public interface IDistributedLoad : IBeamShearLoad
|
||||
public interface IDistributedLoad : IBeamSpanLoad
|
||||
{
|
||||
/// <summary>
|
||||
/// Value of uniformly distributed load, N/m
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -6,9 +7,15 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public interface IFactoredForceTuple
|
||||
public interface IFactoredForceTuple : ISaveable, ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Combination of internal forces for bar
|
||||
/// </summary>
|
||||
IForceTuple ForceTuple { get; set; }
|
||||
/// <summary>
|
||||
/// Properties of combination of forces
|
||||
/// </summary>
|
||||
IFactoredCombinationProperty CombinationProperty { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user