Interpolation of results was added
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public enum ForceType
|
||||
{
|
||||
Force_zero,
|
||||
Force_Mx50My50Nz100,
|
||||
}
|
||||
|
||||
public static class DesignForceFactory
|
||||
{
|
||||
public static IDesignForceTuple GetDesignForce(ForceType forceType, LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
if (forceType == ForceType.Force_zero)
|
||||
{
|
||||
return new DesignForceTuple(limitState, calcTerm);
|
||||
}
|
||||
else if (forceType == ForceType.Force_Mx50My50Nz100)
|
||||
{
|
||||
var tuple = new DesignForceTuple(limitState, calcTerm);
|
||||
var forceTuple = tuple.ForceTuple;
|
||||
forceTuple.Mx = -50e3d;
|
||||
forceTuple.My = -50e3d;
|
||||
forceTuple.Nz = -100e3d;
|
||||
return tuple;
|
||||
}
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public enum DesignForceType
|
||||
{
|
||||
Suit_1,
|
||||
Suit_2
|
||||
}
|
||||
|
||||
public static class ForceCombinationListFactory
|
||||
{
|
||||
public static List<IDesignForceTuple> GetDesignForces(DesignForceType forceType)
|
||||
{
|
||||
if (forceType == DesignForceType.Suit_1)
|
||||
{
|
||||
var designForces = new List<IDesignForceTuple>();
|
||||
designForces.Add(DesignForceFactory.GetDesignForce(ForceType.Force_Mx50My50Nz100, LimitStates.ULS, CalcTerms.ShortTerm));
|
||||
designForces.Add(DesignForceFactory.GetDesignForce(ForceType.Force_Mx50My50Nz100, LimitStates.ULS, CalcTerms.LongTerm));
|
||||
designForces.Add(DesignForceFactory.GetDesignForce(ForceType.Force_Mx50My50Nz100, LimitStates.SLS, CalcTerms.ShortTerm));
|
||||
designForces.Add(DesignForceFactory.GetDesignForce(ForceType.Force_Mx50My50Nz100, LimitStates.SLS, CalcTerms.LongTerm));
|
||||
return designForces;
|
||||
}
|
||||
else throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown);
|
||||
}
|
||||
}
|
||||
}
|
||||
54
StructureHelperCommon/Services/Forces/TupleService.cs
Normal file
54
StructureHelperCommon/Services/Forces/TupleService.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Services.Forces
|
||||
{
|
||||
public static class TupleService
|
||||
{
|
||||
public static IForceTuple MoveTupleIntoPoint(IForceTuple forceTuple, IPoint2D point2D)
|
||||
{
|
||||
var newTuple = forceTuple.Clone() as IForceTuple;
|
||||
newTuple.Mx += newTuple.Nz * point2D.Y;
|
||||
newTuple.My -= newTuple.Nz * point2D.X;
|
||||
return newTuple;
|
||||
}
|
||||
|
||||
public static IForceTuple InterpolateTuples(IForceTuple startTuple, IForceTuple endTuple, double coefficient)
|
||||
{
|
||||
double dMx, dMy, dNz;
|
||||
dMx = endTuple.Mx - startTuple.Mx;
|
||||
dMy = endTuple.My - startTuple.My;
|
||||
dNz = endTuple.Nz - startTuple.Nz;
|
||||
return new ForceTuple()
|
||||
{
|
||||
Mx = startTuple.Mx + dMx * coefficient,
|
||||
My = startTuple.My + dMy * coefficient,
|
||||
Nz = startTuple.Nz + dNz * coefficient
|
||||
};
|
||||
}
|
||||
|
||||
public static IForceTuple InterpolateTuples(IForceTuple endTuple, double coefficient)
|
||||
{
|
||||
IForceTuple startTuple = new ForceTuple();
|
||||
return InterpolateTuples(startTuple, endTuple, coefficient);
|
||||
}
|
||||
|
||||
public static List<IDesignForceTuple> InterpolateDesignTuple(IDesignForceTuple endTuple, int stepCount)
|
||||
{
|
||||
var tuples =new List<IDesignForceTuple>();
|
||||
double step = 1d / stepCount;
|
||||
for (int i = 0; i <= stepCount; i++)
|
||||
{
|
||||
var currentTuple = InterpolateTuples(endTuple.ForceTuple, i * step);
|
||||
var currentDesignTuple = new DesignForceTuple() { LimitState = endTuple.LimitState, CalcTerm = endTuple.CalcTerm, ForceTuple = currentTuple };
|
||||
tuples.Add(currentDesignTuple);
|
||||
}
|
||||
return tuples;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,8 @@
|
||||
<Compile Include="Infrastructures\Enums\MaterialTypes.cs" />
|
||||
<Compile Include="Models\Calculators\IHelperCalculator.cs" />
|
||||
<Compile Include="Models\Forces\DesignForceTuple.cs" />
|
||||
<Compile Include="Models\Forces\Factories\DesignForceFactory.cs" />
|
||||
<Compile Include="Models\Forces\Factories\ForceCombinationListFactory.cs" />
|
||||
<Compile Include="Models\Forces\ForceCombinationList.cs" />
|
||||
<Compile Include="Models\Forces\ForceTuple.cs" />
|
||||
<Compile Include="Models\Forces\IDesignForceTuple.cs" />
|
||||
@@ -85,6 +87,7 @@
|
||||
<Compile Include="Models\Shapes\RectangleShape.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\ColorServices\ColorProcessor.cs" />
|
||||
<Compile Include="Services\Forces\TupleService.cs" />
|
||||
<Compile Include="Services\ShapeServices\ShapeService.cs" />
|
||||
<Compile Include="Services\Units\IUnit.cs" />
|
||||
<Compile Include="Services\Units\Unit.cs" />
|
||||
|
||||
Reference in New Issue
Block a user