RemoveUnderlying property for primitives was added

This commit is contained in:
Evgeny Redikultsev
2023-03-05 19:50:24 +05:00
parent b29d7bfd58
commit edb8afe321
41 changed files with 693 additions and 160 deletions

View File

@@ -0,0 +1,52 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces
{
/// <inheritdoc/>
public class ForceCombinationByFactor : IForceCombinationByFactor
{
/// <inheritdoc/>
public string Name { get; set; }
public bool SetInGravityCenter { get; set; }
/// <inheritdoc/>
public IPoint2D ForcePoint { get; private set; }
/// <inheritdoc/>
public IForceTuple FullSLSForces { get; private set; }
/// <inheritdoc/>
public double ULSFactor { get; set; }
/// <inheritdoc/>
public double LongTermFactor { get; set; }
public ForceCombinationByFactor()
{
Name = "New Factored Load";
SetInGravityCenter = true;
ForcePoint = new Point2D();
FullSLSForces = new ForceTuple();
}
public List<IDesignForceTuple> GetCombination()
{
var result = new List<IDesignForceTuple>();
var limitStates = new List<LimitStates>() { LimitStates.ULS, LimitStates.SLS };
var calcTerms = new List<CalcTerms>() { CalcTerms.ShortTerm, CalcTerms.LongTerm };
foreach (var limitState in limitStates)
{
var stateFactor = limitState is LimitStates.SLS ? 1d : ULSFactor;
foreach (var calcTerm in calcTerms)
{
var termFactor = calcTerm is CalcTerms.ShortTerm ? 1d : LongTermFactor;
var designForceTuple = new DesignForceTuple() { LimitState = limitState, CalcTerm = calcTerm };
designForceTuple.ForceTuple = ForceTupleService.MultiplyTuples(designForceTuple.ForceTuple, stateFactor * termFactor);
result.Add(designForceTuple);
}
}
return result;
}
}
}

View File

@@ -1,29 +1,37 @@
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Models.Shapes;
using StructureHelperCommon.Services.Forces;
namespace StructureHelperCommon.Models.Forces
{
/// <inheritdoc/>
public class ForceCombinationList : IForceCombinationList
{
/// <inheritdoc/>
public string Name { get; set; }
/// <inheritdoc/>
public bool SetInGravityCenter { get; set; }
public Point2D ForcePoint { get; private set; }
/// <inheritdoc/>
public IPoint2D ForcePoint { get; private set; }
/// <inheritdoc/>
public List<IDesignForceTuple> DesignForces { get; private set; }
public ForceCombinationList()
{
SetInGravityCenter = true;
ForcePoint = new Point2D() { X = 0, Y = 0 };
DesignForces = new List<IDesignForceTuple>();
DesignForces.Add(new DesignForceTuple(LimitStates.ULS, CalcTerms.ShortTerm));
DesignForces.Add(new DesignForceTuple(LimitStates.ULS, CalcTerms.LongTerm));
DesignForces.Add(new DesignForceTuple(LimitStates.SLS, CalcTerms.ShortTerm));
DesignForces.Add(new DesignForceTuple(LimitStates.SLS, CalcTerms.LongTerm));
DesignForces = new List<IDesignForceTuple>
{
new DesignForceTuple(LimitStates.ULS, CalcTerms.ShortTerm),
new DesignForceTuple(LimitStates.ULS, CalcTerms.LongTerm),
new DesignForceTuple(LimitStates.SLS, CalcTerms.ShortTerm),
new DesignForceTuple(LimitStates.SLS, CalcTerms.LongTerm)
};
}
/// <inheritdoc/>
public object Clone()
{
var newItem = new ForceCombinationList();
@@ -39,5 +47,26 @@ namespace StructureHelperCommon.Models.Forces
}
return newItem;
}
/// <inheritdoc/>
public List<IDesignForceTuple> GetCombination()
{
var result = new List<IDesignForceTuple>();
var limitStates = new List<LimitStates>() { LimitStates.ULS, LimitStates.SLS };
var calcTerms = new List<CalcTerms>() { CalcTerms.ShortTerm, CalcTerms.LongTerm };
foreach (var limitState in limitStates)
{
foreach (var calcTerm in calcTerms)
{
var designForceTuple = new DesignForceTuple() { LimitState = limitState, CalcTerm = calcTerm };
var forceTupleList = DesignForces.Where(x => x.LimitState == limitState & x.CalcTerm == calcTerm);
foreach (var item in forceTupleList)
{
designForceTuple.ForceTuple = ForceTupleService.SumTuples(designForceTuple.ForceTuple, item.ForceTuple);
}
result.Add(designForceTuple);
}
}
return result;
}
}
}

View File

@@ -1,4 +1,6 @@
namespace StructureHelperCommon.Models.Forces
using System.ComponentModel.DataAnnotations;
namespace StructureHelperCommon.Models.Forces
{
/// <inheritdoc/>
public class ForceTuple : IForceTuple
@@ -22,5 +24,17 @@
IForceTuple forceTuple = new ForceTuple() { Mx = Mx, My = My, Nz = Nz, Qx = Qx, Qy = Qy, Mz = Mz};
return forceTuple;
}
public static ForceTuple operator +(ForceTuple first) => first;
public static ForceTuple operator +(ForceTuple first, ForceTuple second)
{
var result = new ForceTuple();
result.Mx += first.Mx + second.Mx;
result.My += first.My + second.My;
result.Mz += first.Mz + second.Mz;
result.Qx += first.Qx + second.Qx;
result.Qy += first.Qy + second.Qy;
result.Nz += first.Nz + second.Nz;
return result;
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces
{
public interface IAction
{
string Name { get; set; }
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.CodeDom;
using StructureHelperCommon.Infrastructures.Enums;
namespace StructureHelperCommon.Models.Forces
@@ -8,5 +9,6 @@ namespace StructureHelperCommon.Models.Forces
LimitStates LimitState { get; set; }
CalcTerms CalcTerm { get; set; }
IForceTuple ForceTuple { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces
{
public interface IForceAction : IAction
{
bool SetInGravityCenter { get; set; }
IPoint2D ForcePoint { get; }
List<IDesignForceTuple> GetCombination();
}
}

View File

@@ -0,0 +1,16 @@
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Forces
{
public interface IForceCombinationByFactor : IForceAction
{
IForceTuple FullSLSForces { get; }
double ULSFactor { get; set; }
double LongTermFactor { get; set; }
}
}

View File

@@ -4,11 +4,8 @@ using StructureHelperCommon.Models.Shapes;
namespace StructureHelperCommon.Models.Forces
{
public interface IForceCombinationList : ICloneable
public interface IForceCombinationList : IForceAction, ICloneable
{
string Name { get; set; }
bool SetInGravityCenter { get; set; }
Point2D ForcePoint {get ;}
List<IDesignForceTuple> DesignForces { get; }
}
}