From f625bd15a63f73fe514bb3d8a7d47b9d901efe7e Mon Sep 17 00:00:00 2001 From: Peter Nugent Date: Wed, 29 Jul 2026 15:44:36 +0100 Subject: [PATCH 1/2] Upgrade to SDK style format --- SAP2000_Adapter/Properties/AssemblyInfo.cs | 64 ---------- SAP2000_Adapter/SAP2000_Adapter.csproj | 137 +++------------------ SAP2000_Engine/Properties/AssemblyInfo.cs | 64 ---------- SAP2000_Engine/SAP2000_Engine.csproj | 77 +++--------- SAP2000_Toolkit.sln | 8 +- SAP2000_oM/Properties/AssemblyInfo.cs | 61 --------- SAP2000_oM/SAP2000_oM.csproj | 83 +++---------- 7 files changed, 51 insertions(+), 443 deletions(-) delete mode 100644 SAP2000_Adapter/Properties/AssemblyInfo.cs delete mode 100644 SAP2000_Engine/Properties/AssemblyInfo.cs delete mode 100644 SAP2000_oM/Properties/AssemblyInfo.cs diff --git a/SAP2000_Adapter/Properties/AssemblyInfo.cs b/SAP2000_Adapter/Properties/AssemblyInfo.cs deleted file mode 100644 index aaf29f05..00000000 --- a/SAP2000_Adapter/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SAP2000_Adapter")] -[assembly: AssemblyDescription("https://github.com/BHoM/SAP2000_Toolkit")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Buro Happold")] -[assembly: AssemblyProduct("SAP2000_Adapter")] -[assembly: AssemblyCopyright("Copyright © https://github.com/BHoM")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("04e7e3bc-bd2f-47a4-b4f0-a9675f702ced")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("9.0.0.0")] -[assembly: AssemblyFileVersion("9.3.0.0")] - - - - - - diff --git a/SAP2000_Adapter/SAP2000_Adapter.csproj b/SAP2000_Adapter/SAP2000_Adapter.csproj index ff0c8937..931c224a 100644 --- a/SAP2000_Adapter/SAP2000_Adapter.csproj +++ b/SAP2000_Adapter/SAP2000_Adapter.csproj @@ -1,35 +1,20 @@ - - - + - Debug - AnyCPU - {04E7E3BC-BD2F-47A4-B4F0-A9675F702CED} +net472 Library - Properties BH.Adapter.SAP2000 - SAP2000_Adapter - v4.7.2 - 512 - - - - true - full - false - ..\Build\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true ..\Build\ - TRACE - prompt - 4 + SAP2000_Adapter + https://github.com/BHoM/SAP2000_Toolkit + Buro Happold + SAP2000_Adapter + Copyright © https://github.com/BHoM + 9.0.0.0 + 9.3.0.0 + + + $(ProgramData)\BHoM\Assemblies\Acoustic_oM.dll @@ -174,99 +159,11 @@ False False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - {4bb31ae9-b7ce-42c8-80a4-484389d23de2} - SAP2000_Engine - False - - - {bc975b64-e35e-4155-a067-7a88505e61c2} - SAP2000_oM - False - + + - - - - xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - xcopy "$(TargetDir)SAP2000v1.dll" "C:\ProgramData\BHoM\Assemblies" /Y - - - - \ No newline at end of file + diff --git a/SAP2000_Engine/Properties/AssemblyInfo.cs b/SAP2000_Engine/Properties/AssemblyInfo.cs deleted file mode 100644 index 271efcc9..00000000 --- a/SAP2000_Engine/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SAP2000_Engine")] -[assembly: AssemblyDescription("https://github.com/BHoM/SAP2000_Toolkit")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Buro Happold")] -[assembly: AssemblyProduct("SAP2000_Engine")] -[assembly: AssemblyCopyright("Copyright © https://github.com/BHoM")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4bb31ae9-b7ce-42c8-80a4-484389d23de2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("9.0.0.0")] -[assembly: AssemblyFileVersion("9.3.0.0")] - - - - - - diff --git a/SAP2000_Engine/SAP2000_Engine.csproj b/SAP2000_Engine/SAP2000_Engine.csproj index de4bc39a..cff2306d 100644 --- a/SAP2000_Engine/SAP2000_Engine.csproj +++ b/SAP2000_Engine/SAP2000_Engine.csproj @@ -1,35 +1,20 @@ - - - + - Debug - AnyCPU - {4BB31AE9-B7CE-42C8-80A4-484389D23DE2} +net472 Library - Properties BH.Engine.Adapters.SAP2000 - SAP2000_Engine - v4.7.2 - 512 - - - - true - full - false - ..\Build\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true ..\Build\ - TRACE - prompt - 4 + SAP2000_Engine + https://github.com/BHoM/SAP2000_Toolkit + Buro Happold + SAP2000_Engine + Copyright © https://github.com/BHoM + 9.0.0.0 + 9.3.0.0 + + + $(ProgramData)\BHoM\Assemblies\Acoustic_oM.dll @@ -131,45 +116,13 @@ False False - - - - - - - - - - - - - - - - - + + - - {bc975b64-e35e-4155-a067-7a88505e61c2} - SAP2000_oM - False - + - - - -xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - - - diff --git a/SAP2000_Toolkit.sln b/SAP2000_Toolkit.sln index d0a596c5..0af8353e 100644 --- a/SAP2000_Toolkit.sln +++ b/SAP2000_Toolkit.sln @@ -1,16 +1,16 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30225.117 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SAP2000_Adapter", "SAP2000_Adapter\SAP2000_Adapter.csproj", "{04E7E3BC-BD2F-47A4-B4F0-A9675F702CED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAP2000_Adapter", "SAP2000_Adapter\SAP2000_Adapter.csproj", "{04E7E3BC-BD2F-47A4-B4F0-A9675F702CED}" ProjectSection(ProjectDependencies) = postProject {4BB31AE9-B7CE-42C8-80A4-484389D23DE2} = {4BB31AE9-B7CE-42C8-80A4-484389D23DE2} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SAP2000_Engine", "SAP2000_Engine\SAP2000_Engine.csproj", "{4BB31AE9-B7CE-42C8-80A4-484389D23DE2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAP2000_Engine", "SAP2000_Engine\SAP2000_Engine.csproj", "{4BB31AE9-B7CE-42C8-80A4-484389D23DE2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SAP2000_oM", "SAP2000_oM\SAP2000_oM.csproj", "{BC975B64-E35E-4155-A067-7A88505E61C2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAP2000_oM", "SAP2000_oM\SAP2000_oM.csproj", "{BC975B64-E35E-4155-A067-7A88505E61C2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/SAP2000_oM/Properties/AssemblyInfo.cs b/SAP2000_oM/Properties/AssemblyInfo.cs deleted file mode 100644 index ca981b7d..00000000 --- a/SAP2000_oM/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("SAP2000_oM")] -[assembly: AssemblyDescription("https://github.com/BHoM/SAP2000_Toolkit")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Buro Happold")] -[assembly: AssemblyProduct("SAP2000_oM")] -[assembly: AssemblyCopyright("Copyright © https://github.com/BHoM")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("bc975b64-e35e-4155-a067-7a88505e61c2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("9.0.0.0")] -[assembly: AssemblyFileVersion("9.3.0.0")] - - - - - - diff --git a/SAP2000_oM/SAP2000_oM.csproj b/SAP2000_oM/SAP2000_oM.csproj index 02bd7a8b..44b68243 100644 --- a/SAP2000_oM/SAP2000_oM.csproj +++ b/SAP2000_oM/SAP2000_oM.csproj @@ -1,35 +1,20 @@ - - - + - Debug - AnyCPU - {BC975B64-E35E-4155-A067-7A88505E61C2} +net472 Library - Properties BH.oM.Adapters.SAP2000 - SAP2000_oM - v4.7.2 - 512 - - - - true - full - false - ..\Build\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true ..\Build\ - TRACE - prompt - 4 + SAP2000_oM + https://github.com/BHoM/SAP2000_Toolkit + Buro Happold + SAP2000_oM + Copyright © https://github.com/BHoM + 9.0.0.0 + 9.3.0.0 + + + $(ProgramData)\BHoM\Assemblies\Adapter_oM.dll @@ -53,52 +38,14 @@ ..\libs\v26\SAP2000v1.dll - True + True $(ProgramData)\BHoM\Assemblies\Structure_oM.dll False False - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - - From 6679c111bed219e1db494b0293535b3b65ea8637 Mon Sep 17 00:00:00 2001 From: Peter Nugent Date: Wed, 29 Jul 2026 15:45:38 +0100 Subject: [PATCH 2/2] Removed MeshResults and GlobalResults file as they were not included in the old style project files --- .../CRUD/Read/Results/GlobalResults.cs | 202 ----------- .../CRUD/Read/Results/MeshResults.cs | 328 ------------------ 2 files changed, 530 deletions(-) delete mode 100644 SAP2000_Adapter/CRUD/Read/Results/GlobalResults.cs delete mode 100644 SAP2000_Adapter/CRUD/Read/Results/MeshResults.cs diff --git a/SAP2000_Adapter/CRUD/Read/Results/GlobalResults.cs b/SAP2000_Adapter/CRUD/Read/Results/GlobalResults.cs deleted file mode 100644 index a3d45dab..00000000 --- a/SAP2000_Adapter/CRUD/Read/Results/GlobalResults.cs +++ /dev/null @@ -1,202 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using BH.oM.Structure.Results; -using BH.oM.Common; -using BH.oM.Structure.Elements; -using BH.Engine.SAP2000; -using BH.oM.Structure.Loads; -using BH.oM.Structure.Requests; -using BH.oM.Adapters.SAP2000; -using BH.oM.Geometry; -using BH.Engine.Geometry; -/*using SAP2000v19;*/ -using BH.oM.Adapter; -using SAP2000v1; - -namespace BH.Adapter.SAP2000 -{ - /***************************************************/ - /**** Public method - Read override ****/ - /***************************************************/ - - public IEnumerable ReadResults(GlobalResultRequest request, - ActionConfig actionConfig = null) - { - CheckAndSetUpCases(request); - - switch (request.ResultType) - { - case GlobalResultType.Reactions: - return GetGlobalReactions(); - case GlobalResultType.ModalDynamics: - return GetModalParticipationMassRatios(); - default: - Engine.Reflection.Compute.RecordError("Result extraction of type " + request.ResultType + " is not yet supported"); - return new List(); - } - } - - /***************************************************/ - /**** Private method - Extraction methods ****/ - /***************************************************/ - - private List GetGlobalReactions() - { - List globalReactions = new List(); - - int resultCount = 0; - string[] loadcaseNames = null; - string[] stepType = null; - int[] stepNum = 0; - - double[] fx = null; - double[] fy = null; - double[] fz = null; - double[] mx = null; - double[] my = null; - double[] mz = null; - double gx = 0; - double gy = 0; - double gz = 0; - - int ret = m_model.Results.BaseReact(ref resultCount, - ref loadcaseNames, - ref stepType, - ref stepNum, - ref fx, - ref fy, - ref fz, - ref mx, - ref my, - ref mz, - ref gx, - ref gy, - ref gz); - - for (int i; i < resultCount; i++) - { - GlobalReactions g = new GlobalReactions() - { - ResultCase = loadcaseNames[i], - FX = fx[i], - FY = fy[i], - FZ = fz[i], - MX = mx[i], - MY = my[i], - MZ = mz[i], - TimeStep = stepNum[i] - }; - - globalReactions.Add(g); - } - - return globalReactions; - } - - /***************************************************/ - - private List GetModalParticipationMassRatios() - { - List partRatios = new List(); - - int resultCount = 0; - string[] loadcaseNames = null; - string[] stepType = null; - int[] stepNum = null; - double[] period = null; - double[] ux = null; - double[] uy = null; - double[] uz = null; - double[] sumUx = null; - double[] sumUy = null; - double[] sumUz = null; - double[] rx = null; - double[] ry = null; - double[] rz = null; - double[] sumRx = null; - double[] sumRy = null; - double[] sumRz = null; - - int ret = m_model.Results.ModalParticipatingMassRatios(ref resultCount, - ref loadcaseNames, - ref stepType, - ref stepNum, - ref period, - ref ux, - ref uy, - ref uz, - ref sumUx, - ref sumUy, - ref sumUz, - ref rx, - ref ry, - ref rz, - ref sumRx, - ref sumRy, - ref sumRz); - - if (ret != 0) Engine.Reflection.Compute.RecordError("Could not extract Modal information."); - - string previousModalCase = ""; - int modeNumber = 1; //makes up for stepnumber always = 0 - for (int i = 0; i < resultCount; i++) - { - if (loadcaseNames[i] != previousModalCase) - modeNumber = 1; - - ModalDynamics mod = new ModalDynamics() - { - ResultCase = loadcaseNames[i], - ModeNumber = modeNumber, - Frequency = 1 / period[i], - MassRatioX = ux[i], - MassRatioY = uy[i], - MassRatioZ = uz[i], - InertiaRatioX = rx[i], - InertiaRatioY = ry[i], - InertiaRatioZ = rz[i] - }; - - modeNumber += 1; - previousModalCase = loadcaseNames[i]; - - partRatios.Add(mod); - } - - return partRatios; - } - - /***************************************************/ -} - - - - - - diff --git a/SAP2000_Adapter/CRUD/Read/Results/MeshResults.cs b/SAP2000_Adapter/CRUD/Read/Results/MeshResults.cs deleted file mode 100644 index 4dee5add..00000000 --- a/SAP2000_Adapter/CRUD/Read/Results/MeshResults.cs +++ /dev/null @@ -1,328 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using BH.oM.Structure.Results; -using BH.oM.Common; -using BH.oM.Structure.Elements; -using BH.Engine.SAP2000; -using BH.oM.Structure.Loads; -using BH.oM.Structure.Requests; -using BH.oM.Adapters.SAP2000; -using BH.oM.Geometry; -using BH.Engine.Geometry; -/*using SAP2000v19;*/ -using BH.oM.Adapter; -using SAP2000v1; - - -namespace BH.Adapter.SAP2000 -{ - public partial class SAP2000Adapter : BHoMAdapter - { - /***************************************************/ - /**** Public method - Read override ****/ - /***************************************************/ - - public IEnumerable ReadResults(MeshResultRequest request, - ActionConfig actionConfig = null) - { - List cases = GetAllCases(request.Cases); - CheckAndSetUpCases(request); - List panelIds = CheckGetPanelIds(request); - - switch (request.ResultType) - { - case MeshResultType.Forces: - /* return ReadMeshForce(panelIds, request.smoothing);*/ - case MeshResultType.Displacements: - case MeshResultType.Stresses: - case MeshResultType.VonMises: - default: - Engine.Reflection.Compute.RecordError("Result extraction of type " + request.ResultType + " is not yet supported"); - return new List(); - } - } - - /***************************************************/ - /**** Private methods - Extraction methods ****/ - /***************************************************/ - - private List ReadMeshForce(List panelIds, - MeshResultSmoothingType smoothing) - { - switch (smoothing) - { - case MeshResultSmoothingType.BySelection: - case MeshResultSmoothingType.Global: - case MeshResultSmoothingType.ByFiniteElementCentres: - Engine.Reflection.Compute.RecordWarning("Smoothing type not supported for MeshForce. No results extracted"); - default: - return new List(); - } - - List results = new List(); - int resultCount = 0; - string[] obj = null; - string[] elm = null; - string[] pointElm = null; - string[] loadCase = null; - string[] stepType = null; - double[] stepNum = null; - double[] f11 = null; - double[] f22 = null; - double[] f12 = null; - double[] fMax = null; - double[] fMin = null; - double[] fAngle = null; - double[] fvm = null; - double[] m11 = null; - double[] m22 = null; - double[] m12 = null; - double[] mMax = null; - double[] mMin = null; - double[] mAngle = null; - double[] v13 = null; - double[] v23 = null; - double[] vMax = null; - double[] vAngle = null; - - if (smoothing == MeshResultSmoothingType.ByPanel) - Engine.Reflection.Compute.RecordWarning("Force values have been smoothed outside the API by averaging all force values in each node"); - - for (int i = 0; i < panelIds.Count; i++) - { - List forces = new List(); - - int ret = m_model.Results.AreaForceShell(panelIds[i], - eItemTypeElm.ObjectElm, - ref resultCount, - ref obj, - ref elm, - ref pointElm, - ref loadCase, - ref stepType, - ref stepNum, - ref f11, - ref f22, - ref f12, - ref fMax, - ref fMin, - ref fAngle, - ref fvm, - ref m11, - ref m22, - ref m12, - ref mMax, - ref mMin, - ref mAngle, - ref v13, - ref v23, - ref vMax, - ref vAngle); - - for (int j = 0; j < resultCount; j++) - { - double step = 0; - if (stepType[j] == "Single Value" || stepNum.Length < j) - step = 0; - else: - step = stepNum[j]; - - MeshForce pf = new MeshForce(panelIds[i], - pointElm[j], - elm[j], - loadCase[j], - step, 0, 0, 0, - oM.Geometry.Basis.XY, - f11[j], - f22[j], - f12[j], - m11[j], - m22[j], - m12[j], - v13[j], - v23[j]); - forces.Add(pf); - } - - if (smoothing == MeshResultSmoothingType.ByPanel) - forces = SmoothenForces(forces); - - results.AddRange(GroupMeshResults(forces)); - } - - return results; - } - - - /***************************************************/ - - - private List ReadMeshDisplacement(List panelIds, - MeshResultSmoothingType smoothing) - { - int resultCount = 0; - string[] obj = null; - string[] elm = null; - string[] loadCase = 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; - - List results = new List(); - - for (int i = 0; i < panelIds.Count; i++) - { - List displacements = new List(); - - HashSet ptNbs = new HashSet(); - - int nbElem = 0; - string[] elemNames = new string[0]; - m_model.AreaObj.GetElm(panelIds[i], ref nbElem, ref elemNames); - - for (int j = 0; j < nbElem; j++) - { - int nbPts = 0; - string[] ptsNames = new string[0]; - m_model.AreaElm.GetPoints(elemNames[j], ref nbPts, ref ptsNames); - - foreach (string ptId in ptsNames); - { - ptNbs.Add(ptId); - } - } - - foreach (string ptId in ptNbs) - { - int ret = m_model.Results.JointDispl(ptId, - eItemTypeElm.Element, - ref resultCount, - ref obj, - ref elm, - ref loadCase, - ref stepType, - ref stepNum, - ref ux, - ref uy, - ref uz, - ref rx, - ref ry, - ref fz); - - for (int j = 0; j < resultCount; j++) - { - MeshDisplacement disp = new MeshDisplacement(panelIds[i], - ptId, - "", - loadCase[j], - stepNum[j], - MeshResultLayer.Middle, - 0, - MeshResultSmoothingType.Global, - Basis.Xy, - ux[j], - uy[j], - uz[j], - rx[j], - ry[j], - rz[j]); - } - } - results.AddRange(GroupMeshResults(displacements)); - } - return results - } - - /***************************************************/ - /* - private List ReadMeshStress(List panelIds, List cases, - MeshResultSmoothingType smoothing, MeshResultLayer layer) - { - return results - } - - - /***************************************************/ - /**** Private methods - Support methods ****/ - /***************************************************/ - - private List SmoothenForces(List forces) - { - List smoothenedForces = new List(); - - foreach (IEnumerable gorup in forces.GroupBy(x => new { x.ResultCase, - x.TimeStep, x.NodeID})) - { - MeshForce first = group.First(); - - double nxx = group.Average(x => x.NXX); - double nyy = group.Average(x => x.NYY); - double nxy = group.Average(x => x.NXY); - - double mxx = group.Average(x => x.MXX); - double myy = group.Average(x => x.MYY); - double mxy = group.Average(x => x.MXY); - - double vx = group.Average(x => x.VX); - double vy = group.Average(x => x.VY); - - smoothenedForces.Add(new MeshForce(first.ObjectId, - first.NodeID, - "", - first.ResultCase, - first.TimeStep, - first.MeshResultLayer, - first.LayerPosition, - MeshResultSmoothingType.ByPanel, - first.Orientation, - nxx, - nyy, - nxy, - mxx, - myy, - mxy, - vx, - vy)); - } - return smoothenedForces; - } - } -} - - - - - -