-
Notifications
You must be signed in to change notification settings - Fork 841
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
Small cleanup of NEMO solver #1488
Conversation
|
||
|
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.
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.
Important change, I know :D
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.
Perfect! Hahah ill change this. The main motivation for doing this is because I keep running into inconsistencies within branches!
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.
clang-format is your friend...
|
||
/*--- Allocate the value at the outlet ---*/ | ||
V_outlet = GetCharacPrimVar(val_marker, iVertex); |
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.
U_domain is interesting. We need it for CNEMONumerics InviscidProjFlux/Jacs....working on it
Here were are allocating using GetCharacPrimVar.
su2double *U_domain = new su2double[nVar]; su2double *U_outlet = new su2double[nVar]; | ||
su2double *V_domain = new su2double[nPrimVar]; su2double *V_outlet = new su2double[nPrimVar]; | ||
su2double *U_domain; | ||
su2double *U_outlet = new su2double[nVar]; |
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.
For some reason, I can't do something without the regression values changing:
su2double *U_outlet; U_outlet = nodes->GetSolution(iPoint); for (iVar =0 ....) U_outlet[iVar]=0.0;
Any ideas?
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.
That would write over the solution at iPoint since GetSolution returns a pointer, that's where the "const everything" guideline comes from.
const su2double* U_outlet = nodes->GetSolution(iPoint);
With that said, maybe that is what you are trying to do?
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.
Ahh. My idea was to initialize the U_outlet vector with the 'new' command.
Ideally this problem goes away once I break the reliance of the conserved variables in some of the numerical schemes.
@@ -45,7 +45,7 @@ class CNEMOCompOutput final: public CFlowOutput { | |||
* \brief Constructor of the class | |||
* \param[in] config - Definition of the particular problem. | |||
*/ | |||
CNEMOCompOutput(CConfig *config, unsigned short nDim); | |||
CNEMOCompOutput(const CConfig *config, unsigned short nDim); |
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.
👍
su2double *U_domain = new su2double[nVar]; su2double *U_outlet = new su2double[nVar]; | ||
su2double *V_domain = new su2double[nPrimVar]; su2double *V_outlet = new su2double[nPrimVar]; | ||
su2double *U_domain; | ||
su2double *U_outlet = new su2double[nVar]; |
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.
That would write over the solution at iPoint since GetSolution returns a pointer, that's where the "const everything" guideline comes from.
const su2double* U_outlet = nodes->GetSolution(iPoint);
With that said, maybe that is what you are trying to do?
Co-authored-by: Pedro Gomes <[email protected]>
Proposed Changes
This PR cleans up some functions in NEMO. removing some unused code, adding comments, etc.
I plan to do some more cleanup for the PR, but this should impact the functioning of the code at all.
Future work will:
1.) Update boundary conditions to a working state (Supersonic Inlet, inlet, etc.)
2.) Make use of CharacPrimVar() for further code integration
3.) Remove dependency of conserved variables in numerical schemes