diff --git a/GsaGH/Components/5_Results/BeamDisplacements.cs b/GsaGH/Components/5_Results/BeamDisplacements.cs index 89193adab..b289635fc 100644 --- a/GsaGH/Components/5_Results/BeamDisplacements.cs +++ b/GsaGH/Components/5_Results/BeamDisplacements.cs @@ -137,7 +137,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals + List vals = result.Element1DDisplacementValues(elementlist, positionsCount, -1, _lengthUnit); List permutations = result.SelectedPermutationIds is null ? new List() { @@ -218,7 +218,7 @@ List vals da.SetDataTree(6, outRotZ); da.SetDataTree(7, outRotXyz); - PostHog.Result(result.Type, 1, GsaResultsValues.ResultType.Displacement); + PostHog.Result(result.Type, 1, GsaResultValues.ResultType.Displacement); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/BeamForcesAndMoments.cs b/GsaGH/Components/5_Results/BeamForcesAndMoments.cs index 224d70d3c..f9348a01b 100644 --- a/GsaGH/Components/5_Results/BeamForcesAndMoments.cs +++ b/GsaGH/Components/5_Results/BeamForcesAndMoments.cs @@ -165,7 +165,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals + List vals = result.Element1DForceValues(elementlist, positionsCount, 0, _forceUnit, _momentUnit); List permutations = result.SelectedPermutationIds ?? new List() { @@ -249,7 +249,7 @@ List vals da.SetDataTree(6, outRotZ); da.SetDataTree(7, outRotXyz); - PostHog.Result(result.Type, 1, GsaResultsValues.ResultType.Force); + PostHog.Result(result.Type, 1, GsaResultValues.ResultType.Force); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/BeamStrainEnergyDensity.cs b/GsaGH/Components/5_Results/BeamStrainEnergyDensity.cs index 97f9405de..0806bce5f 100644 --- a/GsaGH/Components/5_Results/BeamStrainEnergyDensity.cs +++ b/GsaGH/Components/5_Results/BeamStrainEnergyDensity.cs @@ -170,7 +170,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals = _average ? + List vals = _average ? result.Element1DAverageStrainEnergyDensityValues(elementlist, 0, _energyUnit) : result.Element1DStrainEnergyDensityValues(elementlist, positionsCount, 0, _energyUnit); @@ -207,7 +207,7 @@ protected override void SolveInternal(IGH_DataAccess da) { da.SetDataTree(0, outTransX); - PostHog.Result(result.Type, 1, GsaResultsValues.ResultType.StrainEnergy); + PostHog.Result(result.Type, 1, GsaResultValues.ResultType.StrainEnergy); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/Element2dDisplacements.cs b/GsaGH/Components/5_Results/Element2dDisplacements.cs index de7ed8721..d8b8d5540 100644 --- a/GsaGH/Components/5_Results/Element2dDisplacements.cs +++ b/GsaGH/Components/5_Results/Element2dDisplacements.cs @@ -130,7 +130,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals = result.Element2DDisplacementValues(elementlist, _lengthUnit); + List vals = result.Element2DDisplacementValues(elementlist, _lengthUnit); List permutations = result.SelectedPermutationIds ?? new List() { 1, @@ -209,7 +209,7 @@ protected override void SolveInternal(IGH_DataAccess da) { da.SetDataTree(6, outRotZ); da.SetDataTree(7, outRotXyz); - PostHog.Result(result.Type, 2, GsaResultsValues.ResultType.Displacement); + PostHog.Result(result.Type, 2, GsaResultValues.ResultType.Displacement); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/Element2dForcesAndMoments.cs b/GsaGH/Components/5_Results/Element2dForcesAndMoments.cs index 95705e169..8e204bbe1 100644 --- a/GsaGH/Components/5_Results/Element2dForcesAndMoments.cs +++ b/GsaGH/Components/5_Results/Element2dForcesAndMoments.cs @@ -193,9 +193,9 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals + List vals = result.Element2DForceValues(elementlist, _forceUnit, _momentUnit); - List valsShear = result.Element2DShearValues(elementlist, _forceUnit); + List valsShear = result.Element2DShearValues(elementlist, _forceUnit); List permutations = result.SelectedPermutationIds ?? new List() { 1, @@ -295,7 +295,7 @@ List vals da.SetDataTree(6, outYy); da.SetDataTree(7, outXxyy); - PostHog.Result(result.Type, 2, GsaResultsValues.ResultType.Force); + PostHog.Result(result.Type, 2, GsaResultValues.ResultType.Force); da.SetDataTree(8, outWaxx); da.SetDataTree(9, outWayy); } diff --git a/GsaGH/Components/5_Results/Element2dStresses.cs b/GsaGH/Components/5_Results/Element2dStresses.cs index 767e7a959..d9b9812b3 100644 --- a/GsaGH/Components/5_Results/Element2dStresses.cs +++ b/GsaGH/Components/5_Results/Element2dStresses.cs @@ -137,7 +137,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals + List vals = result.Element2DStressValues(elementlist, layer, _stresshUnit); List permutations = result.SelectedPermutationIds ?? new List() { @@ -213,7 +213,7 @@ List vals da.SetDataTree(4, outYz); da.SetDataTree(5, outZx); - PostHog.Result(result.Type, 2, GsaResultsValues.ResultType.Stress); + PostHog.Result(result.Type, 2, GsaResultValues.ResultType.Stress); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/Element3dDisplacements.cs b/GsaGH/Components/5_Results/Element3dDisplacements.cs index ae7e11d43..330356bf6 100644 --- a/GsaGH/Components/5_Results/Element3dDisplacements.cs +++ b/GsaGH/Components/5_Results/Element3dDisplacements.cs @@ -131,7 +131,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals = result.Element3DDisplacementValues(elementlist, _lengthUnit); + List vals = result.Element3DDisplacementValues(elementlist, _lengthUnit); List permutations = result.SelectedPermutationIds ?? new List() { 1, @@ -210,7 +210,7 @@ protected override void SolveInternal(IGH_DataAccess da) { da.SetDataTree(6, outRotZ); da.SetDataTree(7, outRotXyz); - PostHog.Result(result.Type, 3, GsaResultsValues.ResultType.Displacement); + PostHog.Result(result.Type, 3, GsaResultValues.ResultType.Displacement); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/Element3dStresses.cs b/GsaGH/Components/5_Results/Element3dStresses.cs index e547b355f..a34d596d8 100644 --- a/GsaGH/Components/5_Results/Element3dStresses.cs +++ b/GsaGH/Components/5_Results/Element3dStresses.cs @@ -127,7 +127,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals = result.Element3DStressValues(elementlist, _stresshUnit); + List vals = result.Element3DStressValues(elementlist, _stresshUnit); List permutations = result.SelectedPermutationIds ?? new List() { 1, @@ -202,7 +202,7 @@ protected override void SolveInternal(IGH_DataAccess da) { da.SetDataTree(4, outYz); da.SetDataTree(5, outZx); - PostHog.Result(result.Type, 3, GsaResultsValues.ResultType.Stress); + PostHog.Result(result.Type, 3, GsaResultValues.ResultType.Stress); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/FootfallResults.cs b/GsaGH/Components/5_Results/FootfallResults.cs index e52646cd6..ba8ff98a5 100644 --- a/GsaGH/Components/5_Results/FootfallResults.cs +++ b/GsaGH/Components/5_Results/FootfallResults.cs @@ -68,13 +68,13 @@ protected override void SolveInstance(IGH_DataAccess da) { string nodeList = Inputs.GetNodeListDefinition(this, da, 1, result.Model); - GsaResultsValues res = result.NodeFootfallValues(nodeList, FootfallResultType.Resonant); - GsaResultsValues tra = result.NodeFootfallValues(nodeList, FootfallResultType.Transient); + GsaResultValues res = result.NodeFootfallValues(nodeList, FootfallResultType.Resonant); + GsaResultValues tra = result.NodeFootfallValues(nodeList, FootfallResultType.Transient); da.SetData(0, res.DmaxX.Value); da.SetData(1, tra.DmaxX.Value); - PostHog.Result(result.Type, 0, GsaResultsValues.ResultType.Footfall, "Max"); + PostHog.Result(result.Type, 0, GsaResultValues.ResultType.Footfall, "Max"); } } } diff --git a/GsaGH/Components/5_Results/NodeDisplacements.cs b/GsaGH/Components/5_Results/NodeDisplacements.cs index e0c72737c..1a4db9ada 100644 --- a/GsaGH/Components/5_Results/NodeDisplacements.cs +++ b/GsaGH/Components/5_Results/NodeDisplacements.cs @@ -134,7 +134,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - (List vals, List sortedIDs) + (List vals, List sortedIDs) = result.NodeDisplacementValues(nodeList, _lengthUnit); List permutations = result.SelectedPermutationIds ?? new List() { @@ -211,7 +211,7 @@ protected override void SolveInternal(IGH_DataAccess da) { da.SetDataTree(7, outRotXyz); da.SetDataTree(8, outIDs); - PostHog.Result(result.Type, 0, GsaResultsValues.ResultType.Displacement); + PostHog.Result(result.Type, 0, GsaResultValues.ResultType.Displacement); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/ReactionForces.cs b/GsaGH/Components/5_Results/ReactionForces.cs index c06fd5b80..b3aa4b77a 100644 --- a/GsaGH/Components/5_Results/ReactionForces.cs +++ b/GsaGH/Components/5_Results/ReactionForces.cs @@ -155,7 +155,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - (List vals, List sortedIDs) + (List vals, List sortedIDs) = result.NodeReactionForceValues(nodeList, _forceUnit, _momentUnit); List permutations = result.SelectedPermutationIds ?? new List() { @@ -233,7 +233,7 @@ protected override void SolveInternal(IGH_DataAccess da) { da.SetDataTree(7, outRotXyz); da.SetDataTree(8, outIDs); - PostHog.Result(result.Type, 0, GsaResultsValues.ResultType.Force); + PostHog.Result(result.Type, 0, GsaResultValues.ResultType.Force); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/5_Results/SpringReactionForces.cs b/GsaGH/Components/5_Results/SpringReactionForces.cs index f0a072a90..c7893677c 100644 --- a/GsaGH/Components/5_Results/SpringReactionForces.cs +++ b/GsaGH/Components/5_Results/SpringReactionForces.cs @@ -155,9 +155,9 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - Tuple, List> resultgetter + Tuple, List> resultgetter = result.SpringReactionForceValues(nodeList, _forceUnit, _momentUnit); - List vals = resultgetter.Item1; + List vals = resultgetter.Item1; List sortedIDs = resultgetter.Item2; List permutations = result.SelectedPermutationIds ?? new List() { @@ -235,7 +235,7 @@ Tuple, List> resultgetter da.SetDataTree(7, outRotXyz); da.SetDataTree(8, outIDs); - PostHog.Result(result.Type, 0, GsaResultsValues.ResultType.Force, "Spring"); + PostHog.Result(result.Type, 0, GsaResultValues.ResultType.Force, "Spring"); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/6_Display/Contour1dResults.cs b/GsaGH/Components/6_Display/Contour1dResults.cs index 01a1ae35d..b2b69e295 100644 --- a/GsaGH/Components/6_Display/Contour1dResults.cs +++ b/GsaGH/Components/6_Display/Contour1dResults.cs @@ -558,7 +558,7 @@ protected override void SolveInternal(IGH_DataAccess da) { #endregion - var res = new GsaResultsValues(); + var res = new GsaResultValues(); switch (_mode) { case FoldMode.Displacement: @@ -1018,7 +1018,7 @@ Color gradientcolour da.SetDataList(2, ts); var resultType - = (GsaResultsValues.ResultType)Enum.Parse(typeof(GsaResultsValues.ResultType), + = (GsaResultValues.ResultType)Enum.Parse(typeof(GsaResultValues.ResultType), _mode.ToString()); PostHog.Result(result.Type, 1, resultType, _disp.ToString()); } diff --git a/GsaGH/Components/6_Display/Contour2dResults.cs b/GsaGH/Components/6_Display/Contour2dResults.cs index 93c69b810..2b94dfc1c 100644 --- a/GsaGH/Components/6_Display/Contour2dResults.cs +++ b/GsaGH/Components/6_Display/Contour2dResults.cs @@ -609,8 +609,8 @@ protected override void SolveInternal(IGH_DataAccess da) { GH_Convert.ToInterval(ghInterval, ref customMinMax, GH_Conversion.Both); } - var res = new GsaResultsValues(); - var resShear = new GsaResultsValues(); + var res = new GsaResultValues(); + var resShear = new GsaResultValues(); switch (_mode) { case FoldMode.Displacement: res = result.Element2DDisplacementValues(elementlist, _lengthResultUnit)[0]; @@ -1080,7 +1080,7 @@ Color gradientcolour da.SetDataList(2, ts); var resultType - = (GsaResultsValues.ResultType)Enum.Parse(typeof(GsaResultsValues.ResultType), + = (GsaResultValues.ResultType)Enum.Parse(typeof(GsaResultValues.ResultType), _mode.ToString()); PostHog.Result(result.Type, 2, resultType, _disp.ToString()); } diff --git a/GsaGH/Components/6_Display/Contour3dResults.cs b/GsaGH/Components/6_Display/Contour3dResults.cs index 514e68e3c..766a76cbf 100644 --- a/GsaGH/Components/6_Display/Contour3dResults.cs +++ b/GsaGH/Components/6_Display/Contour3dResults.cs @@ -445,7 +445,7 @@ protected override void SolveInternal(IGH_DataAccess da) { #endregion - var res = new GsaResultsValues(); + var res = new GsaResultValues(); switch (_mode) { case FoldMode.Displacement: res = result.Element3DDisplacementValues(elementlist, _lengthResultUnit)[0]; @@ -790,7 +790,7 @@ Color gradientcolour da.SetDataList(2, ts); var resultType - = (GsaResultsValues.ResultType)Enum.Parse(typeof(GsaResultsValues.ResultType), + = (GsaResultValues.ResultType)Enum.Parse(typeof(GsaResultValues.ResultType), _mode.ToString()); PostHog.Result(result.Type, 3, resultType, _disp.ToString()); } diff --git a/GsaGH/Components/6_Display/ContourNodeResults.cs b/GsaGH/Components/6_Display/ContourNodeResults.cs index d115e742a..b8e718f88 100644 --- a/GsaGH/Components/6_Display/ContourNodeResults.cs +++ b/GsaGH/Components/6_Display/ContourNodeResults.cs @@ -479,16 +479,16 @@ protected override void SolveInternal(IGH_DataAccess da) { #endregion - var res = new GsaResultsValues(); + var res = new GsaResultValues(); switch (_mode) { case FoldMode.Displacement: - Tuple, List> nodedisp + Tuple, List> nodedisp = result.NodeDisplacementValues(nodeList, _lengthResultUnit); res = nodedisp.Item1[0]; break; case FoldMode.Reaction: - Tuple, List> resultgetter + Tuple, List> resultgetter = result.NodeReactionForceValues(nodeList, _forceUnit, _momentUnit); res = resultgetter.Item1[0]; nodeList = string.Join(" ", resultgetter.Item2); @@ -818,9 +818,9 @@ Color gradientcolour da.SetDataList(1, cs); da.SetDataList(2, ts); - GsaResultsValues.ResultType resultType = _mode == FoldMode.Reaction ? - GsaResultsValues.ResultType.Force : - (GsaResultsValues.ResultType)Enum.Parse(typeof(GsaResultsValues.ResultType), + GsaResultValues.ResultType resultType = _mode == FoldMode.Reaction ? + GsaResultValues.ResultType.Force : + (GsaResultValues.ResultType)Enum.Parse(typeof(GsaResultValues.ResultType), _mode.ToString()); PostHog.Result(result.Type, 0, resultType, _disp.ToString()); } diff --git a/GsaGH/Components/6_Display/ReactionForceDiagrams.cs b/GsaGH/Components/6_Display/ReactionForceDiagrams.cs index 65dcdf72b..1779e9de4 100644 --- a/GsaGH/Components/6_Display/ReactionForceDiagrams.cs +++ b/GsaGH/Components/6_Display/ReactionForceDiagrams.cs @@ -187,9 +187,9 @@ protected override void SolveInternal(IGH_DataAccess da) { result = (ghObject.Value as GsaResultGoo).Value; string nodeList = Inputs.GetNodeListDefinition(this, da, 1, result.Model); - Tuple, List> reactionForceValues + Tuple, List> reactionForceValues = result.NodeReactionForceValues(nodeList, _forceUnit, _momentUnit); - GsaResultsValues forceValues = reactionForceValues.Item1[0]; + GsaResultValues forceValues = reactionForceValues.Item1[0]; nodeList = string.Join(" ", reactionForceValues.Item2); LengthUnit lengthUnit = GetLengthUnit(result); @@ -229,11 +229,11 @@ Tuple, List> reactionForceValues }); SetOutputs(da, reactionForceVectors, annotations); - PostHog.Result(result.Type, 0, GsaResultsValues.ResultType.Force, + PostHog.Result(result.Type, 0, GsaResultValues.ResultType.Force, _selectedDisplayValue.ToString()); } - private double ComputeAutoScale(GsaResultsValues forceValues, BoundingBox bbox) { + private double ComputeAutoScale(GsaResultValues forceValues, BoundingBox bbox) { double maxValue = 0; switch (_selectedDisplayValue) { case DisplayValue.X: @@ -327,7 +327,7 @@ private ToolStripMenuItem GenerateMomentUnitsMenu(string menuTitle) { } private (GsaVectorDiagram, GsaAnnotationGoo) CreateReactionForceVectorWithAnnotations( - KeyValuePair node, GsaResultsValues forceValues, double scale, + KeyValuePair node, GsaResultValues forceValues, double scale, int significantDigits, Color color) { int nodeId = node.Key; ConcurrentDictionary> xyzResults diff --git a/GsaGH/Components/GraveyardComp/BeamDisplacement_OBSOLETE.cs b/GsaGH/Components/GraveyardComp/BeamDisplacement_OBSOLETE.cs index 78930b216..bab43a820 100644 --- a/GsaGH/Components/GraveyardComp/BeamDisplacement_OBSOLETE.cs +++ b/GsaGH/Components/GraveyardComp/BeamDisplacement_OBSOLETE.cs @@ -146,7 +146,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - List vals + List vals = result.Element1DDisplacementValues(elementlist, positionsCount, 0, _lengthUnit); List permutations = result.SelectedPermutationIds is null ? new List() { @@ -227,7 +227,7 @@ List vals da.SetDataTree(6, outRotZ); da.SetDataTree(7, outRotXyz); - PostHog.Result(result.Type, 1, GsaResultsValues.ResultType.Displacement); + PostHog.Result(result.Type, 1, GsaResultValues.ResultType.Displacement); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Components/GraveyardComp/Elem1dContourResults_OBSOLETE.cs b/GsaGH/Components/GraveyardComp/Elem1dContourResults_OBSOLETE.cs index 0e4895c29..439729268 100644 --- a/GsaGH/Components/GraveyardComp/Elem1dContourResults_OBSOLETE.cs +++ b/GsaGH/Components/GraveyardComp/Elem1dContourResults_OBSOLETE.cs @@ -405,7 +405,7 @@ protected override void SolveInternal(IGH_DataAccess da) { #endregion - var res = new GsaResultsValues(); + var res = new GsaResultValues(); switch (_mode) { case FoldMode.Displacement: diff --git a/GsaGH/Components/GraveyardComp/Elem2dContourResults_OBSOLETE.cs b/GsaGH/Components/GraveyardComp/Elem2dContourResults_OBSOLETE.cs index 39f698d65..fc9509888 100644 --- a/GsaGH/Components/GraveyardComp/Elem2dContourResults_OBSOLETE.cs +++ b/GsaGH/Components/GraveyardComp/Elem2dContourResults_OBSOLETE.cs @@ -471,8 +471,8 @@ protected override void SolveInternal(IGH_DataAccess da) { #endregion - var res = new GsaResultsValues(); - var resShear = new GsaResultsValues(); + var res = new GsaResultValues(); + var resShear = new GsaResultValues(); switch (_mode) { case FoldMode.Displacement: res = result.Element2DDisplacementValues(elementlist, _lengthUnit)[0]; diff --git a/GsaGH/Components/GraveyardComp/NodeContourResults_OBSOLETE.cs b/GsaGH/Components/GraveyardComp/NodeContourResults_OBSOLETE.cs index 88ad10133..96eb4bc96 100644 --- a/GsaGH/Components/GraveyardComp/NodeContourResults_OBSOLETE.cs +++ b/GsaGH/Components/GraveyardComp/NodeContourResults_OBSOLETE.cs @@ -355,16 +355,16 @@ protected override void SolveInternal(IGH_DataAccess da) { #endregion - var res = new GsaResultsValues(); + var res = new GsaResultValues(); switch (_mode) { case FoldMode.Displacement: - Tuple, List> nodedisp + Tuple, List> nodedisp = result.NodeDisplacementValues(nodeList, _lengthUnit); res = nodedisp.Item1[0]; break; case FoldMode.Reaction: - Tuple, List> resultgetter + Tuple, List> resultgetter = result.NodeReactionForceValues(nodeList, DefaultUnits.ForceUnit, DefaultUnits.MomentUnit); res = resultgetter.Item1[0]; diff --git a/GsaGH/Components/GraveyardComp/ReactionForceDiagrams2_OBSOLETE.cs b/GsaGH/Components/GraveyardComp/ReactionForceDiagrams2_OBSOLETE.cs index b57a4b063..0fd326345 100644 --- a/GsaGH/Components/GraveyardComp/ReactionForceDiagrams2_OBSOLETE.cs +++ b/GsaGH/Components/GraveyardComp/ReactionForceDiagrams2_OBSOLETE.cs @@ -196,9 +196,9 @@ protected override void SolveInternal(IGH_DataAccess da) { result = (ghObject.Value as GsaResultGoo).Value; string nodeList = Inputs.GetNodeListDefinition(this, da, 1, result.Model); - Tuple, List> reactionForceValues + Tuple, List> reactionForceValues = result.NodeReactionForceValues(nodeList, _forceUnit, _momentUnit); - GsaResultsValues forceValues = reactionForceValues.Item1[0]; + GsaResultValues forceValues = reactionForceValues.Item1[0]; nodeList = string.Join(" ", reactionForceValues.Item2); LengthUnit lengthUnit = GetLengthUnit(result); @@ -226,11 +226,11 @@ Tuple, List> reactionForceValues }); SetOutputs(da); - PostHog.Result(result.Type, 0, GsaResultsValues.ResultType.Force, + PostHog.Result(result.Type, 0, GsaResultValues.ResultType.Force, _selectedDisplayValue.ToString()); } - private double ComputeAutoScale(GsaResultsValues forceValues, BoundingBox bbox) { + private double ComputeAutoScale(GsaResultValues forceValues, BoundingBox bbox) { double maxValue = 0; switch (_selectedDisplayValue) { case DisplayValue.X: @@ -274,7 +274,7 @@ private double ComputeAutoScale(GsaResultsValues forceValues, BoundingBox bbox) private (GsaVectorDiagram diagram, GsaAnnotationGoo annotation, IQuantity forceValue) CreateReactionForceVector( - KeyValuePair node, GsaResultsValues forceValues, double scale, Color color) { + KeyValuePair node, GsaResultValues forceValues, double scale, Color color) { int nodeId = node.Key; ConcurrentDictionary> xyzResults = forceValues.XyzResults; diff --git a/GsaGH/Components/GraveyardComp/ReactionForceDiagrams_OBSOLETE.cs b/GsaGH/Components/GraveyardComp/ReactionForceDiagrams_OBSOLETE.cs index 04e54e787..7d72d8f40 100644 --- a/GsaGH/Components/GraveyardComp/ReactionForceDiagrams_OBSOLETE.cs +++ b/GsaGH/Components/GraveyardComp/ReactionForceDiagrams_OBSOLETE.cs @@ -193,9 +193,9 @@ protected override void SolveInternal(IGH_DataAccess da) { result = (ghObject.Value as GsaResultGoo).Value; string nodeList = Inputs.GetNodeListDefinition(this, da, 1, result.Model); - Tuple, List> reactionForceValues + Tuple, List> reactionForceValues = result.NodeReactionForceValues(nodeList, _forceUnit, _momentUnit); - GsaResultsValues forceValues = reactionForceValues.Item1[0]; + GsaResultValues forceValues = reactionForceValues.Item1[0]; nodeList = string.Join(" ", reactionForceValues.Item2); LengthUnit lengthUnit = GetLengthUnit(result); @@ -219,11 +219,11 @@ Tuple, List> reactionForceValues }); SetOutputs(da); - PostHog.Result(result.Type, 0, GsaResultsValues.ResultType.Force, + PostHog.Result(result.Type, 0, GsaResultValues.ResultType.Force, _selectedDisplayValue.ToString()); } - private double ComputeAutoScale(GsaResultsValues forceValues, BoundingBox bbox) { + private double ComputeAutoScale(GsaResultValues forceValues, BoundingBox bbox) { double maxValue = 0; switch (_selectedDisplayValue) { case DisplayValue.X: @@ -266,7 +266,7 @@ private double ComputeAutoScale(GsaResultsValues forceValues, BoundingBox bbox) } private (GsaVectorDiagram diagram, IQuantity quantity) CreateReactionForceVector( - KeyValuePair node, GsaResultsValues forceValues, double scale) { + KeyValuePair node, GsaResultValues forceValues, double scale) { int nodeId = node.Key; ConcurrentDictionary> xyzResults = forceValues.XyzResults; diff --git a/GsaGH/Components/GraveyardComp/ReactionForce_OBSOLETE.cs b/GsaGH/Components/GraveyardComp/ReactionForce_OBSOLETE.cs index c5d0d678b..14fdde066 100644 --- a/GsaGH/Components/GraveyardComp/ReactionForce_OBSOLETE.cs +++ b/GsaGH/Components/GraveyardComp/ReactionForce_OBSOLETE.cs @@ -162,7 +162,7 @@ protected override void SolveInternal(IGH_DataAccess da) { return; } - (List vals, List sortedIDs) + (List vals, List sortedIDs) = result.NodeReactionForceValues(nodeList, _forceUnit, _momentUnit); List permutations = result.SelectedPermutationIds ?? new List() { @@ -240,7 +240,7 @@ protected override void SolveInternal(IGH_DataAccess da) { da.SetDataTree(7, outRotXyz); da.SetDataTree(8, outIDs); - PostHog.Result(result.Type, 0, GsaResultsValues.ResultType.Force); + PostHog.Result(result.Type, 0, GsaResultValues.ResultType.Force); } protected override void UpdateUIFromSelectedItems() { diff --git a/GsaGH/Helpers/GsaAPI/Results/AnalysisCaseQuantities.cs b/GsaGH/Helpers/GsaAPI/Results/AnalysisCaseQuantities.cs index c7d770258..3488ede04 100644 --- a/GsaGH/Helpers/GsaAPI/Results/AnalysisCaseQuantities.cs +++ b/GsaGH/Helpers/GsaAPI/Results/AnalysisCaseQuantities.cs @@ -22,11 +22,11 @@ internal static partial class ResultHelper { /// /// /// - internal static GsaResultsValues GetElement1DResultValues( + internal static GsaResultValues GetElement1DResultValues( ReadOnlyDictionary globalResults, ForceUnit forceUnit, MomentUnit momentUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, key => { @@ -57,11 +57,11 @@ internal static GsaResultsValues GetElement1DResultValues( /// /// /// - internal static GsaResultsValues GetElement1DResultValues( + internal static GsaResultValues GetElement1DResultValues( ReadOnlyDictionary globalResults, EnergyUnit energyUnit, bool average = false) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.StrainEnergy, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.StrainEnergy, }; Parallel.ForEach(globalResults.Keys, key => { @@ -89,10 +89,10 @@ internal static GsaResultsValues GetElement1DResultValues( /// /// /// - internal static GsaResultsValues GetElement1DResultValues( + internal static GsaResultValues GetElement1DResultValues( ReadOnlyDictionary globalResults, LengthUnit resultLengthUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Displacement, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Displacement, }; Parallel.ForEach(globalResults.Keys, key => { @@ -122,10 +122,10 @@ internal static GsaResultsValues GetElement1DResultValues( /// /// /// - internal static GsaResultsValues GetElement2DResultValues( + internal static GsaResultValues GetElement2DResultValues( ReadOnlyDictionary globalResults, PressureUnit stressUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Stress, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Stress, }; Parallel.ForEach(globalResults.Keys, key => { @@ -166,10 +166,10 @@ internal static GsaResultsValues GetElement2DResultValues( /// /// /// - internal static GsaResultsValues GetElement2DResultValues( + internal static GsaResultValues GetElement2DResultValues( ReadOnlyDictionary globalResults, ForcePerLengthUnit forceUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Shear, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Shear, }; Parallel.ForEach(globalResults.Keys, key => { @@ -199,11 +199,11 @@ internal static GsaResultsValues GetElement2DResultValues( /// /// /// - internal static GsaResultsValues GetElement2DResultValues( + internal static GsaResultValues GetElement2DResultValues( ReadOnlyDictionary globalResults, ForcePerLengthUnit forceUnit, ForceUnit momentUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, key => { @@ -253,10 +253,10 @@ internal static GsaResultsValues GetElement2DResultValues( /// /// /// - internal static GsaResultsValues GetElement2DResultValues( + internal static GsaResultValues GetElement2DResultValues( ReadOnlyDictionary globalResults, LengthUnit resultLengthUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Displacement, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Displacement, }; Parallel.ForEach(globalResults.Keys, key => { @@ -296,10 +296,10 @@ internal static GsaResultsValues GetElement2DResultValues( /// /// /// - internal static GsaResultsValues GetElement3DResultValues( + internal static GsaResultValues GetElement3DResultValues( ReadOnlyDictionary globalResults, LengthUnit resultLengthUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Displacement, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Displacement, }; Parallel.ForEach(globalResults.Keys, key => { @@ -325,10 +325,10 @@ internal static GsaResultsValues GetElement3DResultValues( /// /// /// - internal static GsaResultsValues GetElement3DResultValues( + internal static GsaResultValues GetElement3DResultValues( ReadOnlyDictionary globalResults, PressureUnit stressUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Stress, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Stress, }; Parallel.ForEach(globalResults.Keys, key => { @@ -371,11 +371,11 @@ internal static GsaResultsValues GetElement3DResultValues( /// /// /// - internal static GsaResultsValues GetNodeReactionForceResultValues( + internal static GsaResultValues GetNodeReactionForceResultValues( ReadOnlyDictionary globalResults, ForceUnit forceUnit, MomentUnit momentUnit, ConcurrentBag supportnodeIDs = null) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, nodeId => { @@ -407,10 +407,10 @@ internal static GsaResultsValues GetNodeReactionForceResultValues( /// /// /// - internal static GsaResultsValues GetNodeResultValues( + internal static GsaResultValues GetNodeResultValues( ReadOnlyDictionary globalResults, LengthUnit resultLengthUnit) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, nodeId => { @@ -438,11 +438,11 @@ internal static GsaResultsValues GetNodeResultValues( /// /// /// - internal static GsaResultsValues GetNodeSpringForceResultValues( + internal static GsaResultValues GetNodeSpringForceResultValues( ReadOnlyDictionary globalResults, ForceUnit forceUnit, MomentUnit momentUnit, ConcurrentBag supportnodeIDs = null) { - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, nodeId => { diff --git a/GsaGH/Helpers/GsaAPI/Results/CombinationCaseQuantities.cs b/GsaGH/Helpers/GsaAPI/Results/CombinationCaseQuantities.cs index 5110179e8..4f97ccd25 100644 --- a/GsaGH/Helpers/GsaAPI/Results/CombinationCaseQuantities.cs +++ b/GsaGH/Helpers/GsaAPI/Results/CombinationCaseQuantities.cs @@ -24,10 +24,10 @@ internal static partial class ResultHelper { /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetElement1DResultValues( + internal static ConcurrentDictionary GetElement1DResultValues( ReadOnlyDictionary> globalResults, ForceUnit forceUnit, MomentUnit momentUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -38,8 +38,8 @@ internal static ConcurrentDictionary GetElement1DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, key => { @@ -77,10 +77,10 @@ internal static ConcurrentDictionary GetElement1DResultVa /// list of permutations, input an empty list to get all permutations /// /// - internal static ConcurrentDictionary GetElement1DResultValues( + internal static ConcurrentDictionary GetElement1DResultValues( ReadOnlyDictionary> globalResults, EnergyUnit energyUnit, List permutations, bool average = false) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -91,8 +91,8 @@ internal static ConcurrentDictionary GetElement1DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.StrainEnergy, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.StrainEnergy, }; Parallel.ForEach(globalResults.Keys, key => { @@ -129,10 +129,10 @@ internal static ConcurrentDictionary GetElement1DResultVa /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetElement1DResultValues( + internal static ConcurrentDictionary GetElement1DResultValues( ReadOnlyDictionary> globalResults, LengthUnit resultLengthUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -143,8 +143,8 @@ internal static ConcurrentDictionary GetElement1DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Displacement, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Displacement, }; Parallel.ForEach(globalResults.Keys, key => { @@ -181,10 +181,10 @@ internal static ConcurrentDictionary GetElement1DResultVa /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetElement2DResultValues( + internal static ConcurrentDictionary GetElement2DResultValues( ReadOnlyDictionary> globalResults, PressureUnit stressUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -195,8 +195,8 @@ internal static ConcurrentDictionary GetElement2DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Stress, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Stress, }; Parallel.ForEach(globalResults.Keys, key => { @@ -237,10 +237,10 @@ internal static ConcurrentDictionary GetElement2DResultVa /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetElement2DResultValues( + internal static ConcurrentDictionary GetElement2DResultValues( ReadOnlyDictionary> globalResults, ForcePerLengthUnit forceUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -251,8 +251,8 @@ internal static ConcurrentDictionary GetElement2DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Shear, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Shear, }; Parallel.ForEach(globalResults.Keys, key => { @@ -287,10 +287,10 @@ internal static ConcurrentDictionary GetElement2DResultVa /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetElement2DResultValues( + internal static ConcurrentDictionary GetElement2DResultValues( ReadOnlyDictionary> globalResults, ForcePerLengthUnit forceUnit, ForceUnit momentUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -301,8 +301,8 @@ internal static ConcurrentDictionary GetElement2DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, key => { @@ -352,10 +352,10 @@ internal static ConcurrentDictionary GetElement2DResultVa /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetElement2DResultValues( + internal static ConcurrentDictionary GetElement2DResultValues( ReadOnlyDictionary> globalResults, LengthUnit resultLengthUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -366,8 +366,8 @@ internal static ConcurrentDictionary GetElement2DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Displacement, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Displacement, }; Parallel.ForEach(globalResults.Keys, key => { @@ -407,10 +407,10 @@ internal static ConcurrentDictionary GetElement2DResultVa /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetElement3DResultValues( + internal static ConcurrentDictionary GetElement3DResultValues( ReadOnlyDictionary> globalResults, LengthUnit lengthUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -421,8 +421,8 @@ internal static ConcurrentDictionary GetElement3DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Displacement, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Displacement, }; Parallel.ForEach(globalResults.Keys, key => { @@ -454,10 +454,10 @@ internal static ConcurrentDictionary GetElement3DResultVa /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetElement3DResultValues( + internal static ConcurrentDictionary GetElement3DResultValues( ReadOnlyDictionary> globalResults, PressureUnit stressUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -468,8 +468,8 @@ internal static ConcurrentDictionary GetElement3DResultVa Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Stress, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Stress, }; Parallel.ForEach(globalResults.Keys, key => { @@ -511,10 +511,10 @@ internal static ConcurrentDictionary GetElement3DResultVa /// include results for these IDs even if they are all zero /// /// - internal static ConcurrentDictionary GetNodeReactionForceResultValues( + internal static ConcurrentDictionary GetNodeReactionForceResultValues( ReadOnlyDictionary> globalResults, ForceUnit forceUnit, MomentUnit momentUnit, List permutations, ConcurrentBag supportnodeIDs = null) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -525,8 +525,8 @@ internal static ConcurrentDictionary GetNodeReactionForce Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, nodeId => { @@ -563,10 +563,10 @@ internal static ConcurrentDictionary GetNodeReactionForce /// /// list of permutations, input an empty list to get all permutations /// - internal static ConcurrentDictionary GetNodeResultValues( + internal static ConcurrentDictionary GetNodeResultValues( ReadOnlyDictionary> globalResults, LengthUnit resultLengthUnit, List permutations) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -577,8 +577,8 @@ internal static ConcurrentDictionary GetNodeResultValues( Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Displacement, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Displacement, }; Parallel.ForEach(globalResults.Keys, nodeId => { @@ -613,10 +613,10 @@ internal static ConcurrentDictionary GetNodeResultValues( /// include results for these IDs even if they are all zero /// /// - internal static ConcurrentDictionary GetNodeSpringForceResultValues( + internal static ConcurrentDictionary GetNodeSpringForceResultValues( ReadOnlyDictionary> globalResults, ForceUnit forceUnit, MomentUnit momentUnit, List permutations, ConcurrentBag supportnodeIDs = null) { - var rs = new ConcurrentDictionary(); + var rs = new ConcurrentDictionary(); if (permutations.Count == 0) { permutations = Enumerable.Range(1, globalResults[globalResults.Keys.First()].Count) @@ -627,8 +627,8 @@ internal static ConcurrentDictionary GetNodeSpringForceRe Parallel.For(0, permutationCount, index => { int permutationId = permutations[index]; - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Force, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Force, }; Parallel.ForEach(globalResults.Keys, nodeId => { diff --git a/GsaGH/Helpers/GsaCOM/ComResultsHelper.cs b/GsaGH/Helpers/GsaCOM/ComResultsHelper.cs index ef0d27bf4..f5cb01749 100644 --- a/GsaGH/Helpers/GsaCOM/ComResultsHelper.cs +++ b/GsaGH/Helpers/GsaCOM/ComResultsHelper.cs @@ -18,19 +18,19 @@ private enum ElementDimension { _2D, } - internal static GsaResultsValues GetElement1DFootfallResultValues( - string elemList, GsaModel model, GsaResultsValues nodeFootfallResultValues) { + internal static GsaResultValues GetElement1DFootfallResultValues( + string elemList, GsaModel model, GsaResultValues nodeFootfallResultValues) { return GetElementFootfallResults(elemList, model, nodeFootfallResultValues, ElementDimension._1D); } - internal static GsaResultsValues GetElement2DFootfallResultValues( - string elemList, GsaModel model, GsaResultsValues nodeFootfallResultValues) { + internal static GsaResultValues GetElement2DFootfallResultValues( + string elemList, GsaModel model, GsaResultValues nodeFootfallResultValues) { return GetElementFootfallResults(elemList, model, nodeFootfallResultValues, ElementDimension._2D); } - internal static GsaResultsValues GetNodeFootfallResultValues( + internal static GsaResultValues GetNodeFootfallResultValues( string nodelist, GsaModel model, FootfallResultType type, int caseId) { if (model == null) { return null; @@ -49,8 +49,8 @@ internal static GsaResultsValues GetNodeFootfallResultValues( gsa.Output_Init(0, "default", aCase + caseId, dataRef, 0); - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Footfall, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Footfall, }; foreach (int nodeId in nodes.Keys) { @@ -68,8 +68,8 @@ internal static GsaResultsValues GetNodeFootfallResultValues( return r; } - private static GsaResultsValues GetElementFootfallResults( - string elemList, GsaModel model, GsaResultsValues nodeFootfallResultValues, + private static GsaResultValues GetElementFootfallResults( + string elemList, GsaModel model, GsaResultValues nodeFootfallResultValues, ElementDimension typ) { if (model == null) { return null; @@ -77,8 +77,8 @@ private static GsaResultsValues GetElementFootfallResults( ReadOnlyDictionary elements = model.Model.Elements(elemList); - var r = new GsaResultsValues { - Type = GsaResultsValues.ResultType.Footfall, + var r = new GsaResultValues { + Type = GsaResultValues.ResultType.Footfall, }; foreach (int elemId in elements.Keys) { diff --git a/GsaGH/Helpers/PostHog.cs b/GsaGH/Helpers/PostHog.cs index b94256720..103c1ec67 100644 --- a/GsaGH/Helpers/PostHog.cs +++ b/GsaGH/Helpers/PostHog.cs @@ -70,7 +70,7 @@ internal static void Load(bool refType, string subType = "-") { } internal static void Result( - CaseType caseType, int dimension, GsaResultsValues.ResultType resultType, + CaseType caseType, int dimension, GsaResultValues.ResultType resultType, string subType = "-") { const string eventName = "Result"; var properties = new Dictionary() { diff --git a/GsaGH/Parameters/5_Results/GsaAnalysisCaseResult.cs b/GsaGH/Parameters/5_Results/GsaAnalysisCaseResult.cs new file mode 100644 index 000000000..130ab2f2e --- /dev/null +++ b/GsaGH/Parameters/5_Results/GsaAnalysisCaseResult.cs @@ -0,0 +1,809 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using GsaAPI; +using GsaGH.Helpers; +using GsaGH.Helpers.GsaApi; +using OasysUnits.Units; +using Rhino.Geometry; +using EnergyUnit = OasysUnits.Units.EnergyUnit; +using ForceUnit = OasysUnits.Units.ForceUnit; +using LengthUnit = OasysUnits.Units.LengthUnit; + +namespace GsaGH.Parameters { + /// + /// A Result is used to select Cases from an analysed and extract the values for post-processing or visualisation. + /// The following result types can be extracted if they are present in the model: + /// + /// Node Results: `Displacement` and `Reaction`. + /// 1D Element Results: `Displacement`, `Force` and `StrainEnergyDensity`. + /// 2D Element Results: `Displacement`, `Force`, `Moment`, `Shear` and `Stress`. + /// 3D Element Results: `Displacement` and `Stress`. + /// Global Results: `Frequency`, `LoadFactor`, `ModalGeometricStiffness`, `ModalMass`, `ModalStiffness`, `TotalLoad`, `TotalReaction`, `Mode`, `EffectiveInertia`, `EffectiveMass` and `Eigenvalue`. + /// + /// All result values from the .NET API has been wrapped in Unit Number and can be converted into different measures on the fly. The Result parameter caches the result values + /// + public class GsAnalysisCaseResult : IGsaResult { + internal Dictionary, GsaResultValues> ACaseElement1DDisplacementValues { get; set; } = new Dictionary, GsaResultValues>(); + internal Dictionary, GsaResultValues> ACaseElement1DFootfallValues { get; set; } = new Dictionary, GsaResultValues>(); + internal Dictionary, GsaResultValues> ACaseElement1DForceValues { get; set; } = new Dictionary, GsaResultValues>(); + internal Dictionary, ReadOnlyDictionary> ACaseElement1DResults { get; set; } = new Dictionary, ReadOnlyDictionary>(); + internal Dictionary, GsaResultValues> ACaseElement1DStrainEnergyDensityValues { get; set; } = new Dictionary, GsaResultValues>(); + internal Dictionary ACaseElement2DDisplacementValues { get; set; } = new Dictionary(); + internal Dictionary, GsaResultValues> ACaseElement2DFootfallValues { get; set; } = new Dictionary, GsaResultValues>(); + internal Dictionary ACaseElement2DForceValues { get; set; } = new Dictionary(); + internal Dictionary, ReadOnlyDictionary> ACaseElement2DResults { get; set; } = new Dictionary, ReadOnlyDictionary>(); + internal Dictionary ACaseElement2DShearValues { get; set; } = new Dictionary(); + internal Dictionary, GsaResultValues> ACaseElement2DStressValues { get; set; } = new Dictionary, GsaResultValues>(); + internal Dictionary ACaseElement3DDisplacementValues { get; set; } + = new Dictionary(); + internal Dictionary> ACaseElement3DResults { get; set; } = new Dictionary>(); + internal Dictionary ACaseElement3DStressValues { get; set; } = new Dictionary(); + + + + internal Dictionary ACaseNodeDisplacementValues { get; set; } = new Dictionary(); + + + + + internal Dictionary, GsaResultValues> ACaseNodeFootfallValues { get; set; } = new Dictionary, GsaResultValues>(); + internal Dictionary ACaseNodeReactionForceValues { get; set; } = new Dictionary(); + internal Dictionary> ACaseNodeResults { get; set; } = new Dictionary>(); + internal AnalysisCaseResult AnalysisCaseResult { get; set; } + internal int CaseId { get; set; } + internal string CaseName { get; set; } + + internal CaseType Type { get; set; } + + public GsAnalysisCaseResult() { } + + internal GsAnalysisCaseResult(GsaModel model, AnalysisCaseResult result, int caseId) { + Model = model; + AnalysisCaseResult = result; + Type = CaseType.AnalysisCase; + CaseId = caseId; + CaseName = model.Model.AnalysisCaseName(CaseId); + } + + + + public GsaResultValues GetNodeDisplacements(string nodelist, LengthUnit lengthUnit) { + if (nodelist.ToLower() == "all" || nodelist == string.Empty) { + nodelist = "All"; + } + if (!ACaseNodeDisplacementValues.ContainsKey(nodelist)) { + if (!ACaseNodeResults.ContainsKey(nodelist)) { + ACaseNodeResults.Add(nodelist, AnalysisCaseResult.NodeResults(nodelist)); + } + + ACaseNodeDisplacementValues.Add(nodelist, + ResultHelper.GetNodeResultValues(ACaseNodeResults[nodelist], lengthUnit)); + } + + return ACaseNodeDisplacementValues[nodelist]; + } + + + + + + public GsAnalysisCaseResult Duplicate() { + return this; + } + + public override string ToString() { + string txt = string.Empty; + switch (Type) { + case CaseType.AnalysisCase: + txt = "A" + CaseId; + break; + + case CaseType.Combination: { + txt = "C" + CaseId; + if (SelectedPermutationIds.Count > 0) { + txt = SelectedPermutationIds.Count > 1 ? txt + " P:" + SelectedPermutationIds.Count : + txt + " p" + SelectedPermutationIds[0]; + } + + break; + } + } + + return txt.TrimSpaces(); + } + + /// + /// Get beam average strain energy density values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + /// + internal List Element1DAverageStrainEnergyDensityValues( + string elementlist, int axisId, EnergyUnit energyUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + var key = new Tuple(elementlist, 1, axisId); + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement1DStrainEnergyDensityValues.ContainsKey(key)) { + if (!ACaseElement1DResults.ContainsKey(key)) { + ACaseElement1DResults.Add(key, AnalysisCaseResult.Element1DResults(elementlist, 1)); + } + + ACaseElement1DStrainEnergyDensityValues.Add(key, + ResultHelper.GetElement1DResultValues(ACaseElement1DResults[key], energyUnit, true)); + } + + return new List { + ACaseElement1DStrainEnergyDensityValues[key], + }; + } + + if (ComboElement1DStrainEnergyDensityValues.ContainsKey(key)) { + return new List(ComboElement1DStrainEnergyDensityValues[key].Values); + } + + if (!ComboElement1DResults.ContainsKey(key)) { + ComboElement1DResults.Add(key, + CombinationCaseResult.Element1DResults(elementlist, 1, true)); + } + + ComboElement1DStrainEnergyDensityValues.Add(key, + ResultHelper.GetElement1DResultValues(ComboElement1DResults[key], energyUnit, + SelectedPermutationIds, true)); + + return new List(ComboElement1DStrainEnergyDensityValues[key].Values); + } + + /// + /// Get beam displacement values + /// For analysis case the length of the list will be 1 + /// This method will use cached data if it exists + /// + /// + /// + /// + /// + /// + internal List Element1DDisplacementValues( + string elementlist, int positionsCount, int axisId, LengthUnit lengthUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + Plane global = Plane.WorldXY; + + var key = new Tuple(elementlist, positionsCount, axisId); + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement1DDisplacementValues.ContainsKey(key)) { + if (!ACaseElement1DResults.ContainsKey(key)) { + ACaseElement1DResults.Add(key, + AnalysisCaseResult.Element1DResults(elementlist, positionsCount)); + } + + GsaResultValues res = ResultHelper.GetElement1DResultValues(ACaseElement1DResults[key], lengthUnit); + if (axisId == 0) { + res.CoordinateTransformationTo(global, Model.Model); + } + + ACaseElement1DDisplacementValues.Add(key, res); + } + + return new List { + ACaseElement1DDisplacementValues[key] + }; + } + + if (!ComboElement1DDisplacementValues.ContainsKey(key)) { + if (!ComboElement1DResults.ContainsKey(key)) { + ComboElement1DResults.Add(key, + CombinationCaseResult.Element1DResults(elementlist, positionsCount, false)); + } + + ComboElement1DDisplacementValues.Add(key, + ResultHelper.GetElement1DResultValues(ComboElement1DResults[key], lengthUnit, + SelectedPermutationIds)); + } + + return new List(ComboElement1DDisplacementValues[key].Values); + } + + /// + /// Get beam footfall values + /// For analysis case results only + /// This method will use cache data if it exists + /// + /// + /// + /// + internal List Element1DFootfallValues( + string elementlist, FootfallResultType type) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + var key = new Tuple(elementlist, type); + if (Type != CaseType.AnalysisCase) { + throw new Exception("Cannot get Footfall results for a Combination Case."); + } + + if (!ACaseElement1DFootfallValues.ContainsKey(key)) { + GsaResultValues nodeFootfallResultValues = NodeFootfallValues("All", type); + ACaseElement1DFootfallValues.Add(key, + ResultHelper.GetElement1DFootfallResultValues(elementlist, Model, + nodeFootfallResultValues)); + } + + return new List { + ACaseElement1DFootfallValues[key], + }; + } + + /// + /// Get beam force values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + /// + /// + /// + internal List Element1DForceValues( + string elementlist, int positionsCount, int axisId, ForceUnit forceUnit, MomentUnit momentUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + var key = new Tuple(elementlist, positionsCount, axisId); + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement1DForceValues.ContainsKey(key)) { + if (!ACaseElement1DResults.ContainsKey(key)) { + ACaseElement1DResults.Add(key, + AnalysisCaseResult.Element1DResults(elementlist, positionsCount)); + } + + ACaseElement1DForceValues.Add(key, + ResultHelper.GetElement1DResultValues(ACaseElement1DResults[key], forceUnit, + momentUnit)); + } + + return new List { + ACaseElement1DForceValues[key], + }; + } + + if (!ComboElement1DForceValues.ContainsKey(key)) { + if (!ComboElement1DResults.ContainsKey(key)) { + ComboElement1DResults.Add(key, + CombinationCaseResult.Element1DResults(elementlist, positionsCount, false)); + } + + ComboElement1DForceValues.Add(key, + ResultHelper.GetElement1DResultValues(ComboElement1DResults[key], forceUnit, momentUnit, + SelectedPermutationIds)); + } + + return new List(ComboElement1DForceValues[key].Values); + } + + /// + /// Get beam strain energy density values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + /// + /// + internal List Element1DStrainEnergyDensityValues( + string elementlist, int positionsCount, int axisId, EnergyUnit energyUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + var key = new Tuple(elementlist, positionsCount, axisId); + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement1DStrainEnergyDensityValues.ContainsKey(key)) { + if (!ACaseElement1DResults.ContainsKey(key)) { + ACaseElement1DResults.Add(key, + AnalysisCaseResult.Element1DResults(elementlist, positionsCount)); + } + + ACaseElement1DStrainEnergyDensityValues.Add(key, + ResultHelper.GetElement1DResultValues(ACaseElement1DResults[key], energyUnit)); + } + + return new List { + ACaseElement1DStrainEnergyDensityValues[key], + }; + } + + if (ComboElement1DStrainEnergyDensityValues.ContainsKey(key)) { + return new List(ComboElement1DStrainEnergyDensityValues[key].Values); + } + + if (!ComboElement1DResultsInclStrainEnergyDensity.ContainsKey(key)) { + ComboElement1DResultsInclStrainEnergyDensity.Add(key, + CombinationCaseResult.Element1DResults(elementlist, positionsCount, true)); + } + + ComboElement1DStrainEnergyDensityValues.Add(key, + ResultHelper.GetElement1DResultValues(ComboElement1DResultsInclStrainEnergyDensity[key], + energyUnit, SelectedPermutationIds)); + + return new List(ComboElement1DStrainEnergyDensityValues[key].Values); + } + + /// + /// Get 2D displacement values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + internal List Element2DDisplacementValues( + string elementlist, LengthUnit lengthUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement2DDisplacementValues.ContainsKey(elementlist)) { + if (!ACaseElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { + ACaseElement2DResults.Add(new Tuple(elementlist, 0), + AnalysisCaseResult.Element2DResults(elementlist, 0)); + } + + ACaseElement2DDisplacementValues.Add(elementlist, + ResultHelper.GetElement2DResultValues( + ACaseElement2DResults[new Tuple(elementlist, 0)], lengthUnit)); + } + + return new List { + ACaseElement2DDisplacementValues[elementlist], + }; + } + + if (ComboElement2DDisplacementValues.ContainsKey(elementlist)) { + return new List(ComboElement2DDisplacementValues[elementlist].Values); + } + + if (!ComboElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { + ComboElement2DResults.Add(new Tuple(elementlist, 0), + CombinationCaseResult.Element2DResults(elementlist, 0)); + } + + ComboElement2DDisplacementValues.Add(elementlist, + ResultHelper.GetElement2DResultValues( + ComboElement2DResults[new Tuple(elementlist, 0)], lengthUnit, + SelectedPermutationIds)); + + return new List(ComboElement2DDisplacementValues[elementlist].Values); + } + + /// + /// Get beam footfall values + /// For analysis case results only + /// This method will use cache data if it exists + /// + /// + /// + /// + internal List Element2DFootfallValues( + string elementlist, FootfallResultType type) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + var key = new Tuple(elementlist, type); + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement2DFootfallValues.ContainsKey(key)) { + GsaResultValues nodeFootfallResultValues = NodeFootfallValues("All", type); + ACaseElement2DFootfallValues.Add(key, + ResultHelper.GetElement2DFootfallResultValues(elementlist, Model, + nodeFootfallResultValues)); + } + + return new List() { + ACaseElement2DFootfallValues[key], + }; + } else { + throw new Exception("Cannot get Footfall results for a Combination Case."); + } + } + + /// + /// Get 2D force values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + /// + internal List Element2DForceValues( + string elementlist, ForcePerLengthUnit forceUnit, ForceUnit momentUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement2DForceValues.ContainsKey(elementlist)) { + if (!ACaseElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { + ACaseElement2DResults.Add(new Tuple(elementlist, 0), + AnalysisCaseResult.Element2DResults(elementlist, 0)); + } + + ACaseElement2DForceValues.Add(elementlist, + ResultHelper.GetElement2DResultValues( + ACaseElement2DResults[new Tuple(elementlist, 0)], forceUnit, + momentUnit)); + } + + return new List { + ACaseElement2DForceValues[elementlist], + }; + } + + if (ComboElement2DForceValues.ContainsKey(elementlist)) { + return new List(ComboElement2DForceValues[elementlist].Values); + } + + if (!ComboElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { + ComboElement2DResults.Add(new Tuple(elementlist, 0), + CombinationCaseResult.Element2DResults(elementlist, 0)); + } + + ComboElement2DForceValues.Add(elementlist, + ResultHelper.GetElement2DResultValues( + ComboElement2DResults[new Tuple(elementlist, 0)], forceUnit, momentUnit, + SelectedPermutationIds)); + + return new List(ComboElement2DForceValues[elementlist].Values); + } + + /// + /// Get 2D shear force values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// /// + /// + /// + internal List Element2DShearValues( + string elementlist, ForcePerLengthUnit forceUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement2DShearValues.ContainsKey(elementlist)) { + if (!ACaseElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { + ACaseElement2DResults.Add(new Tuple(elementlist, 0), + AnalysisCaseResult.Element2DResults(elementlist, 0)); + } + + ACaseElement2DShearValues.Add(elementlist, + ResultHelper.GetElement2DResultValues( + ACaseElement2DResults[new Tuple(elementlist, 0)], forceUnit)); + } + + return new List { + ACaseElement2DShearValues[elementlist], + }; + } + + if (ComboElement2DShearValues.ContainsKey(elementlist)) { + return new List(ComboElement2DShearValues[elementlist].Values); + } + + if (!ComboElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { + ComboElement2DResults.Add(new Tuple(elementlist, 0), + CombinationCaseResult.Element2DResults(elementlist, 0)); + } + + ComboElement2DShearValues.Add(elementlist, + ResultHelper.GetElement2DResultValues( + ComboElement2DResults[new Tuple(elementlist, 0)], forceUnit, + SelectedPermutationIds)); + + return new List(ComboElement2DShearValues[elementlist].Values); + } + + /// + /// Get 2D stress values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + /// + internal List Element2DStressValues( + string elementlist, double layer, PressureUnit stressUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + var key = new Tuple(elementlist, layer); + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement2DStressValues.ContainsKey(key)) { + if (!ACaseElement2DResults.ContainsKey(key)) { + ACaseElement2DResults.Add(key, AnalysisCaseResult.Element2DResults(elementlist, layer)); + } + + ACaseElement2DStressValues.Add(key, + ResultHelper.GetElement2DResultValues(ACaseElement2DResults[key], stressUnit)); + } + + return new List { + ACaseElement2DStressValues[key], + }; + } + + if (ComboElement2DStressValues.ContainsKey(key)) { + return new List(ComboElement2DStressValues[key].Values); + } + + if (!ComboElement2DResults.ContainsKey(key)) { + ComboElement2DResults.Add(key, CombinationCaseResult.Element2DResults(elementlist, layer)); + } + + ComboElement2DStressValues.Add(key, + ResultHelper.GetElement2DResultValues(ComboElement2DResults[key], stressUnit, + SelectedPermutationIds)); + + return new List(ComboElement2DStressValues[key].Values); + } + + /// + /// Get 3D displacement values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + internal List Element3DDisplacementValues( + string elementlist, LengthUnit lengthUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement3DDisplacementValues.ContainsKey(elementlist)) { + if (!ACaseElement3DResults.ContainsKey(elementlist)) { + ACaseElement3DResults.Add(elementlist, + AnalysisCaseResult.Element3DResults(elementlist)); + } + + ACaseElement3DDisplacementValues.Add(elementlist, + ResultHelper.GetElement3DResultValues(ACaseElement3DResults[elementlist], lengthUnit)); + } + + return new List { + ACaseElement3DDisplacementValues[elementlist], + }; + } + + if (ComboElement3DDisplacementValues.ContainsKey(elementlist)) { + return new List(ComboElement3DDisplacementValues[elementlist].Values); + } + + if (!ComboElement3DResults.ContainsKey(elementlist)) { + ComboElement3DResults.Add(elementlist, CombinationCaseResult.Element3DResults(elementlist)); + } + + ComboElement3DDisplacementValues.Add(elementlist, + ResultHelper.GetElement3DResultValues(ComboElement3DResults[elementlist], lengthUnit, + SelectedPermutationIds)); + + return new List(ComboElement3DDisplacementValues[elementlist].Values); + } + + /// + /// Get 2D stress values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + internal List Element3DStressValues( + string elementlist, PressureUnit stressUnit) { + if (elementlist.ToLower() == "all" || elementlist == string.Empty) { + elementlist = "All"; + } + + if (Type == CaseType.AnalysisCase) { + if (!ACaseElement3DStressValues.ContainsKey(elementlist)) { + if (!ACaseElement3DResults.ContainsKey(elementlist)) { + ACaseElement3DResults.Add(elementlist, + AnalysisCaseResult.Element3DResults(elementlist)); + } + + ACaseElement3DStressValues.Add(elementlist, + ResultHelper.GetElement3DResultValues(ACaseElement3DResults[elementlist], stressUnit)); + } + + return new List { + ACaseElement3DStressValues[elementlist], + }; + } + + if (ComboElement3DStressValues.ContainsKey(elementlist)) { + return new List(ComboElement3DStressValues[elementlist].Values); + } + + if (!ComboElement3DResults.ContainsKey(elementlist)) { + ComboElement3DResults.Add(elementlist, CombinationCaseResult.Element3DResults(elementlist)); + } + + ComboElement3DStressValues.Add(elementlist, + ResultHelper.GetElement3DResultValues(ComboElement3DResults[elementlist], stressUnit, + SelectedPermutationIds)); + + return new List(ComboElement3DStressValues[elementlist].Values); + } + + + + /// + /// Get node footfall result values + /// For analysis case results only + /// This method will use cache data if it exists + /// + /// + /// + /// + internal GsaResultValues NodeFootfallValues(string nodelist, FootfallResultType type) { + if (nodelist.ToLower() == "all" || nodelist == string.Empty) { + nodelist = "All"; + } + + if (Type == CaseType.AnalysisCase) { + var key = new Tuple(nodelist, type); + if (!ACaseNodeFootfallValues.ContainsKey(key)) { + ACaseNodeFootfallValues.Add(key, + ResultHelper.GetNodeFootfallResultValues(nodelist, Model, type, CaseId)); + } + + return ACaseNodeFootfallValues[key]; + } + + throw new Exception("Cannot get Footfall results for a Combination Case."); + } + + /// + /// Get node displacement values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + /// + internal Tuple, List> NodeReactionForceValues( + string nodelist, ForceUnit forceUnit, MomentUnit momentUnit) { + if (nodelist.ToLower() == "all" || nodelist == string.Empty) { + nodelist = "All"; + } + + ConcurrentBag supportnodeIDs = null; + if (nodelist.ToLower() == "all" || nodelist == string.Empty) { + supportnodeIDs = new ConcurrentBag(); + ReadOnlyDictionary nodes = Model.Model.Nodes(); + Parallel.ForEach(nodes, node => { + NodalRestraint rest = node.Value.Restraint; + if (rest.X || rest.Y || rest.Z || rest.XX || rest.YY || rest.ZZ) { + supportnodeIDs.Add(node.Key); + } + }); + nodelist = "All"; + } + + if (Type == CaseType.AnalysisCase) { + if (!ACaseNodeReactionForceValues.ContainsKey(nodelist)) { + if (!ACaseNodeResults.ContainsKey(nodelist)) { + ACaseNodeResults.Add(nodelist, AnalysisCaseResult.NodeResults(nodelist)); + } + + ACaseNodeReactionForceValues.Add(nodelist, + ResultHelper.GetNodeReactionForceResultValues(ACaseNodeResults[nodelist], forceUnit, + momentUnit, supportnodeIDs)); + } + + return new Tuple, List>(new List { + ACaseNodeReactionForceValues[nodelist], + }, ACaseNodeReactionForceValues[nodelist].XyzResults.Keys.OrderBy(x => x).ToList()); + } + + if (!ComboNodeReactionForceValues.ContainsKey(nodelist)) { + if (!ComboNodeResults.ContainsKey(nodelist)) { + ComboNodeResults.Add(nodelist, CombinationCaseResult.NodeResults(nodelist)); + } + + ComboNodeReactionForceValues.Add(nodelist, + ResultHelper.GetNodeReactionForceResultValues(ComboNodeResults[nodelist], forceUnit, + momentUnit, SelectedPermutationIds, supportnodeIDs)); + } + + return new Tuple, List>( + new List(ComboNodeReactionForceValues[nodelist].Values), + ComboNodeReactionForceValues[nodelist].Values.First().XyzResults.Keys.OrderBy(x => x) + .ToList()); + } + + /// + /// Get node displacement values + /// For analysis case the length of the list will be 1 + /// This method will use cache data if it exists + /// + /// + /// + /// + /// + internal Tuple, List> SpringReactionForceValues( + string nodelist, ForceUnit forceUnit, MomentUnit momentUnit) { + if (nodelist.ToLower() == "all" || nodelist == string.Empty) { + nodelist = "All"; + } + + ConcurrentBag supportnodeIDs = null; + if (nodelist.ToLower() == "all" || nodelist == string.Empty) { + supportnodeIDs = new ConcurrentBag(); + ReadOnlyDictionary nodes = Model.Model.Nodes(); + Parallel.ForEach(nodes, node => { + NodalRestraint rest = node.Value.Restraint; + if (rest.X || rest.Y || rest.Z || rest.XX || rest.YY || rest.ZZ) { + supportnodeIDs.Add(node.Key); + } + }); + nodelist = "All"; + } + + if (Type == CaseType.AnalysisCase) { + if (!ACaseNodeReactionForceValues.ContainsKey(nodelist)) { + if (!ACaseNodeResults.ContainsKey(nodelist)) { + ACaseNodeResults.Add(nodelist, AnalysisCaseResult.NodeResults(nodelist)); + } + + ACaseNodeReactionForceValues.Add(nodelist, + ResultHelper.GetNodeSpringForceResultValues(ACaseNodeResults[nodelist], forceUnit, + momentUnit, supportnodeIDs)); + } + + return new Tuple, List>(new List { + ACaseNodeReactionForceValues[nodelist], + }, ACaseNodeReactionForceValues[nodelist].XyzResults.Keys.OrderBy(x => x).ToList()); + } + + if (!ComboNodeReactionForceValues.ContainsKey(nodelist)) { + if (!ComboNodeResults.ContainsKey(nodelist)) { + ComboNodeResults.Add(nodelist, CombinationCaseResult.NodeResults(nodelist)); + } + + ComboNodeReactionForceValues.Add(nodelist, + ResultHelper.GetNodeSpringForceResultValues(ComboNodeResults[nodelist], forceUnit, + momentUnit, SelectedPermutationIds, supportnodeIDs)); + } + + return new Tuple, List>( + new List(ComboNodeReactionForceValues[nodelist].Values), + ComboNodeReactionForceValues[nodelist].Values.First().XyzResults.Keys.OrderBy(x => x) + .ToList()); + } + } +} diff --git a/GsaGH/Parameters/5_Results/GsaResult.cs b/GsaGH/Parameters/5_Results/GsaCombinationCaseResult.cs similarity index 75% rename from GsaGH/Parameters/5_Results/GsaResult.cs rename to GsaGH/Parameters/5_Results/GsaCombinationCaseResult.cs index c2ebc201f..f149de37b 100644 --- a/GsaGH/Parameters/5_Results/GsaResult.cs +++ b/GsaGH/Parameters/5_Results/GsaCombinationCaseResult.cs @@ -26,152 +26,9 @@ namespace GsaGH.Parameters { /// /// All result values from the .NET API has been wrapped in Unit Number and can be converted into different measures on the fly. The Result parameter caches the result values /// - public class GsaResult { - /// - /// Analysis Case 1DElement Displacement Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = Tuple(elementList, numberOfDivisions, axisId) - /// - internal Dictionary, GsaResultsValues> - ACaseElement1DDisplacementValues { get; set; } - = new Dictionary, GsaResultsValues>(); - /// - /// Analysis Case 1DElement Footfall Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = Tuple(elementList, numberOfDivisions) - /// - internal Dictionary, GsaResultsValues> - ACaseElement1DFootfallValues { get; set; } - = new Dictionary, GsaResultsValues>(); - /// - /// Analysis Case 1DElement Force Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = Tuple(elementList, numberOfDivisions, axisId) - /// - internal Dictionary, GsaResultsValues> - ACaseElement1DForceValues { get; set; } - = new Dictionary, GsaResultsValues>(); - /// - /// Analysis Case 1DElement API Result Dictionary - /// Append to this dictionary to chache results - /// key = Tuple(elementList, numberOfDivisions, axisId) - /// - internal Dictionary, ReadOnlyDictionary> - ACaseElement1DResults { get; set; } - = new Dictionary, ReadOnlyDictionary>(); - /// - /// Analysis Case 1DElement Strain Energy Density Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = Tuple(elementList, numberOfDivisions, axisId) - /// - internal Dictionary, GsaResultsValues> - ACaseElement1DStrainEnergyDensityValues { get; set; } - = new Dictionary, GsaResultsValues>(); - /// - /// Analysis Case 2DElement Displacement Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary ACaseElement2DDisplacementValues { get; set; } - = new Dictionary(); - /// - /// Analysis Case 1DElement Footfall Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = Tuple(elementList, numberOfDivisions) - /// - internal Dictionary, GsaResultsValues> - ACaseElement2DFootfallValues { get; set; } - = new Dictionary, GsaResultsValues>(); - /// - /// Analysis Case 2DElement Force Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary ACaseElement2DForceValues { get; set; } - = new Dictionary(); - /// - /// Analysis Case 2DElement API Result Dictionary - /// Append to this dictionary to chache results - /// key = Tuple(elementList, layer) - /// - internal Dictionary, ReadOnlyDictionary> - ACaseElement2DResults { get; set; } - = new Dictionary, ReadOnlyDictionary>(); - /// - /// Analysis Case 2DElement Shear Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary ACaseElement2DShearValues { get; set; } - = new Dictionary(); - /// - /// Analysis Case 2DElement Stress Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = Tuple(elementList, layer) - /// - internal Dictionary, GsaResultsValues> - ACaseElement2DStressValues { get; set; } - = new Dictionary, GsaResultsValues>(); - /// - /// Analysis Case 3DElement Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary ACaseElement3DDisplacementValues { get; set; } - = new Dictionary(); - /// - /// Analysis Case 3DElement API Result Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary> - ACaseElement3DResults { get; set; } - = new Dictionary>(); - /// - /// Analysis Case 3DElement Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary ACaseElement3DStressValues { get; set; } - = new Dictionary(); - /// - /// Analysis Case Node Displacement Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary ACaseNodeDisplacementValues { get; set; } - = new Dictionary(); - /// - /// Analysis Case Node Footfall Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary, GsaResultsValues> - ACaseNodeFootfallValues { get; set; } - = new Dictionary, GsaResultsValues>(); - /// - /// Analysis Case Node Reaction Force Result VALUES Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary ACaseNodeReactionForceValues { get; set; } - = new Dictionary(); - /// - /// Analysis Case Node API Result Dictionary - /// Append to this dictionary to chache results - /// key = elementList - /// - internal Dictionary> ACaseNodeResults { get; set; } - = new Dictionary>(); - /// - /// Analysis Case API Result - /// - internal AnalysisCaseResult AnalysisCaseResult { get; set; } + public class GsaCombinationCaseResult : IGsaResult { internal int CaseId { get; set; } internal string CaseName { get; set; } - /// - /// Combination Case API Result - /// internal CombinationCaseResult CombinationCaseResult { get; set; } /// /// Combination Case 1DElement Displacement Result VALUES Dictionary @@ -179,18 +36,18 @@ internal Dictionary, GsaResultsValues> /// key = Tuple(elementList, permutations, axisId) /// value = Dictionary(elementID, Dictionary(numberOfDivisions, results)) /// - internal Dictionary, ConcurrentDictionary> + internal Dictionary, ConcurrentDictionary> ComboElement1DDisplacementValues { get; set; } - = new Dictionary, ConcurrentDictionary>(); + = new Dictionary, ConcurrentDictionary>(); /// /// Combination Case 1DElement Forces Result VALUES Dictionary /// Append to this dictionary to chache results /// key = Tuple(elementList, permutations, axisId) /// value = Dictionary(elementID, Dictionary(numberOfDivisions, results)) /// - internal Dictionary, ConcurrentDictionary> + internal Dictionary, ConcurrentDictionary> ComboElement1DForceValues { get; set; } - = new Dictionary, ConcurrentDictionary>(); + = new Dictionary, ConcurrentDictionary>(); /// /// Combination Case 1DElement API Result Dictionary /// Append to this dictionary to chache results @@ -219,27 +76,27 @@ internal Dictionary, ConcurrentDictionary - internal Dictionary, ConcurrentDictionary> + internal Dictionary, ConcurrentDictionary> ComboElement1DStrainEnergyDensityValues { get; set; } - = new Dictionary, ConcurrentDictionary>(); + = new Dictionary, ConcurrentDictionary>(); /// /// Combination Case 2DElement Displacement Result VALUES Dictionary /// Append to this dictionary to chache results /// key = elementList /// value = (elementID, collection(permutationResult)) /// - internal Dictionary> + internal Dictionary> ComboElement2DDisplacementValues { get; set; } - = new Dictionary>(); + = new Dictionary>(); /// /// Combination Case 2DElement Force/Moment Result VALUES Dictionary /// Append to this dictionary to chache results /// key = elementList /// value = Dictionary(elementID, Dictionary(permutationID, permutationsResults)) /// - internal Dictionary> + internal Dictionary> ComboElement2DForceValues { get; set; } - = new Dictionary>(); + = new Dictionary>(); /// /// Combination Case 2DElement API Result Dictionary /// Append to this dictionary to chache results @@ -257,27 +114,27 @@ internal Dictionary> /// key = elementList /// value = Dictionary(elementID, Dictionary(numberOfDivisions, results)) /// - internal Dictionary> + internal Dictionary> ComboElement2DShearValues { get; set; } - = new Dictionary>(); + = new Dictionary>(); /// /// Combination Case 2DElement Stress Result VALUES Dictionary /// Append to this dictionary to chache results /// key = Tuple(elementList, layer) /// value = Dictionary(elementID, Dictionary(permutationID, permutationsResults)) /// - internal Dictionary, ConcurrentDictionary> + internal Dictionary, ConcurrentDictionary> ComboElement2DStressValues { get; set; } - = new Dictionary, ConcurrentDictionary>(); + = new Dictionary, ConcurrentDictionary>(); /// /// Combination Case 3DElement Displacement Result VALUES Dictionary /// Append to this dictionary to chache results /// key = elementList /// value = Dictionary(elementID, Dictionary(permutationID, permutationsResults)) /// - internal Dictionary> + internal Dictionary> ComboElement3DDisplacementValues { get; set; } - = new Dictionary>(); + = new Dictionary>(); /// /// Combination Case 3DElement API Result Dictionary /// Append to this dictionary to chache results @@ -293,27 +150,27 @@ internal Dictionary - internal Dictionary> + internal Dictionary> ComboElement3DStressValues { get; set; } - = new Dictionary>(); + = new Dictionary>(); /// /// Combination Case Node Displacement Result VALUES Dictionary /// Append to this dictionary to chache results /// key = elementList /// value = Dictionary(permutationID, permutationsResults) /// - internal Dictionary> + internal Dictionary> ComboNodeDisplacementValues { get; set; } - = new Dictionary>(); + = new Dictionary>(); /// /// Combination Case Node Reaction Force Result VALUES Dictionary /// Append to this dictionary to chache results /// key = elementList /// value = Dictionary(permutationID, permutationsResults) /// - internal Dictionary> + internal Dictionary> ComboNodeReactionForceValues { get; set; } - = new Dictionary>(); + = new Dictionary>(); /// /// Combination Case Node API Result Dictionary /// Append to this dictionary to chache results @@ -330,17 +187,9 @@ internal Dictionary SelectedPermutationIds { get; set; } internal CaseType Type { get; set; } - public GsaResult() { } - - internal GsaResult(GsaModel model, AnalysisCaseResult result, int caseId) { - Model = model; - AnalysisCaseResult = result; - Type = CaseType.AnalysisCase; - CaseId = caseId; - CaseName = model.Model.AnalysisCaseName(CaseId); - } + public GsaCombinationCaseResult() { } - internal GsaResult( + internal GsaCombinationCaseResult( GsaModel model, CombinationCaseResult result, int caseId, IEnumerable permutations) { Model = model; CombinationCaseResult = result; @@ -349,7 +198,7 @@ internal GsaResult( SelectedPermutationIds = permutations.OrderBy(x => x).ToList(); } - public GsaResult Duplicate() { + public GsaCombinationCaseResult Duplicate() { return this; } @@ -383,7 +232,7 @@ public override string ToString() { /// /// /// - internal List Element1DAverageStrainEnergyDensityValues( + internal List Element1DAverageStrainEnergyDensityValues( string elementlist, int axisId, EnergyUnit energyUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -400,13 +249,13 @@ internal List Element1DAverageStrainEnergyDensityValues( ResultHelper.GetElement1DResultValues(ACaseElement1DResults[key], energyUnit, true)); } - return new List { + return new List { ACaseElement1DStrainEnergyDensityValues[key], }; } if (ComboElement1DStrainEnergyDensityValues.ContainsKey(key)) { - return new List(ComboElement1DStrainEnergyDensityValues[key].Values); + return new List(ComboElement1DStrainEnergyDensityValues[key].Values); } if (!ComboElement1DResults.ContainsKey(key)) { @@ -418,7 +267,7 @@ internal List Element1DAverageStrainEnergyDensityValues( ResultHelper.GetElement1DResultValues(ComboElement1DResults[key], energyUnit, SelectedPermutationIds, true)); - return new List(ComboElement1DStrainEnergyDensityValues[key].Values); + return new List(ComboElement1DStrainEnergyDensityValues[key].Values); } /// @@ -431,7 +280,7 @@ internal List Element1DAverageStrainEnergyDensityValues( /// /// /// - internal List Element1DDisplacementValues( + internal List Element1DDisplacementValues( string elementlist, int positionsCount, int axisId, LengthUnit lengthUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -446,7 +295,7 @@ internal List Element1DDisplacementValues( AnalysisCaseResult.Element1DResults(elementlist, positionsCount)); } - GsaResultsValues res = ResultHelper.GetElement1DResultValues(ACaseElement1DResults[key], lengthUnit); + GsaResultValues res = ResultHelper.GetElement1DResultValues(ACaseElement1DResults[key], lengthUnit); if (axisId == 0) { res.CoordinateTransformationTo(global, Model.Model); } @@ -454,7 +303,7 @@ internal List Element1DDisplacementValues( ACaseElement1DDisplacementValues.Add(key, res); } - return new List { + return new List { ACaseElement1DDisplacementValues[key] }; } @@ -470,7 +319,7 @@ internal List Element1DDisplacementValues( SelectedPermutationIds)); } - return new List(ComboElement1DDisplacementValues[key].Values); + return new List(ComboElement1DDisplacementValues[key].Values); } /// @@ -481,7 +330,7 @@ internal List Element1DDisplacementValues( /// /// /// - internal List Element1DFootfallValues( + internal List Element1DFootfallValues( string elementlist, FootfallResultType type) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -493,13 +342,13 @@ internal List Element1DFootfallValues( } if (!ACaseElement1DFootfallValues.ContainsKey(key)) { - GsaResultsValues nodeFootfallResultValues = NodeFootfallValues("All", type); + GsaResultValues nodeFootfallResultValues = NodeFootfallValues("All", type); ACaseElement1DFootfallValues.Add(key, ResultHelper.GetElement1DFootfallResultValues(elementlist, Model, nodeFootfallResultValues)); } - return new List { + return new List { ACaseElement1DFootfallValues[key], }; } @@ -515,7 +364,7 @@ internal List Element1DFootfallValues( /// /// /// - internal List Element1DForceValues( + internal List Element1DForceValues( string elementlist, int positionsCount, int axisId, ForceUnit forceUnit, MomentUnit momentUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -534,7 +383,7 @@ internal List Element1DForceValues( momentUnit)); } - return new List { + return new List { ACaseElement1DForceValues[key], }; } @@ -550,7 +399,7 @@ internal List Element1DForceValues( SelectedPermutationIds)); } - return new List(ComboElement1DForceValues[key].Values); + return new List(ComboElement1DForceValues[key].Values); } /// @@ -563,7 +412,7 @@ internal List Element1DForceValues( /// /// /// - internal List Element1DStrainEnergyDensityValues( + internal List Element1DStrainEnergyDensityValues( string elementlist, int positionsCount, int axisId, EnergyUnit energyUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -581,13 +430,13 @@ internal List Element1DStrainEnergyDensityValues( ResultHelper.GetElement1DResultValues(ACaseElement1DResults[key], energyUnit)); } - return new List { + return new List { ACaseElement1DStrainEnergyDensityValues[key], }; } if (ComboElement1DStrainEnergyDensityValues.ContainsKey(key)) { - return new List(ComboElement1DStrainEnergyDensityValues[key].Values); + return new List(ComboElement1DStrainEnergyDensityValues[key].Values); } if (!ComboElement1DResultsInclStrainEnergyDensity.ContainsKey(key)) { @@ -599,7 +448,7 @@ internal List Element1DStrainEnergyDensityValues( ResultHelper.GetElement1DResultValues(ComboElement1DResultsInclStrainEnergyDensity[key], energyUnit, SelectedPermutationIds)); - return new List(ComboElement1DStrainEnergyDensityValues[key].Values); + return new List(ComboElement1DStrainEnergyDensityValues[key].Values); } /// @@ -610,7 +459,7 @@ internal List Element1DStrainEnergyDensityValues( /// /// /// - internal List Element2DDisplacementValues( + internal List Element2DDisplacementValues( string elementlist, LengthUnit lengthUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -628,13 +477,13 @@ internal List Element2DDisplacementValues( ACaseElement2DResults[new Tuple(elementlist, 0)], lengthUnit)); } - return new List { + return new List { ACaseElement2DDisplacementValues[elementlist], }; } if (ComboElement2DDisplacementValues.ContainsKey(elementlist)) { - return new List(ComboElement2DDisplacementValues[elementlist].Values); + return new List(ComboElement2DDisplacementValues[elementlist].Values); } if (!ComboElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { @@ -647,7 +496,7 @@ internal List Element2DDisplacementValues( ComboElement2DResults[new Tuple(elementlist, 0)], lengthUnit, SelectedPermutationIds)); - return new List(ComboElement2DDisplacementValues[elementlist].Values); + return new List(ComboElement2DDisplacementValues[elementlist].Values); } /// @@ -658,7 +507,7 @@ ComboElement2DResults[new Tuple(elementlist, 0)], lengthUnit, /// /// /// - internal List Element2DFootfallValues( + internal List Element2DFootfallValues( string elementlist, FootfallResultType type) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -667,13 +516,13 @@ internal List Element2DFootfallValues( var key = new Tuple(elementlist, type); if (Type == CaseType.AnalysisCase) { if (!ACaseElement2DFootfallValues.ContainsKey(key)) { - GsaResultsValues nodeFootfallResultValues = NodeFootfallValues("All", type); + GsaResultValues nodeFootfallResultValues = NodeFootfallValues("All", type); ACaseElement2DFootfallValues.Add(key, ResultHelper.GetElement2DFootfallResultValues(elementlist, Model, nodeFootfallResultValues)); } - return new List() { + return new List() { ACaseElement2DFootfallValues[key], }; } else { @@ -690,7 +539,7 @@ internal List Element2DFootfallValues( /// /// /// - internal List Element2DForceValues( + internal List Element2DForceValues( string elementlist, ForcePerLengthUnit forceUnit, ForceUnit momentUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -709,13 +558,13 @@ ACaseElement2DResults[new Tuple(elementlist, 0)], forceUnit, momentUnit)); } - return new List { + return new List { ACaseElement2DForceValues[elementlist], }; } if (ComboElement2DForceValues.ContainsKey(elementlist)) { - return new List(ComboElement2DForceValues[elementlist].Values); + return new List(ComboElement2DForceValues[elementlist].Values); } if (!ComboElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { @@ -728,7 +577,7 @@ ACaseElement2DResults[new Tuple(elementlist, 0)], forceUnit, ComboElement2DResults[new Tuple(elementlist, 0)], forceUnit, momentUnit, SelectedPermutationIds)); - return new List(ComboElement2DForceValues[elementlist].Values); + return new List(ComboElement2DForceValues[elementlist].Values); } /// @@ -740,7 +589,7 @@ ComboElement2DResults[new Tuple(elementlist, 0)], forceUnit, mom /// /// /// /// - internal List Element2DShearValues( + internal List Element2DShearValues( string elementlist, ForcePerLengthUnit forceUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -758,13 +607,13 @@ internal List Element2DShearValues( ACaseElement2DResults[new Tuple(elementlist, 0)], forceUnit)); } - return new List { + return new List { ACaseElement2DShearValues[elementlist], }; } if (ComboElement2DShearValues.ContainsKey(elementlist)) { - return new List(ComboElement2DShearValues[elementlist].Values); + return new List(ComboElement2DShearValues[elementlist].Values); } if (!ComboElement2DResults.ContainsKey(new Tuple(elementlist, 0))) { @@ -777,7 +626,7 @@ internal List Element2DShearValues( ComboElement2DResults[new Tuple(elementlist, 0)], forceUnit, SelectedPermutationIds)); - return new List(ComboElement2DShearValues[elementlist].Values); + return new List(ComboElement2DShearValues[elementlist].Values); } /// @@ -789,7 +638,7 @@ ComboElement2DResults[new Tuple(elementlist, 0)], forceUnit, /// /// /// - internal List Element2DStressValues( + internal List Element2DStressValues( string elementlist, double layer, PressureUnit stressUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -806,13 +655,13 @@ internal List Element2DStressValues( ResultHelper.GetElement2DResultValues(ACaseElement2DResults[key], stressUnit)); } - return new List { + return new List { ACaseElement2DStressValues[key], }; } if (ComboElement2DStressValues.ContainsKey(key)) { - return new List(ComboElement2DStressValues[key].Values); + return new List(ComboElement2DStressValues[key].Values); } if (!ComboElement2DResults.ContainsKey(key)) { @@ -823,7 +672,7 @@ internal List Element2DStressValues( ResultHelper.GetElement2DResultValues(ComboElement2DResults[key], stressUnit, SelectedPermutationIds)); - return new List(ComboElement2DStressValues[key].Values); + return new List(ComboElement2DStressValues[key].Values); } /// @@ -834,7 +683,7 @@ internal List Element2DStressValues( /// /// /// - internal List Element3DDisplacementValues( + internal List Element3DDisplacementValues( string elementlist, LengthUnit lengthUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -851,13 +700,13 @@ internal List Element3DDisplacementValues( ResultHelper.GetElement3DResultValues(ACaseElement3DResults[elementlist], lengthUnit)); } - return new List { + return new List { ACaseElement3DDisplacementValues[elementlist], }; } if (ComboElement3DDisplacementValues.ContainsKey(elementlist)) { - return new List(ComboElement3DDisplacementValues[elementlist].Values); + return new List(ComboElement3DDisplacementValues[elementlist].Values); } if (!ComboElement3DResults.ContainsKey(elementlist)) { @@ -868,7 +717,7 @@ internal List Element3DDisplacementValues( ResultHelper.GetElement3DResultValues(ComboElement3DResults[elementlist], lengthUnit, SelectedPermutationIds)); - return new List(ComboElement3DDisplacementValues[elementlist].Values); + return new List(ComboElement3DDisplacementValues[elementlist].Values); } /// @@ -879,7 +728,7 @@ internal List Element3DDisplacementValues( /// /// /// - internal List Element3DStressValues( + internal List Element3DStressValues( string elementlist, PressureUnit stressUnit) { if (elementlist.ToLower() == "all" || elementlist == string.Empty) { elementlist = "All"; @@ -896,13 +745,13 @@ internal List Element3DStressValues( ResultHelper.GetElement3DResultValues(ACaseElement3DResults[elementlist], stressUnit)); } - return new List { + return new List { ACaseElement3DStressValues[elementlist], }; } if (ComboElement3DStressValues.ContainsKey(elementlist)) { - return new List(ComboElement3DStressValues[elementlist].Values); + return new List(ComboElement3DStressValues[elementlist].Values); } if (!ComboElement3DResults.ContainsKey(elementlist)) { @@ -913,7 +762,7 @@ internal List Element3DStressValues( ResultHelper.GetElement3DResultValues(ComboElement3DResults[elementlist], stressUnit, SelectedPermutationIds)); - return new List(ComboElement3DStressValues[elementlist].Values); + return new List(ComboElement3DStressValues[elementlist].Values); } /// @@ -924,7 +773,7 @@ internal List Element3DStressValues( /// /// /// - internal Tuple, List> NodeDisplacementValues( + internal Tuple, List> NodeDisplacementValues( string nodelist, LengthUnit lengthUnit) { if (nodelist.ToLower() == "all" || nodelist == string.Empty) { nodelist = "All"; @@ -940,7 +789,7 @@ internal Tuple, List> NodeDisplacementValues( ResultHelper.GetNodeResultValues(ACaseNodeResults[nodelist], lengthUnit)); } - return new Tuple, List>(new List { + return new Tuple, List>(new List { ACaseNodeDisplacementValues[nodelist], }, Model.Model.Nodes(nodelist).Keys.ToList()); } @@ -955,8 +804,8 @@ internal Tuple, List> NodeDisplacementValues( SelectedPermutationIds)); } - return new Tuple, List>( - new List(ComboNodeDisplacementValues[nodelist].Values), + return new Tuple, List>( + new List(ComboNodeDisplacementValues[nodelist].Values), Model.Model.Nodes(nodelist).Keys.ToList()); } @@ -968,7 +817,7 @@ internal Tuple, List> NodeDisplacementValues( /// /// /// - internal GsaResultsValues NodeFootfallValues(string nodelist, FootfallResultType type) { + internal GsaResultValues NodeFootfallValues(string nodelist, FootfallResultType type) { if (nodelist.ToLower() == "all" || nodelist == string.Empty) { nodelist = "All"; } @@ -995,7 +844,7 @@ internal GsaResultsValues NodeFootfallValues(string nodelist, FootfallResultType /// /// /// - internal Tuple, List> NodeReactionForceValues( + internal Tuple, List> NodeReactionForceValues( string nodelist, ForceUnit forceUnit, MomentUnit momentUnit) { if (nodelist.ToLower() == "all" || nodelist == string.Empty) { nodelist = "All"; @@ -1025,7 +874,7 @@ internal Tuple, List> NodeReactionForceValues( momentUnit, supportnodeIDs)); } - return new Tuple, List>(new List { + return new Tuple, List>(new List { ACaseNodeReactionForceValues[nodelist], }, ACaseNodeReactionForceValues[nodelist].XyzResults.Keys.OrderBy(x => x).ToList()); } @@ -1040,8 +889,8 @@ internal Tuple, List> NodeReactionForceValues( momentUnit, SelectedPermutationIds, supportnodeIDs)); } - return new Tuple, List>( - new List(ComboNodeReactionForceValues[nodelist].Values), + return new Tuple, List>( + new List(ComboNodeReactionForceValues[nodelist].Values), ComboNodeReactionForceValues[nodelist].Values.First().XyzResults.Keys.OrderBy(x => x) .ToList()); } @@ -1055,7 +904,7 @@ internal Tuple, List> NodeReactionForceValues( /// /// /// - internal Tuple, List> SpringReactionForceValues( + internal Tuple, List> SpringReactionForceValues( string nodelist, ForceUnit forceUnit, MomentUnit momentUnit) { if (nodelist.ToLower() == "all" || nodelist == string.Empty) { nodelist = "All"; @@ -1085,7 +934,7 @@ internal Tuple, List> SpringReactionForceValues( momentUnit, supportnodeIDs)); } - return new Tuple, List>(new List { + return new Tuple, List>(new List { ACaseNodeReactionForceValues[nodelist], }, ACaseNodeReactionForceValues[nodelist].XyzResults.Keys.OrderBy(x => x).ToList()); } @@ -1100,8 +949,8 @@ internal Tuple, List> SpringReactionForceValues( momentUnit, SelectedPermutationIds, supportnodeIDs)); } - return new Tuple, List>( - new List(ComboNodeReactionForceValues[nodelist].Values), + return new Tuple, List>( + new List(ComboNodeReactionForceValues[nodelist].Values), ComboNodeReactionForceValues[nodelist].Values.First().XyzResults.Keys.OrderBy(x => x) .ToList()); } diff --git a/GsaGH/Parameters/5_Results/GsaNodeDisplacement.cs b/GsaGH/Parameters/5_Results/GsaNodeDisplacement.cs new file mode 100644 index 000000000..b0c2ff7b5 --- /dev/null +++ b/GsaGH/Parameters/5_Results/GsaNodeDisplacement.cs @@ -0,0 +1,7 @@ +namespace GsaGH.Parameters { + public class GsaNodeDisplacement { + + + + } +} \ No newline at end of file diff --git a/GsaGH/Parameters/5_Results/GsaResultsValues.cs b/GsaGH/Parameters/5_Results/GsaResultValues.cs similarity index 98% rename from GsaGH/Parameters/5_Results/GsaResultsValues.cs rename to GsaGH/Parameters/5_Results/GsaResultValues.cs index 72099f966..874d10ec2 100644 --- a/GsaGH/Parameters/5_Results/GsaResultsValues.cs +++ b/GsaGH/Parameters/5_Results/GsaResultValues.cs @@ -9,7 +9,7 @@ using LengthUnit = OasysUnits.Units.LengthUnit; namespace GsaGH.Parameters { - internal class GsaResultsValues { + public class GsaResultValues { internal enum ResultType { Displacement, Force, @@ -47,7 +47,7 @@ internal ConcurrentDictionary> XyzResults { get; set; } = new ConcurrentDictionary>(); - internal GsaResultsValues() { } + internal GsaResultValues() { } internal void CoordinateTransformationTo(Plane plane, Model model) { // coordinate transformation diff --git a/GsaGH/Parameters/5_Results/IGsaResult.cs b/GsaGH/Parameters/5_Results/IGsaResult.cs new file mode 100644 index 000000000..e975ba815 --- /dev/null +++ b/GsaGH/Parameters/5_Results/IGsaResult.cs @@ -0,0 +1,7 @@ +using GsaAPI; + +namespace GsaGH.Parameters { + public interface IGsaResult { + GsaResultValues GetNodeDisplacements(string nodelist, LengthUnit lengthUnit); + } +} diff --git a/GsaGHTests/1_BaseParameters/5_Results/GsaResultAnalysisCaseTests.cs b/GsaGHTests/1_BaseParameters/5_Results/GsaResultAnalysisCaseTests.cs index fddf846a9..c860b0f5b 100644 --- a/GsaGHTests/1_BaseParameters/5_Results/GsaResultAnalysisCaseTests.cs +++ b/GsaGHTests/1_BaseParameters/5_Results/GsaResultAnalysisCaseTests.cs @@ -41,13 +41,13 @@ public void GsaResultAnalysisCaseDisplacementXTest() { Assert.Equal(CaseType.AnalysisCase, result.Type); string nodeList = "442 to 468"; - Tuple, List> resultValueTuple = + Tuple, List> resultValueTuple = result.NodeDisplacementValues(nodeList, LengthUnit.Millimeter); var expectedIds = result.Model.Model.Nodes(nodeList).Keys.ToList(); Assert.Equal(expectedIds, resultValueTuple.Item2); - List resultValues = resultValueTuple.Item1; + List resultValues = resultValueTuple.Item1; List expectedX = ExpectedDisplacementXInMillimeter(); var actualX = new List();