Skip to content

Commit

Permalink
Revert "Revert "Revert "Shear modulus and thermal coefficient value f…
Browse files Browse the repository at this point in the history
…ix"""

This reverts commit bed84d1.
  • Loading branch information
johannaisak authored and Fraser Greenroyd committed Jul 7, 2023
1 parent 0813718 commit 2f15b2c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 184 deletions.
138 changes: 0 additions & 138 deletions GSA_Adapter/CRUD/ReadResultsElements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
using System.Collections.Generic;
using System.Linq;
using BH.Engine.Adapters.GSA;
using BH.oM.Structure.Results;

namespace BH.Adapter.GSA
{
Expand Down Expand Up @@ -219,99 +218,6 @@ private bool GetExtractionParameters(NodeResultRequest request, out ResHeader he

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

private bool GetExtractionParameters(MeshResultRequest request, out ResHeader header, out ForceConverter converter, out string axis, out double unitFactor, out int divisions, out int flags)
{
axis = Output_Axis.Local;
divisions = 0;
flags = 0;

double[] unitFactors = GetUnitFactors();

switch (request.LayerPosition)
{
case -1:
flags = (int)Output_Init_Flags.OP_INIT_2D_BOTTOM;
break;
case 0:
flags = (int)Output_Init_Flags.OP_INIT_2D_MIDDLE;
break;
case 1:
flags = (int)Output_Init_Flags.OP_INIT_2D_TOP;
break;
case 2:
converter = null;
header = ResHeader.REF_ACC;
unitFactor = unitFactors[(int)UnitType.FORCE];
flags = 0;
Engine.Base.Compute.RecordError("Result of layer position " + request.LayerPosition + " is not yet supported");
return false;
case 3:
converter = null;
header = ResHeader.REF_ACC;
unitFactor = unitFactors[(int)UnitType.FORCE];
flags = 0;
Engine.Base.Compute.RecordError("Result of layer position " + request.LayerPosition + " is not yet supported");
return false;
case 4:
converter = null;
header = ResHeader.REF_ACC;
unitFactor = unitFactors[(int)UnitType.FORCE];
flags = 0;
Engine.Base.Compute.RecordError("Result of layer position " + request.LayerPosition + " is not yet supported");
return false;
case 5:
converter = null;
header = ResHeader.REF_ACC;
unitFactor = unitFactors[(int)UnitType.FORCE];
flags = 0;
Engine.Base.Compute.RecordError("Result of layer position " + request.LayerPosition + " is not yet supported");
return false;
}

switch (request.ResultType)
{
case MeshResultType.Forces:
converter = null;
header = ResHeader.REF_FORCE_EL2D_DRV;
unitFactor = unitFactors[(int)UnitType.FORCE];
Engine.Base.Compute.RecordError("Result of layer position " + request.ResultType + " is not yet supported");
return false;
case MeshResultType.Displacements:
converter = null;
header = ResHeader.REF_DISP_EL2D;
unitFactor = unitFactors[(int)UnitType.LENGTH];
Engine.Base.Compute.RecordError("Result of layer position " + request.ResultType + " is not yet supported");
return false;
case MeshResultType.MeshModeShape:
converter = null;
header = ResHeader.REF_ACC;
unitFactor = 1;
Engine.Base.Compute.RecordError("Result of layer position " + request.ResultType + " is not yet supported");
return false;
case MeshResultType.Stresses:
converter = Convert.FromGsaMeshStress;
header = ResHeader.REF_STRESS_EL2D_DRV;
unitFactor = unitFactors[(int)UnitType.STRESS];
break;
case MeshResultType.VonMises:
converter = null;
header = ResHeader.REF_ACC;
unitFactor = 1;
Engine.Base.Compute.RecordError("Result of layer position " + request.ResultType + " is not yet supported");
return false;
default:
converter = null;
header = ResHeader.REF_ACC;
unitFactor = 1;
Engine.Base.Compute.RecordError("Result of type " + request.ResultType + " is not yet supported");
return false;
}

return true;
}

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

private bool IGetExtractionParameters(IResultRequest request, out ResHeader header, out ForceConverter converter, out string axis, out double unitFactor, out int divisions, out int flags)
{
return GetExtractionParameters(request as dynamic, out header, out converter, out axis, out unitFactor, out divisions, out flags);
Expand Down Expand Up @@ -469,50 +375,6 @@ private List<int> GetAllIds(NodeResultRequest request)
}


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

private List<int> GetAllIds(MeshResultRequest request)
{
string allBars = m_gsaCom.GwaCommand("GET_ALL, EL.2").ToString();
string[] barArr = string.IsNullOrWhiteSpace(allBars) ? new string[0] : allBars.Split('\n');

List<int> ids = new List<int>();
bool containsDummies = false;
foreach (string gsaBar in barArr)
{

string[] arr = gsaBar.Split(',');

string index = arr[1];

//Check that the element type is a mesh
switch (arr[4])
{
case "TRI3":
case "TRI6":
case "QUAD4":
case "QUAD8":
break;
default:
continue;
}

//Check if dummy
if (arr.Last().ToUpper() == "DUMMY")
{
containsDummies = true;
continue;
}

ids.Add(int.Parse(index));
}

if (containsDummies)
Engine.Base.Compute.RecordNote("Model contains 'dummy'-elements. The elements with this tag do not contain any results and will not have any results extracted.");

return ids;
}

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

static public int[] CreateIntSequence(int maxId)
Expand Down
12 changes: 6 additions & 6 deletions GSA_Adapter/Convert/FromGsa/Properties/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ private static void OrthotropicMaterialProperties(string gsaString, out double e
v2 = double.Parse(gStr[10]);
v3 = double.Parse(gStr[11]);

g1 = double.Parse(gStr[16]);
g2 = double.Parse(gStr[17]);
g3 = double.Parse(gStr[18]);
g1 = double.Parse(gStr[13]);
g2 = double.Parse(gStr[14]);
g3 = double.Parse(gStr[15]);

tC1 = double.Parse(gStr[13]);
tC2 = double.Parse(gStr[14]);
tC3 = double.Parse(gStr[15]);
tC1 = double.Parse(gStr[16]);
tC2 = double.Parse(gStr[17]);
tC3 = double.Parse(gStr[18]);

rho = double.Parse(gStr[12]);

Expand Down
10 changes: 0 additions & 10 deletions GSA_Adapter/Convert/FromGsa/Properties/SectionProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,6 @@ public static ISectionProperty FromGsaSectionProperty(string gsaString, Dictiona

Engine.Base.Compute.RecordNote("Section of type: " + secName + " not found in the library. Custom section will be used");
}
else if (desc[1].Contains("CHS"))
{
description = "STD%" + secType + "%";
string trim = desc[2].TrimStart(secType.ToCharArray());
string[] arr = trim.Split('x');

description += arr[0] + "%" + arr[1];

Engine.Base.Compute.RecordNote("Section of type: " + secName + " not found in the library. Custom section will be used");
}
else
{
message += "Catalogue section of type " + secName + " not found in library\n";
Expand Down
26 changes: 0 additions & 26 deletions GSA_Adapter/Convert/FromGsa/Results/Results.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,32 +189,6 @@ public static BarStrain FromGsaBarStrain(GsaResults results, int id, string load

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

public static MeshStress FromGsaMeshStress(GsaResults results, int id, string loadCase, int divisions, double timeStep = 0, int mode = -1)
{
return new MeshStress(
id,
0,
0,
loadCase,
mode,
timeStep,
MeshResultLayer.Lower,
-1,
MeshResultSmoothingType.None,
oM.Geometry.Basis.XY,
results.dynaResults[0],
results.dynaResults[1],
results.dynaResults[2],
results.dynaResults[4],
results.dynaResults[3],
results.dynaResults[6],
results.dynaResults[5],
results.dynaResults[7]
);
}

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

public static GlobalReactions FromGsaGlobalReactions(string id, string force, string moment)
{
string[] fArr = force.Split(',');
Expand Down
8 changes: 4 additions & 4 deletions GSA_Adapter/GSA_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" DefaultTarget="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 All @@ -20,7 +20,7 @@
<DefineConstants>DEBUG;TRACE;GSA_8_7</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AssemblyName>GSA87_Adapter</AssemblyName>
<AssemblyName>GSA87_Adapter</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,7 +29,7 @@
<DefineConstants>TRACE;GSA_8_7</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AssemblyName>GSA87_Adapter</AssemblyName>
<AssemblyName>GSA87_Adapter</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug87|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -258,4 +258,4 @@
xcopy "$(TargetDir)$(TargetFileName)" "$(ProgramData)\BHoM\Assemblies" /Y
</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

0 comments on commit 2f15b2c

Please sign in to comment.