-
Notifications
You must be signed in to change notification settings - Fork 849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User defined functions for history outputs #1705
Conversation
This pull request fixes 1 alert when merging 78f98e7 into 3a9f8d6 - view on LGTM.com fixed alerts:
|
Even usage of custom-outputs in the custom outputs 😮 With Area/Avg+Int and Massflow-stuff, multiple markers in the list and everything I can dream of... solely CodeFactor tries to blame you for additional spaces in the python scripts :) |
CUSTOM_OUTPUTS= 'velocity : Macro{sqrt(pow(VELOCITY_X, 2) + pow(VELOCITY_Y, 2) + pow(VELOCITY_Z, 2))};\ | ||
avg_vel : AreaAvg{$velocity}[z_minus, z_plus];\ | ||
var_vel : AreaAvg{pow($velocity - avg_vel, 2)}[z_minus, z_plus];\ | ||
dev_vel : Function{sqrt(var_vel) / avg_vel}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MVP is live if anyone wants to play.
This pull request fixes 1 alert when merging 6995c81 into f2add99 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging f1bb97a into eed1e67 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 3babe42 into eed1e67 - view on LGTM.com fixed alerts:
|
I'll give this a test and put in my review Friday morning 👍 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SEL (SU2 Expression language) seems pretty powerful and renders quite a bit of output routines and OF logic in the code unnecessary (if I see that correctly). But not only that, but it allows for custom output (no shoot sherlock) that otherwise would have required additional coding.
So big kudos and thanks a lot 💐 looks good to me (I might have struggled (and still do) to understand the code :) and works for what i tested 👍
std::vector<unsigned long> varIndices; | ||
|
||
/*--- Offset between varIndices of different solvers (see above). Power of 2 to make decoding faster. ---*/ | ||
static constexpr unsigned long MAX_VARS_PER_SOLVER = 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets see when the first person needs to solve for 33 species together with some fancy custom output :) (never... I guess)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be any 2^n, we are not allocating anything it's just an "encoding" convention, maybe my subconscious picked 32 because I am 32 xD
#ifndef NDEBUG | ||
std::cout << str << std::endl; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping additional debugging code behind preprocessor directives seems like an concept Su2 could adopt... but if more people use NDEBUG, that might quickly bloat screen output. (so maybe some additional info needs to be printed ahead? idk just leave it like that, i am more thinking to myself)
Co-authored-by: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com>
What parts do you find trickier? I can try to improve comments. |
This pull request fixes 1 alert when merging 9b99cc6 into eed1e67 - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for adding this! I'll see how quickly I can break it :)
您的邮件我已收到,我会尽快处理,祝好。 ——王络
|
Proposed Changes
Allows this type of "language" to create new history outputs.
Related Work
#1478
PR Checklist