Skip to content

Commit

Permalink
GSAGH-366 proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilman Reinhardt committed Oct 5, 2023
1 parent e807abf commit 179d68d
Show file tree
Hide file tree
Showing 34 changed files with 1,072 additions and 400 deletions.
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/BeamDisplacements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals
List<GsaResultValues> vals
= result.Element1DDisplacementValues(elementlist, positionsCount, -1, _lengthUnit);

List<int> permutations = result.SelectedPermutationIds is null ? new List<int>() {
Expand Down Expand Up @@ -218,7 +218,7 @@ List<GsaResultsValues> 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() {
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/BeamForcesAndMoments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals
List<GsaResultValues> vals
= result.Element1DForceValues(elementlist, positionsCount, 0, _forceUnit, _momentUnit);

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
Expand Down Expand Up @@ -249,7 +249,7 @@ List<GsaResultsValues> 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() {
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/BeamStrainEnergyDensity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals = _average ?
List<GsaResultValues> vals = _average ?
result.Element1DAverageStrainEnergyDensityValues(elementlist, 0, _energyUnit) :
result.Element1DStrainEnergyDensityValues(elementlist, positionsCount, 0, _energyUnit);

Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/Element2dDisplacements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals = result.Element2DDisplacementValues(elementlist, _lengthUnit);
List<GsaResultValues> vals = result.Element2DDisplacementValues(elementlist, _lengthUnit);

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
1,
Expand Down Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions GsaGH/Components/5_Results/Element2dForcesAndMoments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals
List<GsaResultValues> vals
= result.Element2DForceValues(elementlist, _forceUnit, _momentUnit);
List<GsaResultsValues> valsShear = result.Element2DShearValues(elementlist, _forceUnit);
List<GsaResultValues> valsShear = result.Element2DShearValues(elementlist, _forceUnit);

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
1,
Expand Down Expand Up @@ -295,7 +295,7 @@ List<GsaResultsValues> 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);
}
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/Element2dStresses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals
List<GsaResultValues> vals
= result.Element2DStressValues(elementlist, layer, _stresshUnit);

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
Expand Down Expand Up @@ -213,7 +213,7 @@ List<GsaResultsValues> 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() {
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/Element3dDisplacements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals = result.Element3DDisplacementValues(elementlist, _lengthUnit);
List<GsaResultValues> vals = result.Element3DDisplacementValues(elementlist, _lengthUnit);

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
1,
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/Element3dStresses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals = result.Element3DStressValues(elementlist, _stresshUnit);
List<GsaResultValues> vals = result.Element3DStressValues(elementlist, _stresshUnit);

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
1,
Expand Down Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions GsaGH/Components/5_Results/FootfallResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/NodeDisplacements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

(List<GsaResultsValues> vals, List<int> sortedIDs)
(List<GsaResultValues> vals, List<int> sortedIDs)
= result.NodeDisplacementValues(nodeList, _lengthUnit);

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/5_Results/ReactionForces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

(List<GsaResultsValues> vals, List<int> sortedIDs)
(List<GsaResultValues> vals, List<int> sortedIDs)
= result.NodeReactionForceValues(nodeList, _forceUnit, _momentUnit);

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
Expand Down Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions GsaGH/Components/5_Results/SpringReactionForces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

Tuple<List<GsaResultsValues>, List<int>> resultgetter
Tuple<List<GsaResultValues>, List<int>> resultgetter
= result.SpringReactionForceValues(nodeList, _forceUnit, _momentUnit);
List<GsaResultsValues> vals = resultgetter.Item1;
List<GsaResultValues> vals = resultgetter.Item1;
List<int> sortedIDs = resultgetter.Item2;

List<int> permutations = result.SelectedPermutationIds ?? new List<int>() {
Expand Down Expand Up @@ -235,7 +235,7 @@ Tuple<List<GsaResultsValues>, List<int>> 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() {
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/6_Display/Contour1dResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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());
}
Expand Down
6 changes: 3 additions & 3 deletions GsaGH/Components/6_Display/Contour2dResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/6_Display/Contour3dResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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());
}
Expand Down
12 changes: 6 additions & 6 deletions GsaGH/Components/6_Display/ContourNodeResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GsaResultsValues>, List<int>> nodedisp
Tuple<List<GsaResultValues>, List<int>> nodedisp
= result.NodeDisplacementValues(nodeList, _lengthResultUnit);
res = nodedisp.Item1[0];
break;

case FoldMode.Reaction:
Tuple<List<GsaResultsValues>, List<int>> resultgetter
Tuple<List<GsaResultValues>, List<int>> resultgetter
= result.NodeReactionForceValues(nodeList, _forceUnit, _momentUnit);
res = resultgetter.Item1[0];
nodeList = string.Join(" ", resultgetter.Item2);
Expand Down Expand Up @@ -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());
}
Expand Down
10 changes: 5 additions & 5 deletions GsaGH/Components/6_Display/ReactionForceDiagrams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GsaResultsValues>, List<int>> reactionForceValues
Tuple<List<GsaResultValues>, List<int>> 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);
Expand Down Expand Up @@ -229,11 +229,11 @@ Tuple<List<GsaResultsValues>, List<int>> 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:
Expand Down Expand Up @@ -327,7 +327,7 @@ private ToolStripMenuItem GenerateMomentUnitsMenu(string menuTitle) {
}

private (GsaVectorDiagram, GsaAnnotationGoo) CreateReactionForceVectorWithAnnotations(
KeyValuePair<int, GsaNodeGoo> node, GsaResultsValues forceValues, double scale,
KeyValuePair<int, GsaNodeGoo> node, GsaResultValues forceValues, double scale,
int significantDigits, Color color) {
int nodeId = node.Key;
ConcurrentDictionary<int, ConcurrentDictionary<int, GsaResultQuantity>> xyzResults
Expand Down
4 changes: 2 additions & 2 deletions GsaGH/Components/GraveyardComp/BeamDisplacement_OBSOLETE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
return;
}

List<GsaResultsValues> vals
List<GsaResultValues> vals
= result.Element1DDisplacementValues(elementlist, positionsCount, 0, _lengthUnit);

List<int> permutations = result.SelectedPermutationIds is null ? new List<int>() {
Expand Down Expand Up @@ -227,7 +227,7 @@ List<GsaResultsValues> 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Loading

0 comments on commit 179d68d

Please sign in to comment.