Skip to content

Commit

Permalink
Merge branch 'develop' into ETABS_Toolkit-#459-AddSetGetPointDisplLoads
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjamesnugent committed Sep 4, 2024
2 parents a65971d + aebab56 commit b5bd8e5
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 14 deletions.
17 changes: 11 additions & 6 deletions ETABS_oM/ETABS_oM.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -33,22 +33,27 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="BHoM">
<HintPath>C:\ProgramData\BHoM\Assemblies\BHoM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\BHoM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Data_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Data_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Data_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Geometry_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Geometry_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Geometry_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Quantities_oM">
<HintPath>$(ProgramData)\BHoM\Assemblies\Quantities_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Structure_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Structure_oM.dll</HintPath>
<HintPath>$(ProgramData)\BHoM\Assemblies\Structure_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
Expand Down Expand Up @@ -99,4 +104,4 @@ xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
37 changes: 35 additions & 2 deletions ETABS_oM/Results/PierForce.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BH.oM.Structure.Results;
using BH.oM.Base;
using BH.oM.Quantities.Attributes;
using System.ComponentModel;

namespace BH.oM.Adapters.ETABS.Results
{
public class PierForce : Structure.Results.BarForce, IImmutable
public class PierForce : BarResult, IImmutable
{
/***************************************************/
/**** Public Properties ****/
Expand All @@ -39,14 +42,44 @@ public class PierForce : Structure.Results.BarForce, IImmutable
//Just using this for the name
public virtual string Location { get; } = "";

[Force]
[Description("Axial force along the local x-axis. Positive for tension, negative for compression.")]
public virtual double FX { get; }

[Force]
[Description("Shear force along the local y-axis. Generally minor axis shear force.")]
public virtual double FY { get; }

[Force]
[Description("Shear force along the local z-axis. Generally major axis shear force.")]
public virtual double FZ { get; }

[Moment]
[Description("Torsional moment.")]
public virtual double MX { get; }

[Moment]
[Description("Bending moment about the local y-axis. Generally major axis bending moment.")]
public virtual double MY { get; }

[Moment]
[Description("Bending moment about the local z-axis. Generally minor axis bending moment.")]
public virtual double MZ { get; }

/***************************************************/
/**** Constructors ****/
/***************************************************/

public PierForce(IComparable objectId, IComparable resultCase, string location, int modeNumber, double timeStep, double position, int divisions, double fx, double fy, double fz, double mx, double my, double mz)
: base(objectId, resultCase, modeNumber, timeStep, position, divisions, fx, fy, fz, mx, my, mz)
: base(objectId, resultCase, modeNumber, timeStep, position, divisions)
{
Location = location;
FX = fx;
FY = fy;
FZ = fz;
MX = mx;
MY = my;
MZ = mz;
}

/***************************************************/
Expand Down
75 changes: 71 additions & 4 deletions Etabs_Adapter/CRUD/Read/Results/NodeResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
using BH.oM.Structure.Requests;
using BH.oM.Adapter;
using BH.oM.Structure.Elements;
using System.Xml.Linq;

namespace BH.Adapter.ETABS
{
Expand Down Expand Up @@ -67,7 +68,9 @@ public IEnumerable<IResult> ReadResults(NodeResultRequest request, ActionConfig
case NodeResultType.NodeDisplacement:
return ReadNodeDisplacement(nodeIds);
case NodeResultType.NodeVelocity:
return ReadNodeVelocity(nodeIds);
case NodeResultType.NodeAcceleration:
return ReadNodeAcceleration(nodeIds);
default:
Engine.Base.Compute.RecordError("Result extraction of type " + request.ResultType + " is not yet supported");
return new List<IResult>();
Expand All @@ -78,9 +81,42 @@ public IEnumerable<IResult> ReadResults(NodeResultRequest request, ActionConfig
/**** Private method - Extraction methods ****/
/***************************************************/

private List<NodeResult> ReadNodeAcceleration(IList ids = null, IList cases = null)
private List<NodeAcceleration> ReadNodeAcceleration(List<string> nodeIds)
{
throw new NotImplementedException("Node Acceleration results is not supported yet!");

List<NodeAcceleration> nodeAccelerations = new List<NodeAcceleration>();

int resultCount = 0;
string[] loadcaseNames = null;
string[] objects = null;
string[] elm = null;
string[] stepType = null;
double[] stepNum = null;
double[] ux = null;
double[] uy = null;
double[] uz = null;
double[] rx = null;
double[] ry = null;
double[] rz = null;

for (int i = 0; i < nodeIds.Count; i++)
{
int ret = m_model.Results.JointAccAbs(nodeIds[i].ToString(), eItemTypeElm.ObjectElm, ref resultCount, ref objects, ref elm, ref loadcaseNames,
ref stepType, ref stepNum, ref ux, ref uy, ref uz, ref rx, ref ry, ref rz);
if (ret == 0)
{
for (int j = 0; j < resultCount; j++)
{
int mode;
double timeStep;
GetStepAndMode(stepType[j], stepNum[j], out timeStep, out mode);
NodeAcceleration na = new NodeAcceleration(nodeIds[i], loadcaseNames[j], mode, timeStep, oM.Geometry.Basis.XY, ux[j], uy[j], uz[j], rx[j], ry[j], rz[j]);
nodeAccelerations.Add(na);
}
}
}

return nodeAccelerations;
}

/***************************************************/
Expand Down Expand Up @@ -166,10 +202,41 @@ private List<NodeReaction> ReadNodeReaction(List<string> nodeIds)

/***************************************************/

private List<NodeResult> ReadNodeVelocity(IList ids = null, IList cases = null)
private List<NodeVelocity> ReadNodeVelocity(List<string> nodeIds)
{
throw new NotImplementedException("Node Acceleration results is not supported yet!");
List<NodeVelocity> nodeVelocities = new List<NodeVelocity>();

int resultCount = 0;
string[] loadcaseNames = null;
string[] objects = null;
string[] elm = null;
string[] stepType = null;
double[] stepNum = null;
double[] ux = null;
double[] uy = null;
double[] uz = null;
double[] rx = null;
double[] ry = null;
double[] rz = null;

for (int i = 0; i < nodeIds.Count; i++)
{
int ret = m_model.Results.JointVelAbs(nodeIds[i], eItemTypeElm.ObjectElm, ref resultCount, ref objects, ref elm,
ref loadcaseNames, ref stepType, ref stepNum, ref ux, ref uy, ref uz, ref rx, ref ry, ref rz);
if (ret == 0)
{
for (int j = 0; j < resultCount; j++)
{
int mode;
double timeStep;
GetStepAndMode(stepType[j], stepNum[j], out timeStep, out mode);
NodeVelocity nv = new NodeVelocity(nodeIds[i], loadcaseNames[j], mode, timeStep, oM.Geometry.Basis.XY, ux[j], uy[j], uz[j], rx[j], ry[j], rz[j]);
nodeVelocities.Add(nv);
}
}
}

return nodeVelocities;
}

/***************************************************/
Expand Down
4 changes: 2 additions & 2 deletions Etabs_Adapter/Etabs_Adapter.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -427,4 +427,4 @@ xcopy "$(TargetDir)CSiAPIv1.dll" "C:\ProgramData\BHoM\Assemblies" /Y
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

0 comments on commit b5bd8e5

Please sign in to comment.