-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
5 changed files
with
99 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using GsaGH.Parameters.Results; | ||
using System.Collections.ObjectModel; | ||
|
||
namespace GsaGH.Components.Helpers { | ||
internal class ExtremaHelper { | ||
internal static readonly ReadOnlyCollection<string> Vector6Displacements = new ReadOnlyCollection<string>(new[] { | ||
"All", | ||
"Max Ux", | ||
"Max Uy", | ||
"Max Uz", | ||
"Max |U|", | ||
"Max Rxx", | ||
"Max Ryy", | ||
"Max Rzz", | ||
"Max |R|", | ||
"Min Ux", | ||
"Min Uy", | ||
"Min Uz", | ||
"Min |U|", | ||
"Min Rxx", | ||
"Min Ryy", | ||
"Min Rzz", | ||
"Min |R|", | ||
}); | ||
|
||
internal static U ExtremaKey<T, U>(INodeResultSubset<T, ResultVector6<U>> resultSet, string key) | ||
where T : IResultItem { | ||
return key switch { | ||
"Max Ux" => resultSet.Max.X, | ||
"Max Uy" => resultSet.Max.Y, | ||
"Max Uz" => resultSet.Max.Z, | ||
"Max |U|" => resultSet.Max.Xyz, | ||
"Max Rxx" => resultSet.Max.Xx, | ||
"Max Ryy" => resultSet.Max.Yy, | ||
"Max Rzz" => resultSet.Max.Zz, | ||
"Max |R|" => resultSet.Max.Xxyyzz, | ||
"Min Ux" => resultSet.Min.X, | ||
"Min Uy" => resultSet.Min.Y, | ||
"Min Uz" => resultSet.Min.Z, | ||
"Min |U|" => resultSet.Min.Xyz, | ||
"Min Rxx" => resultSet.Min.Xx, | ||
"Min Ryy" => resultSet.Min.Yy, | ||
"Min Rzz" => resultSet.Min.Zz, | ||
"Min |R|" => resultSet.Min.Xxyyzz, | ||
_ => throw new System.ArgumentException("Extrema case not found"), | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters