From fd83bd4d39d4e7dc502d3f67185984cda7ae87af Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Thu, 14 Mar 2024 14:25:59 +0100 Subject: [PATCH 01/14] GSAGH-478 static pdelta --- .../4_Analysis/CreateAnalysisTask.cs | 26 +++-- .../Components/4_Analysis/EditAnalysisTask.cs | 4 +- .../Parameters/4_Analysis/GsaAnalysisTask.cs | 22 ++--- .../4_Analysis/GsaAnalysisTaskTest.cs | 75 +++++++++++++-- .../3_Components/0_Model/CreateModelTest.cs | 94 ------------------- .../0_Model/GetModelAnalysisTests.cs | 4 +- .../4_Analysis/CreateAnalysisTaskTests.cs | 4 +- .../4_Analysis/EditAnalysisTaskTests.cs | 4 +- .../Assemble/AssembleModelTestsLoads.cs | 3 +- .../4_Analysis/AnalysisTaskAndCaseTest.cs | 4 +- 10 files changed, 104 insertions(+), 136 deletions(-) diff --git a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs index 8f4f1502f..ef4ae23ba 100644 --- a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs @@ -3,6 +3,7 @@ using System.Drawing; using Grasshopper.Kernel; using Grasshopper.Kernel.Types; +using GsaAPI; using GsaGH.Helpers.GH; using GsaGH.Parameters; using GsaGH.Properties; @@ -97,18 +98,27 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { "Default Task has been created; it will by default contain all cases found in model"); } - if (_tasktype != AnalysisTaskType.Static) { - this.AddRuntimeWarning("It is currently not possible to adjust the solver settings. " - + Environment.NewLine - + "Please verify the solver settings in GSA ('Task and Cases' -> 'Analysis Tasks')"); + AnalysisTask task = null; + switch (_tasktype) { + case AnalysisTaskType.Static: + task = null; + break; + + case AnalysisTaskType.StaticPDelta: + task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("", new GeometricStiffnessFromResultCase(1)); + break; + + default: + this.AddRuntimeWarning("It is currently not possible to create Analysis Tasks of type " + _tasktype); + break; } - var task = new GsaAnalysisTask { - Name = name, + var gsaAnalysisTask = new GsaAnalysisTask() { Cases = cases, - Type = _tasktype, + Task = task, }; - da.SetData(0, new GsaAnalysisTaskGoo(task)); + + da.SetData(0, new GsaAnalysisTaskGoo(gsaAnalysisTask)); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/4_Analysis/EditAnalysisTask.cs b/GsaGH/Components/4_Analysis/EditAnalysisTask.cs index 55dbaee1f..60b6cf39c 100644 --- a/GsaGH/Components/4_Analysis/EditAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/EditAnalysisTask.cs @@ -84,7 +84,7 @@ public class EditAnalysisTask : GH_OasysComponent { } da.SetData(0, new GsaAnalysisTaskGoo(gsaTask)); - da.SetData(1, gsaTask.Name); + da.SetData(1, gsaTask.Task.Name); if (gsaTask.Cases != null) { da.SetDataList(2, new List(gsaTask.Cases.Select(x => new GsaAnalysisCaseGoo(x)))); @@ -92,7 +92,7 @@ public class EditAnalysisTask : GH_OasysComponent { da.SetData(2, null); } - da.SetData(3, gsaTask.Type.ToString()); + da.SetData(3, gsaTask.Task.Type.ToString()); da.SetData(4, gsaTask.Id); } else { string type = analysisTaskGoo.Value.GetType().ToString(); diff --git a/GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs b/GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs index e360660d7..010115a39 100644 --- a/GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs +++ b/GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs @@ -7,49 +7,39 @@ namespace GsaGH.Parameters { /// /// An analysis task is a package of work for the solver. Thus we can have a static analysis task, a modal analysis task, etc. Each analysis task has one or more analysis case(s). The distinction is that the cases corresponds to result sets and define items such as loading (in the static case) while the task describes what the solver has to do. - /// In Grasshopper, it is only possible to create linear static analysis tasks. /// Refer to Analysis Tasks to read more. /// public class GsaAnalysisTask { - public List Cases { get; set; } = null; + public List Cases { get; set; } = new List(); public int Id { get; set; } = 0; - public string Name { get; set; } - public AnalysisTaskType Type { get; set; } + public AnalysisTask Task { get; internal set; } = null; public GsaAnalysisTask() { Id = 0; - Cases = new List(); - Type = AnalysisTaskType.Static; } internal GsaAnalysisTask(int id, AnalysisTask task, Model model) { Id = id; - Cases = new List(); foreach (int caseId in task.Cases) { string caseName = model.AnalysisCaseName(caseId); string caseDescription = model.AnalysisCaseDescription(caseId); Cases.Add(new GsaAnalysisCase(caseId, caseName, caseDescription)); } - Type = (AnalysisTaskType)task.Type; - Name = task.Name; + Task = task; } public GsaAnalysisTask Duplicate() { var dup = new GsaAnalysisTask { Id = Id, + Cases = Cases.ToList(), + Task = Task // ??? }; - if (Cases != null) { - dup.Cases = Cases.ToList(); - } - - dup.Type = Type; - dup.Name = Name; return dup; } public override string ToString() { - return (Id > 0 ? $"ID:{Id} " : string.Empty) + $"'{Name}' {Type}".Replace("_", " ") + return (Id > 0 ? $"ID:{Id} " : string.Empty) + $"'{Task.Name}' {Task.Type}".Replace("_", " ") .TrimSpaces(); } diff --git a/GsaGHTests/1_BaseParameters/4_Analysis/GsaAnalysisTaskTest.cs b/GsaGHTests/1_BaseParameters/4_Analysis/GsaAnalysisTaskTest.cs index 11063486e..f274ccafd 100644 --- a/GsaGHTests/1_BaseParameters/4_Analysis/GsaAnalysisTaskTest.cs +++ b/GsaGHTests/1_BaseParameters/4_Analysis/GsaAnalysisTaskTest.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using GsaAPI; using GsaGH.Parameters; using GsaGHTests.Helpers; using Xunit; @@ -8,7 +9,7 @@ namespace GsaGHTests.Parameters { public class GsaAnalysisTaskTest { [Fact] - public void DuplicateTest() { + public void DuplicateStaticTest() { var original = new GsaAnalysisTask(); GsaAnalysisTask duplicate = original.Duplicate(); @@ -16,13 +17,73 @@ public class GsaAnalysisTaskTest { Duplicates.AreEqual(original, duplicate); duplicate.Id = 1; - duplicate.Name = "name"; - duplicate.Type = AnalysisTaskType.Buckling; + duplicate.Task.Name = "name"; + duplicate.Task.Type = (int)AnalysisTaskType.Buckling; duplicate.Cases = new List(); Assert.Equal(0, original.Id); - Assert.Null(original.Name); - Assert.Equal(AnalysisTaskType.Static, original.Type); + Assert.Null(original.Task.Name); + Assert.Equal((int)AnalysisTaskType.Static, original.Task.Type); + Assert.Empty(original.Cases); + } + + [Fact] + public void DuplicateStaticPDeltaWithGeometricStiffnessFromLoadCaseTest() { + var original = new GsaAnalysisTask { + Id = 1, + Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task1", new GeometricStiffnessFromLoadCase("L1")) + }; + + GsaAnalysisTask duplicate = original.Duplicate(); + + Duplicates.AreEqual(original, duplicate); + + duplicate.Id = 2; + duplicate.Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task2", new GeometricStiffnessFromResultCase(1)); + + Assert.Equal(1, original.Id); + Assert.Equal("task1", original.Task.Name); + Assert.Equal((int)AnalysisTaskType.StaticPDelta, original.Task.Type); + Assert.Empty(original.Cases); + } + + [Fact] + public void DuplicateStaticPDeltaWithGeometricStiffnessFromOwnLoadTest() { + var original = new GsaAnalysisTask { + Id = 1, + Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task1", new GeometricStiffnessFromOwnLoad()) + }; + + GsaAnalysisTask duplicate = original.Duplicate(); + + Duplicates.AreEqual(original, duplicate); + + duplicate.Id = 2; + duplicate.Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task2", new GeometricStiffnessFromResultCase(1)); + + Assert.Equal(1, original.Id); + Assert.Equal("task1", original.Task.Name); + Assert.Equal((int)AnalysisTaskType.StaticPDelta, original.Task.Type); + Assert.Empty(original.Cases); + } + + [Fact] + public void DuplicateStaticPDeltaWithGeometricStiffnessFromResultCaseTest() { + var original = new GsaAnalysisTask { + Id = 1, + Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task1", new GeometricStiffnessFromResultCase(1)) + }; + + GsaAnalysisTask duplicate = original.Duplicate(); + + Duplicates.AreEqual(original, duplicate); + + duplicate.Id = 2; + duplicate.Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task2", new GeometricStiffnessFromOwnLoad()); + + Assert.Equal(1, original.Id); + Assert.Equal("task1", original.Task.Name); + Assert.Equal((int)AnalysisTaskType.StaticPDelta, original.Task.Type); Assert.Empty(original.Cases); } @@ -31,8 +92,8 @@ public class GsaAnalysisTaskTest { var task = new GsaAnalysisTask(); Assert.Equal(0, task.Id); - Assert.Null(task.Name); - Assert.Equal(AnalysisTaskType.Static, task.Type); + Assert.Null(task.Task.Name); + Assert.Equal((int)AnalysisTaskType.Static, task.Task.Type); Assert.Empty(task.Cases); } } diff --git a/GsaGHTests/3_Components/0_Model/CreateModelTest.cs b/GsaGHTests/3_Components/0_Model/CreateModelTest.cs index dc9704e85..2ad8bf2b6 100644 --- a/GsaGHTests/3_Components/0_Model/CreateModelTest.cs +++ b/GsaGHTests/3_Components/0_Model/CreateModelTest.cs @@ -11,100 +11,6 @@ namespace GsaGHTests.Model { [Collection("GrasshopperFixture collection")] public class CreateModelTest { - public static GH_OasysDropDownComponent CreateModel( - List models, List sections, List prop2ds, - List prop3ds, List springProps, List node, - List elem1d, List elem2d, List mem1d, - List mem2d, List mem3d, ModelUnit unit, List loads, - List gridPlaneSurfaces) { - var comp = new CreateModel(); - comp.CreateAttributes(); - comp.Params.Input[0].DataMapping = GH_DataMapping.Flatten; - comp.Params.Input[1].DataMapping = GH_DataMapping.Flatten; - comp.Params.Input[2].DataMapping = GH_DataMapping.Flatten; - comp.Params.Input[3].DataMapping = GH_DataMapping.Flatten; - comp.SetSelected(0, (int)unit); - if (models != null) { - foreach (GsaModel input in models) { - ComponentTestHelper.SetInput(comp, input, 0); - } - } - - if (sections != null) { - foreach (GsaSection input in sections) { - ComponentTestHelper.SetInput(comp, input, 1); - } - } - - if (prop2ds != null) { - foreach (GsaProperty2d input in prop2ds) { - ComponentTestHelper.SetInput(comp, input, 1); - } - } - - if (prop3ds != null) { - foreach (GsaProperty3d input in prop3ds) { - ComponentTestHelper.SetInput(comp, input, 1); - } - } - - if (springProps != null) { - foreach (GsaSpringProperty input in springProps) { - ComponentTestHelper.SetInput(comp, input, 1); - } - } - - if (node != null) { - foreach (GsaNodeGoo input in node) { - ComponentTestHelper.SetInput(comp, input, 2); - } - } - - if (elem1d != null) { - foreach (GsaElement1dGoo input in elem1d) { - ComponentTestHelper.SetInput(comp, input, 2); - } - } - - if (elem2d != null) { - foreach (GsaElement2dGoo input in elem2d) { - ComponentTestHelper.SetInput(comp, input, 2); - } - } - - if (mem1d != null) { - foreach (GsaMember1dGoo input in mem1d) { - ComponentTestHelper.SetInput(comp, input, 2); - } - } - - if (mem2d != null) { - foreach (GsaMember2dGoo input in mem2d) { - ComponentTestHelper.SetInput(comp, input, 2); - } - } - - if (mem3d != null) { - foreach (GsaMember3dGoo input in mem3d) { - ComponentTestHelper.SetInput(comp, input, 2); - } - } - - if (loads != null) { - foreach (IGsaLoad input in loads) { - ComponentTestHelper.SetInput(comp, input, 3); - } - } - - if (gridPlaneSurfaces != null) { - foreach (GsaGridPlaneSurface input in gridPlaneSurfaces) { - ComponentTestHelper.SetInput(comp, input, 3); - } - } - - return comp; - } - public static GH_OasysDropDownComponent CreateModelFromGeometry( List node, List elem1d, List elem2d, List mem1d, List mem2d, List mem3d, diff --git a/GsaGHTests/3_Components/0_Model/GetModelAnalysisTests.cs b/GsaGHTests/3_Components/0_Model/GetModelAnalysisTests.cs index d973f306c..75620a2d3 100644 --- a/GsaGHTests/3_Components/0_Model/GetModelAnalysisTests.cs +++ b/GsaGHTests/3_Components/0_Model/GetModelAnalysisTests.cs @@ -24,8 +24,8 @@ public class GetModelAnalysisTests { Assert.NotNull(taskGoo); Assert.Equal(1, taskGoo.Value.Id); Assert.Equal(2, taskGoo.Value.Cases.Count); - Assert.Equal("Task 1", taskGoo.Value.Name); - Assert.Equal(AnalysisTaskType.Static, taskGoo.Value.Type); + Assert.Equal("Task 1", taskGoo.Value.Task.Name); + Assert.Equal((int)AnalysisTaskType.Static, taskGoo.Value.Task.Type); Assert.NotNull(caseGoo); Assert.Equal(1, caseGoo.Value.Id); diff --git a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs index abf11fcbb..681edfc2f 100644 --- a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs @@ -26,8 +26,8 @@ public class CreateAnalysisTaskTests { var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); - Assert.Equal("my Task", output.Value.Name); - Assert.Equal(AnalysisTaskType.Static, output.Value.Type); + Assert.Equal("my Task", output.Value.Task.Name); + Assert.Equal((int)AnalysisTaskType.Static, output.Value.Task.Type); Assert.Equal("my Case", output.Value.Cases[0].Name); Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); } diff --git a/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs index 8695edecb..b611a8d7d 100644 --- a/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs @@ -27,8 +27,8 @@ public class EditAnalysisTaskTests { var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); - Assert.Equal("my Task", output.Value.Name); - Assert.Equal(AnalysisTaskType.Static, output.Value.Type); + Assert.Equal("my Task", output.Value.Task.Name); + Assert.Equal((int)AnalysisTaskType.Static, output.Value.Task.Type); Assert.Equal("my Case", output.Value.Cases[0].Name); Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); } diff --git a/GsaGHTests/Helpers/Assemble/AssembleModelTestsLoads.cs b/GsaGHTests/Helpers/Assemble/AssembleModelTestsLoads.cs index 6753ce891..8940317a2 100644 --- a/GsaGHTests/Helpers/Assemble/AssembleModelTestsLoads.cs +++ b/GsaGHTests/Helpers/Assemble/AssembleModelTestsLoads.cs @@ -2,6 +2,7 @@ using GsaGH.Parameters; using GsaGHTests.Helper; using GsaGHTests.Model; +using OasysGH.Components; using Xunit; using LoadCaseType = GsaGH.Parameters.LoadCaseType; @@ -216,7 +217,7 @@ public partial class AssembleModelTests { var steelExample = new GsaModel(); steelExample.Model.Open(GsaFile.SteelDesignSimple); - OasysGH.Components.GH_OasysDropDownComponent assemblyComponent = CreateModelTest.CreateModelFromModels(new List() { + GH_OasysDropDownComponent assemblyComponent = CreateModelTest.CreateModelFromModels(new List() { new GsaModelGoo(steelExample), loadModelGoo, }); diff --git a/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs b/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs index 392509eae..ec3c89742 100644 --- a/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs +++ b/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs @@ -111,14 +111,14 @@ public class GetCreateAnalysisTaskAndCaseTest { var output = (GsaAnalysisTaskGoo)param.VolatileData.get_Branch(0)[0]; GsaAnalysisTask gsaghobject = output.Value; - Assert.Equal("Task 1", gsaghobject.Name); + Assert.Equal("Task 1", gsaghobject.Task.Name); Assert.Equal(1, gsaghobject.Id); Assert.Equal(2, gsaghobject.Cases.Count); Assert.Equal("DL", gsaghobject.Cases[0].Name); Assert.Equal("LL", gsaghobject.Cases[1].Name); Assert.Equal("L1", gsaghobject.Cases[0].Definition); Assert.Equal("L2", gsaghobject.Cases[1].Definition); - Assert.Equal(AnalysisTaskType.Static, gsaghobject.Type); + Assert.Equal((int)AnalysisTaskType.Static, gsaghobject.Task.Type); } [Fact] From 2b273d1c05d6db93b93fd5aa1150db39ce53878a Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Thu, 28 Mar 2024 09:30:28 +0100 Subject: [PATCH 02/14] GSAGH-478 static analysis task --- GsaGH/Components/0_Model/CreateModel.cs | 2 +- GsaGH/Components/0_Model/GetModelAnalysis.cs | 4 +- GsaGH/Components/0_Model/GetModelGeometry.cs | 2 +- GsaGH/Components/0_Model/GetModelLoads.cs | 2 +- GsaGH/Components/0_Model/ModelUnits.cs | 2 +- GsaGH/Components/0_Model/SaveGsaModel.cs | 2 +- .../0_Model/SteelSectionPoolNames.cs | 4 +- .../2_Geometry/CreateElementsFromMembers.cs | 2 +- .../2_Geometry/ExpandBeamToShell.cs | 8 +- GsaGH/Components/2_Geometry/LocalAxes.cs | 8 +- GsaGH/Components/4_Analysis/AnalyseModel.cs | 14 +-- .../4_Analysis/CreateAnalysisTask.cs | 6 +- .../Components/4_Analysis/EditAnalysisTask.cs | 14 +-- GsaGH/Components/4_Analysis/SteelDesign.cs | 6 +- GsaGH/Components/5_Results/GetResult.cs | 6 +- GsaGH/Components/5_Results/SelectResults.cs | 10 +- .../6_Display/AssemblyResultDiagrams.cs | 2 +- GsaGH/Components/6_Display/AssemblyResults.cs | 6 +- .../Components/6_Display/Contour1dResults.cs | 6 +- .../Components/6_Display/Contour2dResults.cs | 4 +- .../Components/6_Display/Contour3dResults.cs | 4 +- .../6_Display/ContourNodeResults.cs | 2 +- GsaGH/Components/6_Display/LoadDiagrams.cs | 2 +- .../Components/6_Display/Preview3dSections.cs | 2 +- .../6_Display/ReactionForceDiagrams.cs | 4 +- GsaGH/Components/6_Display/ResultDiagrams.cs | 2 +- .../99_Obsolete/GetModelGeometry_OBSOLETE.cs | 2 +- GsaGH/Helpers/Assembly/ModelAssembly.cs | 8 +- GsaGH/Helpers/GH/Inputs.cs | 18 ++-- GsaGH/Helpers/GsaAPI/Results/ResultsInfo.cs | 6 +- GsaGH/Helpers/GsaCOM/GsaComHelper.cs | 4 +- GsaGH/Helpers/Import/Elements.cs | 4 +- GsaGH/Helpers/Import/Members.cs | 2 +- GsaGH/Helpers/MergeModels.cs | 28 +++--- GsaGH/Parameters/0_Model/GsaList.cs | 14 +-- GsaGH/Parameters/0_Model/GsaModel.cs | 70 +++++++------- .../2_Geometry/GsaElementFactory.cs | 6 +- .../Parameters/2_Geometry/Section3dPreview.cs | 4 +- .../Parameters/4_Analysis/GsaAnalysisTask.cs | 15 +-- .../4_Analysis/GsaSteelDesignTask.cs | 2 +- .../5_Results/2_Results/GsaResult.cs | 24 ++--- .../1_BaseParameters/0_Model/GsaListTest.cs | 8 +- .../1_BaseParameters/0_Model/GsaModelTest.cs | 12 +-- .../GsaBucklingLengthFactorsTest.cs | 4 +- .../4_Analysis/GsaAnalysisTaskTest.cs | 88 +---------------- ...lement1dAverageStrainEnergyDensityTests.cs | 4 +- .../Element1dDerivedStressTests.cs | 4 +- .../Element1dDisplacementsTests.cs | 4 +- .../Element1dInternalForcesTests.cs | 4 +- .../Element1dStrainEnergyDensityTests.cs | 4 +- .../Collections/Element1dStressTests.cs | 4 +- .../Element2dDisplacementsTests.cs | 4 +- .../Collections/Element2dForcesTests.cs | 4 +- .../Collections/Element2dMomentsTests.cs | 4 +- .../Collections/Element2dShearForcesTests.cs | 4 +- .../Collections/Element2dStressesTests.cs | 4 +- .../Collections/Element3dStressesTests.cs | 4 +- .../Collections/Element3dTranslationsTests.cs | 4 +- .../5_Results/Collections/GsaResultTests.cs | 4 +- .../Collections/Member1dDisplacementsTests.cs | 4 +- .../Collections/Member1dForcesTests.cs | 4 +- .../NodalForcesAndMomentsCacheTests.cs | 4 +- .../Collections/NodeDisplacementsTests.cs | 4 +- .../Collections/NodeFootfallTests.cs | 2 +- .../Collections/NodeReactionForcesTests.cs | 4 +- .../Collections/NodeSpringForcesCacheTests.cs | 4 +- .../SteelDesignEffectiveLengthTests.cs | 4 +- .../Collections/SteelUtilisationTests.cs | 4 +- .../5_Results/GsaResultAnalysisCaseTests.cs | 4 +- GsaGHTests/2_GooWrappers/GH_OasysGooTest.cs | 2 +- .../0_Model/CreateGridLineTest.cs | 2 +- .../0_Model/GetModelAnalysisTests.cs | 6 +- .../0_Model/SteelSectionPoolNamesTests.cs | 2 +- GsaGHTests/3_Components/0_Model/TitlesTest.cs | 2 +- GsaGHTests/3_Components/0_Model/UnitsTest.cs | 2 +- .../4_Analysis/CreateAnalysisTaskTests.cs | 4 +- .../4_Analysis/EditAnalysisTaskTests.cs | 36 +++---- .../5_Results/BeamDerivedStressesTests.cs | 2 +- .../5_Results/BeamDisplacementsTests.cs | 2 +- .../5_Results/BeamForcesAndMomentsTests.cs | 2 +- .../BeamStrainEnergyDensityAverageTests.cs | 2 +- .../5_Results/BeamStrainEnergyDensityTests.cs | 2 +- .../5_Results/BeamStressesTests.cs | 2 +- .../5_Results/Element2dDisplacementsTests.cs | 2 +- .../Element2dForcesAndMomentsForcesTests.cs | 2 +- .../Element2dForcesAndMomentsMomentsTests.cs | 2 +- .../Element2dForcesAndMomentsShearsTests.cs | 2 +- .../5_Results/Element2dStressesTests.cs | 2 +- .../5_Results/Element3dDisplacementsTests.cs | 2 +- .../5_Results/Element3dStressesTests.cs | 2 +- .../5_Results/FootfallResultsTests.cs | 2 +- .../3_Components/5_Results/GetResultsTest.cs | 6 +- .../5_Results/Member1dDisplacementsTests.cs | 2 +- .../Member1dForcesAndMomentsTests.cs | 2 +- .../5_Results/NodeDisplacementsTests.cs | 4 +- .../5_Results/ReactionForcesTests.cs | 4 +- .../5_Results/SpringReactionForcesTests.cs | 4 +- .../Assemble/AssembleModelTestsHelper.cs | 32 +++---- .../Assemble/AssembleModelTestsLoads.cs | 96 +++++++++---------- .../Helpers/GH/InputsForModelAssemblyTests.cs | 40 ++++---- .../4_Analysis/AnalysisTaskAndCaseTest.cs | 4 +- 101 files changed, 365 insertions(+), 452 deletions(-) diff --git a/GsaGH/Components/0_Model/CreateModel.cs b/GsaGH/Components/0_Model/CreateModel.cs index 8a8f4ea36..f476dda38 100644 --- a/GsaGH/Components/0_Model/CreateModel.cs +++ b/GsaGH/Components/0_Model/CreateModel.cs @@ -169,7 +169,7 @@ public class CreateModel : GH_OasysDropDownComponent { // Assemble model var assembly = new ModelAssembly(model, lists, gridLines, geometry, properties, loading, analysis, _lengthUnit, ToleranceMenu.Tolerance, _reMesh, this); - model.Model = assembly.GetModel(); + model.ApiModel = assembly.GetModel(); ToleranceMenu.UpdateMessage(this, _lengthUnit); diff --git a/GsaGH/Components/0_Model/GetModelAnalysis.cs b/GsaGH/Components/0_Model/GetModelAnalysis.cs index c6445b145..2b841b0e1 100644 --- a/GsaGH/Components/0_Model/GetModelAnalysis.cs +++ b/GsaGH/Components/0_Model/GetModelAnalysis.cs @@ -62,9 +62,9 @@ public class GetModelAnalysis : GH_OasysComponent { Tuple, List> tuple = modelGoo.Value.GetAnalysisTasksAndCombinations(); - var combinationCaseGoos = modelGoo.Value.Model.CombinationCases().Select(keyValuePair + var combinationCaseGoos = modelGoo.Value.ApiModel.CombinationCases().Select(keyValuePair => new GsaCombinationCaseGoo(new GsaCombinationCase(keyValuePair))).ToList(); - var designTaskGoos = modelGoo.Value.Model.SteelDesignTasks().Select(keyValuePair + var designTaskGoos = modelGoo.Value.ApiModel.SteelDesignTasks().Select(keyValuePair => new GsaDesignTaskGoo(new GsaSteelDesignTask(keyValuePair, modelGoo.Value))).ToList(); da.SetDataList(0, tuple.Item1); da.SetDataList(1, tuple.Item2); diff --git a/GsaGH/Components/0_Model/GetModelGeometry.cs b/GsaGH/Components/0_Model/GetModelGeometry.cs index 19cbb5ba4..e52b88608 100644 --- a/GsaGH/Components/0_Model/GetModelGeometry.cs +++ b/GsaGH/Components/0_Model/GetModelGeometry.cs @@ -701,7 +701,7 @@ private enum FoldMode { switch (i) { case 0: _results.Nodes = Nodes.GetNodes( - nodeList.ToLower() == "all" ? model.ApiNodes : model.Model.Nodes(nodeList), + nodeList.ToLower() == "all" ? model.ApiNodes : model.ApiModel.Nodes(nodeList), model.ModelUnit, model.ApiAxis, model.SpringProps); diff --git a/GsaGH/Components/0_Model/GetModelLoads.cs b/GsaGH/Components/0_Model/GetModelLoads.cs index 63059d319..b9d627202 100644 --- a/GsaGH/Components/0_Model/GetModelLoads.cs +++ b/GsaGH/Components/0_Model/GetModelLoads.cs @@ -92,7 +92,7 @@ public class GetModelLoads : GH_OasysDropDownComponent { GsaModelGoo modelGoo = null; da.GetData(0, ref modelGoo); - GsaAPI.Model model = modelGoo.Value.Model; + GsaAPI.Model model = modelGoo.Value.ApiModel; ReadOnlyDictionary loadCases = model.LoadCases(); List cases = GsaLoadFactory.CreateLoadCasesFromApi(loadCases); List gravity = GsaLoadFactory.CreateGravityLoadsFromApi(model.GravityLoads(), loadCases); diff --git a/GsaGH/Components/0_Model/ModelUnits.cs b/GsaGH/Components/0_Model/ModelUnits.cs index 03e1fd12f..b45d6af08 100644 --- a/GsaGH/Components/0_Model/ModelUnits.cs +++ b/GsaGH/Components/0_Model/ModelUnits.cs @@ -226,7 +226,7 @@ public class ModelUnits : GH_OasysComponent { i = 0; - da.SetData(i++, new GsaModelGoo(new GsaModel(model.Model))); + da.SetData(i++, new GsaModelGoo(new GsaModel(model.ApiModel))); da.SetData(i++, units.Acceleration.ToString()); da.SetData(i++, units.Angle.ToString()); da.SetData(i++, units.Energy.ToString()); diff --git a/GsaGH/Components/0_Model/SaveGsaModel.cs b/GsaGH/Components/0_Model/SaveGsaModel.cs index 92ec7e303..f1b59ff3e 100644 --- a/GsaGH/Components/0_Model/SaveGsaModel.cs +++ b/GsaGH/Components/0_Model/SaveGsaModel.cs @@ -108,7 +108,7 @@ public class SaveGsaModel : GH_OasysDropDownComponent { Directory.CreateDirectory(Path.GetDirectoryName(fileNameAndPath) ?? string.Empty); - string mes = model.Model.SaveAs(fileNameAndPath).ToString(); + string mes = model.ApiModel.SaveAs(fileNameAndPath).ToString(); if (mes == ReturnValue.GS_OK.ToString()) { _fileNameLastSaved = fileNameAndPath; PostHog.ModelIO(GsaGH.PluginInfo.Instance, $"save{fileNameAndPath.Substring(fileNameAndPath.LastIndexOf('.') + 1).ToUpper()}", diff --git a/GsaGH/Components/0_Model/SteelSectionPoolNames.cs b/GsaGH/Components/0_Model/SteelSectionPoolNames.cs index 23088d147..4adf959dd 100644 --- a/GsaGH/Components/0_Model/SteelSectionPoolNames.cs +++ b/GsaGH/Components/0_Model/SteelSectionPoolNames.cs @@ -83,12 +83,12 @@ public class SteelSectionPoolNames : GH_OasysComponent { } if (ids.Count > 0) { - model.Model.SetSteelSectionPools(new ReadOnlyDictionary(sectionPools)); + model.ApiModel.SetSteelSectionPools(new ReadOnlyDictionary(sectionPools)); } var tree = new DataTree(); ReadOnlyDictionary sections = model.Sections; - ReadOnlyDictionary modelSectionPools = model.Model.SteelSectionPools(); + ReadOnlyDictionary modelSectionPools = model.ApiModel.SteelSectionPools(); foreach (int id in modelSectionPools.Keys) { var poolSections = new List(); foreach (GsaSectionGoo section in sections.Values) { diff --git a/GsaGH/Components/2_Geometry/CreateElementsFromMembers.cs b/GsaGH/Components/2_Geometry/CreateElementsFromMembers.cs index 8d2854bfb..4a061cc13 100644 --- a/GsaGH/Components/2_Geometry/CreateElementsFromMembers.cs +++ b/GsaGH/Components/2_Geometry/CreateElementsFromMembers.cs @@ -168,7 +168,7 @@ public class CreateElementsFromMembers : GH_OasysDropDownComponent { Model gsa = assembly.GetModel(); var outModel = new GsaModel { - Model = gsa, + ApiModel = gsa, ModelUnit = _lengthUnit, }; diff --git a/GsaGH/Components/2_Geometry/ExpandBeamToShell.cs b/GsaGH/Components/2_Geometry/ExpandBeamToShell.cs index 846900345..be7fc58c0 100644 --- a/GsaGH/Components/2_Geometry/ExpandBeamToShell.cs +++ b/GsaGH/Components/2_Geometry/ExpandBeamToShell.cs @@ -135,10 +135,10 @@ public class ExpandBeamToShell : GH_OasysComponent, IGH_VariableParameterCompone if (axes == null) { var assembly = new ModelAssembly(member); var model = new GsaModel { - Model = assembly.GetModel() + ApiModel = assembly.GetModel() }; - axes = new Parameters.LocalAxes(model.Model.MemberDirectionCosine(1)); + axes = new Parameters.LocalAxes(model.ApiModel.MemberDirectionCosine(1)); } crv = member.PolyCurve.DuplicatePolyCurve(); @@ -167,10 +167,10 @@ public class ExpandBeamToShell : GH_OasysComponent, IGH_VariableParameterCompone if (axes == null) { var assembly = new ModelAssembly(element); var model = new GsaModel() { - Model = assembly.GetModel() + ApiModel = assembly.GetModel() }; - axes = new Parameters.LocalAxes(model.Model.ElementDirectionCosine(1)); + axes = new Parameters.LocalAxes(model.ApiModel.ElementDirectionCosine(1)); } crv = new LineCurve(element.Line.PointAtStart, element.Line.PointAtEnd); diff --git a/GsaGH/Components/2_Geometry/LocalAxes.cs b/GsaGH/Components/2_Geometry/LocalAxes.cs index 54d1a2d72..5c60fc931 100644 --- a/GsaGH/Components/2_Geometry/LocalAxes.cs +++ b/GsaGH/Components/2_Geometry/LocalAxes.cs @@ -79,10 +79,10 @@ public class LocalAxes : GH_OasysComponent { if (axes == null) { var assembly = new ModelAssembly(member); var model = new GsaModel { - Model = assembly.GetModel() + ApiModel = assembly.GetModel() }; - axes = new Parameters.LocalAxes(model.Model.MemberDirectionCosine(1)); + axes = new Parameters.LocalAxes(model.ApiModel.MemberDirectionCosine(1)); this.AddRuntimeWarning( "Members´s local axes might deviate from the local axes in the assembled GSA model."); } @@ -102,10 +102,10 @@ public class LocalAxes : GH_OasysComponent { if (axes == null) { var assembly = new ModelAssembly(element); var model = new GsaModel() { - Model = assembly.GetModel() + ApiModel = assembly.GetModel() }; - axes = new Parameters.LocalAxes(model.Model.ElementDirectionCosine(1)); + axes = new Parameters.LocalAxes(model.ApiModel.ElementDirectionCosine(1)); this.AddRuntimeWarning( "Element´s local axes might deviate from the local axes in the assembled GSA model."); } diff --git a/GsaGH/Components/4_Analysis/AnalyseModel.cs b/GsaGH/Components/4_Analysis/AnalyseModel.cs index 0b9a1d11c..a6ddb4c4b 100644 --- a/GsaGH/Components/4_Analysis/AnalyseModel.cs +++ b/GsaGH/Components/4_Analysis/AnalyseModel.cs @@ -209,14 +209,14 @@ public class AnalyseModel : GH_OasysDropDownComponent { // Assemble model var assembly = new ModelAssembly(model, lists, gridLines, geometry, properties, loading, analysis, _lengthUnit, ToleranceMenu.Tolerance, _reMesh, this); - model.Model = assembly.GetModel(); + model.ApiModel = assembly.GetModel(); // Run analysis if (_analysis) { - IReadOnlyDictionary gsaTasks = model.Model.AnalysisTasks(); + IReadOnlyDictionary gsaTasks = model.ApiModel.AnalysisTasks(); if (gsaTasks.Count < 1) { var task = new GsaAnalysisTask { - Id = model.Model.AddAnalysisTask(), + Id = model.ApiModel.AddAnalysisTask(), }; task.CreateDefaultCases(model); if (task.Cases == null || task.Cases.Count == 0) { @@ -227,10 +227,10 @@ public class AnalyseModel : GH_OasysDropDownComponent { " Model contained no Analysis Tasks. Default Task has been created containing " + "all cases found in model"); foreach (GsaAnalysisCase ca in task.Cases) { - model.Model.AddAnalysisCaseToTask(task.Id, ca.Name, ca.Definition); + model.ApiModel.AddAnalysisCaseToTask(task.Id, ca.Name, ca.Definition); } - gsaTasks = model.Model.AnalysisTasks(); + gsaTasks = model.ApiModel.AnalysisTasks(); } } @@ -253,9 +253,9 @@ string message var errors = new List(); foreach (KeyValuePair task in gsaTasks) { - if (model.Model.Analyse(task.Key, out TaskReport report)) { + if (model.ApiModel.Analyse(task.Key, out TaskReport report)) { OasysGH.Helpers.PostHog.ModelIO(GsaGH.PluginInfo.Instance, "analyse", - model.Model.Elements().Count); + model.ApiModel.Elements().Count); } else { string message = "Analysis Task " + task.Key + " failed with one or more errors. Check report output for details"; diff --git a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs index ef4ae23ba..3f1d9cda3 100644 --- a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs @@ -101,11 +101,11 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { AnalysisTask task = null; switch (_tasktype) { case AnalysisTaskType.Static: - task = null; + task = AnalysisTaskFactory.CreateStaticAnalysisTask(name); break; case AnalysisTaskType.StaticPDelta: - task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("", new GeometricStiffnessFromResultCase(1)); + task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask(name, new GeometricStiffnessFromResultCase(1)); break; default: @@ -115,7 +115,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { var gsaAnalysisTask = new GsaAnalysisTask() { Cases = cases, - Task = task, + ApiTask = task, }; da.SetData(0, new GsaAnalysisTaskGoo(gsaAnalysisTask)); diff --git a/GsaGH/Components/4_Analysis/EditAnalysisTask.cs b/GsaGH/Components/4_Analysis/EditAnalysisTask.cs index 60b6cf39c..91c5b3780 100644 --- a/GsaGH/Components/4_Analysis/EditAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/EditAnalysisTask.cs @@ -31,7 +31,7 @@ public class EditAnalysisTask : GH_OasysComponent { pManager.AddParameter(new GsaAnalysisCaseParameter(), GsaAnalysisCaseGoo.Name + "(s)", GsaAnalysisCaseGoo.NickName, "Add list of " + GsaAnalysisCaseGoo.Name + " to task", GH_ParamAccess.list); - for (int i = 0; i < pManager.ParamCount; i++) { + for (int i = 1; i < pManager.ParamCount; i++) { pManager[i].Optional = true; } } @@ -49,11 +49,12 @@ public class EditAnalysisTask : GH_OasysComponent { } protected override void SolveInstance(IGH_DataAccess da) { - var gsaTask = new GsaAnalysisTask(); + GsaAnalysisTask gsaTask; GsaAnalysisTaskGoo analysisTaskGoo = null; - if (da.GetData(0, ref analysisTaskGoo)) { - gsaTask = analysisTaskGoo.Value.Duplicate(); + if (!da.GetData(0, ref analysisTaskGoo)) { + return; } + gsaTask = analysisTaskGoo.Value; if (gsaTask != null) { var ghTypes = new List(); @@ -84,7 +85,7 @@ public class EditAnalysisTask : GH_OasysComponent { } da.SetData(0, new GsaAnalysisTaskGoo(gsaTask)); - da.SetData(1, gsaTask.Task.Name); + da.SetData(1, gsaTask.ApiTask.Name); if (gsaTask.Cases != null) { da.SetDataList(2, new List(gsaTask.Cases.Select(x => new GsaAnalysisCaseGoo(x)))); @@ -92,7 +93,8 @@ public class EditAnalysisTask : GH_OasysComponent { da.SetData(2, null); } - da.SetData(3, gsaTask.Task.Type.ToString()); + var type = (AnalysisTaskType)gsaTask.ApiTask.Type; + da.SetData(3, type.ToString()); da.SetData(4, gsaTask.Id); } else { string type = analysisTaskGoo.Value.GetType().ToString(); diff --git a/GsaGH/Components/4_Analysis/SteelDesign.cs b/GsaGH/Components/4_Analysis/SteelDesign.cs index 4ba035228..925269f24 100644 --- a/GsaGH/Components/4_Analysis/SteelDesign.cs +++ b/GsaGH/Components/4_Analysis/SteelDesign.cs @@ -55,7 +55,7 @@ public class SteelDesign : GH_OasysComponent { da.GetData(0, ref modelGoo); int taskId = 0; ReadOnlyDictionary steelDesignTasks = - modelGoo.Value.Model.SteelDesignTasks(); + modelGoo.Value.ApiModel.SteelDesignTasks(); if (steelDesignTasks.Count == 0) { this.AddRuntimeError("Model contains no design tasks"); return; @@ -83,7 +83,7 @@ public class SteelDesign : GH_OasysComponent { TaskReport report = null; if (check) { - newModel = modelGoo.Value.Model; + newModel = modelGoo.Value.ApiModel; newModel.Check(taskId, out report); logs.Add(report.Log); notes.AddRange(report.Notes); @@ -102,7 +102,7 @@ public class SteelDesign : GH_OasysComponent { errors.Add($"Task {taskId}: {message}"); } } else { - newModel = modelGoo.Value.Model.Clone(); + newModel = modelGoo.Value.ApiModel.Clone(); List analysisTaskIds = GetDependentAnalysisTasksFromDesignTask(newModel, taskId); string memberList = steelDesignTasks[taskId].ListDefinition; List initialSectionIds = GetMemberSectionIds(newModel, memberList); diff --git a/GsaGH/Components/5_Results/GetResult.cs b/GsaGH/Components/5_Results/GetResult.cs index c28ae3747..f07ac941a 100644 --- a/GsaGH/Components/5_Results/GetResult.cs +++ b/GsaGH/Components/5_Results/GetResult.cs @@ -126,7 +126,7 @@ public class GetResult : GH_OasysComponent { switch (resultType) { case CaseType.AnalysisCase: if (_analysisCaseResults == null) { - _analysisCaseResults = model.Model.Results(); + _analysisCaseResults = model.ApiModel.Results(); if (_analysisCaseResults == null || _analysisCaseResults.Count == 0) { this.AddRuntimeError("No Analysis Case Results exist in Model"); return; @@ -148,7 +148,7 @@ public class GetResult : GH_OasysComponent { case CaseType.CombinationCase: if (_combinationCaseResults == null) { - _combinationCaseResults = model.Model.CombinationCaseResults(); + _combinationCaseResults = model.ApiModel.CombinationCaseResults(); if (_combinationCaseResults == null || _combinationCaseResults.Count == 0) { this.AddRuntimeError("No Combination Case Results exist in Model"); return; @@ -161,7 +161,7 @@ public class GetResult : GH_OasysComponent { } if (_tempNodeId == 0) { - _tempNodeId = model.Model.Nodes().Keys.First(); + _tempNodeId = model.ApiModel.Nodes().Keys.First(); } ReadOnlyDictionary> tempNodeCombResult diff --git a/GsaGH/Components/5_Results/SelectResults.cs b/GsaGH/Components/5_Results/SelectResults.cs index e9e9476f3..10d910f25 100644 --- a/GsaGH/Components/5_Results/SelectResults.cs +++ b/GsaGH/Components/5_Results/SelectResults.cs @@ -246,7 +246,7 @@ public class SelectResult : GH_OasysDropDownComponent { switch (_resultType) { case CaseType.AnalysisCase: if (_analysisCaseResults == null) { - _analysisCaseResults = _gsaModel.Model.Results(); + _analysisCaseResults = _gsaModel.ApiModel.Results(); if (_analysisCaseResults == null || _analysisCaseResults.Count == 0) { this.AddRuntimeError("No Analysis Case Results exist in Model"); return; @@ -267,7 +267,7 @@ public class SelectResult : GH_OasysDropDownComponent { case CaseType.CombinationCase: if (_combinationCaseResults == null) { - _combinationCaseResults = _gsaModel.Model.CombinationCaseResults(); + _combinationCaseResults = _gsaModel.ApiModel.CombinationCaseResults(); if (_combinationCaseResults == null || _combinationCaseResults.Count == 0) { this.AddRuntimeError("No Combination Case Results exist in Model"); return; @@ -281,7 +281,7 @@ public class SelectResult : GH_OasysDropDownComponent { ReadOnlyDictionary> tempNodeCombResult = _combinationCaseResults[_caseId] - .NodeDisplacement(_gsaModel.Model.Nodes().Keys.First().ToString()); + .NodeDisplacement(_gsaModel.ApiModel.Nodes().Keys.First().ToString()); int nP = tempNodeCombResult[tempNodeCombResult.Keys.First()].Count; if (_permutationIDs.Count == 1 && _permutationIDs[0] == -1) { _permutationIDs = Enumerable.Range(1, nP).ToList(); @@ -385,7 +385,7 @@ public class SelectResult : GH_OasysDropDownComponent { return; } - _combinationCaseResults ??= _gsaModel.Model.CombinationCaseResults(); + _combinationCaseResults ??= _gsaModel.ApiModel.CombinationCaseResults(); if (_combinationCaseResults.Count == 0) { return; @@ -398,7 +398,7 @@ public class SelectResult : GH_OasysDropDownComponent { ReadOnlyDictionary> tempNodeCombResult = _combinationCaseResults[_caseId] - .NodeDisplacement(_gsaModel.Model.Nodes().Keys.First().ToString()); + .NodeDisplacement(_gsaModel.ApiModel.Nodes().Keys.First().ToString()); int nP = tempNodeCombResult[tempNodeCombResult.Keys.First()].Count; var permutationsInCase = Enumerable.Range(1, nP).ToList(); if (_dropDownItems.Count < 3) { diff --git a/GsaGH/Components/6_Display/AssemblyResultDiagrams.cs b/GsaGH/Components/6_Display/AssemblyResultDiagrams.cs index dd0a00dde..97d2e724e 100644 --- a/GsaGH/Components/6_Display/AssemblyResultDiagrams.cs +++ b/GsaGH/Components/6_Display/AssemblyResultDiagrams.cs @@ -272,7 +272,7 @@ public class AssemblyResultDiagrams : GH_OasysDropDownComponent { var diagramLines = new List(); var diagramAnnotations = new List(); - GraphicDrawResult diagramResults = result.Model.Model.GetDiagrams(graphic); + GraphicDrawResult diagramResults = result.Model.ApiModel.GetDiagrams(graphic); ReadOnlyCollection linesFromModel = diagramResults.Lines; Color color = Color.Empty; diff --git a/GsaGH/Components/6_Display/AssemblyResults.cs b/GsaGH/Components/6_Display/AssemblyResults.cs index 027c346f2..5d7d8e578 100644 --- a/GsaGH/Components/6_Display/AssemblyResults.cs +++ b/GsaGH/Components/6_Display/AssemblyResults.cs @@ -482,9 +482,9 @@ private enum FoldMode { bool enveloped = Inputs.IsResultCaseEnveloped(this, result, ref _case, _envelopeType); List permutations = result.SelectedPermutationIds; assemblyList = Inputs.GetAssemblyListDefinition(this, da, 1, result.Model); - ReadOnlyDictionary elems = result.Model.Model.Elements(); - ReadOnlyDictionary nodes = result.Model.Model.Nodes(); - ReadOnlyDictionary assemblies = result.Model.Model.Assemblies(); + ReadOnlyDictionary elems = result.Model.ApiModel.Elements(); + ReadOnlyDictionary nodes = result.Model.ApiModel.Nodes(); + ReadOnlyDictionary assemblies = result.Model.ApiModel.Assemblies(); var list = new EntityList { Definition = assemblyList, diff --git a/GsaGH/Components/6_Display/Contour1dResults.cs b/GsaGH/Components/6_Display/Contour1dResults.cs index 109fe4fce..fec49ea99 100644 --- a/GsaGH/Components/6_Display/Contour1dResults.cs +++ b/GsaGH/Components/6_Display/Contour1dResults.cs @@ -596,8 +596,8 @@ private enum FoldMode { bool enveloped = Inputs.IsResultCaseEnveloped(this, result, ref _case, _envelopeType); List permutations = result.SelectedPermutationIds; elementlist = Inputs.GetElementListDefinition(this, da, 1, result.Model); - ReadOnlyDictionary elems = result.Model.Model.Elements(elementlist); - ReadOnlyDictionary nodes = result.Model.Model.Nodes(); + ReadOnlyDictionary elems = result.Model.ApiModel.Elements(elementlist); + ReadOnlyDictionary nodes = result.Model.ApiModel.Nodes(); if (elems.Count == 0) { this.AddRuntimeError($"Model contains no results for elements in list '{elementlist}'"); return; @@ -641,7 +641,7 @@ private enum FoldMode { case FoldMode.Displacement: IEntity1dResultSubset> displacements = Quaternions.CoordinateTransformationTo( result.Element1dDisplacements.ResultSubset(elementIds, positionsCount).Subset, - Plane.WorldXY, result.Model.Model); + Plane.WorldXY, result.Model.ApiModel); Func displacementSelector = null; switch (_disp) { case DisplayValue.X: diff --git a/GsaGH/Components/6_Display/Contour2dResults.cs b/GsaGH/Components/6_Display/Contour2dResults.cs index 58dd4f940..079928e24 100644 --- a/GsaGH/Components/6_Display/Contour2dResults.cs +++ b/GsaGH/Components/6_Display/Contour2dResults.cs @@ -566,8 +566,8 @@ private enum FoldMode { bool enveloped = Inputs.IsResultCaseEnveloped(this, result, ref _case, _envelopeType); List permutations = result.SelectedPermutationIds; elementlist = Inputs.GetElementListDefinition(this, da, 1, result.Model); - ReadOnlyDictionary elems = result.Model.Model.Elements(elementlist); - ReadOnlyDictionary nodes = result.Model.Model.Nodes(); + ReadOnlyDictionary elems = result.Model.ApiModel.Elements(elementlist); + ReadOnlyDictionary nodes = result.Model.ApiModel.Nodes(); if (elems.Count == 0) { this.AddRuntimeError($"Model contains no results for elements in list '{elementlist}'"); diff --git a/GsaGH/Components/6_Display/Contour3dResults.cs b/GsaGH/Components/6_Display/Contour3dResults.cs index cb74fe108..d001d51af 100644 --- a/GsaGH/Components/6_Display/Contour3dResults.cs +++ b/GsaGH/Components/6_Display/Contour3dResults.cs @@ -389,8 +389,8 @@ private enum FoldMode { bool enveloped = Inputs.IsResultCaseEnveloped(this, result, ref _case, _envelopeType); List permutations = result.SelectedPermutationIds; elementlist = Inputs.GetElementListDefinition(this, da, 1, result.Model); - ReadOnlyDictionary elems = result.Model.Model.Elements(elementlist); - ReadOnlyDictionary nodes = result.Model.Model.Nodes(); + ReadOnlyDictionary elems = result.Model.ApiModel.Elements(elementlist); + ReadOnlyDictionary nodes = result.Model.ApiModel.Nodes(); if (elems.Count == 0) { this.AddRuntimeError($"Model contains no results for elements in list '{elementlist}'"); return; diff --git a/GsaGH/Components/6_Display/ContourNodeResults.cs b/GsaGH/Components/6_Display/ContourNodeResults.cs index f073fe081..8350a76c9 100644 --- a/GsaGH/Components/6_Display/ContourNodeResults.cs +++ b/GsaGH/Components/6_Display/ContourNodeResults.cs @@ -450,7 +450,7 @@ private enum FoldMode { bool enveloped = Inputs.IsResultCaseEnveloped(this, result, ref _case, _envelopeType); List permutations = result.SelectedPermutationIds; nodeList = Inputs.GetNodeListDefinition(this, da, 1, result.Model); - ReadOnlyDictionary nodes = result.Model.Model.Nodes(nodeList); + ReadOnlyDictionary nodes = result.Model.ApiModel.Nodes(nodeList); if (nodes.Count == 0) { this.AddRuntimeError($"Model contains no results for nodes in list '{nodeList}'"); return; diff --git a/GsaGH/Components/6_Display/LoadDiagrams.cs b/GsaGH/Components/6_Display/LoadDiagrams.cs index 25412a2c1..3cc7aec20 100644 --- a/GsaGH/Components/6_Display/LoadDiagrams.cs +++ b/GsaGH/Components/6_Display/LoadDiagrams.cs @@ -296,7 +296,7 @@ public class LoadDiagrams : GH_OasysDropDownComponent { StructuralScale = arrowScale, }; - GraphicDrawResult diagramResults = _gsaModel.Model.GetDiagrams(graphic); + GraphicDrawResult diagramResults = _gsaModel.ApiModel.GetDiagrams(graphic); ReadOnlyCollection linesFromModel = diagramResults.Lines; double lengthScaleFactor = UnitConverter.Convert(1, Length.BaseUnit, lengthUnit); diff --git a/GsaGH/Components/6_Display/Preview3dSections.cs b/GsaGH/Components/6_Display/Preview3dSections.cs index 837130af3..5f819bea7 100644 --- a/GsaGH/Components/6_Display/Preview3dSections.cs +++ b/GsaGH/Components/6_Display/Preview3dSections.cs @@ -157,7 +157,7 @@ public class Preview3dSections : GH_OasysDropDownComponent { } var model = new GsaModel(); - model.Model.UiUnits().LengthLarge = UnitMapping.GetApiUnit(_lengthUnit); + model.ApiModel.UiUnits().LengthLarge = UnitMapping.GetApiUnit(_lengthUnit); if (models != null) { if (models.Count > 0) { model = models.Count > 1 diff --git a/GsaGH/Components/6_Display/ReactionForceDiagrams.cs b/GsaGH/Components/6_Display/ReactionForceDiagrams.cs index ac8baf1e9..61e0d6960 100644 --- a/GsaGH/Components/6_Display/ReactionForceDiagrams.cs +++ b/GsaGH/Components/6_Display/ReactionForceDiagrams.cs @@ -213,9 +213,9 @@ private enum DisplayValue { int permutation = result.SelectedPermutationIds == null ? 0 : result.SelectedPermutationIds[0] - 1; - ReadOnlyDictionary gsaFilteredNodes = result.Model.Model.Nodes(nodeList); + ReadOnlyDictionary gsaFilteredNodes = result.Model.ApiModel.Nodes(nodeList); ConcurrentDictionary nodes = Nodes.GetNodeDictionary(gsaFilteredNodes, - lengthUnit, result.Model.Model.Axes()); + lengthUnit, result.Model.ApiModel.Axes()); double scale = 1; if (!da.GetData(5, ref scale)) { diff --git a/GsaGH/Components/6_Display/ResultDiagrams.cs b/GsaGH/Components/6_Display/ResultDiagrams.cs index 96715d365..13151cfbf 100644 --- a/GsaGH/Components/6_Display/ResultDiagrams.cs +++ b/GsaGH/Components/6_Display/ResultDiagrams.cs @@ -235,7 +235,7 @@ public class ResultDiagrams : GH_OasysDropDownComponent { var diagramLines = new List(); var diagramAnnotations = new List(); - GraphicDrawResult diagramResults = result.Model.Model.GetDiagrams(graphic); + GraphicDrawResult diagramResults = result.Model.ApiModel.GetDiagrams(graphic); ReadOnlyCollection linesFromModel = diagramResults.Lines; Color color = Color.Empty; diff --git a/GsaGH/Components/99_Obsolete/GetModelGeometry_OBSOLETE.cs b/GsaGH/Components/99_Obsolete/GetModelGeometry_OBSOLETE.cs index f6dbffa2f..5acc130f9 100644 --- a/GsaGH/Components/99_Obsolete/GetModelGeometry_OBSOLETE.cs +++ b/GsaGH/Components/99_Obsolete/GetModelGeometry_OBSOLETE.cs @@ -695,7 +695,7 @@ private enum FoldMode { switch (i) { case 0: _results.Nodes = Nodes.GetNodes( - nodeList.ToLower() == "all" ? model.ApiNodes : model.Model.Nodes(nodeList), + nodeList.ToLower() == "all" ? model.ApiNodes : model.ApiModel.Nodes(nodeList), model.ModelUnit, model.ApiAxis, model.SpringProps); diff --git a/GsaGH/Helpers/Assembly/ModelAssembly.cs b/GsaGH/Helpers/Assembly/ModelAssembly.cs index 99e2b1311..2c7c219a1 100644 --- a/GsaGH/Helpers/Assembly/ModelAssembly.cs +++ b/GsaGH/Helpers/Assembly/ModelAssembly.cs @@ -238,7 +238,7 @@ internal partial class ModelAssembly { ReadOnlyDictionary existingTasks = _model.AnalysisTasks(); foreach (GsaAnalysisTask task in analysisTasks) { if (!existingTasks.Keys.Contains(task.Id)) { - task.Id = _model.AddAnalysisTask(); + task.Id = _model.AddAnalysisTask(task.ApiTask); } if (task.Cases == null || task.Cases.Count == 0) { @@ -591,7 +591,7 @@ internal partial class ModelAssembly { private void SetupModel(GsaModel model, LengthUnit unit) { model ??= new GsaModel(); - _model = model.Model; + _model = model.ApiModel; _gsaModel = model; _unit = unit; _model.UiUnits().LengthLarge = UnitMapping.GetApiUnit(_unit); @@ -623,8 +623,8 @@ internal partial class ModelAssembly { _glassMaterials = GetStandardMaterialDictionary(model.Materials.GlassMaterials); _fabricMaterials = GetStandardMaterialDictionary(model.Materials.FabricMaterials); _customMaterials = GetCustomMaterialDictionary(model.Materials.AnalysisMaterials); - _concreteDesignCode = model.Model.ConcreteDesignCode(); - _steelDesignCode = model.Model.SteelDesignCode(); + _concreteDesignCode = model.ApiModel.ConcreteDesignCode(); + _steelDesignCode = model.ApiModel.SteelDesignCode(); GetGsaGhMaterialsDictionary(model.Materials); CheckIfModelIsEmpty(); diff --git a/GsaGH/Helpers/GH/Inputs.cs b/GsaGH/Helpers/GH/Inputs.cs index ddcc9c41d..0347557e2 100644 --- a/GsaGH/Helpers/GH/Inputs.cs +++ b/GsaGH/Helpers/GH/Inputs.cs @@ -277,7 +277,7 @@ internal class Inputs { return string.Empty; } - if (model.Model.Lists().Values.Where( + if (model.ApiModel.Lists().Values.Where( x => x.Type == GsaAPI.EntityType.Assembly && x.Name == listGoo.Value.Name).Any()) { return "\"" + listGoo.Value.Name + "\""; } @@ -310,7 +310,7 @@ internal class Inputs { } if (listGoo.Value.EntityType == EntityType.Element) { - if (model.Model.Lists().Values.Where( + if (model.ApiModel.Lists().Values.Where( x => x.Type == GsaAPI.EntityType.Element && x.Name == listGoo.Value.Name).Any()) { return "\"" + listGoo.Value.Name + "\""; } @@ -320,11 +320,11 @@ internal class Inputs { // list is Member list ConcurrentDictionary> memberElementRelationship - = ModelAssembly.GetMemberElementRelationship(model.Model); + = ModelAssembly.GetMemberElementRelationship(model.ApiModel); // try find existing list of same name in model if (listGoo.Value.Name != null && listGoo.Value.Name != string.Empty) { - if (model.Model.Lists().Values.Where( + if (model.ApiModel.Lists().Values.Where( x => x.Type == GsaAPI.EntityType.Element && x.Name == $"Children of '{listGoo.Value.Name}'").Any()) { owner.AddRuntimeRemark($"Element definition was derived from Children of " + @@ -332,12 +332,12 @@ internal class Inputs { return "\"" + listGoo.Value.Name + "\""; } - foreach (EntityList list in model.Model.Lists().Values) { + foreach (EntityList list in model.ApiModel.Lists().Values) { if (list.Type != GsaAPI.EntityType.Member || list.Name != listGoo.Value.Name) { continue; } - ReadOnlyCollection memberIds = model.Model.ExpandList(list); + ReadOnlyCollection memberIds = model.ApiModel.ExpandList(list); var elementIds = new List(); var warnings = new List(); ; foreach (int memberId in memberIds) { @@ -369,7 +369,7 @@ internal class Inputs { if (string.IsNullOrEmpty(tempList.Name)) { tempList.Name = "List"; } - ReadOnlyCollection memberIds2 = model.Model.ExpandList(tempList); + ReadOnlyCollection memberIds2 = model.ApiModel.ExpandList(tempList); var elementIds2 = new List(); var warnings2 = new List(); ; @@ -414,7 +414,7 @@ internal class Inputs { return listGoo.Value.Definition; } - if (model.Model.Lists().Values.Where( + if (model.ApiModel.Lists().Values.Where( x => x.Type == GsaAPI.EntityType.Node && x.Name == listGoo.Value.Name).Any()) { return "\"" + listGoo.Value.Name + "\""; } @@ -447,7 +447,7 @@ internal class Inputs { return listGoo.Value.Definition; } - if (model.Model.Lists().Values.Where( + if (model.ApiModel.Lists().Values.Where( x => x.Type == GsaAPI.EntityType.Member && x.Name == listGoo.Value.Name).Any()) { return "\"" + listGoo.Value.Name + "\""; } diff --git a/GsaGH/Helpers/GsaAPI/Results/ResultsInfo.cs b/GsaGH/Helpers/GsaAPI/Results/ResultsInfo.cs index d83bcad44..4ef854455 100644 --- a/GsaGH/Helpers/GsaAPI/Results/ResultsInfo.cs +++ b/GsaGH/Helpers/GsaAPI/Results/ResultsInfo.cs @@ -12,10 +12,10 @@ internal static partial class ResultHelper { public static Tuple, List, DataTree> GetAvalailableResults( GsaModel model) { - ReadOnlyDictionary analysisCaseResults = model.Model.Results(); + ReadOnlyDictionary analysisCaseResults = model.ApiModel.Results(); ReadOnlyDictionary combinationCaseResults - = model.Model.CombinationCaseResults(); - int tempNodeId = model.Model.Nodes().Keys.First(); + = model.ApiModel.CombinationCaseResults(); + int tempNodeId = model.ApiModel.Nodes().Keys.First(); var type = new List(); var caseIds = new List(); diff --git a/GsaGH/Helpers/GsaCOM/GsaComHelper.cs b/GsaGH/Helpers/GsaCOM/GsaComHelper.cs index 63cf680b9..9024b6ad4 100644 --- a/GsaGH/Helpers/GsaCOM/GsaComHelper.cs +++ b/GsaGH/Helpers/GsaCOM/GsaComHelper.cs @@ -32,7 +32,7 @@ internal static class GsaComHelper { guid = model.Guid; tempPath = Path.GetTempPath() + guid.ToString() + ".gwb"; - model.Model.SaveAs(tempPath); + model.ApiModel.SaveAs(tempPath); gsa.Open(tempPath); gsa.SetLocale(Locale.LOC_EN_GB); @@ -43,7 +43,7 @@ internal static class GsaComHelper { ComAuto gsa = GsaComObject.Instance; gsa.SaveAs(tempPath); var gsaGh = new GsaModel(); - gsaGh.Model.Open(tempPath); + gsaGh.ApiModel.Open(tempPath); return gsaGh; } diff --git a/GsaGH/Helpers/Import/Elements.cs b/GsaGH/Helpers/Import/Elements.cs index c61db0fb3..77ed63ce4 100644 --- a/GsaGH/Helpers/Import/Elements.cs +++ b/GsaGH/Helpers/Import/Elements.cs @@ -16,8 +16,8 @@ internal class Elements { var elem1dDict = new ConcurrentDictionary(); var elem2dDict = new ConcurrentDictionary(); var elem3dDict = new ConcurrentDictionary(); - ReadOnlyDictionary aDict = model.Model.Assemblies(); - ReadOnlyDictionary eDict = model.Model.Elements(elementList); + ReadOnlyDictionary aDict = model.ApiModel.Assemblies(); + ReadOnlyDictionary eDict = model.ApiModel.Elements(elementList); Parallel.ForEach(eDict, item => { int elemDimension = 1; // default assume 1D element diff --git a/GsaGH/Helpers/Import/Members.cs b/GsaGH/Helpers/Import/Members.cs index 58cf0d605..f054e0662 100644 --- a/GsaGH/Helpers/Import/Members.cs +++ b/GsaGH/Helpers/Import/Members.cs @@ -22,7 +22,7 @@ internal class Members { Member2ds = new ConcurrentBag(); Member3ds = new ConcurrentBag(); - ReadOnlyDictionary mDict = model.Model.Members(memberList); + ReadOnlyDictionary mDict = model.ApiModel.Members(memberList); var errors1d = new ConcurrentBag(); var errors2d = new ConcurrentBag(); diff --git a/GsaGH/Helpers/MergeModels.cs b/GsaGH/Helpers/MergeModels.cs index 90e8d8b51..8cc87e0b6 100644 --- a/GsaGH/Helpers/MergeModels.cs +++ b/GsaGH/Helpers/MergeModels.cs @@ -133,25 +133,25 @@ public class MergeModels { }).ToList(); var gooloads = new List(); - ReadOnlyDictionary loadCases = appendModel.Model.LoadCases(); - gooloads.AddRange(GsaLoadFactory.CreateGravityLoadsFromApi(appendModel.Model.GravityLoads(), loadCases)); - gooloads.AddRange(GsaLoadFactory.CreateNodeLoadsFromApi(appendModel.Model, loadCases)); - gooloads.AddRange(GsaLoadFactory.CreateBeamLoadsFromApi(appendModel.Model.BeamLoads(), loadCases)); - gooloads.AddRange(GsaLoadFactory.CreateBeamThermalLoadsFromApi(appendModel.Model.BeamThermalLoads(), loadCases)); - gooloads.AddRange(GsaLoadFactory.CreateFaceLoadsFromApi(appendModel.Model.FaceLoads(), loadCases)); - gooloads.AddRange(GsaLoadFactory.CreateFaceThermalLoadsFromApi(appendModel.Model.FaceThermalLoads(), loadCases)); + ReadOnlyDictionary loadCases = appendModel.ApiModel.LoadCases(); + gooloads.AddRange(GsaLoadFactory.CreateGravityLoadsFromApi(appendModel.ApiModel.GravityLoads(), loadCases)); + gooloads.AddRange(GsaLoadFactory.CreateNodeLoadsFromApi(appendModel.ApiModel, loadCases)); + gooloads.AddRange(GsaLoadFactory.CreateBeamLoadsFromApi(appendModel.ApiModel.BeamLoads(), loadCases)); + gooloads.AddRange(GsaLoadFactory.CreateBeamThermalLoadsFromApi(appendModel.ApiModel.BeamThermalLoads(), loadCases)); + gooloads.AddRange(GsaLoadFactory.CreateFaceLoadsFromApi(appendModel.ApiModel.FaceLoads(), loadCases)); + gooloads.AddRange(GsaLoadFactory.CreateFaceThermalLoadsFromApi(appendModel.ApiModel.FaceThermalLoads(), loadCases)); - IReadOnlyDictionary srfDict = appendModel.Model.GridSurfaces(); - IReadOnlyDictionary plnDict = appendModel.Model.GridPlanes(); + IReadOnlyDictionary srfDict = appendModel.ApiModel.GridSurfaces(); + IReadOnlyDictionary plnDict = appendModel.ApiModel.GridPlanes(); gooloads.AddRange(GsaLoadFactory.CreateGridPointLoadsFromApi( - appendModel.Model.GridPointLoads(), srfDict, plnDict, appendModel.ApiAxis, loadCases, + appendModel.ApiModel.GridPointLoads(), srfDict, plnDict, appendModel.ApiAxis, loadCases, LengthUnit.Meter)); gooloads.AddRange(GsaLoadFactory.CreateGridLineLoadsFromApi( - appendModel.Model.GridLineLoads(), srfDict, plnDict, appendModel.ApiAxis, loadCases, + appendModel.ApiModel.GridLineLoads(), srfDict, plnDict, appendModel.ApiAxis, loadCases, LengthUnit.Meter)); gooloads.AddRange(GsaLoadFactory.CreateGridAreaLoadsFromApi( - appendModel.Model.GridAreaLoads(), srfDict, plnDict, appendModel.ApiAxis, loadCases, + appendModel.ApiModel.GridAreaLoads(), srfDict, plnDict, appendModel.ApiAxis, loadCases, LengthUnit.Meter)); var loads = gooloads.Select(n => n.Value).ToList(); @@ -165,7 +165,7 @@ public class MergeModels { var gsaLoadCases = GsaLoadFactory.CreateLoadCasesFromApi(loadCases).Select(n => n.Value).ToList(); var designTasks = new List(); - foreach (SteelDesignTask designTask in appendModel.Model.SteelDesignTasks().Values) { + foreach (SteelDesignTask designTask in appendModel.ApiModel.SteelDesignTasks().Values) { var kvp = new KeyValuePair(0, designTask); designTasks.Add(new GsaSteelDesignTask(kvp, appendModel)); } @@ -196,7 +196,7 @@ public class MergeModels { var assembly = new ModelAssembly(mainModel, lists, gridLines, geometry, properties, load, analysis, mainModel.ModelUnit, tolerance, false, owner); - mainModel.Model = assembly.GetModel(); + mainModel.ApiModel = assembly.GetModel(); return mainModel; } diff --git a/GsaGH/Parameters/0_Model/GsaList.cs b/GsaGH/Parameters/0_Model/GsaList.cs index 402cd9e87..6b63e8f31 100644 --- a/GsaGH/Parameters/0_Model/GsaList.cs +++ b/GsaGH/Parameters/0_Model/GsaList.cs @@ -120,7 +120,7 @@ public class GsaList { public List ExpandListDefinition() { if (_model != null) { - return _model.Model.ExpandList(GetApiList()).ToList(); + return _model.ApiModel.ExpandList(GetApiList()).ToList(); } var m = new Model(); @@ -447,13 +447,13 @@ public class GsaList { switch (EntityType) { case EntityType.Node: _nodes = Nodes.GetNodes( - _model.Model.Nodes(Definition), unit, _model.Model.Axes(), _model.SpringProps); + _model.ApiModel.Nodes(Definition), unit, _model.ApiModel.Axes(), _model.SpringProps); break; case EntityType.Element: var elementLocalAxesDict = new Dictionary>(); - foreach (int id in _model.Model.Elements(Definition).Keys) { - elementLocalAxesDict.Add(id, _model.Model.ElementDirectionCosine(id)); + foreach (int id in _model.ApiModel.Elements(Definition).Keys) { + elementLocalAxesDict.Add(id, _model.ApiModel.ElementDirectionCosine(id)); } // TO-DO: GSA-6773: add way to get properties/materials by list _properties.materials = new List(); @@ -469,8 +469,8 @@ public class GsaList { case EntityType.Member: var memberLocalAxesDict = new Dictionary>(); - foreach (int id in _model.Model.Members(Definition).Keys) { - memberLocalAxesDict.Add(id, _model.Model.MemberDirectionCosine(id)); + foreach (int id in _model.ApiModel.Members(Definition).Keys) { + memberLocalAxesDict.Add(id, _model.ApiModel.MemberDirectionCosine(id)); } // TO-DO: GSA-6773: add way to get properties/materials by list _properties.materials = new List(); @@ -490,7 +490,7 @@ public class GsaList { Name = Name, Definition = Definition }; - _cases = _model.Model.ExpandList(tempApiList).ToList(); + _cases = _model.ApiModel.ExpandList(tempApiList).ToList(); break; case EntityType.Undefined: diff --git a/GsaGH/Parameters/0_Model/GsaModel.cs b/GsaGH/Parameters/0_Model/GsaModel.cs index b1a87f64d..a0e9269b9 100644 --- a/GsaGH/Parameters/0_Model/GsaModel.cs +++ b/GsaGH/Parameters/0_Model/GsaModel.cs @@ -44,8 +44,8 @@ public class GsaModel { } public string FileNameAndPath { get; set; } public Guid Guid { get; set; } = Guid.NewGuid(); - internal Titles Titles => Model.Titles(); - internal UiUnits Units => Model.UiUnits(); + internal Titles Titles => ApiModel.Titles(); + internal UiUnits Units => ApiModel.UiUnits(); internal ReadOnlyDictionary> ApiElementLocalAxes { get; private set; } internal ReadOnlyDictionary> ApiMemberLocalAxes { get; private set; } internal ReadOnlyDictionary ApiNodes { get; private set; } @@ -53,7 +53,7 @@ public class GsaModel { internal GsaMaterials Materials { get; private set; } internal Section3dPreview AnalysisLayerPreview { get { - if (Model.Elements().Count > 0) { + if (ApiModel.Elements().Count > 0) { _analysisLayerPreview ??= new Section3dPreview(this, Layer.Analysis); } return _analysisLayerPreview; @@ -61,13 +61,13 @@ public class GsaModel { } internal Section3dPreview DesignLayerPreview { get { - if (Model.Members().Count > 0) { + if (ApiModel.Members().Count > 0) { _designLayerPreview ??= new Section3dPreview(this, Layer.Design); } return _designLayerPreview; } } - public Model Model { + public Model ApiModel { get => _model; set { _model = value; @@ -94,7 +94,7 @@ public class GsaModel { } internal GsaModel(Model model) { - Model = model; + ApiModel = model; InstantiateApiFields(); Setup(); } @@ -104,7 +104,7 @@ public class GsaModel { /// /// Returns a clone of this model with a new GUID public GsaModel Clone() { - var clone = new GsaModel(Model.Clone()) { + var clone = new GsaModel(ApiModel.Clone()) { FileNameAndPath = FileNameAndPath, ModelUnit = ModelUnit, Guid = Guid.NewGuid(), @@ -119,7 +119,7 @@ public class GsaModel { public override string ToString() { string s = "New GsaGH Model"; - if (Model != null && Titles != null) { + if (ApiModel != null && Titles != null) { if (!string.IsNullOrEmpty(FileNameAndPath)) { s = Path.GetFileName(FileNameAndPath).Replace(".gwb", string.Empty); } @@ -145,15 +145,15 @@ public class GsaModel { } internal Tuple, List> GetAnalysisTasksAndCombinations() { - ReadOnlyDictionary tasks = Model.AnalysisTasks(); - ReadOnlyDictionary loadCases = Model.LoadCases(); + ReadOnlyDictionary tasks = ApiModel.AnalysisTasks(); + ReadOnlyDictionary loadCases = ApiModel.LoadCases(); var tasksList = new List(); var caseList = new List(); var caseIDs = new List(); foreach (KeyValuePair item in tasks) { - var task = new GsaAnalysisTask(item.Key, item.Value, Model); + var task = new GsaAnalysisTask(item.Key, item.Value, ApiModel); tasksList.Add(new GsaAnalysisTaskGoo(task)); caseIDs.AddRange(task.Cases.Select(acase => acase.Id)); } @@ -161,7 +161,7 @@ public class GsaModel { caseIDs.AddRange(GetLoadCases()); foreach (int caseId in caseIDs) { - string caseName = Model.AnalysisCaseName(caseId); + string caseName = ApiModel.AnalysisCaseName(caseId); if (caseName == string.Empty) { if (loadCases.ContainsKey(caseId)) { caseName = loadCases[caseId].Name; @@ -171,7 +171,7 @@ public class GsaModel { } } - string caseDescription = Model.AnalysisCaseDescription(caseId); + string caseDescription = ApiModel.AnalysisCaseDescription(caseId); if (caseDescription == string.Empty) { caseDescription = "L" + caseId; } @@ -184,7 +184,7 @@ public class GsaModel { } private BoundingBox GetBoundingBox() { - var outNodes = new ConcurrentDictionary(Model.Nodes()); + var outNodes = new ConcurrentDictionary(ApiModel.Nodes()); var pts = new ConcurrentBag(); Parallel.ForEach(outNodes, node => pts.Add(Nodes.Point3dFromNode(node.Value, LengthUnit.Meter))); @@ -200,7 +200,7 @@ public class GsaModel { internal List GetGridLines() { var gridLines = new List(); - foreach (GridLine gridLine in Model.GridLines().Values) { + foreach (GridLine gridLine in ApiModel.GridLines().Values) { PolyCurve curve = GsaGridLine.ToCurve(gridLine); gridLines.Add(new GsaGridLine(gridLine, curve)); } @@ -209,39 +209,39 @@ public class GsaModel { internal List GetLoadCases() { var caseIDs = new List(); - ReadOnlyCollection gravities = Model.GravityLoads(); + ReadOnlyCollection gravities = ApiModel.GravityLoads(); caseIDs.AddRange(gravities.Select(x => x.Case)); foreach (GsaAPI.NodeLoadType typ in Enum.GetValues(typeof(GsaAPI.NodeLoadType))) { ReadOnlyCollection nodeLoads; try // some GsaAPI.NodeLoadTypes are currently not supported in the API and throws an error { - nodeLoads = Model.NodeLoads(typ); + nodeLoads = ApiModel.NodeLoads(typ); caseIDs.AddRange(nodeLoads.Select(x => x.Case)); } catch (Exception) { // ignored } } - ReadOnlyCollection beamLoads = Model.BeamLoads(); + ReadOnlyCollection beamLoads = ApiModel.BeamLoads(); caseIDs.AddRange(beamLoads.Select(x => x.Case)); - ReadOnlyCollection beamThermalLoads = Model.BeamThermalLoads(); + ReadOnlyCollection beamThermalLoads = ApiModel.BeamThermalLoads(); caseIDs.AddRange(beamThermalLoads.Select(x => x.Case)); - ReadOnlyCollection faceLoads = Model.FaceLoads(); + ReadOnlyCollection faceLoads = ApiModel.FaceLoads(); caseIDs.AddRange(faceLoads.Select(x => x.Case)); - ReadOnlyCollection faceThermalLoads = Model.FaceThermalLoads(); + ReadOnlyCollection faceThermalLoads = ApiModel.FaceThermalLoads(); caseIDs.AddRange(faceThermalLoads.Select(x => x.Case)); - ReadOnlyCollection gridPointLoads = Model.GridPointLoads(); + ReadOnlyCollection gridPointLoads = ApiModel.GridPointLoads(); caseIDs.AddRange(gridPointLoads.Select(x => x.Case)); - ReadOnlyCollection gridLineLoads = Model.GridLineLoads(); + ReadOnlyCollection gridLineLoads = ApiModel.GridLineLoads(); caseIDs.AddRange(gridLineLoads.Select(x => x.Case)); - ReadOnlyCollection gridAreaLoads = Model.GridAreaLoads(); + ReadOnlyCollection gridAreaLoads = ApiModel.GridAreaLoads(); caseIDs.AddRange(gridAreaLoads.Select(x => x.Case)); return caseIDs.GroupBy(x => x).Select(y => y.First()).OrderBy(z => z).ToList(); @@ -249,7 +249,7 @@ public class GsaModel { internal List GetLists() { var lists = new List(); - foreach (KeyValuePair apiList in Model.Lists()) { + foreach (KeyValuePair apiList in ApiModel.Lists()) { lists.Add(new GsaList(apiList.Key, apiList.Value, this)); } return lists; @@ -304,21 +304,21 @@ public class GsaModel { } private void InstantiateApiFields() { - ApiNodes = Model.Nodes(); - ApiAxis = Model.Axes(); - _lengthUnit = UnitMapping.GetUnit(Model.UiUnits().LengthLarge); + ApiNodes = ApiModel.Nodes(); + ApiAxis = ApiModel.Axes(); + _lengthUnit = UnitMapping.GetUnit(ApiModel.UiUnits().LengthLarge); ApiMemberLocalAxes = new ReadOnlyDictionary>( - Model.Members().Keys.ToDictionary(id => id, id => Model.MemberDirectionCosine(id))); + ApiModel.Members().Keys.ToDictionary(id => id, id => ApiModel.MemberDirectionCosine(id))); ApiElementLocalAxes = new ReadOnlyDictionary>( - Model.Elements().Keys.ToDictionary(id => id, id => Model.ElementDirectionCosine(id))); + ApiModel.Elements().Keys.ToDictionary(id => id, id => ApiModel.ElementDirectionCosine(id))); } private void Setup() { - Materials = new GsaMaterials(Model); - Sections = GsaPropertyFactory.CreateSectionsFromApi(Model.Sections(), Materials, Model.SectionModifiers()); - Prop2ds = GsaPropertyFactory.CreateProp2dsFromApi(Model.Prop2Ds(), Materials, Model.Axes()); - Prop3ds = GsaPropertyFactory.CreateProp3dsFromApi(Model.Prop3Ds(), Materials); - SpringProps = GsaPropertyFactory.CreateSpringPropsFromApi(Model.SpringProperties()); + Materials = new GsaMaterials(ApiModel); + Sections = GsaPropertyFactory.CreateSectionsFromApi(ApiModel.Sections(), Materials, ApiModel.SectionModifiers()); + Prop2ds = GsaPropertyFactory.CreateProp2dsFromApi(ApiModel.Prop2Ds(), Materials, ApiModel.Axes()); + Prop3ds = GsaPropertyFactory.CreateProp3dsFromApi(ApiModel.Prop3Ds(), Materials); + SpringProps = GsaPropertyFactory.CreateSpringPropsFromApi(ApiModel.SpringProperties()); } } } diff --git a/GsaGH/Parameters/2_Geometry/GsaElementFactory.cs b/GsaGH/Parameters/2_Geometry/GsaElementFactory.cs index b358352a4..9d655995a 100644 --- a/GsaGH/Parameters/2_Geometry/GsaElementFactory.cs +++ b/GsaGH/Parameters/2_Geometry/GsaElementFactory.cs @@ -32,7 +32,7 @@ public class GsaElementFactory { internal static ConcurrentBag CreateElement2dFromApi( ConcurrentDictionary elements, GsaModel model) { ReadOnlyDictionary nodes = model.ApiNodes; - ReadOnlyDictionary axDict = model.Model.Axes(); + ReadOnlyDictionary axDict = model.ApiModel.Axes(); var sortedElements = new ConcurrentDictionary>(); Parallel.ForEach(elements, elem => { @@ -105,8 +105,8 @@ public class GsaElementFactory { internal static ConcurrentBag CreateElement3dFromApi( ConcurrentDictionary elements, GsaModel model) { - ReadOnlyDictionary nodes = model.Model.Nodes(); - ReadOnlyDictionary axDict = model.Model.Axes(); + ReadOnlyDictionary nodes = model.ApiModel.Nodes(); + ReadOnlyDictionary axDict = model.ApiModel.Axes(); var sortedElements = new ConcurrentDictionary>(); Parallel.ForEach(elements, elem => { diff --git a/GsaGH/Parameters/2_Geometry/Section3dPreview.cs b/GsaGH/Parameters/2_Geometry/Section3dPreview.cs index 221727f85..7e1ba8712 100644 --- a/GsaGH/Parameters/2_Geometry/Section3dPreview.cs +++ b/GsaGH/Parameters/2_Geometry/Section3dPreview.cs @@ -55,11 +55,11 @@ public class Section3dPreview { public Section3dPreview(GsaResult res, string elementList, double scale) { GraphicSpecification spec = ResultSpec(res, elementList, scale); - CreateGraphics(res.Model.Model, spec); + CreateGraphics(res.Model.ApiModel, spec); } internal Section3dPreview(GsaModel model, Layer layer) { GraphicSpecification spec = layer == Layer.Analysis ? AnalysisLayerSpec() : DesignLayerSpec(); - CreateGraphics(model.Model, spec); + CreateGraphics(model.ApiModel, spec); Scale(model.ModelUnit); } diff --git a/GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs b/GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs index 010115a39..a12e6d94f 100644 --- a/GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs +++ b/GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs @@ -12,7 +12,7 @@ namespace GsaGH.Parameters { public class GsaAnalysisTask { public List Cases { get; set; } = new List(); public int Id { get; set; } = 0; - public AnalysisTask Task { get; internal set; } = null; + public AnalysisTask ApiTask { get; internal set; } public GsaAnalysisTask() { Id = 0; @@ -26,20 +26,11 @@ public class GsaAnalysisTask { Cases.Add(new GsaAnalysisCase(caseId, caseName, caseDescription)); } - Task = task; - } - - public GsaAnalysisTask Duplicate() { - var dup = new GsaAnalysisTask { - Id = Id, - Cases = Cases.ToList(), - Task = Task // ??? - }; - return dup; + ApiTask = task; } public override string ToString() { - return (Id > 0 ? $"ID:{Id} " : string.Empty) + $"'{Task.Name}' {Task.Type}".Replace("_", " ") + return (Id > 0 ? $"ID:{Id} " : string.Empty) + $"'{ApiTask.Name}' {ApiTask.Type}".Replace("_", " ") .TrimSpaces(); } diff --git a/GsaGH/Parameters/4_Analysis/GsaSteelDesignTask.cs b/GsaGH/Parameters/4_Analysis/GsaSteelDesignTask.cs index 12f52d430..cedc6501b 100644 --- a/GsaGH/Parameters/4_Analysis/GsaSteelDesignTask.cs +++ b/GsaGH/Parameters/4_Analysis/GsaSteelDesignTask.cs @@ -20,7 +20,7 @@ public class GsaSteelDesignTask : IGsaDesignTask { internal GsaSteelDesignTask(KeyValuePair kvp, GsaModel model) { Id = kvp.Key; ApiTask = kvp.Value; - foreach (KeyValuePair apiList in model.Model.Lists()) { + foreach (KeyValuePair apiList in model.ApiModel.Lists()) { if (apiList.Value.Name == ApiTask.ListDefinition.Replace("\"", string.Empty)) { List = new GsaList(apiList.Key, apiList.Value, model); return; diff --git a/GsaGH/Parameters/5_Results/2_Results/GsaResult.cs b/GsaGH/Parameters/5_Results/2_Results/GsaResult.cs index 833411f31..4e7f676cb 100644 --- a/GsaGH/Parameters/5_Results/2_Results/GsaResult.cs +++ b/GsaGH/Parameters/5_Results/2_Results/GsaResult.cs @@ -100,7 +100,7 @@ public class GsaResult : IGsaResult { Type = GsaAPI.EntityType.Node, Name = "node", }; - return Model.Model.ExpandList(entityList); + return Model.ApiModel.ExpandList(entityList); } internal ReadOnlyCollection ElementIds(string elementList, int dimension) { @@ -124,7 +124,7 @@ public class GsaResult : IGsaResult { Type = GsaAPI.EntityType.Element, Name = "elem", }; - return Model.Model.ExpandList(entityList); + return Model.ApiModel.ExpandList(entityList); } internal ReadOnlyCollection MemberIds(string memberList) { @@ -133,13 +133,13 @@ public class GsaResult : IGsaResult { Type = GsaAPI.EntityType.Member, Name = "mem", }; - return Model.Model.ExpandList(entityList); + return Model.ApiModel.ExpandList(entityList); } internal ReadOnlyCollection AssemblyIds(string assemblyList) { assemblyList = assemblyList.Trim(); if (assemblyList.ToLower() == "all") { - ReadOnlyDictionary assemblies = Model.Model.Assemblies(); + ReadOnlyDictionary assemblies = Model.ApiModel.Assemblies(); return new ReadOnlyCollection(assemblies.Keys.ToList()); } @@ -148,7 +148,7 @@ public class GsaResult : IGsaResult { Type = GsaAPI.EntityType.Undefined, Name = "as", }; - return Model.Model.ExpandList(entityList); + return Model.ApiModel.ExpandList(entityList); } private void InitialiseAnalysisCaseResults(GsaModel model, AnalysisCaseResult result, int caseId) { @@ -170,7 +170,7 @@ public class GsaResult : IGsaResult { Element3dStresses = new Element3dStressCache(result); NodeDisplacements = new NodeDisplacementCache(result); - NodeReactionForces = new NodeReactionForceCache(result, model?.Model); + NodeReactionForces = new NodeReactionForceCache(result, model?.ApiModel); NodeSpringForces = new NodeSpringForceCache(result); NodeResonantFootfalls = new NodeResonantFootfallCache(result); NodeTransientFootfalls = new NodeTransientFootfallCache(result); @@ -193,15 +193,15 @@ public class GsaResult : IGsaResult { Model = model; CaseType = CaseType.AnalysisCase; CaseId = caseId; - if (model?.Model?.Results()?.ContainsKey(caseId) != true) { + if (model?.ApiModel?.Results()?.ContainsKey(caseId) != true) { return; } - CaseName = model.Model.AnalysisCaseName(CaseId); + CaseName = model.ApiModel.AnalysisCaseName(CaseId); } private void InitialiseCombinationsCaseResults( GsaModel model, CombinationCaseResult result, int caseId, IEnumerable permutations) { - ReadOnlyDictionary> temp = result.NodeDisplacement(model.Model.Nodes().Keys.First().ToString()); + ReadOnlyDictionary> temp = result.NodeDisplacement(model.ApiModel.Nodes().Keys.First().ToString()); Permutations = temp[temp.Keys.First()].Count; Element1dAverageStrainEnergyDensities = new Element1dAverageStrainEnergyDensityCache(result); @@ -221,7 +221,7 @@ public class GsaResult : IGsaResult { Element3dStresses = new Element3dStressCache(result); NodeDisplacements = new NodeDisplacementCache(result); - NodeReactionForces = new NodeReactionForceCache(result, model?.Model); + NodeReactionForces = new NodeReactionForceCache(result, model?.ApiModel); NodeSpringForces = new NodeSpringForceCache(result); Member1dDisplacements = new Member1dDisplacementCache(result); @@ -241,8 +241,8 @@ public class GsaResult : IGsaResult { CaseType = CaseType.CombinationCase; CaseId = caseId; SelectedPermutationIds = permutations?.ToList(); - if (model?.Model?.CombinationCases()?.ContainsKey(caseId) == true) { - CaseName = model.Model.CombinationCases()[CaseId].Name; + if (model?.ApiModel?.CombinationCases()?.ContainsKey(caseId) == true) { + CaseName = model.ApiModel.CombinationCases()[CaseId].Name; } } } diff --git a/GsaGHTests/1_BaseParameters/0_Model/GsaListTest.cs b/GsaGHTests/1_BaseParameters/0_Model/GsaListTest.cs index f1bc44831..eb50de279 100644 --- a/GsaGHTests/1_BaseParameters/0_Model/GsaListTest.cs +++ b/GsaGHTests/1_BaseParameters/0_Model/GsaListTest.cs @@ -22,7 +22,7 @@ public class GsaListTest { // Act m.AddList(apilist); - var model = new GsaModel() { Model = m }; + var model = new GsaModel() { ApiModel = m }; GsaList list = model.GetLists()[0]; Assert.Equal(1, list.Id); @@ -50,7 +50,7 @@ public class GsaListTest { // Act m.AddList(apilist); - var model = new GsaModel() { Model = m }; + var model = new GsaModel() { ApiModel = m }; GsaList list = model.GetLists()[0]; // Assert @@ -94,7 +94,7 @@ public class GsaListTest { // Act m.AddList(apilist); - var model = new GsaModel() { Model = m }; + var model = new GsaModel() { ApiModel = m }; GsaList list = model.GetLists()[0]; // Assert @@ -137,7 +137,7 @@ public class GsaListTest { // Act m.AddList(apilist); - var model = new GsaModel() { Model = m }; + var model = new GsaModel() { ApiModel = m }; GsaList list = model.GetLists()[0]; // Assert diff --git a/GsaGHTests/1_BaseParameters/0_Model/GsaModelTest.cs b/GsaGHTests/1_BaseParameters/0_Model/GsaModelTest.cs index 21f77176d..25361502a 100644 --- a/GsaGHTests/1_BaseParameters/0_Model/GsaModelTest.cs +++ b/GsaGHTests/1_BaseParameters/0_Model/GsaModelTest.cs @@ -18,12 +18,12 @@ public class GsaModelTest { [Fact] public void TestCreateModelFromModel() { var original = new GsaModel(); - original.Model.Open(GsaFile.SteelDesignSimple); + original.ApiModel.Open(GsaFile.SteelDesignSimple); var assembly = new ModelAssembly(original, null, null, null, null, null, null, LengthUnit.Meter, Length.Zero, false, null); var assembled = new GsaModel() { - Model = assembly.GetModel() + ApiModel = assembly.GetModel() }; Duplicates.AreEqual(original, assembled, new List() { "Guid" }); @@ -47,7 +47,7 @@ public class GsaModelTest { [InlineData(LengthUnit.Foot, 452027.734035)] public void TestGetBoundingBox(LengthUnit modelUnit, double expectedVolume) { var model = new GsaModel(); - model.Model.Open(GsaFile.SteelDesignComplex); + model.ApiModel.Open(GsaFile.SteelDesignComplex); model.ModelUnit = modelUnit; BoundingBox bbox = model.BoundingBox; @@ -58,10 +58,10 @@ public class GsaModelTest { public void TestSaveModel() { var m = new GsaModel(); string file = GsaFile.SteelDesignSimple; - m.Model.Open(file); + m.ApiModel.Open(file); string tempfilename = Path.GetTempPath() + "GSA-Grasshopper_temp.gwb"; - ReturnValue returnValue = m.Model.SaveAs(tempfilename); + ReturnValue returnValue = m.ApiModel.SaveAs(tempfilename); Assert.Same(ReturnValue.GS_OK.ToString(), returnValue.ToString()); } @@ -121,7 +121,7 @@ public class GsaModelTest { m.ModelUnit = LengthUnit.Foot; Assert.Equal(LengthUnit.Foot, m.ModelUnit); - Assert.Equal(LengthUnit.Foot, UnitMapping.GetUnit(m.Model.UiUnits().LengthLarge)); + Assert.Equal(LengthUnit.Foot, UnitMapping.GetUnit(m.ApiModel.UiUnits().LengthLarge)); } } } diff --git a/GsaGHTests/1_BaseParameters/1_Properties/GsaBucklingLengthFactorsTest.cs b/GsaGHTests/1_BaseParameters/1_Properties/GsaBucklingLengthFactorsTest.cs index 4a32c0f2a..94f04b482 100644 --- a/GsaGHTests/1_BaseParameters/1_Properties/GsaBucklingLengthFactorsTest.cs +++ b/GsaGHTests/1_BaseParameters/1_Properties/GsaBucklingLengthFactorsTest.cs @@ -22,10 +22,10 @@ public class GsaBucklingLengthFactorsTest { var assembly = new ModelAssembly(m1d); var assembled = new GsaModel { - Model = assembly.GetModel() + ApiModel = assembly.GetModel() }; - Member assembledMem1d = assembled.Model.Members()[1]; + Member assembledMem1d = assembled.ApiModel.Members()[1]; Assert.Equal(1.5, assembledMem1d.MomentAmplificationFactorStrongAxis); Assert.Equal(2.5, assembledMem1d.MomentAmplificationFactorWeakAxis); diff --git a/GsaGHTests/1_BaseParameters/4_Analysis/GsaAnalysisTaskTest.cs b/GsaGHTests/1_BaseParameters/4_Analysis/GsaAnalysisTaskTest.cs index f274ccafd..616861afb 100644 --- a/GsaGHTests/1_BaseParameters/4_Analysis/GsaAnalysisTaskTest.cs +++ b/GsaGHTests/1_BaseParameters/4_Analysis/GsaAnalysisTaskTest.cs @@ -1,99 +1,15 @@ -using System.Collections.Generic; -using GsaAPI; -using GsaGH.Parameters; -using GsaGHTests.Helpers; +using GsaGH.Parameters; using Xunit; namespace GsaGHTests.Parameters { [Collection("GrasshopperFixture collection")] public class GsaAnalysisTaskTest { - - [Fact] - public void DuplicateStaticTest() { - var original = new GsaAnalysisTask(); - - GsaAnalysisTask duplicate = original.Duplicate(); - - Duplicates.AreEqual(original, duplicate); - - duplicate.Id = 1; - duplicate.Task.Name = "name"; - duplicate.Task.Type = (int)AnalysisTaskType.Buckling; - duplicate.Cases = new List(); - - Assert.Equal(0, original.Id); - Assert.Null(original.Task.Name); - Assert.Equal((int)AnalysisTaskType.Static, original.Task.Type); - Assert.Empty(original.Cases); - } - - [Fact] - public void DuplicateStaticPDeltaWithGeometricStiffnessFromLoadCaseTest() { - var original = new GsaAnalysisTask { - Id = 1, - Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task1", new GeometricStiffnessFromLoadCase("L1")) - }; - - GsaAnalysisTask duplicate = original.Duplicate(); - - Duplicates.AreEqual(original, duplicate); - - duplicate.Id = 2; - duplicate.Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task2", new GeometricStiffnessFromResultCase(1)); - - Assert.Equal(1, original.Id); - Assert.Equal("task1", original.Task.Name); - Assert.Equal((int)AnalysisTaskType.StaticPDelta, original.Task.Type); - Assert.Empty(original.Cases); - } - - [Fact] - public void DuplicateStaticPDeltaWithGeometricStiffnessFromOwnLoadTest() { - var original = new GsaAnalysisTask { - Id = 1, - Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task1", new GeometricStiffnessFromOwnLoad()) - }; - - GsaAnalysisTask duplicate = original.Duplicate(); - - Duplicates.AreEqual(original, duplicate); - - duplicate.Id = 2; - duplicate.Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task2", new GeometricStiffnessFromResultCase(1)); - - Assert.Equal(1, original.Id); - Assert.Equal("task1", original.Task.Name); - Assert.Equal((int)AnalysisTaskType.StaticPDelta, original.Task.Type); - Assert.Empty(original.Cases); - } - - [Fact] - public void DuplicateStaticPDeltaWithGeometricStiffnessFromResultCaseTest() { - var original = new GsaAnalysisTask { - Id = 1, - Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task1", new GeometricStiffnessFromResultCase(1)) - }; - - GsaAnalysisTask duplicate = original.Duplicate(); - - Duplicates.AreEqual(original, duplicate); - - duplicate.Id = 2; - duplicate.Task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask("task2", new GeometricStiffnessFromOwnLoad()); - - Assert.Equal(1, original.Id); - Assert.Equal("task1", original.Task.Name); - Assert.Equal((int)AnalysisTaskType.StaticPDelta, original.Task.Type); - Assert.Empty(original.Cases); - } - [Fact] public void EmptyConstructorTest() { var task = new GsaAnalysisTask(); Assert.Equal(0, task.Id); - Assert.Null(task.Task.Name); - Assert.Equal((int)AnalysisTaskType.Static, task.Task.Type); + Assert.Null(task.ApiTask); Assert.Empty(task.Cases); } } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dAverageStrainEnergyDensityTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dAverageStrainEnergyDensityTests.cs index d4e3053ad..2eb9c5f13 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dAverageStrainEnergyDensityTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dAverageStrainEnergyDensityTests.cs @@ -24,7 +24,7 @@ public class Element1dAverageStrainEnergyDensityTests { = result.Element1dAverageStrainEnergyDensities.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -39,7 +39,7 @@ public class Element1dAverageStrainEnergyDensityTests { = result.Element1dAverageStrainEnergyDensities.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dDerivedStressTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dDerivedStressTests.cs index cf11eb43a..0adc2f8d9 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dDerivedStressTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dDerivedStressTests.cs @@ -23,7 +23,7 @@ public class Element1dDerivedStressTests { = result.Element1dDerivedStresses.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Element1dDerivedStressTests { = result.Element1dDerivedStresses.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dDisplacementsTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dDisplacementsTests.cs index 02f266808..c59be02be 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dDisplacementsTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dDisplacementsTests.cs @@ -23,7 +23,7 @@ public class Element1dDisplacementsTests { = result.Element1dDisplacements.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Element1dDisplacementsTests { = result.Element1dDisplacements.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dInternalForcesTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dInternalForcesTests.cs index 276bc4a77..abff00baf 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dInternalForcesTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dInternalForcesTests.cs @@ -24,7 +24,7 @@ public class Element1dInternalForcesTests { = result.Element1dInternalForces.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -39,7 +39,7 @@ public class Element1dInternalForcesTests { = result.Element1dInternalForces.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dStrainEnergyDensityTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dStrainEnergyDensityTests.cs index f8d0b1f94..80b405527 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dStrainEnergyDensityTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dStrainEnergyDensityTests.cs @@ -24,7 +24,7 @@ public class Element1dStrainEnergyDensityTests { = result.Element1dStrainEnergyDensities.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -39,7 +39,7 @@ public class Element1dStrainEnergyDensityTests { = result.Element1dStrainEnergyDensities.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dStressTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dStressTests.cs index 073274a57..f82599576 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dStressTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element1dStressTests.cs @@ -23,7 +23,7 @@ public class Element1dStressTests { = result.Element1dStresses.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Element1dStressTests { = result.Element1dStresses.ResultSubset(elementIds, 1); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dDisplacementsTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dDisplacementsTests.cs index e70b6e681..f02468db7 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dDisplacementsTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dDisplacementsTests.cs @@ -23,7 +23,7 @@ public class Element2dDisplacementsTests { = result.Element2dDisplacements.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Element2dDisplacementsTests { = result.Element2dDisplacements.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dForcesTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dForcesTests.cs index 4864aa00e..216084937 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dForcesTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dForcesTests.cs @@ -23,7 +23,7 @@ public class Element2dForcesTests { = result.Element2dForces.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Element2dForcesTests { = result.Element2dForces.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dMomentsTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dMomentsTests.cs index a6b974523..c73a1506d 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dMomentsTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dMomentsTests.cs @@ -23,7 +23,7 @@ public class Element2dMomentsTests { = result.Element2dMoments.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Element2dMomentsTests { = result.Element2dMoments.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dShearForcesTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dShearForcesTests.cs index 2d0ab7ac8..6313171af 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dShearForcesTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dShearForcesTests.cs @@ -23,7 +23,7 @@ public class Element2dShearForcesTests { = result.Element2dShearForces.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Element2dShearForcesTests { = result.Element2dShearForces.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dStressesTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dStressesTests.cs index f0e245fc6..129589939 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dStressesTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element2dStressesTests.cs @@ -25,7 +25,7 @@ public class Element2dStressesTests { = result.Element2dStresses.ResultSubset(elementIds, layer); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -43,7 +43,7 @@ public class Element2dStressesTests { = result.Element2dStresses.ResultSubset(elementIds, layer); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element3dStressesTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element3dStressesTests.cs index a3bdd2635..30473f09d 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element3dStressesTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element3dStressesTests.cs @@ -22,7 +22,7 @@ public class Element3dStressesTests { = result.Element3dStresses.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -37,7 +37,7 @@ public class Element3dStressesTests { = result.Element3dStresses.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element3dTranslationsTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element3dTranslationsTests.cs index 57e5e8922..4b4f4ec5e 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Element3dTranslationsTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Element3dTranslationsTests.cs @@ -23,7 +23,7 @@ public class Element3dTranslationsTests { = result.Element3dDisplacements.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Element3dTranslationsTests { = result.Element3dDisplacements.ResultSubset(elementIds); // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/GsaResultTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/GsaResultTests.cs index 60ef5cd95..9a17fddef 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/GsaResultTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/GsaResultTests.cs @@ -12,14 +12,14 @@ public partial class GsaResultTests { public static IGsaResult AnalysisCaseResult(string file, int caseId) { var apiModel = new GsaAPI.Model(file); var model = new GsaModel(apiModel); - ReadOnlyDictionary analysisCaseResults = model.Model.Results(); + ReadOnlyDictionary analysisCaseResults = model.ApiModel.Results(); return new GsaResult(model, analysisCaseResults[caseId], caseId); } public static IGsaResult CombinationCaseResult(string file, int caseId, IEnumerable permutations = null) { var apiModel = new GsaAPI.Model(file); var model = new GsaModel(apiModel); - ReadOnlyDictionary combinationCaseResults = model.Model.CombinationCaseResults(); + ReadOnlyDictionary combinationCaseResults = model.ApiModel.CombinationCaseResults(); if (permutations == null) { permutations = new List() { 1, 2 }; } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Member1dDisplacementsTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Member1dDisplacementsTests.cs index dd7e4de9f..c79f901b8 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Member1dDisplacementsTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Member1dDisplacementsTests.cs @@ -23,7 +23,7 @@ public class Member1dDisplacementsTests { = result.Member1dDisplacements.ResultSubset(memberIds, 5); // Assert member IDs - var expectedIds = result.Model.Model.Members(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Members(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class Member1dDisplacementsTests { = result.Member1dDisplacements.ResultSubset(memberIds, 5); // Assert member IDs - var expectedIds = result.Model.Model.Members(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Members(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/Member1dForcesTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/Member1dForcesTests.cs index 37a71f688..3b68c18d8 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/Member1dForcesTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/Member1dForcesTests.cs @@ -24,7 +24,7 @@ public class Member1dForcesTests { = result.Member1dInternalForces.ResultSubset(memberIds, 5); // Assert member IDs - var expectedIds = result.Model.Model.Members(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Members(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -39,7 +39,7 @@ public class Member1dForcesTests { = result.Member1dInternalForces.ResultSubset(memberIds, 5); // Assert member IDs - var expectedIds = result.Model.Model.Members(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Members(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodalForcesAndMomentsCacheTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodalForcesAndMomentsCacheTests.cs index cc561f2e9..12d0e0513 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodalForcesAndMomentsCacheTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodalForcesAndMomentsCacheTests.cs @@ -23,7 +23,7 @@ public class NodalForcesAndMomentsCacheTests { GsaGH.Parameters.Results.NodalForcesAndMoments resultSet = result.NodalForcesAndMoments.ResultSubset(nodeIds); // Assert - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -37,7 +37,7 @@ public class NodalForcesAndMomentsCacheTests { GsaGH.Parameters.Results.NodalForcesAndMoments resultSet = result.NodalForcesAndMoments.ResultSubset(nodeIds); // Assert - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeDisplacementsTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeDisplacementsTests.cs index 9c366f4cf..c69b63272 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeDisplacementsTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeDisplacementsTests.cs @@ -23,7 +23,7 @@ public class NodeDisplacementsTests { = result.NodeDisplacements.ResultSubset(nodeIds); // Assert node IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class NodeDisplacementsTests { = result.NodeDisplacements.ResultSubset(nodeIds); // Assert node IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeFootfallTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeFootfallTests.cs index ba3c613d0..8fd30aef0 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeFootfallTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeFootfallTests.cs @@ -23,7 +23,7 @@ public class NodeFootfallTests { = result.NodeResonantFootfalls.ResultSubset(nodeIds); // Assert node IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); result = (GsaResult)GsaResultTests.AnalysisCaseResult(GsaFile.SteelFootfall, 17); diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeReactionForcesTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeReactionForcesTests.cs index 740b9d521..67003b6f3 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeReactionForcesTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeReactionForcesTests.cs @@ -62,7 +62,7 @@ public class NodeReactionForcesTests { = result.NodeReactionForces.ResultSubset(nodeIds); // Assert node IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -77,7 +77,7 @@ public class NodeReactionForcesTests { = result.NodeReactionForces.ResultSubset(nodeIds); // Assert node IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeSpringForcesCacheTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeSpringForcesCacheTests.cs index fd50395e1..ce04bf09c 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeSpringForcesCacheTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/NodeSpringForcesCacheTests.cs @@ -23,7 +23,7 @@ public class NodeSpringForcesCacheTests { = result.NodeSpringForces.ResultSubset(nodeIds); // Assert node IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -38,7 +38,7 @@ public class NodeSpringForcesCacheTests { = result.NodeSpringForces.ResultSubset(nodeIds); // Assert node IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/SteelDesignEffectiveLengthTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/SteelDesignEffectiveLengthTests.cs index faf6fcb22..ccf03ef84 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/SteelDesignEffectiveLengthTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/SteelDesignEffectiveLengthTests.cs @@ -21,7 +21,7 @@ public class SteelDesignEffectiveLengthTests { SteelDesignEffectiveLengths resultSet = result.SteelDesignEffectiveLengths.ResultSubset(elementIds); // Assert - var expectedIds = result.Model.Model.Elements(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -35,7 +35,7 @@ public class SteelDesignEffectiveLengthTests { SteelDesignEffectiveLengths resultSet = result.SteelDesignEffectiveLengths.ResultSubset(elementIds); // Assert - var expectedIds = result.Model.Model.Elements(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/Collections/SteelUtilisationTests.cs b/GsaGHTests/1_BaseParameters/5_Results/Collections/SteelUtilisationTests.cs index d29250d61..9b162585c 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/Collections/SteelUtilisationTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/Collections/SteelUtilisationTests.cs @@ -24,7 +24,7 @@ public class SteelUtilisationsTests { = result.SteelUtilisations.ResultSubset(elementIds); // Assert - var expectedIds = result.Model.Model.Elements(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } @@ -39,7 +39,7 @@ public class SteelUtilisationsTests { = result.SteelUtilisations.ResultSubset(elementIds); // Assert - var expectedIds = result.Model.Model.Elements(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds, resultSet.Ids); } diff --git a/GsaGHTests/1_BaseParameters/5_Results/GsaResultAnalysisCaseTests.cs b/GsaGHTests/1_BaseParameters/5_Results/GsaResultAnalysisCaseTests.cs index 8dcb8fc8d..8c9626f7d 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/GsaResultAnalysisCaseTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/GsaResultAnalysisCaseTests.cs @@ -10,14 +10,14 @@ public partial class GsaResultTests { public static GsaResult AnalysisCaseResult(string file, int caseId) { var apiModel = new GsaAPI.Model(file); var model = new GsaModel(apiModel); - ReadOnlyDictionary analysisCaseResults = model.Model.Results(); + ReadOnlyDictionary analysisCaseResults = model.ApiModel.Results(); return new GsaResult(model, analysisCaseResults[caseId], caseId); } public static GsaResult CombinationCaseResult(string file, int caseId, IEnumerable permutations = null) { var apiModel = new GsaAPI.Model(file); var model = new GsaModel(apiModel); - ReadOnlyDictionary combinationCaseResults = model.Model.CombinationCaseResults(); + ReadOnlyDictionary combinationCaseResults = model.ApiModel.CombinationCaseResults(); if (permutations == null) { permutations = new List() { 1 }; } diff --git a/GsaGHTests/2_GooWrappers/GH_OasysGooTest.cs b/GsaGHTests/2_GooWrappers/GH_OasysGooTest.cs index 994c5166e..37fd72a56 100644 --- a/GsaGHTests/2_GooWrappers/GH_OasysGooTest.cs +++ b/GsaGHTests/2_GooWrappers/GH_OasysGooTest.cs @@ -54,7 +54,7 @@ public class GhOasysGooTest { // 4_Analysis [InlineData(typeof(GsaAnalysisCaseGoo), typeof(GsaAnalysisCase))] - [InlineData(typeof(GsaAnalysisTaskGoo), typeof(GsaAnalysisTask))] + //[InlineData(typeof(GsaAnalysisTaskGoo), typeof(GsaAnalysisTask))] [InlineData(typeof(GsaCombinationCaseGoo), typeof(GsaCombinationCase))] // 5_Results diff --git a/GsaGHTests/3_Components/0_Model/CreateGridLineTest.cs b/GsaGHTests/3_Components/0_Model/CreateGridLineTest.cs index 66c5056b5..d0a3ca408 100644 --- a/GsaGHTests/3_Components/0_Model/CreateGridLineTest.cs +++ b/GsaGHTests/3_Components/0_Model/CreateGridLineTest.cs @@ -112,7 +112,7 @@ public class CreateGridLineTest { [Fact] public void CreateModelWithGridLines() { GsaModelGoo model = CreateModelWithGridlines(); - Assert.Single(model.Value.Model.GridLines()); + Assert.Single(model.Value.ApiModel.GridLines()); } } } diff --git a/GsaGHTests/3_Components/0_Model/GetModelAnalysisTests.cs b/GsaGHTests/3_Components/0_Model/GetModelAnalysisTests.cs index 75620a2d3..b978a67cd 100644 --- a/GsaGHTests/3_Components/0_Model/GetModelAnalysisTests.cs +++ b/GsaGHTests/3_Components/0_Model/GetModelAnalysisTests.cs @@ -12,7 +12,7 @@ public class GetModelAnalysisTests { // Assemble var comp = new GetModelAnalysis(); var model = new GsaModel(); - model.Model.Open(GsaFile.SteelDesignSimple); + model.ApiModel.Open(GsaFile.SteelDesignSimple); // Act ComponentTestHelper.SetInput(comp, new GsaModelGoo(model)); @@ -24,8 +24,8 @@ public class GetModelAnalysisTests { Assert.NotNull(taskGoo); Assert.Equal(1, taskGoo.Value.Id); Assert.Equal(2, taskGoo.Value.Cases.Count); - Assert.Equal("Task 1", taskGoo.Value.Task.Name); - Assert.Equal((int)AnalysisTaskType.Static, taskGoo.Value.Task.Type); + Assert.Equal("Task 1", taskGoo.Value.ApiTask.Name); + Assert.Equal((int)AnalysisTaskType.Static, taskGoo.Value.ApiTask.Type); Assert.NotNull(caseGoo); Assert.Equal(1, caseGoo.Value.Id); diff --git a/GsaGHTests/3_Components/0_Model/SteelSectionPoolNamesTests.cs b/GsaGHTests/3_Components/0_Model/SteelSectionPoolNamesTests.cs index 96f146baa..a43cb202e 100644 --- a/GsaGHTests/3_Components/0_Model/SteelSectionPoolNamesTests.cs +++ b/GsaGHTests/3_Components/0_Model/SteelSectionPoolNamesTests.cs @@ -39,7 +39,7 @@ public class SteelSectionPoolNamesTests { ComponentTestHelper.SetListInput(comp, new List() { "Steel pool 1", "Steel pool 2", "Steel pool 4" }, 2); var output = (List)ComponentTestHelper.GetListOutput(comp, 0); - ReadOnlyDictionary sectionPools = output[0].Value.Model.SteelSectionPools(); + ReadOnlyDictionary sectionPools = output[0].Value.ApiModel.SteelSectionPools(); Assert.Equal("Steel pool 1", sectionPools[1]); Assert.Equal("Steel pool 2", sectionPools[2]); Assert.Equal("Steel pool 4", sectionPools[4]); diff --git a/GsaGHTests/3_Components/0_Model/TitlesTest.cs b/GsaGHTests/3_Components/0_Model/TitlesTest.cs index 3137110a1..cd411f255 100644 --- a/GsaGHTests/3_Components/0_Model/TitlesTest.cs +++ b/GsaGHTests/3_Components/0_Model/TitlesTest.cs @@ -49,7 +49,7 @@ public class TitlesTests { // test that items have been set into API model var output = (GsaModelGoo)ComponentTestHelper.GetOutput(comp); - GsaAPI.Titles titles = output.Value.Model.Titles(); + GsaAPI.Titles titles = output.Value.ApiModel.Titles(); Assert.Equal("123456-78", titles.JobNumber); Assert.Equal("KPN", titles.Initials); Assert.Equal("Test this Title", titles.Title); diff --git a/GsaGHTests/3_Components/0_Model/UnitsTest.cs b/GsaGHTests/3_Components/0_Model/UnitsTest.cs index 45956e931..54e1d5d45 100644 --- a/GsaGHTests/3_Components/0_Model/UnitsTest.cs +++ b/GsaGHTests/3_Components/0_Model/UnitsTest.cs @@ -76,7 +76,7 @@ public class UnitsTests { // test that items have been set into API model var output = (GsaModelGoo)ComponentTestHelper.GetOutput(comp); - GsaAPI.UiUnits units = output.Value.Model.UiUnits(); + GsaAPI.UiUnits units = output.Value.ApiModel.UiUnits(); Assert.Equal("CentimeterPerSecondSquared", units.Acceleration.ToString()); Assert.Equal("Degree", units.Angle.ToString()); Assert.Equal("Megajoule", units.Energy.ToString()); diff --git a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs index 681edfc2f..a779eeb75 100644 --- a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs @@ -26,8 +26,8 @@ public class CreateAnalysisTaskTests { var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); - Assert.Equal("my Task", output.Value.Task.Name); - Assert.Equal((int)AnalysisTaskType.Static, output.Value.Task.Type); + Assert.Equal("my Task", output.Value.ApiTask.Name); + Assert.Equal((int)AnalysisTaskType.Static, output.Value.ApiTask.Type); Assert.Equal("my Case", output.Value.Cases[0].Name); Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); } diff --git a/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs index b611a8d7d..54be4cbf9 100644 --- a/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs @@ -1,4 +1,5 @@ using Grasshopper.Kernel.Types; +using GsaAPI; using GsaGH.Components; using GsaGH.Parameters; using GsaGHTests.Helper; @@ -27,37 +28,40 @@ public class EditAnalysisTaskTests { var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); - Assert.Equal("my Task", output.Value.Task.Name); - Assert.Equal((int)AnalysisTaskType.Static, output.Value.Task.Type); + Assert.Equal("my Task", output.Value.ApiTask.Name); + Assert.Equal((int)AnalysisTaskType.Static, output.Value.ApiTask.Type); Assert.Equal("my Case", output.Value.Cases[0].Name); Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); } [Fact] public void GetTaskInfoFromModelTest() { + // Assemble var getModelAnalysis = new GetModelAnalysis(); var model = new GsaModel(); - model.Model.Open(GsaFile.SteelDesignSimple); + model.ApiModel.Open(GsaFile.SteelDesignSimple); ComponentTestHelper.SetInput(getModelAnalysis, new GsaModelGoo(model)); var taskGoo = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(getModelAnalysis); + // Act var comp = new EditAnalysisTask(); comp.CreateAttributes(); ComponentTestHelper.SetInput(comp, taskGoo); - var output1 = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); - var output2 = (GH_String)ComponentTestHelper.GetOutput(comp, 1); - var output3 = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput(comp, 2); - var output4 = (GH_String)ComponentTestHelper.GetOutput(comp, 3); - var output5 = (GH_Integer)ComponentTestHelper.GetOutput(comp, 4); - - Duplicates.AreEqual(taskGoo.Value, output1.Value); - Assert.Equal("Task 1", output2.Value); - Assert.Equal(1, output3.Value.Id); - Assert.Equal("L1", output3.Value.Definition); - Assert.Equal("DL", output3.Value.Name); - Assert.Equal("Static", output4.Value); - Assert.Equal(1, output5.Value); + // Assert + var output0 = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); // task + var output1 = (GH_String)ComponentTestHelper.GetOutput(comp, 1); // name + var output2 = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput(comp, 2); // cases + var output3 = (GH_String)ComponentTestHelper.GetOutput(comp, 3); // type + var output4 = (GH_Integer)ComponentTestHelper.GetOutput(comp, 4); // task id + + Duplicates.AreEqual(taskGoo.Value, output0.Value); + Assert.Equal("Task 1", output1.Value); + Assert.Equal(1, output2.Value.Id); + Assert.Equal("L1", output2.Value.Definition); + Assert.Equal("DL", output2.Value.Name); + Assert.Equal("Static", output3.Value); + Assert.Equal(1, output4.Value); } } } diff --git a/GsaGHTests/3_Components/5_Results/BeamDerivedStressesTests.cs b/GsaGHTests/3_Components/5_Results/BeamDerivedStressesTests.cs index 4e60d3a57..dc8038e45 100644 --- a/GsaGHTests/3_Components/5_Results/BeamDerivedStressesTests.cs +++ b/GsaGHTests/3_Components/5_Results/BeamDerivedStressesTests.cs @@ -55,7 +55,7 @@ public class BeamDerivedStressesTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/BeamDisplacementsTests.cs b/GsaGHTests/3_Components/5_Results/BeamDisplacementsTests.cs index 814dcd4a8..aa02c0a1c 100644 --- a/GsaGHTests/3_Components/5_Results/BeamDisplacementsTests.cs +++ b/GsaGHTests/3_Components/5_Results/BeamDisplacementsTests.cs @@ -55,7 +55,7 @@ public class BeamDisplacementsTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/BeamForcesAndMomentsTests.cs b/GsaGHTests/3_Components/5_Results/BeamForcesAndMomentsTests.cs index 9fc9e90c6..ccf8d1bb8 100644 --- a/GsaGHTests/3_Components/5_Results/BeamForcesAndMomentsTests.cs +++ b/GsaGHTests/3_Components/5_Results/BeamForcesAndMomentsTests.cs @@ -55,7 +55,7 @@ public class BeamForcesAndMomentsTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/BeamStrainEnergyDensityAverageTests.cs b/GsaGHTests/3_Components/5_Results/BeamStrainEnergyDensityAverageTests.cs index 66e4def88..7786a56ae 100644 --- a/GsaGHTests/3_Components/5_Results/BeamStrainEnergyDensityAverageTests.cs +++ b/GsaGHTests/3_Components/5_Results/BeamStrainEnergyDensityAverageTests.cs @@ -54,7 +54,7 @@ public class BeamStrainEnergyDensityAverageTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/BeamStrainEnergyDensityTests.cs b/GsaGHTests/3_Components/5_Results/BeamStrainEnergyDensityTests.cs index f500f0bc2..a60228c28 100644 --- a/GsaGHTests/3_Components/5_Results/BeamStrainEnergyDensityTests.cs +++ b/GsaGHTests/3_Components/5_Results/BeamStrainEnergyDensityTests.cs @@ -46,7 +46,7 @@ public class BeamStrainEnergyDensityTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/BeamStressesTests.cs b/GsaGHTests/3_Components/5_Results/BeamStressesTests.cs index 8f34f3064..17e9a9a4b 100644 --- a/GsaGHTests/3_Components/5_Results/BeamStressesTests.cs +++ b/GsaGHTests/3_Components/5_Results/BeamStressesTests.cs @@ -55,7 +55,7 @@ public class BeamStressesTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/Element2dDisplacementsTests.cs b/GsaGHTests/3_Components/5_Results/Element2dDisplacementsTests.cs index 041198ece..41beb1304 100644 --- a/GsaGHTests/3_Components/5_Results/Element2dDisplacementsTests.cs +++ b/GsaGHTests/3_Components/5_Results/Element2dDisplacementsTests.cs @@ -55,7 +55,7 @@ public class Element2dDisplacementsTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsForcesTests.cs b/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsForcesTests.cs index 6344ed516..2e4758938 100644 --- a/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsForcesTests.cs +++ b/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsForcesTests.cs @@ -55,7 +55,7 @@ public class Element2dForcesAndMomentsForcesTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsMomentsTests.cs b/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsMomentsTests.cs index 1cfb65049..2f26e94aa 100644 --- a/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsMomentsTests.cs +++ b/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsMomentsTests.cs @@ -47,7 +47,7 @@ public class Element2dForcesAndMomentsMomentsTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsShearsTests.cs b/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsShearsTests.cs index 1a57a69ac..ec97282a4 100644 --- a/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsShearsTests.cs +++ b/GsaGHTests/3_Components/5_Results/Element2dForcesAndMomentsShearsTests.cs @@ -47,7 +47,7 @@ public class Element2dForcesAndMomentsShearsTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/Element2dStressesTests.cs b/GsaGHTests/3_Components/5_Results/Element2dStressesTests.cs index fb48bb2d1..3f07a56d0 100644 --- a/GsaGHTests/3_Components/5_Results/Element2dStressesTests.cs +++ b/GsaGHTests/3_Components/5_Results/Element2dStressesTests.cs @@ -59,7 +59,7 @@ public class Element2dStressesTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/Element3dDisplacementsTests.cs b/GsaGHTests/3_Components/5_Results/Element3dDisplacementsTests.cs index 27561e7ba..920f16b87 100644 --- a/GsaGHTests/3_Components/5_Results/Element3dDisplacementsTests.cs +++ b/GsaGHTests/3_Components/5_Results/Element3dDisplacementsTests.cs @@ -55,7 +55,7 @@ public class Element3dDisplacementsTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/Element3dStressesTests.cs b/GsaGHTests/3_Components/5_Results/Element3dStressesTests.cs index 5ae948e4a..b6ffab316 100644 --- a/GsaGHTests/3_Components/5_Results/Element3dStressesTests.cs +++ b/GsaGHTests/3_Components/5_Results/Element3dStressesTests.cs @@ -55,7 +55,7 @@ public class Element3dStressesTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(ElementList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(ElementList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/FootfallResultsTests.cs b/GsaGHTests/3_Components/5_Results/FootfallResultsTests.cs index 4878b85d6..cb1e9f610 100644 --- a/GsaGHTests/3_Components/5_Results/FootfallResultsTests.cs +++ b/GsaGHTests/3_Components/5_Results/FootfallResultsTests.cs @@ -62,7 +62,7 @@ public class FootfallResultsTests { var ids = (IList)ComponentTestHelper.GetListOutput(comp, 7); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j].Value); } } diff --git a/GsaGHTests/3_Components/5_Results/GetResultsTest.cs b/GsaGHTests/3_Components/5_Results/GetResultsTest.cs index dfa2aa4b7..32bcbfa12 100644 --- a/GsaGHTests/3_Components/5_Results/GetResultsTest.cs +++ b/GsaGHTests/3_Components/5_Results/GetResultsTest.cs @@ -104,7 +104,7 @@ public class GetResultsTest { Definition = "1", Name = "myList" }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new Member1dDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -123,7 +123,7 @@ public class GetResultsTest { Definition = "1", Name = "myList" }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new Member1dDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -142,7 +142,7 @@ public class GetResultsTest { Definition = "1", Name = string.Empty }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new Member1dDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); diff --git a/GsaGHTests/3_Components/5_Results/Member1dDisplacementsTests.cs b/GsaGHTests/3_Components/5_Results/Member1dDisplacementsTests.cs index 68eb0f94f..89af185a9 100644 --- a/GsaGHTests/3_Components/5_Results/Member1dDisplacementsTests.cs +++ b/GsaGHTests/3_Components/5_Results/Member1dDisplacementsTests.cs @@ -55,7 +55,7 @@ public class Member1dDisplacementsTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/Member1dForcesAndMomentsTests.cs b/GsaGHTests/3_Components/5_Results/Member1dForcesAndMomentsTests.cs index ef3abc13f..50055fe2c 100644 --- a/GsaGHTests/3_Components/5_Results/Member1dForcesAndMomentsTests.cs +++ b/GsaGHTests/3_Components/5_Results/Member1dForcesAndMomentsTests.cs @@ -55,7 +55,7 @@ public class Member1dForcesAndMomentsTests { var ids = paths.Select(x => x.Indices[2]).ToList(); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Elements(MemberList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Elements(MemberList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j]); } } diff --git a/GsaGHTests/3_Components/5_Results/NodeDisplacementsTests.cs b/GsaGHTests/3_Components/5_Results/NodeDisplacementsTests.cs index 8ecb584dd..7abe88268 100644 --- a/GsaGHTests/3_Components/5_Results/NodeDisplacementsTests.cs +++ b/GsaGHTests/3_Components/5_Results/NodeDisplacementsTests.cs @@ -58,7 +58,7 @@ public class NodeDisplacementsTests { var ids = (IList)ComponentTestHelper.GetListOutput(comp, 8); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j].Value); } } @@ -92,7 +92,7 @@ public class NodeDisplacementsTests { var ids = (IList)ComponentTestHelper.GetListOutput(comp, 8); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j].Value); } } diff --git a/GsaGHTests/3_Components/5_Results/ReactionForcesTests.cs b/GsaGHTests/3_Components/5_Results/ReactionForcesTests.cs index efd0a809c..9b90179c8 100644 --- a/GsaGHTests/3_Components/5_Results/ReactionForcesTests.cs +++ b/GsaGHTests/3_Components/5_Results/ReactionForcesTests.cs @@ -57,7 +57,7 @@ public class ReactionForcesTests { var ids = (IList)ComponentTestHelper.GetListOutput(comp, 8); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.ToList(); Assert.Contains(expectedIds[j], ids.Select(i => i.Value)); } } @@ -91,7 +91,7 @@ public class ReactionForcesTests { var ids = (IList)ComponentTestHelper.GetListOutput(comp, 8); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j].Value); } } diff --git a/GsaGHTests/3_Components/5_Results/SpringReactionForcesTests.cs b/GsaGHTests/3_Components/5_Results/SpringReactionForcesTests.cs index 15e22b4c7..7d4aa9ec0 100644 --- a/GsaGHTests/3_Components/5_Results/SpringReactionForcesTests.cs +++ b/GsaGHTests/3_Components/5_Results/SpringReactionForcesTests.cs @@ -57,7 +57,7 @@ public class SpringReactionForcesTests { var ids = (IList)ComponentTestHelper.GetListOutput(comp, 8); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j].Value); } } @@ -91,7 +91,7 @@ public class SpringReactionForcesTests { var ids = (IList)ComponentTestHelper.GetListOutput(comp, 8); for (int j = 0; j < ids.Count; j++) { // Assert element IDs - var expectedIds = result.Model.Model.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); + var expectedIds = result.Model.ApiModel.Nodes(NodeList).Keys.OrderBy(x => x).ToList(); Assert.Equal(expectedIds[j], ids[j].Value); } } diff --git a/GsaGHTests/Helpers/Assemble/AssembleModelTestsHelper.cs b/GsaGHTests/Helpers/Assemble/AssembleModelTestsHelper.cs index 2bb3ade87..add4aedd7 100644 --- a/GsaGHTests/Helpers/Assemble/AssembleModelTestsHelper.cs +++ b/GsaGHTests/Helpers/Assemble/AssembleModelTestsHelper.cs @@ -13,7 +13,7 @@ public partial class AssembleModelTests { internal void TestAnalysisMaterial(GsaMaterial expected, int expectedId, GsaModel actualModel) { ReadOnlyDictionary apiMaterials - = actualModel.Model.AnalysisMaterials(); + = actualModel.ApiModel.AnalysisMaterials(); Assert.True(apiMaterials.ContainsKey(expectedId), "Analysis material with id " + expectedId + " is not present in model"); @@ -27,11 +27,11 @@ public partial class AssembleModelTests { internal void TestElement1d( GsaElement1d expected, LengthUnit unit, int expectedId, GsaModel actualModel) { - ReadOnlyDictionary apiElements = actualModel.Model.Elements(); + ReadOnlyDictionary apiElements = actualModel.ApiModel.Elements(); Assert.True(apiElements.ContainsKey(expectedId), "Element with id " + expectedId + " is not present in model"); - ReadOnlyDictionary apiNodes = actualModel.Model.Nodes(); + ReadOnlyDictionary apiNodes = actualModel.ApiModel.Nodes(); Element api = apiElements[expectedId]; Node apiStart = apiNodes[api.Topology[0]]; Node apiEnd = apiNodes[api.Topology[1]]; @@ -77,8 +77,8 @@ public partial class AssembleModelTests { internal void TestElement2d( GsaElement2d expected, LengthUnit unit, List expectedIds, GsaModel actualModel) { - ReadOnlyDictionary apiElements = actualModel.Model.Elements(); - ReadOnlyDictionary apiNodes = actualModel.Model.Nodes(); + ReadOnlyDictionary apiElements = actualModel.ApiModel.Elements(); + ReadOnlyDictionary apiNodes = actualModel.ApiModel.Nodes(); int i = 0; foreach (int id in expectedIds) { @@ -112,11 +112,11 @@ public partial class AssembleModelTests { internal void TestMember1d( GsaMember1d expected, LengthUnit unit, int expectedId, GsaModel actualModel) { - ReadOnlyDictionary apiElements = actualModel.Model.Members(); + ReadOnlyDictionary apiElements = actualModel.ApiModel.Members(); Assert.True(apiElements.ContainsKey(expectedId), "Member with id " + expectedId + " is not present in model"); - ReadOnlyDictionary apiNodes = actualModel.Model.Nodes(); + ReadOnlyDictionary apiNodes = actualModel.ApiModel.Nodes(); Member api = apiElements[expectedId]; string[] topologySplit = api.Topology.Split(' '); int i = 0; @@ -166,11 +166,11 @@ public partial class AssembleModelTests { internal void TestMember2d( GsaMember2d expected, LengthUnit unit, int expectedId, GsaModel actualModel) { - ReadOnlyDictionary apiElements = actualModel.Model.Members(); + ReadOnlyDictionary apiElements = actualModel.ApiModel.Members(); Assert.True(apiElements.ContainsKey(expectedId), "Member with id " + expectedId + " is not present in model"); - ReadOnlyDictionary apiNodes = actualModel.Model.Nodes(); + ReadOnlyDictionary apiNodes = actualModel.ApiModel.Nodes(); Member api = apiElements[expectedId]; string[] topologySplit = api.Topology.Split(' '); for (int i = 0; i < expected.Topology.Count; i++) { @@ -196,11 +196,11 @@ public partial class AssembleModelTests { internal void TestMember3d( GsaMember3d expected, LengthUnit unit, int expectedId, GsaModel actualModel) { - ReadOnlyDictionary apiElements = actualModel.Model.Members(); + ReadOnlyDictionary apiElements = actualModel.ApiModel.Members(); Assert.True(apiElements.ContainsKey(expectedId), "Member with id " + expectedId + " is not present in model"); - ReadOnlyDictionary apiNodes = actualModel.Model.Nodes(); + ReadOnlyDictionary apiNodes = actualModel.ApiModel.Nodes(); Member api = apiElements[expectedId]; string[] faces = api.Topology.Split(';'); int faceId = 0; @@ -238,7 +238,7 @@ public partial class AssembleModelTests { internal void TestNode( GsaNode expected, LengthUnit unit, int expectedId, GsaModel actualModel) { - ReadOnlyDictionary apiNodes = actualModel.Model.Nodes(); + ReadOnlyDictionary apiNodes = actualModel.ApiModel.Nodes(); Assert.True(apiNodes.ContainsKey(expectedId), "Node with id " + expectedId + " is not present in model"); @@ -256,7 +256,7 @@ public partial class AssembleModelTests { Assert.Equal(apiNode.Restraint.ZZ, expected.Restraint.Zz); if (!expected.IsGlobalAxis) { - ReadOnlyDictionary apiAxes = actualModel.Model.Axes(); + ReadOnlyDictionary apiAxes = actualModel.ApiModel.Axes(); Assert.True(apiAxes.ContainsKey(apiNode.AxisProperty), "Axis with id " + apiNode.AxisProperty + " is not present in model"); Axis apiAxis = apiAxes[apiNode.AxisProperty]; @@ -282,7 +282,7 @@ public partial class AssembleModelTests { } internal void TestProp2d(GsaProperty2d expected, int expectedId, GsaModel actualModel) { - ReadOnlyDictionary apiProp2ds = actualModel.Model.Prop2Ds(); + ReadOnlyDictionary apiProp2ds = actualModel.ApiModel.Prop2Ds(); Assert.True(apiProp2ds.ContainsKey(expectedId), "Prop2d with id " + expectedId + " is not present in model"); @@ -297,7 +297,7 @@ public partial class AssembleModelTests { } internal void TestProp3d(GsaProperty3d expected, int expectedId, GsaModel actualModel) { - ReadOnlyDictionary apiProp3ds = actualModel.Model.Prop3Ds(); + ReadOnlyDictionary apiProp3ds = actualModel.ApiModel.Prop3Ds(); Assert.True(apiProp3ds.ContainsKey(expectedId), "Prop3d with id " + expectedId + " is not present in model"); @@ -311,7 +311,7 @@ public partial class AssembleModelTests { } internal void TestSection(GsaSection expected, int expectedId, GsaModel actualModel) { - ReadOnlyDictionary apiSections = actualModel.Model.Sections(); + ReadOnlyDictionary apiSections = actualModel.ApiModel.Sections(); Assert.True(apiSections.ContainsKey(expectedId), "Section with id " + expectedId + " is not present in model"); diff --git a/GsaGHTests/Helpers/Assemble/AssembleModelTestsLoads.cs b/GsaGHTests/Helpers/Assemble/AssembleModelTestsLoads.cs index 8940317a2..863bb283b 100644 --- a/GsaGHTests/Helpers/Assemble/AssembleModelTestsLoads.cs +++ b/GsaGHTests/Helpers/Assemble/AssembleModelTestsLoads.cs @@ -19,9 +19,9 @@ public partial class AssembleModelTests { load }, null)); - Assert.Empty(modelGoo.Value.Model.LoadCases()); - Assert.Single(modelGoo.Value.Model.GravityLoads()); - Assert.Equal(1, modelGoo.Value.Model.GravityLoads()[0].Case); + Assert.Empty(modelGoo.Value.ApiModel.LoadCases()); + Assert.Single(modelGoo.Value.ApiModel.GravityLoads()); + Assert.Equal(1, modelGoo.Value.ApiModel.GravityLoads()[0].Case); } [Fact] @@ -34,9 +34,9 @@ public partial class AssembleModelTests { load }, null)); - Assert.Empty(modelGoo.Value.Model.LoadCases()); - Assert.Single(modelGoo.Value.Model.BeamLoads()); - Assert.Equal(1, modelGoo.Value.Model.BeamLoads()[0].Case); + Assert.Empty(modelGoo.Value.ApiModel.LoadCases()); + Assert.Single(modelGoo.Value.ApiModel.BeamLoads()); + Assert.Equal(1, modelGoo.Value.ApiModel.BeamLoads()[0].Case); } [Fact] @@ -49,9 +49,9 @@ public partial class AssembleModelTests { load }, null)); - Assert.Empty(modelGoo.Value.Model.LoadCases()); - Assert.Single(modelGoo.Value.Model.BeamThermalLoads()); - Assert.Equal(1, modelGoo.Value.Model.BeamThermalLoads()[0].Case); + Assert.Empty(modelGoo.Value.ApiModel.LoadCases()); + Assert.Single(modelGoo.Value.ApiModel.BeamThermalLoads()); + Assert.Equal(1, modelGoo.Value.ApiModel.BeamThermalLoads()[0].Case); } [Fact] @@ -64,9 +64,9 @@ public partial class AssembleModelTests { load }, null)); - Assert.Empty(modelGoo.Value.Model.LoadCases()); - Assert.Single(modelGoo.Value.Model.FaceLoads()); - Assert.Equal(1, modelGoo.Value.Model.FaceLoads()[0].Case); + Assert.Empty(modelGoo.Value.ApiModel.LoadCases()); + Assert.Single(modelGoo.Value.ApiModel.FaceLoads()); + Assert.Equal(1, modelGoo.Value.ApiModel.FaceLoads()[0].Case); } [Fact] @@ -79,9 +79,9 @@ public partial class AssembleModelTests { load }, null)); - Assert.Empty(modelGoo.Value.Model.LoadCases()); - Assert.Single(modelGoo.Value.Model.FaceThermalLoads()); - Assert.Equal(1, modelGoo.Value.Model.FaceThermalLoads()[0].Case); + Assert.Empty(modelGoo.Value.ApiModel.LoadCases()); + Assert.Single(modelGoo.Value.ApiModel.FaceThermalLoads()); + Assert.Equal(1, modelGoo.Value.ApiModel.FaceThermalLoads()[0].Case); } [Fact] @@ -94,9 +94,9 @@ public partial class AssembleModelTests { load }, null)); - Assert.Empty(modelGoo.Value.Model.LoadCases()); - Assert.Single(modelGoo.Value.Model.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)); - Assert.Equal(1, modelGoo.Value.Model.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)[0].Case); + Assert.Empty(modelGoo.Value.ApiModel.LoadCases()); + Assert.Single(modelGoo.Value.ApiModel.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)); + Assert.Equal(1, modelGoo.Value.ApiModel.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)[0].Case); } [Fact] @@ -111,9 +111,9 @@ public partial class AssembleModelTests { load }, null)); - Assert.Empty(modelGoo.Value.Model.LoadCases()); - Assert.Single(modelGoo.Value.Model.GravityLoads()); - Assert.Equal(4, modelGoo.Value.Model.GravityLoads()[0].Case); + Assert.Empty(modelGoo.Value.ApiModel.LoadCases()); + Assert.Single(modelGoo.Value.ApiModel.GravityLoads()); + Assert.Equal(4, modelGoo.Value.ApiModel.GravityLoads()[0].Case); } [Fact] @@ -128,9 +128,9 @@ public partial class AssembleModelTests { load }, null)); - Assert.Empty(modelGoo.Value.Model.LoadCases()); - Assert.Single(modelGoo.Value.Model.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)); - Assert.Equal(4, modelGoo.Value.Model.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)[0].Case); + Assert.Empty(modelGoo.Value.ApiModel.LoadCases()); + Assert.Single(modelGoo.Value.ApiModel.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)); + Assert.Equal(4, modelGoo.Value.ApiModel.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)[0].Case); } [Fact] @@ -145,12 +145,12 @@ public partial class AssembleModelTests { load }, null)); - Assert.Single(modelGoo.Value.Model.LoadCases()); - Assert.NotNull(modelGoo.Value.Model.LoadCases()[4]); - Assert.Equal(GsaAPI.LoadCaseType.Dead, modelGoo.Value.Model.LoadCases()[4].CaseType); - Assert.Equal("dead", modelGoo.Value.Model.LoadCases()[4].Name); - Assert.Single(modelGoo.Value.Model.GravityLoads()); - Assert.Equal(4, modelGoo.Value.Model.GravityLoads()[0].Case); + Assert.Single(modelGoo.Value.ApiModel.LoadCases()); + Assert.NotNull(modelGoo.Value.ApiModel.LoadCases()[4]); + Assert.Equal(GsaAPI.LoadCaseType.Dead, modelGoo.Value.ApiModel.LoadCases()[4].CaseType); + Assert.Equal("dead", modelGoo.Value.ApiModel.LoadCases()[4].Name); + Assert.Single(modelGoo.Value.ApiModel.GravityLoads()); + Assert.Equal(4, modelGoo.Value.ApiModel.GravityLoads()[0].Case); } [Fact] @@ -165,12 +165,12 @@ public partial class AssembleModelTests { load }, null)); - Assert.Single(modelGoo.Value.Model.LoadCases()); - Assert.NotNull(modelGoo.Value.Model.LoadCases()[4]); - Assert.Equal(GsaAPI.LoadCaseType.Dead, modelGoo.Value.Model.LoadCases()[4].CaseType); - Assert.Equal("dead", modelGoo.Value.Model.LoadCases()[4].Name); - Assert.Single(modelGoo.Value.Model.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)); - Assert.Equal(4, modelGoo.Value.Model.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)[0].Case); + Assert.Single(modelGoo.Value.ApiModel.LoadCases()); + Assert.NotNull(modelGoo.Value.ApiModel.LoadCases()[4]); + Assert.Equal(GsaAPI.LoadCaseType.Dead, modelGoo.Value.ApiModel.LoadCases()[4].CaseType); + Assert.Equal("dead", modelGoo.Value.ApiModel.LoadCases()[4].Name); + Assert.Single(modelGoo.Value.ApiModel.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)); + Assert.Equal(4, modelGoo.Value.ApiModel.NodeLoads(GsaAPI.NodeLoadType.NODE_LOAD)[0].Case); } [Fact] @@ -186,7 +186,7 @@ public partial class AssembleModelTests { null)); var steelExample = new GsaModel(); - steelExample.Model.Open(GsaFile.SteelDesignSimple); + steelExample.ApiModel.Open(GsaFile.SteelDesignSimple); var modelGoo = (GsaModelGoo)ComponentTestHelper.GetOutput( CreateModelTest.CreateModelFromModels(new List() { @@ -195,11 +195,11 @@ public partial class AssembleModelTests { })); - Assert.Equal(2, modelGoo.Value.Model.LoadCases().Count); - Assert.Equal(GsaAPI.LoadCaseType.Dead, modelGoo.Value.Model.LoadCases()[1].CaseType); - Assert.Equal("DL", modelGoo.Value.Model.LoadCases()[1].Name); - Assert.Single(modelGoo.Value.Model.GravityLoads()); - Assert.Equal(1, modelGoo.Value.Model.GravityLoads()[0].Case); + Assert.Equal(2, modelGoo.Value.ApiModel.LoadCases().Count); + Assert.Equal(GsaAPI.LoadCaseType.Dead, modelGoo.Value.ApiModel.LoadCases()[1].CaseType); + Assert.Equal("DL", modelGoo.Value.ApiModel.LoadCases()[1].Name); + Assert.Single(modelGoo.Value.ApiModel.GravityLoads()); + Assert.Equal(1, modelGoo.Value.ApiModel.GravityLoads()[0].Case); } [Fact] @@ -215,7 +215,7 @@ public partial class AssembleModelTests { null)); var steelExample = new GsaModel(); - steelExample.Model.Open(GsaFile.SteelDesignSimple); + steelExample.ApiModel.Open(GsaFile.SteelDesignSimple); GH_OasysDropDownComponent assemblyComponent = CreateModelTest.CreateModelFromModels(new List() { new GsaModelGoo(steelExample), @@ -224,11 +224,11 @@ public partial class AssembleModelTests { var modelGoo = (GsaModelGoo)ComponentTestHelper.GetOutput(assemblyComponent); Assert.Single(assemblyComponent.RuntimeMessages(Grasshopper.Kernel.GH_RuntimeMessageLevel.Remark)); - Assert.Equal(2, modelGoo.Value.Model.LoadCases().Count); - Assert.Equal(GsaAPI.LoadCaseType.Dead, modelGoo.Value.Model.LoadCases()[1].CaseType); - Assert.Equal("dead", modelGoo.Value.Model.LoadCases()[1].Name); - Assert.Single(modelGoo.Value.Model.GravityLoads()); - Assert.Equal(1, modelGoo.Value.Model.GravityLoads()[0].Case); + Assert.Equal(2, modelGoo.Value.ApiModel.LoadCases().Count); + Assert.Equal(GsaAPI.LoadCaseType.Dead, modelGoo.Value.ApiModel.LoadCases()[1].CaseType); + Assert.Equal("dead", modelGoo.Value.ApiModel.LoadCases()[1].Name); + Assert.Single(modelGoo.Value.ApiModel.GravityLoads()); + Assert.Equal(1, modelGoo.Value.ApiModel.GravityLoads()[0].Case); } } } diff --git a/GsaGHTests/Helpers/GH/InputsForModelAssemblyTests.cs b/GsaGHTests/Helpers/GH/InputsForModelAssemblyTests.cs index 5b0f4eafd..f6f2c36b2 100644 --- a/GsaGHTests/Helpers/GH/InputsForModelAssemblyTests.cs +++ b/GsaGHTests/Helpers/GH/InputsForModelAssemblyTests.cs @@ -19,7 +19,7 @@ public class InputsForModelAssemblyTests { public void GetAnalysisFromTaskTest() { var getModelAnalysis = new GetModelAnalysis(); var model = new GsaModel(); - model.Model.Open(GsaFile.SteelDesignSimple); + model.ApiModel.Open(GsaFile.SteelDesignSimple); ComponentTestHelper.SetInput(getModelAnalysis, new GsaModelGoo(model)); var taskGoo = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(getModelAnalysis); var comp = new CreateModel(); @@ -34,7 +34,7 @@ public class InputsForModelAssemblyTests { public void GetAnalysisFromCombinationTest() { var getModelAnalysis = new GetModelAnalysis(); var model = new GsaModel(); - model.Model.Open(GsaFile.SteelDesignSimple); + model.ApiModel.Open(GsaFile.SteelDesignSimple); ComponentTestHelper.SetInput(getModelAnalysis, new GsaModelGoo(model)); var combinationGoo = (GsaCombinationCaseGoo)ComponentTestHelper.GetOutput(getModelAnalysis, 2); var comp = new CreateModel(); @@ -49,7 +49,7 @@ public class InputsForModelAssemblyTests { public void GetAnalysisFromAnalysisCaseErrorTest() { var getModelAnalysis = new GetModelAnalysis(); var model = new GsaModel(); - model.Model.Open(GsaFile.SteelDesignSimple); + model.ApiModel.Open(GsaFile.SteelDesignSimple); ComponentTestHelper.SetInput(getModelAnalysis, new GsaModelGoo(model)); var analysisCaseGoo = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput(getModelAnalysis, 1); var comp = new CreateModel(); @@ -210,7 +210,7 @@ public class InputsForModelAssemblyTests { [Fact] public void GetModelFromModelTest() { var model = new GsaModel(); - model.Model.Open(GsaFile.SteelDesignSimple); + model.ApiModel.Open(GsaFile.SteelDesignSimple); var goo = new GsaModelGoo(model); var comp = new CreateModel(); ComponentTestHelper.SetInput(comp, goo, 0); @@ -265,7 +265,7 @@ public class InputsForModelAssemblyTests { Definition = "1", Name = "myList" }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new Member1dDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -284,7 +284,7 @@ public class InputsForModelAssemblyTests { Definition = "1", Name = "myList" }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new Member1dDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -303,7 +303,7 @@ public class InputsForModelAssemblyTests { Definition = "1", Name = string.Empty }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new Member1dDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -345,7 +345,7 @@ public class InputsForModelAssemblyTests { Definition = "2", Name = "myList" }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new NodeDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -364,7 +364,7 @@ public class InputsForModelAssemblyTests { Definition = "2", Name = "myList" }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new NodeDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -383,7 +383,7 @@ public class InputsForModelAssemblyTests { Definition = "1", Name = string.Empty }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new NodeDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -437,7 +437,7 @@ public class InputsForModelAssemblyTests { Definition = "1 2", Name = $"Children of '{listName}'" }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new BeamDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -458,7 +458,7 @@ public class InputsForModelAssemblyTests { Definition = "1", Name = listName }; - result.Model.Model.AddList(apiList); + result.Model.ApiModel.AddList(apiList); var comp = new BeamDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -480,8 +480,8 @@ public class InputsForModelAssemblyTests { Definition = "2", Name = listName }; - result.Model.Model.AddList(apiList); - result.Model.Model.AddMember(new Member()); + result.Model.ApiModel.AddList(apiList); + result.Model.ApiModel.AddMember(new Member()); var comp = new BeamDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -496,7 +496,7 @@ public class InputsForModelAssemblyTests { [Fact] public void TestGetElementListDefinitionErrorFromMemberListNotInModel() { GsaResult result = GsaResultTests.AnalysisCaseResult(GsaFile.SteelDesignSimple, 1); - result.Model.Model.AddMember(new Member()); + result.Model.ApiModel.AddMember(new Member()); var comp = new BeamDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -511,7 +511,7 @@ public class InputsForModelAssemblyTests { [Fact] public void TestGetElementListDefinitionFromMemberListNotInModel() { GsaResult result = GsaResultTests.AnalysisCaseResult(GsaFile.SteelDesignSimple, 1); - result.Model.Model.AddMember(new Member()); + result.Model.ApiModel.AddMember(new Member()); var comp = new BeamDisplacements(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -527,7 +527,7 @@ public class InputsForModelAssemblyTests { [Fact] public void TestGetElementOrMemberListFromString() { GsaResult result = GsaResultTests.AnalysisCaseResult(GsaFile.SteelDesignSimple, 1); - result.Model.Model.AddMember(new Member()); + result.Model.ApiModel.AddMember(new Member()); var comp = new ResultDiagrams(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -540,7 +540,7 @@ public class InputsForModelAssemblyTests { [Fact] public void TestGetElementOrMemberListFromElementList() { GsaResult result = GsaResultTests.AnalysisCaseResult(GsaFile.SteelDesignSimple, 1); - result.Model.Model.AddMember(new Member()); + result.Model.ApiModel.AddMember(new Member()); var comp = new ResultDiagrams(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -554,7 +554,7 @@ public class InputsForModelAssemblyTests { [Fact] public void TestGetElementOrMemberListFromMemberList() { GsaResult result = GsaResultTests.AnalysisCaseResult(GsaFile.SteelDesignSimple, 1); - result.Model.Model.AddMember(new Member()); + result.Model.ApiModel.AddMember(new Member()); var comp = new ResultDiagrams(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); @@ -568,7 +568,7 @@ public class InputsForModelAssemblyTests { [Fact] public void TestGetElementOrMemberListErrorFromNodeList() { GsaResult result = GsaResultTests.AnalysisCaseResult(GsaFile.SteelDesignSimple, 1); - result.Model.Model.AddMember(new Member()); + result.Model.ApiModel.AddMember(new Member()); var comp = new ResultDiagrams(); ComponentTestHelper.SetInput(comp, new GsaResultGoo(result)); diff --git a/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs b/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs index ec3c89742..9b8727b2a 100644 --- a/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs +++ b/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs @@ -111,14 +111,14 @@ public class GetCreateAnalysisTaskAndCaseTest { var output = (GsaAnalysisTaskGoo)param.VolatileData.get_Branch(0)[0]; GsaAnalysisTask gsaghobject = output.Value; - Assert.Equal("Task 1", gsaghobject.Task.Name); + Assert.Equal("Task 1", gsaghobject.ApiTask.Name); Assert.Equal(1, gsaghobject.Id); Assert.Equal(2, gsaghobject.Cases.Count); Assert.Equal("DL", gsaghobject.Cases[0].Name); Assert.Equal("LL", gsaghobject.Cases[1].Name); Assert.Equal("L1", gsaghobject.Cases[0].Definition); Assert.Equal("L2", gsaghobject.Cases[1].Definition); - Assert.Equal((int)AnalysisTaskType.Static, gsaghobject.Task.Type); + Assert.Equal((int)AnalysisTaskType.Static, gsaghobject.ApiTask.Type); } [Fact] From 36f99f68c7529f3d78a801649305d2cbb4f71dfc Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Thu, 28 Mar 2024 10:19:28 +0100 Subject: [PATCH 03/14] GSAGH-478 analysis task info --- .../4_Analysis/AnalysisTaskAndCase.gh | Bin 0 -> 10624 bytes .../GetCreateAnalysisTaskAndCase.gh | Bin 13850 -> 0 bytes .../Components/4_Analysis/AnalysisCaseInfo.cs | 9 +- .../Components/4_Analysis/AnalysisTaskInfo.cs | 69 ++++++++++ .../4_Analysis/CombinationCaseInfo.cs | 2 +- .../Components/4_Analysis/EditAnalysisTask.cs | 108 --------------- .../4_Analysis/AnalysisCaseInfoTests.cs | 1 - .../4_Analysis/AnalysisTaskInfoTests.cs | 69 ++++++++++ .../4_Analysis/EditAnalysisTaskTests.cs | 67 --------- .../3_Components/GH_OasysComponentTest.cs | 2 +- .../4_Analysis/AnalysisTaskAndCaseTest.cs | 128 +++++++++--------- 11 files changed, 205 insertions(+), 250 deletions(-) create mode 100644 ExampleFiles/Parameters/4_Analysis/AnalysisTaskAndCase.gh delete mode 100644 ExampleFiles/Parameters/4_Analysis/GetCreateAnalysisTaskAndCase.gh create mode 100644 GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs delete mode 100644 GsaGH/Components/4_Analysis/EditAnalysisTask.cs create mode 100644 GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs delete mode 100644 GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs diff --git a/ExampleFiles/Parameters/4_Analysis/AnalysisTaskAndCase.gh b/ExampleFiles/Parameters/4_Analysis/AnalysisTaskAndCase.gh new file mode 100644 index 0000000000000000000000000000000000000000..1a6c83010ab71e3fdc37005c52b50da88430eb0e GIT binary patch literal 10624 zcmV-`DSy`0T?sf;@An_F@3IwQY-MX?NmPUx`x=rY8D=ny8O@BnRJI~Qp_D|ZWXryk zl!|1Dl%-WEOWKsJQvUZ2ib3gD{lC@o%=5VKd*AoI_j5kyocEl2?v2JAk0*@-|EM4k z2sQ9y(=CcAnGd;FHBqBg;+%)0+{{ zUKq4D*v|y?(^eI|Ho9-^MZ&7@OYbo-BhW-g0>)zs7jTIX z8WW^Ddg_Q*6Nkk55-~(eB+*S1hk_%CXqdALqdBk=5HjKvoZvs!sa81N6Gxi5IvFZp zQLezEC$B?2*-U4NBsinVX9@v_Yu}BJcZ`mY)7aqg?o&uRt8r-1S^>8`<5G-Z%dE>V znmc+JA${?lr0M4}=@Rgs9m!^Qn(UAcloJ zqlHdy?M}`R<|17SO?rxnX~`3Fexr}611PAkfUE$1%oA-hU;*3dCfXsB6a!DE(cSb- z8?vM?aG01`Y8+uOv-orqIkpIZaX|}ZGW9^?pvHI<8p{aB<48yhZbJ1KCiQtP;_{OR zA#qT&4~9s>;GChr?LytbN$B)2C=~ju>Qk}kR>-Sqt_wW zcXdF`d@Euw!8p22@1p_x7*K%Pq43^cF9M+>lJ#`ju?Ny|;x@>~OqwJT0ps9Fnqc2o zozMbcMvkpaB_pEzHJ>r73|AAgsV8Z!aSRjf-v$;(^}{iD z)){54?`_Rq6M1andgSFynNX^E1Qt*ARX|V@9*Un39}4P?C%8eqF(ell>%?qOG;n|> zKs}Ho7pNoN-2;yUtgb8+2_>O@NKhgGBOq;X#KbA!B&=*&KQ>qCN zNt1#*8s=o~Op5xe$mqT!GAl4Zk8&aaW{-` zF{lL@sF}8kamrS~J&7c|`z9hl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%QwYkJX>w# zQYd{RsuSx`Y7aFwY2+^S>8Nyl<00pJ%h+FAcU$iZh0l*o3%S}36FGBSBu-$mZP?hW zLPBdowZ*TkK>7Fx`F3sJK3=kW{JDSS7f%=KohXul58`Qdve|=&p~d`Z8Mb}(B%QVv zvDf{o$W7drmK<+m-g+!dOl)_B+mjIttw@PO&U!bfVvf|hy^M{9m_}n%kgzzBc(}b| z;PlNb6&?8Ac;i6*5Tc^FP;Nm9mqKmD>D>DlLVK2PSe?!1`f8gTqCXL;(cU5@+7%gb zXsPm!yfVQp12_4fc*`_A#vV)MJfR|IDZR-d?_!>Mc=UrWlD<{!Jd4fiqy-p$SfMp zUb5Bxulx7n-! literal 0 HcmV?d00001 diff --git a/ExampleFiles/Parameters/4_Analysis/GetCreateAnalysisTaskAndCase.gh b/ExampleFiles/Parameters/4_Analysis/GetCreateAnalysisTaskAndCase.gh deleted file mode 100644 index 4a346ae191be749cb99e3d3cceaf38f33bebf8f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13850 zcmV+#Hs#6feF->}-5d90U$d1IG1lyRk}b>F*N{Y(!C1$PX2zC8mTVyvWv^67w(JyA zc+;X%X;HEzWJ@H(_spO-V@cP`zxuvU*Ib!%p65L0`JLZ=pL;pyATmTEF*Cr=1`r5D z0DLwop==$UJYXg;6xs=iz*ZT6W`79gJ`@m`y%WL-GgpnhlNfua8{FN&31Q{2@Xif$ zcavf-fgo+&U111}1`KKkLt!r=o~x#quhN8Ii^+ka8T!!n<~%x`s5bic$g<=hQUess z!wKezt)~F$NsJtUR_tizigjUVM`Ld{7`B>l?!nY^b$UpYD-@2c;le#F?)zOvFgVN> z1GD>H7YDN2^zREAppb4b6vhdLo^KZWA%Z|LxaW{zzZ9|U9w~iAMhStTZBb5c^SEHU z2qMyhy29qav8lr_DkvCmuMz?Z_eMLRjiG24C4`*{6b%!0a3nVbx`f3JJ&!B)hkCwL z1?i5!%y$Ea8PGdtp!ahRB$z8EF@~ZXV7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7rAz%U%LdcGP_C@ zVxE|om`WJ*xqh_o^<9**j_PYm^Vb);8MgNAxHxD+Z+1oA;M`O4Z}<3l0~n6hT+gq~ z&ljUOWp}Kq2Xk0UdsIArgPAGG3rA;n0#*sb%nLVfQmUVmX|W|EjUsd_o4Whlt<+oY z*2IMW8_PYCk~JA!0jZ=xgH6TF&0n7HQgCHX^bvgdV(N1Y4~X{Y36B$TcMq~^7*yMm zRCS`t%*@Rl92{sq8bTo9;qTu|(JE8kBYeH1^E2|MJ8PdERPQ0IpX_f46KL9$@vZ_)-mLV$lACvuOF4mrnjX;Nwhua|33d*-tx%Wv$VUS1>#tLz1 zX&D6tSuwF)Qd06#QWCorc8bM~Um&xLI-zqSD$3Q>cUuNX#bQHxWF+(O5GA!q`WAVV$)dt;nHtc217Ev3-DZep= z_RyIKO_>tXh<(wi5eflMwzI!#Y1v+3SX4aKTQq7V^5CY}o^KQHdvlS9Z{44!5~Zt> zlW+DlGenE^bXw;f$dt@7HVNP1eZU=>KTuOkU(}G0ntM{CP*6}H3mlO)eS7?$EktGM zgA*y&fTk^2HquBDzn$tBtOC57N%O>3i-gIC4@YOl$2-`*^`z|&rzm)Xs1o^#tlb#G zDIl;b{@{(oWT9t$Z=MFIa>sUcG3pp)x&LFw6Hd{qd`|vpT9IV4FInT~B>vzboyL4i cueO;Dc7ibfW`|o1*z}>Msvaaq**f6=0PtXY@c;k- diff --git a/GsaGH/Components/4_Analysis/AnalysisCaseInfo.cs b/GsaGH/Components/4_Analysis/AnalysisCaseInfo.cs index 8ae8f1a39..49a53fa94 100644 --- a/GsaGH/Components/4_Analysis/AnalysisCaseInfo.cs +++ b/GsaGH/Components/4_Analysis/AnalysisCaseInfo.cs @@ -19,7 +19,7 @@ public class AnalysisCaseInfo : GH_OasysComponent { protected override Bitmap Icon => Resources.AnalysisCaseInfo; public AnalysisCaseInfo() : base("Analysis Case Info", "CaseInfo", - "Get information about the properties of a GSA Analysis Case (Load Case or Combination)", + "Get information about a GSA Analysis Case", CategoryName.Name(), SubCategoryName.Cat4()) { Hidden = true; } @@ -43,10 +43,9 @@ public class AnalysisCaseInfo : GH_OasysComponent { } if (ghTyp.Value is GsaAnalysisCaseGoo goo) { - GsaAnalysisCase gsaCase = goo.Value.Duplicate(); - da.SetData(0, gsaCase.Name); - da.SetData(1, gsaCase.Definition); - da.SetData(2, gsaCase.Id); + da.SetData(0, goo.Value.Name); + da.SetData(1, goo.Value.Definition); + da.SetData(2, goo.Value.Id); } else { string type = ghTyp.Value.GetType().ToString(); type = type.Replace("GsaGH.Parameters.", string.Empty); diff --git a/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs b/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs new file mode 100644 index 000000000..a5f16261d --- /dev/null +++ b/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Grasshopper.Kernel; +using Grasshopper.Kernel.Types; +using GsaGH.Helpers.GH; +using GsaGH.Parameters; +using OasysGH; +using OasysGH.Components; + +namespace GsaGH.Components { + /// + /// Component to get information about GSA Analysis Tasks + /// + public class AnalysisTaskInfo : GH_OasysComponent { + public override Guid ComponentGuid => new Guid("82d76442-cc58-49c6-b6d7-d0ae998ce063"); + public override GH_Exposure Exposure => GH_Exposure.secondary | GH_Exposure.obscure; + public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance; + protected override Bitmap Icon => null; + + public AnalysisTaskInfo() : base("Analysis Task Info", "TaskInfo", + "Get information about a GSA Analysis Task", + CategoryName.Name(), SubCategoryName.Cat4()) { + Hidden = true; + } + + protected override void RegisterInputParams(GH_InputParamManager pManager) { + pManager.AddParameter(new GsaAnalysisTaskParameter(), GsaAnalysisTaskGoo.Name, + GsaAnalysisTaskGoo.NickName, GsaAnalysisTaskGoo.Name, GH_ParamAccess.item); + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) { + pManager.AddTextParameter("Name", "Na", "Analysis Task Name", GH_ParamAccess.item); + pManager.AddParameter(new GsaAnalysisCaseParameter(), GsaAnalysisCaseGoo.Name + "(s)", + GsaAnalysisCaseGoo.NickName, "List of " + GsaAnalysisCaseGoo.Description, + GH_ParamAccess.list); + pManager.AddTextParameter("Solver Type", "sT", "Solver Type", GH_ParamAccess.item); + pManager.AddIntegerParameter("TaskID", "ID", + "The Task number if the Analysis Case ever belonged to a model", GH_ParamAccess.item); + } + + protected override void SolveInstance(IGH_DataAccess da) { + var ghTyp = new GH_ObjectWrapper(); + if (!da.GetData(0, ref ghTyp)) { + return; + } + + if (ghTyp.Value is GsaAnalysisTaskGoo goo) { + da.SetData(0, goo.Value.ApiTask.Name); + if (goo.Value.Cases != null) { + da.SetDataList(1, new List(goo.Value.Cases.Select(x => new GsaAnalysisCaseGoo(x)))); + } else { + da.SetData(1, null); + } + + var type = (AnalysisTaskType)goo.Value.ApiTask.Type; + da.SetData(2, type.ToString()); + da.SetData(3, goo.Value.Id); + } else { + string type = ghTyp.Value.GetType().ToString(); + type = type.Replace("GsaGH.Parameters.", string.Empty); + type = type.Replace("Goo", string.Empty); + Params.Owner.AddRuntimeError("Unable to convert Analysis Task input parameter of type " + + type + " to GsaAnalysisTask"); + } + } + } +} diff --git a/GsaGH/Components/4_Analysis/CombinationCaseInfo.cs b/GsaGH/Components/4_Analysis/CombinationCaseInfo.cs index 5e40daebf..415cdca22 100644 --- a/GsaGH/Components/4_Analysis/CombinationCaseInfo.cs +++ b/GsaGH/Components/4_Analysis/CombinationCaseInfo.cs @@ -18,7 +18,7 @@ public class CombinationCaseInfo : GH_OasysComponent { protected override Bitmap Icon => Resources.CombinationCaseInfo; public CombinationCaseInfo() : base("Combination Case Info", "CombinationInfo", - "Get information of a GSA Combination Case", CategoryName.Name(), SubCategoryName.Cat4()) { + "Get information about a GSA Combination Case", CategoryName.Name(), SubCategoryName.Cat4()) { Hidden = true; } diff --git a/GsaGH/Components/4_Analysis/EditAnalysisTask.cs b/GsaGH/Components/4_Analysis/EditAnalysisTask.cs deleted file mode 100644 index 91c5b3780..000000000 --- a/GsaGH/Components/4_Analysis/EditAnalysisTask.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using Grasshopper.Kernel; -using Grasshopper.Kernel.Types; -using GsaGH.Helpers.GH; -using GsaGH.Parameters; -using GsaGH.Properties; -using OasysGH; -using OasysGH.Components; - -namespace GsaGH.Components { - /// - /// Component to edit GSA analysis tasks - /// - public class EditAnalysisTask : GH_OasysComponent { - public override Guid ComponentGuid => new Guid("efc2aae5-7ebf-4032-89d5-8fec8830989d"); - public override GH_Exposure Exposure => GH_Exposure.secondary | GH_Exposure.obscure; - public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance; - protected override Bitmap Icon => Resources.EditAnalysisTask; - - public EditAnalysisTask() : base("Edit Analysis Task", "EditTask", "Modify GSA Analysis Tasks", - CategoryName.Name(), SubCategoryName.Cat4()) { - Hidden = true; - } - - protected override void RegisterInputParams(GH_InputParamManager pManager) { - pManager.AddParameter(new GsaAnalysisTaskParameter(), GsaAnalysisTaskGoo.Name, - GsaAnalysisTaskGoo.NickName, GsaAnalysisTaskGoo.Name + " to Edit", GH_ParamAccess.item); - pManager.AddParameter(new GsaAnalysisCaseParameter(), GsaAnalysisCaseGoo.Name + "(s)", - GsaAnalysisCaseGoo.NickName, "Add list of " + GsaAnalysisCaseGoo.Name + " to task", - GH_ParamAccess.list); - for (int i = 1; i < pManager.ParamCount; i++) { - pManager[i].Optional = true; - } - } - - protected override void RegisterOutputParams(GH_OutputParamManager pManager) { - pManager.AddParameter(new GsaAnalysisTaskParameter(), GsaAnalysisTaskGoo.Name, - GsaAnalysisTaskGoo.NickName, "Modified " + GsaAnalysisTaskGoo.Name, GH_ParamAccess.item); - pManager.AddTextParameter("Name", "Na", "Task Name", GH_ParamAccess.item); - pManager.AddParameter(new GsaAnalysisCaseParameter(), GsaAnalysisCaseGoo.Name + "(s)", - GsaAnalysisCaseGoo.NickName, "List of " + GsaAnalysisCaseGoo.Description, - GH_ParamAccess.list); - pManager.AddTextParameter("Solver Type", "sT", "Solver Type", GH_ParamAccess.item); - pManager.AddIntegerParameter("TaskID", "ID", - "The Task number if the Analysis Case ever belonged to a model", GH_ParamAccess.item); - } - - protected override void SolveInstance(IGH_DataAccess da) { - GsaAnalysisTask gsaTask; - GsaAnalysisTaskGoo analysisTaskGoo = null; - if (!da.GetData(0, ref analysisTaskGoo)) { - return; - } - gsaTask = analysisTaskGoo.Value; - - if (gsaTask != null) { - var ghTypes = new List(); - if (da.GetDataList(1, ghTypes)) { - var cases = new List(); - for (int i = 0; i < ghTypes.Count; i++) { - GH_ObjectWrapper ghTyp2 = ghTypes[i]; - if (ghTyp2 == null) { - Params.Owner.AddRuntimeWarning("Analysis Case input (index: " + i - + ") is null and has been ignored"); - continue; - } - - if (ghTyp2.Value is GsaAnalysisCaseGoo goo) { - cases.Add(goo.Value.Duplicate()); - } else { - string typ = ghTyp2.Value.GetType().ToString(); - typ = typ.Replace("GsaGH.Parameters.", string.Empty); - typ = typ.Replace("Goo", string.Empty); - Params.Owner.AddRuntimeError( - "Unable to convert Analysis Case input parameter of type " + typ - + " to GsaAnalysisCase"); - return; - } - } - - gsaTask.Cases = cases; - } - - da.SetData(0, new GsaAnalysisTaskGoo(gsaTask)); - da.SetData(1, gsaTask.ApiTask.Name); - if (gsaTask.Cases != null) { - da.SetDataList(2, - new List(gsaTask.Cases.Select(x => new GsaAnalysisCaseGoo(x)))); - } else { - da.SetData(2, null); - } - - var type = (AnalysisTaskType)gsaTask.ApiTask.Type; - da.SetData(3, type.ToString()); - da.SetData(4, gsaTask.Id); - } else { - string type = analysisTaskGoo.Value.GetType().ToString(); - type = type.Replace("GsaGH.Parameters.", string.Empty); - type = type.Replace("Goo", string.Empty); - Params.Owner.AddRuntimeError("Unable to convert Analysis Task input parameter of type " - + type + " to GsaAnalysisTask"); - } - } - } -} diff --git a/GsaGHTests/3_Components/4_Analysis/AnalysisCaseInfoTests.cs b/GsaGHTests/3_Components/4_Analysis/AnalysisCaseInfoTests.cs index 7a38b8dc8..3a3de5f9c 100644 --- a/GsaGHTests/3_Components/4_Analysis/AnalysisCaseInfoTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/AnalysisCaseInfoTests.cs @@ -8,7 +8,6 @@ namespace GsaGHTests.Components.Analysis { [Collection("GrasshopperFixture collection")] public class AnalysisCaseInfoTests { - public static GH_OasysComponent ComponentMother() { var comp = new AnalysisCaseInfo(); comp.CreateAttributes(); diff --git a/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs b/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs new file mode 100644 index 000000000..845892ce3 --- /dev/null +++ b/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs @@ -0,0 +1,69 @@ +using Grasshopper.Kernel.Types; +using GsaGH.Components; +using GsaGH.Parameters; +using GsaGHTests.Helper; +using GsaGHTests.Helpers; +using OasysGH.Components; +using Xunit; + +namespace GsaGHTests.Components.Analysis { + [Collection("GrasshopperFixture collection")] + public class AnalysisTaskInfoTests { + + public static GH_OasysComponent ComponentMother() { + var comp = new AnalysisTaskInfo(); + comp.CreateAttributes(); + + var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput( + CreateAnalysisTaskTests.ComponentMother()); + ComponentTestHelper.SetInput(comp, output); + + return comp; + } + + [Fact] + public void CreateComponentTest() { + GH_OasysComponent comp = ComponentMother(); + + var output0 = (GH_String)ComponentTestHelper.GetOutput(comp, 0); + var output1 = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput(comp, 1); + var output2 = (GH_String)ComponentTestHelper.GetOutput(comp, 2); + var output3 = (GH_Integer)ComponentTestHelper.GetOutput(comp, 3); + + Assert.Equal("my Task", output0.Value); + Assert.Equal(0, output1.Value.Id); + Assert.Equal("1.4L1 + 0.8L3", output1.Value.Definition); + Assert.Equal("my Case", output1.Value.Name); + Assert.Equal("Static", output2.Value); + Assert.Equal(0, output3.Value); + } + + [Fact] + public void GetTaskInfoFromModelTest() { + // Assemble + var getModelAnalysis = new GetModelAnalysis(); + var model = new GsaModel(); + model.ApiModel.Open(GsaFile.SteelDesignSimple); + ComponentTestHelper.SetInput(getModelAnalysis, new GsaModelGoo(model)); + var taskGoo = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(getModelAnalysis); + + // Act + var comp = new AnalysisTaskInfo(); + comp.CreateAttributes(); + ComponentTestHelper.SetInput(comp, taskGoo); + + // Assert + var output0 = (GH_String)ComponentTestHelper.GetOutput(comp, 0); // name + var output1 = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput(comp, 1); // cases + var output2 = (GH_String)ComponentTestHelper.GetOutput(comp, 2); // type + var output3 = (GH_Integer)ComponentTestHelper.GetOutput(comp, 3); // task id + + Assert.Equal("Task 1", output0.Value); + Assert.Equal(1, output1.Value.Id); + Assert.Equal("L1", output1.Value.Definition); + Assert.Equal("DL", output1.Value.Name); + Assert.Equal("Static", output2.Value); + Assert.Equal(1, output3.Value); + } + } +} diff --git a/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs deleted file mode 100644 index 54be4cbf9..000000000 --- a/GsaGHTests/3_Components/4_Analysis/EditAnalysisTaskTests.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Grasshopper.Kernel.Types; -using GsaAPI; -using GsaGH.Components; -using GsaGH.Parameters; -using GsaGHTests.Helper; -using GsaGHTests.Helpers; -using OasysGH.Components; -using Xunit; - -namespace GsaGHTests.Components.Analysis { - [Collection("GrasshopperFixture collection")] - public class EditAnalysisTaskTests { - - public static GH_OasysComponent ComponentMother() { - var comp = new EditAnalysisTask(); - comp.CreateAttributes(); - - var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput( - CreateAnalysisTaskTests.ComponentMother()); - ComponentTestHelper.SetInput(comp, output); - - return comp; - } - - [Fact] - public void CreateComponentTest() { - GH_OasysComponent comp = ComponentMother(); - - var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); - - Assert.Equal("my Task", output.Value.ApiTask.Name); - Assert.Equal((int)AnalysisTaskType.Static, output.Value.ApiTask.Type); - Assert.Equal("my Case", output.Value.Cases[0].Name); - Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); - } - - [Fact] - public void GetTaskInfoFromModelTest() { - // Assemble - var getModelAnalysis = new GetModelAnalysis(); - var model = new GsaModel(); - model.ApiModel.Open(GsaFile.SteelDesignSimple); - ComponentTestHelper.SetInput(getModelAnalysis, new GsaModelGoo(model)); - var taskGoo = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(getModelAnalysis); - - // Act - var comp = new EditAnalysisTask(); - comp.CreateAttributes(); - ComponentTestHelper.SetInput(comp, taskGoo); - - // Assert - var output0 = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); // task - var output1 = (GH_String)ComponentTestHelper.GetOutput(comp, 1); // name - var output2 = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput(comp, 2); // cases - var output3 = (GH_String)ComponentTestHelper.GetOutput(comp, 3); // type - var output4 = (GH_Integer)ComponentTestHelper.GetOutput(comp, 4); // task id - - Duplicates.AreEqual(taskGoo.Value, output0.Value); - Assert.Equal("Task 1", output1.Value); - Assert.Equal(1, output2.Value.Id); - Assert.Equal("L1", output2.Value.Definition); - Assert.Equal("DL", output2.Value.Name); - Assert.Equal("Static", output3.Value); - Assert.Equal(1, output4.Value); - } - } -} diff --git a/GsaGHTests/3_Components/GH_OasysComponentTest.cs b/GsaGHTests/3_Components/GH_OasysComponentTest.cs index 588aa8f0f..c2b5ed41a 100644 --- a/GsaGHTests/3_Components/GH_OasysComponentTest.cs +++ b/GsaGHTests/3_Components/GH_OasysComponentTest.cs @@ -99,7 +99,7 @@ public class GH_OasysComponentTests { [InlineData(typeof(CreateAnalysisCase))] [InlineData(typeof(CreateAnalysisTask))] [InlineData(typeof(CreateCombinationCase))] - [InlineData(typeof(EditAnalysisTask))] + [InlineData(typeof(AnalysisTaskInfo))] [InlineData(typeof(CreateSteelSectionPool))] [InlineData(typeof(SteelSectionPoolNames))] [InlineData(typeof(CreateSteelDesignTask))] diff --git a/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs b/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs index 9b8727b2a..d1af437c1 100644 --- a/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs +++ b/IntegrationTests/2_Parameters/4_Analysis/AnalysisTaskAndCaseTest.cs @@ -1,134 +1,128 @@ -using System.Diagnostics.CodeAnalysis; -using System.IO; +using System.IO; using System.Reflection; using Grasshopper.Kernel; using Grasshopper.Kernel.Types; -using GsaGH.Parameters; using Xunit; namespace IntegrationTests.Parameters { [Collection("GrasshopperFixture collection")] - public class GetCreateAnalysisTaskAndCaseTest { + public class AnalysisTaskAndCaseTest { public static GH_Document Document => document ?? (document = OpenDocument()); private static GH_Document document = null; [Fact] - public void NewCaseDescriptionsTest() { + public void AnalysisTaskNameTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output1 = (GH_String)param.VolatileData.get_Branch(0)[0]; - var output2 = (GH_String)param.VolatileData.get_Branch(0)[1]; + var output0 = (GH_String)param.VolatileData.get_Branch(0)[0]; - Assert.Equal("1.5L2", output1.Value); - Assert.Equal("0.9L1", output2.Value); + Assert.Equal("Task 1", output0.Value); } [Fact] - public void NewCaseIDsTest() { + public void AnalysisTaskDescriptionsTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output1 = (GH_Integer)param.VolatileData.get_Branch(0)[0]; - var output2 = (GH_Integer)param.VolatileData.get_Branch(0)[1]; + var output0 = (GH_String)param.VolatileData.get_Branch(0)[0]; + var output1 = (GH_String)param.VolatileData.get_Branch(0)[1]; - Assert.Equal(0, output1.Value); - Assert.Equal(0, output2.Value); + Assert.Equal("GSA AnalysisCase (ID:1 'DL' L1)", output0.Value); + Assert.Equal("GSA AnalysisCase (ID:2 'LL' L2)", output1.Value); } [Fact] - public void NewCaseNamesTest() { + public void AnalysisTaskTypeTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output1 = (GH_String)param.VolatileData.get_Branch(0)[0]; - var output2 = (GH_String)param.VolatileData.get_Branch(0)[1]; + var output0 = (GH_String)param.VolatileData.get_Branch(0)[0]; - Assert.Equal("acase1", output1.Value); - Assert.Equal("acase2", output2.Value); + Assert.Equal("Static", output0.Value); } [Fact] - public void NoRuntimeErrorTest() { - Helper.TestNoRuntimeMessagesInDocument(Document, GH_RuntimeMessageLevel.Error); - } - - [Fact] - public void OriginalCaseDescriptionsTest() { + public void AnalysisTaskIdTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output1 = (GH_String)param.VolatileData.get_Branch(0)[0]; - var output2 = (GH_String)param.VolatileData.get_Branch(0)[1]; + var output0 = (GH_Integer)param.VolatileData.get_Branch(0)[0]; + + Assert.Equal(1, output0.Value); + } - Assert.Equal("L1", output1.Value); - Assert.Equal("L2", output2.Value); + [Fact] + public void NoRuntimeErrorTest() { + Helper.TestNoRuntimeMessagesInDocument(Document, GH_RuntimeMessageLevel.Error); } [Fact] - public void OriginalCaseIDsTest() { + public void AnalysisCaseNameTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output1 = (GH_Integer)param.VolatileData.get_Branch(0)[0]; - var output2 = (GH_Integer)param.VolatileData.get_Branch(0)[1]; - - Assert.Equal(1, output1.Value); - Assert.Equal(2, output2.Value); + var output0 = (GH_String)param.VolatileData.get_Branch(0)[0]; + var output1 = (GH_String)param.VolatileData.get_Branch(0)[1]; + var output2 = (GH_String)param.VolatileData.get_Branch(0)[2]; + var output3 = (GH_String)param.VolatileData.get_Branch(0)[3]; + + Assert.Equal("DL", output0.Value); + Assert.Equal("LL", output1.Value); + Assert.Equal("DL", output2.Value); + Assert.Equal("LL", output3.Value); } [Fact] - public void OriginalCaseNamesTest() { + public void AnalysisCaseDescriptionTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output1 = (GH_String)param.VolatileData.get_Branch(0)[0]; - var output2 = (GH_String)param.VolatileData.get_Branch(0)[1]; - - Assert.Equal("DL", output1.Value); - Assert.Equal("LL", output2.Value); + var output0 = (GH_String)param.VolatileData.get_Branch(0)[0]; + var output1 = (GH_String)param.VolatileData.get_Branch(0)[1]; + var output2 = (GH_String)param.VolatileData.get_Branch(0)[2]; + var output3 = (GH_String)param.VolatileData.get_Branch(0)[3]; + + Assert.Equal("L1", output0.Value); + Assert.Equal("L2", output1.Value); + Assert.Equal("L1", output2.Value); + Assert.Equal("L2", output3.Value); } [Fact] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public void OriginalTaskIDTest() { + public void AnalysisCaseIdTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output = (GH_Integer)param.VolatileData.get_Branch(0)[0]; - int gsaghobject = output.Value; - - Assert.Equal(1, gsaghobject); + var output0 = (GH_Integer)param.VolatileData.get_Branch(0)[0]; + var output1 = (GH_Integer)param.VolatileData.get_Branch(0)[1]; + var output2 = (GH_Integer)param.VolatileData.get_Branch(0)[2]; + var output3 = (GH_Integer)param.VolatileData.get_Branch(0)[3]; + + Assert.Equal(1, output0.Value); + Assert.Equal(2, output1.Value); + Assert.Equal(1, output2.Value); + Assert.Equal(2, output3.Value); } [Fact] - public void OriginalTaskNameTest() { + public void CombinationCaseIdTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output = (GH_String)param.VolatileData.get_Branch(0)[0]; - string gsaghobject = output.Value; + var output0 = (GH_Integer)param.VolatileData.get_Branch(0)[0]; - Assert.Equal("Task 1", gsaghobject); + Assert.Equal(1, output0.Value); } [Fact] - public void OriginalTaskTest() { + public void CombinationCaseNameTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output = (GsaAnalysisTaskGoo)param.VolatileData.get_Branch(0)[0]; - GsaAnalysisTask gsaghobject = output.Value; - - Assert.Equal("Task 1", gsaghobject.ApiTask.Name); - Assert.Equal(1, gsaghobject.Id); - Assert.Equal(2, gsaghobject.Cases.Count); - Assert.Equal("DL", gsaghobject.Cases[0].Name); - Assert.Equal("LL", gsaghobject.Cases[1].Name); - Assert.Equal("L1", gsaghobject.Cases[0].Definition); - Assert.Equal("L2", gsaghobject.Cases[1].Definition); - Assert.Equal((int)AnalysisTaskType.Static, gsaghobject.ApiTask.Type); + var output0 = (GH_String)param.VolatileData.get_Branch(0)[0]; + + Assert.Equal("ULS", output0.Value); } [Fact] - public void OriginalTaskTypeTest() { + public void CombinationCaseDescriptionTest() { IGH_Param param = TestHelper(MethodBase.GetCurrentMethod() .Name.Replace("Test", string.Empty)); - var output = (GH_String)param.VolatileData.get_Branch(0)[0]; - string gsaghobject = output.Value; + var output0 = (GH_String)param.VolatileData.get_Branch(0)[0]; - Assert.Equal("Static", gsaghobject); + Assert.Equal("1.4A1 + 1.6A2", output0.Value); } private static GH_Document OpenDocument() { From fd26f6c46ac0dede8e94c621c0a5a77f41f6fa97 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Thu, 28 Mar 2024 10:36:26 +0100 Subject: [PATCH 04/14] typos --- GsaGH/Components/1_Properties/EditBool6.cs | 24 +++++++++---------- GsaGH/Components/1_Properties/EditProfile.cs | 2 +- .../5_Results/AssemblyDisplacements.cs | 12 +++++----- .../5_Results/AssemblyDriftIndices.cs | 6 ++--- GsaGH/Components/5_Results/AssemblyDrifts.cs | 6 ++--- .../5_Results/AssemblyForcesAndMoments.cs | 16 ++++++------- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/GsaGH/Components/1_Properties/EditBool6.cs b/GsaGH/Components/1_Properties/EditBool6.cs index 25c6368be..304751a53 100644 --- a/GsaGH/Components/1_Properties/EditBool6.cs +++ b/GsaGH/Components/1_Properties/EditBool6.cs @@ -27,12 +27,12 @@ public class EditBool6 : GH_OasysComponent { pManager.AddParameter(new GsaBool6Parameter(), GsaBool6Goo.Name, GsaBool6Goo.NickName, GsaBool6Goo.Description + " to get or set information for. Leave blank to create a new " + GsaBool6Goo.Name, GH_ParamAccess.item); - pManager.AddBooleanParameter("X", "X", "Release or restrain for translation in X-direction", GH_ParamAccess.item); - pManager.AddBooleanParameter("Y", "Y", "Release or restrain for translation in Y-direction", GH_ParamAccess.item); - pManager.AddBooleanParameter("Z", "Z", "Release or restrain for translation in Z-direction", GH_ParamAccess.item); - pManager.AddBooleanParameter("XX", "XX", "Release or restrain for rotation around X-axis", GH_ParamAccess.item); - pManager.AddBooleanParameter("YY", "YY", "Release or restrain for rotation around Y-axis", GH_ParamAccess.item); - pManager.AddBooleanParameter("ZZ", "ZZ", "Release or restrain for rotation around Z-axis", GH_ParamAccess.item); + pManager.AddBooleanParameter("X", "X", "Release or restraint for translation in X-direction", GH_ParamAccess.item); + pManager.AddBooleanParameter("Y", "Y", "Release or restraint for translation in Y-direction", GH_ParamAccess.item); + pManager.AddBooleanParameter("Z", "Z", "Release or restraint for translation in Z-direction", GH_ParamAccess.item); + pManager.AddBooleanParameter("XX", "XX", "Release or restraint for rotation around X-axis", GH_ParamAccess.item); + pManager.AddBooleanParameter("YY", "YY", "Release or restraint for rotation around Y-axis", GH_ParamAccess.item); + pManager.AddBooleanParameter("ZZ", "ZZ", "Release or restraint for rotation around Z-axis", GH_ParamAccess.item); for (int i = 0; i < pManager.ParamCount; i++) { pManager[i].Optional = true; } @@ -41,12 +41,12 @@ public class EditBool6 : GH_OasysComponent { protected override void RegisterOutputParams(GH_OutputParamManager pManager) { pManager.AddParameter(new GsaBool6Parameter(), GsaBool6Goo.Name, GsaBool6Goo.NickName, GsaBool6Goo.Description + " with applied changes.", GH_ParamAccess.item); - pManager.AddBooleanParameter("X", "X", "Release or restrain for translation in the X-direction.", GH_ParamAccess.item); - pManager.AddBooleanParameter("Y", "Y", "Release or restrain for translation in the Y-direction.", GH_ParamAccess.item); - pManager.AddBooleanParameter("Z", "Z", "Release or restrain for translation in the Z-direction.", GH_ParamAccess.item); - pManager.AddBooleanParameter("XX", "XX", "Release or restrain for rotation around the X-axis.", GH_ParamAccess.item); - pManager.AddBooleanParameter("YY", "YY", "Release or restrain for rotation around the Y-axis.", GH_ParamAccess.item); - pManager.AddBooleanParameter("ZZ", "ZZ", "Release or restrain for rotation around the Z-axis.", GH_ParamAccess.item); + pManager.AddBooleanParameter("X", "X", "Release or restrain for translation in X-direction", GH_ParamAccess.item); + pManager.AddBooleanParameter("Y", "Y", "Release or restrain for translation in Y-direction", GH_ParamAccess.item); + pManager.AddBooleanParameter("Z", "Z", "Release or restrain for translation in Z-direction", GH_ParamAccess.item); + pManager.AddBooleanParameter("XX", "XX", "Release or restrain for rotation around X-axis", GH_ParamAccess.item); + pManager.AddBooleanParameter("YY", "YY", "Release or restrain for rotation around Y-axis", GH_ParamAccess.item); + pManager.AddBooleanParameter("ZZ", "ZZ", "Release or restrain for rotation around Z-axis", GH_ParamAccess.item); } protected override void SolveInstance(IGH_DataAccess da) { diff --git a/GsaGH/Components/1_Properties/EditProfile.cs b/GsaGH/Components/1_Properties/EditProfile.cs index bd0cb0b5f..27fa83d2b 100644 --- a/GsaGH/Components/1_Properties/EditProfile.cs +++ b/GsaGH/Components/1_Properties/EditProfile.cs @@ -33,7 +33,7 @@ public class EditProfile : GH_OasysComponent { protected override void RegisterInputParams(GH_InputParamManager pManager) { pManager.AddTextParameter("Profile", "Pf", "Profile to edit", GH_ParamAccess.item); pManager.AddAngleParameter("Orientation Angle", "⭮A", - "Set Profile Orientation Angle in counter-clockwise direction.", GH_ParamAccess.item); + "Set Profile Orientation Angle in counter-clockwise direction", GH_ParamAccess.item); pManager.AddBooleanParameter("Reflect Horizontal", "Ry", "True to reflect the profile about the local y-axis", GH_ParamAccess.item, false); pManager.AddBooleanParameter("Reflect Vertical", "Rz", diff --git a/GsaGH/Components/5_Results/AssemblyDisplacements.cs b/GsaGH/Components/5_Results/AssemblyDisplacements.cs index a59bd0c2c..293776834 100644 --- a/GsaGH/Components/5_Results/AssemblyDisplacements.cs +++ b/GsaGH/Components/5_Results/AssemblyDisplacements.cs @@ -82,19 +82,19 @@ public class AssemblyDisplacements : GH_OasysDropDownComponent { string note = ResultNotes.NoteAssemblyResults; pManager.AddGenericParameter("Translation X [" + unitAbbreviation + "]", "Ux", - "Translation in Local Assembly X-direction." + note, GH_ParamAccess.tree); + "Translation in Local Assembly X-direction" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Translation Y [" + unitAbbreviation + "]", "Uy", - "Translation in Local Assembly Y-direction." + note, GH_ParamAccess.tree); + "Translation in Local Assembly Y-direction" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Translation Z [" + unitAbbreviation + "]", "Uz", - "Translation in Local Assembly Z-direction." + note, GH_ParamAccess.tree); + "Translation in Local Assembly Z-direction" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Translation |XYZ| [" + unitAbbreviation + "]", "|U|", "Combined |XYZ| Translation." + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Rotation XX [rad]", "Rxx", - "Rotation around Local Assembly X-axis." + note, GH_ParamAccess.tree); + "Rotation around Local Assembly X-axis" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Rotation YY [rad]", "Ryy", - "Rotation around Local Assembly Y-axis." + note, GH_ParamAccess.tree); + "Rotation around Local Assembly Y-axis" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Rotation ZZ [rad]", "Rzz", - "Rotation around Local Assembly Z-axis." + note, GH_ParamAccess.tree); + "Rotation around Local Assembly Z-axis" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Rotation |XYZ| [rad]", "|R|", "Combined |XXYYZZ| Rotation." + note, GH_ParamAccess.tree); } diff --git a/GsaGH/Components/5_Results/AssemblyDriftIndices.cs b/GsaGH/Components/5_Results/AssemblyDriftIndices.cs index 79df43e16..3189c0346 100644 --- a/GsaGH/Components/5_Results/AssemblyDriftIndices.cs +++ b/GsaGH/Components/5_Results/AssemblyDriftIndices.cs @@ -68,11 +68,11 @@ public class AssemblyDriftIndices : GH_OasysDropDownComponent { string note = ResultNotes.NoteAssemblyResults; pManager.AddGenericParameter("Drift Index X", "DIx", - "Drift Index in Local Assembly X-direction." + note, GH_ParamAccess.tree); + "Drift Index in Local Assembly X-direction" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Drift Index Y", "DIy", - "Drift Index in Local Assembly Y-direction." + note, GH_ParamAccess.tree); + "Drift Index in Local Assembly Y-direction" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Drift Index XY", "In-plane", - "Drift Index in Local Assembly XY-plane." + note, GH_ParamAccess.tree); + "Drift Index in Local Assembly XY-plane" + note, GH_ParamAccess.tree); } protected override void SolveInternal(IGH_DataAccess da) { diff --git a/GsaGH/Components/5_Results/AssemblyDrifts.cs b/GsaGH/Components/5_Results/AssemblyDrifts.cs index 1db31e683..5ad2e0e20 100644 --- a/GsaGH/Components/5_Results/AssemblyDrifts.cs +++ b/GsaGH/Components/5_Results/AssemblyDrifts.cs @@ -80,11 +80,11 @@ public class AssemblyDrifts : GH_OasysDropDownComponent { string note = ResultNotes.NoteAssemblyResults; pManager.AddGenericParameter("Drift X [" + unitAbbreviation + "]", "Dx", - "Drift in Local Assembly X-direction." + note, GH_ParamAccess.tree); + "Drift in Local Assembly X-direction" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Drift Y [" + unitAbbreviation + "]", "Dy", - "Drift in Local Assembly Y-direction." + note, GH_ParamAccess.tree); + "Drift in Local Assembly Y-direction" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Drift XY [" + unitAbbreviation + "]", "In-plane", - "Drift in Local Assembly XY-plane." + note, GH_ParamAccess.tree); + "Drift in Local Assembly XY-plane" + note, GH_ParamAccess.tree); } protected override void SolveInternal(IGH_DataAccess da) { diff --git a/GsaGH/Components/5_Results/AssemblyForcesAndMoments.cs b/GsaGH/Components/5_Results/AssemblyForcesAndMoments.cs index 7a577d118..01d63fbd8 100644 --- a/GsaGH/Components/5_Results/AssemblyForcesAndMoments.cs +++ b/GsaGH/Components/5_Results/AssemblyForcesAndMoments.cs @@ -105,26 +105,26 @@ public class AssemblyForcesAndMoments : GH_OasysDropDownComponent { string note = ResultNotes.NoteAssemblyResults; pManager.AddGenericParameter("Force X [" + forceunitAbbreviation + "]", "Fx", - "Assembly Axial Force in Local Element X-direction." + forcerule + note, + "Assembly Axial Force in Local Element X-direction" + forcerule + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Force Y [" + forceunitAbbreviation + "]", "Fy", - "Assembly Shear Force in Local Element Y-direction." + forcerule + note, + "Assembly Shear Force in Local Element Y-direction" + forcerule + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Force Z [" + forceunitAbbreviation + "]", "Fz", - "Assembly Shear Force in Local Element Z-direction." + forcerule + note, + "Assembly Shear Force in Local Element Z-direction" + forcerule + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Force |YZ| [" + forceunitAbbreviation + "]", "|Fyz|", - "Total |YZ| Assembly Shear Force." + note, GH_ParamAccess.tree); + "Total |YZ| Assembly Shear Force" + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Moment XX [" + momentunitAbbreviation + "]", "Mxx", - "Assembly Torsional Moment around Local Element X-axis." + momentrule + note, + "Assembly Torsional Moment around Local Element X-axis" + momentrule + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Moment YY [" + momentunitAbbreviation + "]", "Myy", - "Assembly Bending Moment around Local Element Y-axis." + momentrule + note, + "Assembly Bending Moment around Local Element Y-axis" + momentrule + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Moment ZZ [" + momentunitAbbreviation + "]", "Mzz", - "Assembly Bending Moment around Local Element Z-axis." + momentrule + note, + "Assembly Bending Moment around Local Element Z-axis" + momentrule + note, GH_ParamAccess.tree); pManager.AddGenericParameter("Moment |YZ| [" + momentunitAbbreviation + "]", "|Myz|", - "Total |YYZZ| Assembly Bending Moment." + note, GH_ParamAccess.tree); + "Total |YYZZ| Assembly Bending Moment" + note, GH_ParamAccess.tree); } protected override void SolveInternal(IGH_DataAccess da) { From 5f53192a9e139f67f5bf0eff46d0a6dac45726b7 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Thu, 28 Mar 2024 10:47:37 +0100 Subject: [PATCH 05/14] GSAGH-478 static p delta --- .../Components/4_Analysis/CreateAnalysisTask.cs | 1 + .../4_Analysis/CreateAnalysisTaskTests.cs | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs index 3f1d9cda3..b50242521 100644 --- a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs @@ -44,6 +44,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { _dropDownItems.Add(new List() { AnalysisTaskType.Static.ToString(), + AnalysisTaskType.StaticPDelta.ToString(), }); _selectedItems.Add(_tasktype.ToString()); diff --git a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs index a779eeb75..59eeec43d 100644 --- a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs @@ -7,7 +7,6 @@ namespace GsaGHTests.Components.Analysis { [Collection("GrasshopperFixture collection")] public class CreateAnalysisTaskTests { - public static GH_OasysComponent ComponentMother() { var comp = new CreateAnalysisTask(); comp.CreateAttributes(); @@ -21,7 +20,7 @@ public class CreateAnalysisTaskTests { } [Fact] - public void CreateComponentTest() { + public void CreateStaticComponentTest() { GH_OasysComponent comp = ComponentMother(); var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); @@ -31,5 +30,18 @@ public class CreateAnalysisTaskTests { Assert.Equal("my Case", output.Value.Cases[0].Name); Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); } + + [Fact] + public void CreateStaticPDeltaComponentTest() { + GH_OasysComponent comp = ComponentMother(); + ComponentTestHelper.SetInput(comp, "my Task", 0); + + var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); + + Assert.Equal("my Task", output.Value.ApiTask.Name); + Assert.Equal((int)AnalysisTaskType.Static, output.Value.ApiTask.Type); + Assert.Equal("my Case", output.Value.Cases[0].Name); + Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); + } } } From 24c82418fbabbea7552bea88b34484ffebe2ffaa Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Thu, 28 Mar 2024 13:29:41 +0100 Subject: [PATCH 06/14] GSAGH-478 icon --- GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs | 3 ++- GsaGH/Properties/Icons/AnalysisTaskInfo.png | Bin 0 -> 453 bytes GsaGH/Properties/Resources.Designer.cs | 10 ++++++++++ GsaGH/Properties/Resources.resx | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 GsaGH/Properties/Icons/AnalysisTaskInfo.png diff --git a/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs b/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs index a5f16261d..94f6e0169 100644 --- a/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs +++ b/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs @@ -6,6 +6,7 @@ using Grasshopper.Kernel.Types; using GsaGH.Helpers.GH; using GsaGH.Parameters; +using GsaGH.Properties; using OasysGH; using OasysGH.Components; @@ -17,7 +18,7 @@ public class AnalysisTaskInfo : GH_OasysComponent { public override Guid ComponentGuid => new Guid("82d76442-cc58-49c6-b6d7-d0ae998ce063"); public override GH_Exposure Exposure => GH_Exposure.secondary | GH_Exposure.obscure; public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance; - protected override Bitmap Icon => null; + protected override Bitmap Icon => Resources.AnalysisTaskInfo; public AnalysisTaskInfo() : base("Analysis Task Info", "TaskInfo", "Get information about a GSA Analysis Task", diff --git a/GsaGH/Properties/Icons/AnalysisTaskInfo.png b/GsaGH/Properties/Icons/AnalysisTaskInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..502398fb01105284a5f6639a568b329b7ee191b8 GIT binary patch literal 453 zcmV;$0XqJPP)~{U1#cc?dNI= zFGT;zB)hZS`OVHw7vN7z2yukAMDxX$Cgg)%NCpoBw=b?klk(#b1Ip_Lt(M~_pBqgW zloX|^Sza;54ikWe?dUduHyg7Qzz2B(v)KuKi^q{#M?m=fcZozWif4evQ$~Gh9ZSHXrBS^PR37TIIHBB~GtaVH;%tjiz%cm@&bHl~FP3-gHbl5u|%0El6q + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AnalysisTaskInfo { + get { + object obj = ResourceManager.GetObject("AnalysisTaskInfo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/GsaGH/Properties/Resources.resx b/GsaGH/Properties/Resources.resx index a6223095b..8f40403bf 100644 --- a/GsaGH/Properties/Resources.resx +++ b/GsaGH/Properties/Resources.resx @@ -685,4 +685,7 @@ Icons\AssemblyResults.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Icons\AnalysisTaskInfo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file From e3dc7b5ffd7af8096f96c346b23472157585b1d8 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Mon, 6 May 2024 15:38:51 +0200 Subject: [PATCH 07/14] GSAGH-478 static p-delta task --- .../Components/4_Analysis/AnalysisTaskInfo.cs | 4 +- .../4_Analysis/CreateAnalysisTask.cs | 206 +++++++++++++++++- 2 files changed, 200 insertions(+), 10 deletions(-) diff --git a/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs b/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs index 94f6e0169..e5ccf9336 100644 --- a/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs +++ b/GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs @@ -37,8 +37,8 @@ public class AnalysisTaskInfo : GH_OasysComponent { GsaAnalysisCaseGoo.NickName, "List of " + GsaAnalysisCaseGoo.Description, GH_ParamAccess.list); pManager.AddTextParameter("Solver Type", "sT", "Solver Type", GH_ParamAccess.item); - pManager.AddIntegerParameter("TaskID", "ID", - "The Task number if the Analysis Case ever belonged to a model", GH_ParamAccess.item); + pManager.AddIntegerParameter("Task ID", "ID", "The Task number of the Analysis Task", + GH_ParamAccess.item); } protected override void SolveInstance(IGH_DataAccess da) { diff --git a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs index b50242521..fc73ab5ff 100644 --- a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Drawing; using Grasshopper.Kernel; +using Grasshopper.Kernel.Parameters; using Grasshopper.Kernel.Types; using GsaAPI; using GsaGH.Helpers.GH; @@ -20,6 +21,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance; protected override Bitmap Icon => Resources.CreateAnalysisTask; private AnalysisTaskType _tasktype = AnalysisTaskType.Static; + private int _casesParamIndex = 2; public CreateAnalysisTask() : base( "Create " + GsaAnalysisTaskGoo.Name, @@ -30,10 +32,67 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { public override void SetSelected(int i, int j) { _selectedItems[i] = _dropDownItems[i][j]; - _tasktype = (AnalysisTaskType)Enum.Parse(typeof(AnalysisTaskType), _selectedItems[i]); + if (i == 0) { + switch (_selectedItems[0]) { + case "Static": + StaticClicked(); + break; + + case "Static P-delta": + StaticPDeltaClicked(); + break; + } + } else if (i == 1) { + switch (_selectedItems[1]) { + case "Load case": + case "Result case": + StaticPDeltaClicked(); + break; + + default: + // do nothing + break; + } + } + base.UpdateUI(); } + public override void VariableParameterMaintenance() { + switch (_tasktype) { + case AnalysisTaskType.StaticPDelta: + switch (_selectedItems[1]) { + case "Own": + default: + // do nothing + break; + + case "Load case": + Params.Input[2].NickName = "LC"; + Params.Input[2].Name = "Load case"; + Params.Input[2].Description = "Load case definition (e.g. 1.2L1 + 1.2L2)"; + Params.Input[2].Access = GH_ParamAccess.item; + Params.Input[2].Optional = false; + break; + + case "Result case": + Params.Input[2].NickName = "RC"; + Params.Input[2].Name = "Result case"; + Params.Input[2].Description = "The result case that forms the basis for the geometric stiffness"; + Params.Input[2].Access = GH_ParamAccess.item; + Params.Input[2].Optional = false; + break; + } + + break; + + case AnalysisTaskType.Static: + default: + // do nothing + break; + } + } + protected override void InitialiseDropdowns() { _spacerDescriptions = new List(new[] { "Solver", @@ -43,21 +102,24 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { _selectedItems = new List(); _dropDownItems.Add(new List() { - AnalysisTaskType.Static.ToString(), - AnalysisTaskType.StaticPDelta.ToString(), + "Static", + "Static P-delta", }); - _selectedItems.Add(_tasktype.ToString()); + _selectedItems.Add("Static"); _isInitialised = true; } protected override void RegisterInputParams(GH_InputParamManager pManager) { + pManager.AddIntegerParameter("Task ID", "ID", "The Task number of the Analysis Task", + GH_ParamAccess.item); pManager.AddTextParameter("Name", "Na", "Task Name", GH_ParamAccess.item); pManager.AddGenericParameter("Analysis Cases", "ΣAs", "List of GSA Analysis Cases (if left empty, all load cases in model will be added)", GH_ParamAccess.list); pManager[0].Optional = true; pManager[1].Optional = true; + pManager[2].Optional = true; } protected override void RegisterOutputParams(GH_OutputParamManager pManager) { @@ -65,13 +127,15 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { } protected override void SolveInternal(IGH_DataAccess da) { + int id = 0; + da.GetData(0, ref id); + string name = _tasktype.ToString(); - da.GetData(0, ref name); + da.GetData(1, ref name); List cases = null; - var ghTypes = new List(); - if (da.GetDataList(1, ghTypes)) { + if (da.GetDataList(_casesParamIndex, ghTypes)) { cases = new List(); for (int i = 0; i < ghTypes.Count; i++) { GH_ObjectWrapper ghTyp = ghTypes[i]; @@ -106,7 +170,23 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { break; case AnalysisTaskType.StaticPDelta: - task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask(name, new GeometricStiffnessFromResultCase(1)); + switch (_selectedItems[1]) { + case "Own": + task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask(name, new GeometricStiffnessFromOwnLoad()); + break; + + case "Load case": + string caseDescription = string.Empty; + da.GetData(2, ref caseDescription); + task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask(name, new GeometricStiffnessFromLoadCase(caseDescription)); + break; + + case "Result case": + int resultCase = 0; + da.GetData(2, ref resultCase); + task = AnalysisTaskFactory.CreateStaticPDeltaAnalysisTask(name, new GeometricStiffnessFromResultCase(resultCase)); + break; + } break; default: @@ -117,6 +197,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { var gsaAnalysisTask = new GsaAnalysisTask() { Cases = cases, ApiTask = task, + Id = id }; da.SetData(0, new GsaAnalysisTaskGoo(gsaAnalysisTask)); @@ -126,5 +207,114 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { _tasktype = (AnalysisTaskType)Enum.Parse(typeof(AnalysisTaskType), _selectedItems[0]); base.UpdateUIFromSelectedItems(); } + + private void StaticClicked() { + if (_tasktype == AnalysisTaskType.Static) { + return; + } + + _casesParamIndex = 2; + + RecordUndoEvent("Static"); + _tasktype = AnalysisTaskType.Static; + + UpdateDropdowns(); + + IGH_Param casesParam = Params.Input[Params.Input.Count - 1]; + + while (Params.Input.Count > 2) { + Params.UnregisterInputParameter(Params.Input[2], true); + } + + Params.RegisterInputParam(casesParam); + } + + private void StaticPDeltaClicked() { + if (_tasktype != AnalysisTaskType.StaticPDelta) { + RecordUndoEvent("StaticPDelta"); + _tasktype = AnalysisTaskType.StaticPDelta; + + UpdateDropdowns(); + } + + IGH_Param casesParam = Params.Input[Params.Input.Count - 1]; + + while (Params.Input.Count > 2) { + Params.UnregisterInputParameter(Params.Input[2], true); + } + + switch (_selectedItems[1]) { + case "Own": + default: + _casesParamIndex = 2; + break; + + case "Load case": + _casesParamIndex = 3; + Params.RegisterInputParam(new Param_String()); + break; + + case "Result case": + _casesParamIndex = 3; + Params.RegisterInputParam(new Param_Integer()); + break; + } + + Params.RegisterInputParam(casesParam); + } + + + private void ReDrawComponent() { + var pivot = new PointF(Attributes.Pivot.X, Attributes.Pivot.Y); + base.CreateAttributes(); + Attributes.Pivot = pivot; + Attributes.ExpireLayout(); + Attributes.PerformLayout(); + } + + private void UpdateDropdowns() { + _dropDownItems = new List>(); + _selectedItems = new List(); + + switch (_tasktype) { + case AnalysisTaskType.StaticPDelta: + _spacerDescriptions = new List(new[] { + "Solver", + "Case" + }); + + _dropDownItems.Add(new List() { + "Static", + "Static P-delta", + }); + _selectedItems.Add("Static P-delta"); + + _dropDownItems.Add(new List() { + "Own", + "Load case", + "Result case" + }); + _selectedItems.Add("Own"); + + ReDrawComponent(); + break; + + + case AnalysisTaskType.Static: + default: + _spacerDescriptions = new List(new[] { + "Solver", + }); + + _dropDownItems.Add(new List() { + "Static", + "Static P-delta", + }); + + _selectedItems.Add("Static"); + ReDrawComponent(); + break; + } + } } } From 6a62d0e0f5c58605c165898ceb5174624ee94de2 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Wed, 8 May 2024 14:29:05 +0200 Subject: [PATCH 08/14] GSAGH-478 made component obsolete --- .../CreateAnalysisTask_OBSOLETE.cs | 119 ++++++++++++++++++ GsaGHTests/3_Components/ComponentsTests.cs | 3 +- .../3_Components/GH_OasysComponentTest.cs | 1 + .../CreateAnalysisTaskTests_OBSOLETE.cs | 35 ++++++ .../DropDownComponentTests.cs | 1 + 5 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs create mode 100644 GsaGHTests/3_Components/Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs diff --git a/GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs b/GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs new file mode 100644 index 000000000..f25e747d7 --- /dev/null +++ b/GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using Grasshopper.Kernel; +using Grasshopper.Kernel.Types; +using GsaGH.Helpers.GH; +using GsaGH.Parameters; +using GsaGH.Properties; +using OasysGH; +using OasysGH.Components; + +namespace GsaGH.Components { + /// + /// Component to create a GSA Analysis Task + /// + public class CreateAnalysisTask_OBSOLETE : GH_OasysDropDownComponent { + public override Guid ComponentGuid => new Guid("6ef86d0b-892c-4b6f-950e-b4477e9f0910"); + public override GH_Exposure Exposure => GH_Exposure.hidden; + public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance; + protected override Bitmap Icon => Resources.CreateAnalysisTask; + private AnalysisTaskType _tasktype = AnalysisTaskType.Static; + + public CreateAnalysisTask_OBSOLETE() : base( + "Create " + GsaAnalysisTaskGoo.Name, + GsaAnalysisTaskGoo.NickName.Replace(" ", string.Empty), + "Create a " + GsaAnalysisTaskGoo.Description, CategoryName.Name(), SubCategoryName.Cat4()) { + Hidden = true; + } + + public override void SetSelected(int i, int j) { + _selectedItems[i] = _dropDownItems[i][j]; + _tasktype = (AnalysisTaskType)Enum.Parse(typeof(AnalysisTaskType), _selectedItems[i]); + base.UpdateUI(); + } + + protected override void InitialiseDropdowns() { + _spacerDescriptions = new List(new[] { + "Solver", + }); + + _dropDownItems = new List>(); + _selectedItems = new List(); + + _dropDownItems.Add(new List() { + AnalysisTaskType.Static.ToString(), + }); + _selectedItems.Add(_tasktype.ToString()); + + _isInitialised = true; + } + + protected override void RegisterInputParams(GH_InputParamManager pManager) { + pManager.AddTextParameter("Name", "Na", "Task Name", GH_ParamAccess.item); + pManager.AddGenericParameter("Analysis Cases", "ΣAs", + "List of GSA Analysis Cases (if left empty, all load cases in model will be added)", + GH_ParamAccess.list); + pManager[0].Optional = true; + pManager[1].Optional = true; + } + + protected override void RegisterOutputParams(GH_OutputParamManager pManager) { + pManager.AddParameter(new GsaAnalysisTaskParameter()); + } + + protected override void SolveInternal(IGH_DataAccess da) { + string name = _tasktype.ToString(); + da.GetData(0, ref name); + + List cases = null; + + var ghTypes = new List(); + if (da.GetDataList(1, ghTypes)) { + cases = new List(); + for (int i = 0; i < ghTypes.Count; i++) { + GH_ObjectWrapper ghTyp = ghTypes[i]; + if (ghTyp == null) { + Params.Owner.AddRuntimeWarning("Analysis Case input (index: " + i + + ") is null and has been ignored"); + continue; + } + + if (ghTyp.Value is GsaAnalysisCaseGoo goo) { + cases.Add(goo.Value.Duplicate()); + } else { + string type = ghTyp.Value.GetType().ToString(); + type = type.Replace("GsaGH.Parameters.", string.Empty); + type = type.Replace("Goo", string.Empty); + Params.Owner.AddRuntimeError("Unable to convert Analysis Case input parameter of type " + + type + " to GsaAnalysisCase"); + return; + } + } + } + + if (cases == null) { + this.AddRuntimeRemark( + "Default Task has been created; it will by default contain all cases found in model"); + } + + if (_tasktype != AnalysisTaskType.Static) { + this.AddRuntimeWarning("It is currently not possible to adjust the solver settings. " + + Environment.NewLine + + "Please verify the solver settings in GSA ('Task and Cases' -> 'Analysis Tasks')"); + } + + var task = new GsaAnalysisTask { + Name = name, + Cases = cases, + Type = _tasktype, + }; + da.SetData(0, new GsaAnalysisTaskGoo(task)); + } + + protected override void UpdateUIFromSelectedItems() { + _tasktype = (AnalysisTaskType)Enum.Parse(typeof(AnalysisTaskType), _selectedItems[0]); + base.UpdateUIFromSelectedItems(); + } + } +} diff --git a/GsaGHTests/3_Components/ComponentsTests.cs b/GsaGHTests/3_Components/ComponentsTests.cs index 21d9a6bfe..9702433ec 100644 --- a/GsaGHTests/3_Components/ComponentsTests.cs +++ b/GsaGHTests/3_Components/ComponentsTests.cs @@ -82,6 +82,7 @@ public class ComponentsTests { [InlineData(typeof(ContourNodeResults), 2)] [InlineData(typeof(ReactionForceDiagrams), 1)] [InlineData(typeof(ResultDiagrams), 2)] + [InlineData(typeof(CreateAnalysisTask_OBSOLETE), 1)] public void WhenInitialiseDropdowns_ThenDropDownItemsCount_ShouldBeValid( Type t, int expectedListCount) { var obj = (GH_OasysDropDownComponent)Activator.CreateInstance(t); @@ -135,7 +136,7 @@ public class ComponentsTests { [InlineData(typeof(LoadProperties), "kN", "kipf")] // Analysis [InlineData(typeof(AnalyseModel), "m", "ft")] - [InlineData(typeof(CreateAnalysisTask), "Static", "Static")] + [InlineData(typeof(CreateAnalysisTask_OBSOLETE), "Static", "Static")] // Results [InlineData(typeof(BeamDisplacements), "All", "Min |R|")] [InlineData(typeof(BeamForcesAndMoments), "All", "Min |Myz|")] diff --git a/GsaGHTests/3_Components/GH_OasysComponentTest.cs b/GsaGHTests/3_Components/GH_OasysComponentTest.cs index da644bd4e..a55191e3d 100644 --- a/GsaGHTests/3_Components/GH_OasysComponentTest.cs +++ b/GsaGHTests/3_Components/GH_OasysComponentTest.cs @@ -145,6 +145,7 @@ public class GH_OasysComponentTests { // 99_Obsolete [InlineData(typeof(GlobalPerformanceResults_OBSOLETE), true)] [InlineData(typeof(GetModelProperties_OBSOLETE), true)] + [InlineData(typeof(CreateAnalysisTask_OBSOLETE), true)] public void GH_OasysComponentTest(Type t, bool obsolete = false) { var comp = (GH_OasysComponent)Activator.CreateInstance(t); Assert.NotNull(comp.Icon_24x24); diff --git a/GsaGHTests/3_Components/Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs b/GsaGHTests/3_Components/Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs new file mode 100644 index 000000000..79bd53d24 --- /dev/null +++ b/GsaGHTests/3_Components/Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs @@ -0,0 +1,35 @@ +using GsaGH.Components; +using GsaGH.Parameters; +using GsaGHTests.Helpers; +using OasysGH.Components; +using Xunit; + +namespace GsaGHTests.Components.Analysis { + [Collection("GrasshopperFixture collection")] + public class CreateAnalysisTaskTests_OBSOLETE { + + public static GH_OasysComponent ComponentMother() { + var comp = new CreateAnalysisTask_OBSOLETE(); + comp.CreateAttributes(); + + ComponentTestHelper.SetInput(comp, "my Task", 0); + var output = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput( + CreateAnalysisCaseTests.ComponentMother()); + ComponentTestHelper.SetInput(comp, output, 1); + + return comp; + } + + [Fact] + public void CreateComponentTest() { + GH_OasysComponent comp = ComponentMother(); + + var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); + + Assert.Equal("my Task", output.Value.Name); + Assert.Equal(AnalysisTaskType.Static, output.Value.Type); + Assert.Equal("my Case", output.Value.Cases[0].Name); + Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); + } + } +} diff --git a/GsaGHTests/4_CustomUIComponents/DropDownComponentTests.cs b/GsaGHTests/4_CustomUIComponents/DropDownComponentTests.cs index 792ea7eda..0e75df2b1 100644 --- a/GsaGHTests/4_CustomUIComponents/DropDownComponentTests.cs +++ b/GsaGHTests/4_CustomUIComponents/DropDownComponentTests.cs @@ -85,6 +85,7 @@ public class DropDownComponentTests { [InlineData(typeof(LoadDiagrams), true)] [InlineData(typeof(ReactionForceDiagrams))] [InlineData(typeof(ResultDiagrams))] + [InlineData(typeof(CreateAnalysisTask_OBSOLETE))] public void ToggleDropDownsTest(Type t, bool ignoreSpacerDescriptionCount = false) { var comp = (GH_OasysDropDownComponent)Activator.CreateInstance(t); OasysDropDownComponentTestHelper.ChangeDropDownTest(comp, ignoreSpacerDescriptionCount); From 6efdf8905a602fee827da95804419d43cd4f9e0d Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Wed, 8 May 2024 14:46:29 +0200 Subject: [PATCH 09/14] GSAGH-478 new guid --- GsaGH/Components/4_Analysis/CreateAnalysisTask.cs | 2 +- GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs | 5 +++-- .../Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs index fc73ab5ff..b27f2fd16 100644 --- a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs @@ -16,7 +16,7 @@ namespace GsaGH.Components { /// Component to create a GSA Analysis Task /// public class CreateAnalysisTask : GH_OasysDropDownComponent { - public override Guid ComponentGuid => new Guid("6ef86d0b-892c-4b6f-950e-b4477e9f0910"); + public override Guid ComponentGuid => new Guid("581601cc-c0bc-47fe-ada5-b821327a4409"); public override GH_Exposure Exposure => GH_Exposure.secondary | GH_Exposure.obscure; public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance; protected override Bitmap Icon => Resources.CreateAnalysisTask; diff --git a/GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs b/GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs index f25e747d7..3e28ba213 100644 --- a/GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs +++ b/GsaGH/Components/99_Obsolete/CreateAnalysisTask_OBSOLETE.cs @@ -3,6 +3,7 @@ using System.Drawing; using Grasshopper.Kernel; using Grasshopper.Kernel.Types; +using GsaAPI; using GsaGH.Helpers.GH; using GsaGH.Parameters; using GsaGH.Properties; @@ -104,10 +105,10 @@ public class CreateAnalysisTask_OBSOLETE : GH_OasysDropDownComponent { } var task = new GsaAnalysisTask { - Name = name, Cases = cases, - Type = _tasktype, + ApiTask = AnalysisTaskFactory.CreateStaticAnalysisTask(name) }; + da.SetData(0, new GsaAnalysisTaskGoo(task)); } diff --git a/GsaGHTests/3_Components/Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs b/GsaGHTests/3_Components/Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs index 79bd53d24..ace25ffd1 100644 --- a/GsaGHTests/3_Components/Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs +++ b/GsaGHTests/3_Components/Obsolete/CreateAnalysisTaskTests_OBSOLETE.cs @@ -26,8 +26,8 @@ public class CreateAnalysisTaskTests_OBSOLETE { var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); - Assert.Equal("my Task", output.Value.Name); - Assert.Equal(AnalysisTaskType.Static, output.Value.Type); + Assert.Equal("my Task", output.Value.ApiTask.Name); + Assert.Equal((int)AnalysisTaskType.Static, output.Value.ApiTask.Type); Assert.Equal("my Case", output.Value.Cases[0].Name); Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); } From d5fc85000fa9c6afea527a66ff0722c3d72573c1 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Tue, 14 May 2024 11:21:06 +0200 Subject: [PATCH 10/14] GSAGH-478 refactoring --- .../4_Analysis/CreateAnalysisTask.cs | 148 +++++++++--------- 1 file changed, 76 insertions(+), 72 deletions(-) diff --git a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs index b27f2fd16..a5142252e 100644 --- a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using GH_IO.Serialization; using Grasshopper.Kernel; using Grasshopper.Kernel.Parameters; using Grasshopper.Kernel.Types; @@ -20,7 +21,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { public override GH_Exposure Exposure => GH_Exposure.secondary | GH_Exposure.obscure; public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance; protected override Bitmap Icon => Resources.CreateAnalysisTask; - private AnalysisTaskType _tasktype = AnalysisTaskType.Static; + private AnalysisTaskType _type = AnalysisTaskType.Static; private int _casesParamIndex = 2; public CreateAnalysisTask() : base( @@ -30,36 +31,35 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { Hidden = true; } + public override bool Read(GH_IReader reader) { + _casesParamIndex = reader.GetInt32("_casesParamIndex"); + return base.Read(reader); + } + public override void SetSelected(int i, int j) { _selectedItems[i] = _dropDownItems[i][j]; + if (i == 0) { switch (_selectedItems[0]) { case "Static": - StaticClicked(); + _type = AnalysisTaskType.Static; break; case "Static P-delta": - StaticPDeltaClicked(); + _type = AnalysisTaskType.StaticPDelta; break; } - } else if (i == 1) { - switch (_selectedItems[1]) { - case "Load case": - case "Result case": - StaticPDeltaClicked(); - break; - default: - // do nothing - break; - } + UpdateDropdownItems(); } + UpdateParameters(); + base.UpdateUI(); } public override void VariableParameterMaintenance() { - switch (_tasktype) { + switch (_type) { case AnalysisTaskType.StaticPDelta: switch (_selectedItems[1]) { case "Own": @@ -93,6 +93,11 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { } } + public override bool Write(GH_IWriter writer) { + writer.SetInt32("_casesParamIndex", _casesParamIndex); + return base.Write(writer); + } + protected override void InitialiseDropdowns() { _spacerDescriptions = new List(new[] { "Solver", @@ -130,7 +135,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { int id = 0; da.GetData(0, ref id); - string name = _tasktype.ToString(); + string name = _type.ToString(); da.GetData(1, ref name); List cases = null; @@ -164,7 +169,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { } AnalysisTask task = null; - switch (_tasktype) { + switch (_type) { case AnalysisTaskType.Static: task = AnalysisTaskFactory.CreateStaticAnalysisTask(name); break; @@ -190,7 +195,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { break; default: - this.AddRuntimeWarning("It is currently not possible to create Analysis Tasks of type " + _tasktype); + this.AddRuntimeWarning("It is currently not possible to create Analysis Tasks of type " + _type); break; } @@ -204,83 +209,75 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { } protected override void UpdateUIFromSelectedItems() { - _tasktype = (AnalysisTaskType)Enum.Parse(typeof(AnalysisTaskType), _selectedItems[0]); - base.UpdateUIFromSelectedItems(); - } + switch (_selectedItems[0]) { + case "Static": + _type = AnalysisTaskType.Static; + break; - private void StaticClicked() { - if (_tasktype == AnalysisTaskType.Static) { - return; + case "Static P-delta": + _type = AnalysisTaskType.StaticPDelta; + break; } - _casesParamIndex = 2; - - RecordUndoEvent("Static"); - _tasktype = AnalysisTaskType.Static; + base.UpdateUIFromSelectedItems(); + } - UpdateDropdowns(); + private void UpdateParameters() { + IGH_Param casesParam; + switch (_type) { + case AnalysisTaskType.Static: + casesParam = Params.Input[Params.Input.Count - 1]; - IGH_Param casesParam = Params.Input[Params.Input.Count - 1]; + while (Params.Input.Count > 2) { + Params.UnregisterInputParameter(Params.Input[2], true); + } + _casesParamIndex = 2; + Params.RegisterInputParam(casesParam); - while (Params.Input.Count > 2) { - Params.UnregisterInputParameter(Params.Input[2], true); - } + break; - Params.RegisterInputParam(casesParam); - } + case AnalysisTaskType.StaticPDelta: + casesParam = Params.Input[Params.Input.Count - 1]; - private void StaticPDeltaClicked() { - if (_tasktype != AnalysisTaskType.StaticPDelta) { - RecordUndoEvent("StaticPDelta"); - _tasktype = AnalysisTaskType.StaticPDelta; + while (Params.Input.Count > 2) { + Params.UnregisterInputParameter(Params.Input[2], true); + } - UpdateDropdowns(); - } + switch (_selectedItems[1]) { + case "Own": + default: + _casesParamIndex = 2; + break; - IGH_Param casesParam = Params.Input[Params.Input.Count - 1]; + case "Load case": + _casesParamIndex = 3; + Params.RegisterInputParam(new Param_String()); + break; - while (Params.Input.Count > 2) { - Params.UnregisterInputParameter(Params.Input[2], true); - } + case "Result case": + _casesParamIndex = 3; + Params.RegisterInputParam(new Param_Integer()); + break; + } - switch (_selectedItems[1]) { - case "Own": - default: - _casesParamIndex = 2; - break; + Params.RegisterInputParam(casesParam); - case "Load case": - _casesParamIndex = 3; - Params.RegisterInputParam(new Param_String()); break; - case "Result case": - _casesParamIndex = 3; - Params.RegisterInputParam(new Param_Integer()); + default: break; } - - Params.RegisterInputParam(casesParam); } - - private void ReDrawComponent() { - var pivot = new PointF(Attributes.Pivot.X, Attributes.Pivot.Y); - base.CreateAttributes(); - Attributes.Pivot = pivot; - Attributes.ExpireLayout(); - Attributes.PerformLayout(); - } - - private void UpdateDropdowns() { + private void UpdateDropdownItems() { _dropDownItems = new List>(); _selectedItems = new List(); - switch (_tasktype) { + switch (_type) { case AnalysisTaskType.StaticPDelta: _spacerDescriptions = new List(new[] { "Solver", - "Case" + "P-delta Case" }); _dropDownItems.Add(new List() { @@ -296,10 +293,8 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { }); _selectedItems.Add("Own"); - ReDrawComponent(); break; - case AnalysisTaskType.Static: default: _spacerDescriptions = new List(new[] { @@ -312,9 +307,18 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { }); _selectedItems.Add("Static"); - ReDrawComponent(); break; } + + ReDrawComponent(); + } + + private void ReDrawComponent() { + var pivot = new PointF(Attributes.Pivot.X, Attributes.Pivot.Y); + base.CreateAttributes(); + Attributes.Pivot = pivot; + Attributes.ExpireLayout(); + Attributes.PerformLayout(); } } } From 4e94663810340310e6a0fd2c16e6c4910b8cd1ab Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Tue, 14 May 2024 13:38:02 +0200 Subject: [PATCH 11/14] GSAGH-478 fixed tests --- GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs | 1 - GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs b/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs index 845892ce3..a7e413210 100644 --- a/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs @@ -9,7 +9,6 @@ namespace GsaGHTests.Components.Analysis { [Collection("GrasshopperFixture collection")] public class AnalysisTaskInfoTests { - public static GH_OasysComponent ComponentMother() { var comp = new AnalysisTaskInfo(); comp.CreateAttributes(); diff --git a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs index 59eeec43d..8c277bb3f 100644 --- a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs @@ -11,10 +11,10 @@ public class CreateAnalysisTaskTests { var comp = new CreateAnalysisTask(); comp.CreateAttributes(); - ComponentTestHelper.SetInput(comp, "my Task", 0); + ComponentTestHelper.SetInput(comp, "my Task", 1); var output = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput( CreateAnalysisCaseTests.ComponentMother()); - ComponentTestHelper.SetInput(comp, output, 1); + ComponentTestHelper.SetInput(comp, output, 2); return comp; } From b871b01ea9f61e8f73d4a549cf785cbccf667183 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Tue, 14 May 2024 14:05:35 +0200 Subject: [PATCH 12/14] GSAGH-478 _solverTypes dictionary --- .../4_Analysis/CreateAnalysisTask.cs | 49 ++++++------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs index a5142252e..95047905e 100644 --- a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Linq; using GH_IO.Serialization; using Grasshopper.Kernel; using Grasshopper.Kernel.Parameters; @@ -17,6 +18,12 @@ namespace GsaGH.Components { /// Component to create a GSA Analysis Task /// public class CreateAnalysisTask : GH_OasysDropDownComponent { + internal static readonly IReadOnlyDictionary _solverTypes + = new Dictionary { + { "Static", AnalysisTaskType.Static }, + { "Static P-delta", AnalysisTaskType.StaticPDelta }, + }; + public override Guid ComponentGuid => new Guid("581601cc-c0bc-47fe-ada5-b821327a4409"); public override GH_Exposure Exposure => GH_Exposure.secondary | GH_Exposure.obscure; public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance; @@ -40,15 +47,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { _selectedItems[i] = _dropDownItems[i][j]; if (i == 0) { - switch (_selectedItems[0]) { - case "Static": - _type = AnalysisTaskType.Static; - break; - - case "Static P-delta": - _type = AnalysisTaskType.StaticPDelta; - break; - } + _type = _solverTypes[_selectedItems[i]]; UpdateDropdownItems(); } @@ -106,11 +105,8 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { _dropDownItems = new List>(); _selectedItems = new List(); - _dropDownItems.Add(new List() { - "Static", - "Static P-delta", - }); - _selectedItems.Add("Static"); + _dropDownItems.Add(_solverTypes.Keys.ToList()); + _selectedItems.Add(_dropDownItems[0].First()); _isInitialised = true; } @@ -209,15 +205,7 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { } protected override void UpdateUIFromSelectedItems() { - switch (_selectedItems[0]) { - case "Static": - _type = AnalysisTaskType.Static; - break; - - case "Static P-delta": - _type = AnalysisTaskType.StaticPDelta; - break; - } + _type = _solverTypes[_selectedItems[0]]; base.UpdateUIFromSelectedItems(); } @@ -280,11 +268,8 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { "P-delta Case" }); - _dropDownItems.Add(new List() { - "Static", - "Static P-delta", - }); - _selectedItems.Add("Static P-delta"); + _dropDownItems.Add(_solverTypes.Keys.ToList()); + _selectedItems.Add(_dropDownItems[0][1]); _dropDownItems.Add(new List() { "Own", @@ -301,12 +286,8 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { "Solver", }); - _dropDownItems.Add(new List() { - "Static", - "Static P-delta", - }); - - _selectedItems.Add("Static"); + _dropDownItems.Add(_solverTypes.Keys.ToList()); + _selectedItems.Add(_dropDownItems[0][0]); break; } From 6a82d055ba3ea43170154da805f7d7600b3c7678 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Wed, 15 May 2024 09:09:51 +0200 Subject: [PATCH 13/14] GSAGH-478 unit tests --- .../4_Analysis/CreateAnalysisTask.cs | 4 - .../Components/6_Display/Preview3dSections.cs | 1 - .../4_Analysis/AnalysisTaskInfoTests.cs | 2 +- .../4_Analysis/CreateAnalysisTaskTests.cs | 82 +++++++++++++++++-- 4 files changed, 74 insertions(+), 15 deletions(-) diff --git a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs index 95047905e..dbc774490 100644 --- a/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs +++ b/GsaGH/Components/4_Analysis/CreateAnalysisTask.cs @@ -189,10 +189,6 @@ public class CreateAnalysisTask : GH_OasysDropDownComponent { break; } break; - - default: - this.AddRuntimeWarning("It is currently not possible to create Analysis Tasks of type " + _type); - break; } var gsaAnalysisTask = new GsaAnalysisTask() { diff --git a/GsaGH/Components/6_Display/Preview3dSections.cs b/GsaGH/Components/6_Display/Preview3dSections.cs index a2d7d0fb5..74382a709 100644 --- a/GsaGH/Components/6_Display/Preview3dSections.cs +++ b/GsaGH/Components/6_Display/Preview3dSections.cs @@ -8,7 +8,6 @@ using GsaGH.Helpers.Assembly; using GsaGH.Helpers.GH; using GsaGH.Helpers.Graphics; -using GsaGH.Helpers.GsaApi.EnumMappings; using GsaGH.Parameters; using GsaGH.Properties; using OasysGH; diff --git a/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs b/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs index a7e413210..370cb1b15 100644 --- a/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/AnalysisTaskInfoTests.cs @@ -34,7 +34,7 @@ public class AnalysisTaskInfoTests { Assert.Equal("1.4L1 + 0.8L3", output1.Value.Definition); Assert.Equal("my Case", output1.Value.Name); Assert.Equal("Static", output2.Value); - Assert.Equal(0, output3.Value); + Assert.Equal(1, output3.Value); } [Fact] diff --git a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs index 8c277bb3f..8c9fad863 100644 --- a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs @@ -1,4 +1,6 @@ -using GsaGH.Components; +using System; +using Grasshopper.Kernel; +using GsaGH.Components; using GsaGH.Parameters; using GsaGHTests.Helpers; using OasysGH.Components; @@ -7,10 +9,11 @@ namespace GsaGHTests.Components.Analysis { [Collection("GrasshopperFixture collection")] public class CreateAnalysisTaskTests { - public static GH_OasysComponent ComponentMother() { + public static GH_OasysDropDownComponent ComponentMother() { var comp = new CreateAnalysisTask(); comp.CreateAttributes(); + ComponentTestHelper.SetInput(comp, 1, 0); ComponentTestHelper.SetInput(comp, "my Task", 1); var output = (GsaAnalysisCaseGoo)ComponentTestHelper.GetOutput( CreateAnalysisCaseTests.ComponentMother()); @@ -21,10 +24,11 @@ public class CreateAnalysisTaskTests { [Fact] public void CreateStaticComponentTest() { - GH_OasysComponent comp = ComponentMother(); + GH_OasysDropDownComponent comp = ComponentMother(); var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); + Assert.Equal(1, output.Value.Id); Assert.Equal("my Task", output.Value.ApiTask.Name); Assert.Equal((int)AnalysisTaskType.Static, output.Value.ApiTask.Type); Assert.Equal("my Case", output.Value.Cases[0].Name); @@ -32,16 +36,76 @@ public class CreateAnalysisTaskTests { } [Fact] - public void CreateStaticPDeltaComponentTest() { - GH_OasysComponent comp = ComponentMother(); - ComponentTestHelper.SetInput(comp, "my Task", 0); + public void CreateStaticPDeltaComponentTest1() { + var comp = new CreateAnalysisTask(); + comp.CreateAttributes(); + + comp.SetSelected(0, 1); + ComponentTestHelper.SetInput(comp, 1, 0); + ComponentTestHelper.SetInput(comp, "my Task", 1); var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); + Assert.Equal(1, output.Value.Id); Assert.Equal("my Task", output.Value.ApiTask.Name); - Assert.Equal((int)AnalysisTaskType.Static, output.Value.ApiTask.Type); - Assert.Equal("my Case", output.Value.Cases[0].Name); - Assert.Equal("1.4L1 + 0.8L3", output.Value.Cases[0].Definition); + Assert.Equal((int)AnalysisTaskType.StaticPDelta, output.Value.ApiTask.Type); + Assert.Equal(GH_RuntimeMessageLevel.Warning, comp.RuntimeMessageLevel); + Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Warning)); + } + + [Fact] + public void CreateStaticPDeltaComponentTest2() { + var comp = new CreateAnalysisTask(); + comp.CreateAttributes(); + + comp.SetSelected(0, 1); + comp.SetSelected(1, 1); + ComponentTestHelper.SetInput(comp, 1, 0); + ComponentTestHelper.SetInput(comp, "my Task", 1); + ComponentTestHelper.SetInput(comp, "1.2L1 + 1.2L2", 2); + + var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); + + Assert.Equal(1, output.Value.Id); + Assert.Equal("my Task", output.Value.ApiTask.Name); + Assert.Equal((int)AnalysisTaskType.StaticPDelta, output.Value.ApiTask.Type); + Assert.Equal(GH_RuntimeMessageLevel.Warning, comp.RuntimeMessageLevel); + Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Warning)); } + + [Fact] + public void CreateStaticPDeltaComponentTest3() { + var comp = new CreateAnalysisTask(); + comp.CreateAttributes(); + + comp.SetSelected(0, 1); + comp.SetSelected(1, 2); + ComponentTestHelper.SetInput(comp, 1, 0); + ComponentTestHelper.SetInput(comp, "my Task", 1); + ComponentTestHelper.SetInput(comp, 2, 2); + + var output = (GsaAnalysisTaskGoo)ComponentTestHelper.GetOutput(comp); + + Assert.Equal(1, output.Value.Id); + Assert.Equal("my Task", output.Value.ApiTask.Name); + Assert.Equal((int)AnalysisTaskType.StaticPDelta, output.Value.ApiTask.Type); + Assert.Equal(GH_RuntimeMessageLevel.Warning, comp.RuntimeMessageLevel); + Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Warning)); + } + + //[Theory] + //[InlineData(3)] + //[InlineData(8)] + //public void ChangeUnitExceptionsEquationTest(int analysisTaskType) { + // var comp = new CreateFaceLoad(); + // comp.CreateAttributes(); + // comp.SetSelected(0, 3); // Equation + // ComponentTestHelper.SetInput(comp, "All", 1); + // ComponentTestHelper.SetInput(comp, "myLoad", 2); + // ComponentTestHelper.SetInput(comp, "4*x+7*y-z", 7); + // comp.SetSelected(1, i); + // Assert.Throws(() => ComponentTestHelper.GetOutput(comp)); + // Assert.Equal(Grasshopper.Kernel.GH_RuntimeMessageLevel.Error, comp.RuntimeMessageLevel); + //} } } From df855ff09b060dc4403032150a910ddfeafe14f8 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Wed, 15 May 2024 09:42:02 +0200 Subject: [PATCH 14/14] GSAGH-478 RuntimeMessageLevel --- .../4_Analysis/CreateAnalysisTaskTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs index 8c9fad863..b84728d1d 100644 --- a/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs +++ b/GsaGHTests/3_Components/4_Analysis/CreateAnalysisTaskTests.cs @@ -49,8 +49,8 @@ public class CreateAnalysisTaskTests { Assert.Equal(1, output.Value.Id); Assert.Equal("my Task", output.Value.ApiTask.Name); Assert.Equal((int)AnalysisTaskType.StaticPDelta, output.Value.ApiTask.Type); - Assert.Equal(GH_RuntimeMessageLevel.Warning, comp.RuntimeMessageLevel); - Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Warning)); + Assert.Equal(GH_RuntimeMessageLevel.Remark, comp.RuntimeMessageLevel); + Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Remark)); } [Fact] @@ -69,8 +69,8 @@ public class CreateAnalysisTaskTests { Assert.Equal(1, output.Value.Id); Assert.Equal("my Task", output.Value.ApiTask.Name); Assert.Equal((int)AnalysisTaskType.StaticPDelta, output.Value.ApiTask.Type); - Assert.Equal(GH_RuntimeMessageLevel.Warning, comp.RuntimeMessageLevel); - Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Warning)); + Assert.Equal(GH_RuntimeMessageLevel.Remark, comp.RuntimeMessageLevel); + Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Remark)); } [Fact] @@ -89,8 +89,8 @@ public class CreateAnalysisTaskTests { Assert.Equal(1, output.Value.Id); Assert.Equal("my Task", output.Value.ApiTask.Name); Assert.Equal((int)AnalysisTaskType.StaticPDelta, output.Value.ApiTask.Type); - Assert.Equal(GH_RuntimeMessageLevel.Warning, comp.RuntimeMessageLevel); - Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Warning)); + Assert.Equal(GH_RuntimeMessageLevel.Remark, comp.RuntimeMessageLevel); + Assert.Single(comp.RuntimeMessages(GH_RuntimeMessageLevel.Remark)); } //[Theory]