-
Notifications
You must be signed in to change notification settings - Fork 918
Intermediate base class for flow solvers to avoid duplication. #1044
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
Conversation
| * \author F. Palacios | ||
| */ | ||
| class CEulerSolver : public CSolver { | ||
| class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> { |
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.
Exhibit A
| ReducerStrategy = parallelEff < COLORING_EFF_THRESH; | ||
| Allocate(*config); |
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.
Exhibit B
| #include "../../include/solvers/CFVMFlowSolverBase.inl" | ||
|
|
||
| /*--- Explicit instantiation of the parent class of CEulerSolver, | ||
| * to spread the compilation over two cpp files. ---*/ | ||
| template class CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE>; |
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.
Exhibit C
| template<class VariableType, ENUM_REGIME FlowRegime> | ||
| class CFVMFlowSolverBase : public CSolver { |
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.
Declarations and inline function in the hpp file.
The first template parameter is the type for nodes this is so we can still have de-virtualization.
| template<class V, ENUM_REGIME R> | ||
| void CFVMFlowSolverBase<V,R>::Allocate(const CConfig& config) { | ||
|
|
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.
Implementations of long functions go to the .inl file, we include this file in the cpp where we want the instantiation of the class template to take place (we can spread out the compilation cost like this).
|
@koodlyakshay can you have a quick look if this will cause too much trouble for the pressure based solver? |
|
Can we please merge this darn thing already? This was discussed and presented in 2 dev meetings, and people are starting to fix problems that are already fixed here, I do not like wasting time fixing pointless merge conflicts. |
talbring
left a comment
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.
Thanks @pcarruscag ! To me that looks good.
CatarinaGarbacz
left a comment
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.
Looks good and solid as a first step towards this new inheritance structure for flow solvers. thanks @pcarruscag , NEMO will make good use of this
|
Thank you both, now there will be precedent for less duplication :) |
Proposed Changes
As discussed in today's developers meeting.
Related Work
#1014
PR Checklist