Intermediate base class for flow solvers to avoid duplication.#1044
Intermediate base class for flow solvers to avoid duplication.#1044pcarruscag merged 23 commits intodevelopfrom
Conversation
| * \author F. Palacios | ||
| */ | ||
| class CEulerSolver : public CSolver { | ||
| class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> { |
| ReducerStrategy = parallelEff < COLORING_EFF_THRESH; | ||
| Allocate(*config); |
| #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>; |
| template<class VariableType, ENUM_REGIME FlowRegime> | ||
| class CFVMFlowSolverBase : public CSolver { |
There was a problem hiding this comment.
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.
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.
Thanks @pcarruscag ! To me that looks good.
CatarinaGarbacz
left a comment
There was a problem hiding this comment.
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