Skip to content

Conversation

@pcarruscag
Copy link
Member

Proposed Changes

As discussed in today's developers meeting.

Related Work

#1014

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

Comment on lines 38 to +39
* \author F. Palacios
*/
class CEulerSolver : public CSolver {
class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exhibit A

Comment on lines 210 to 149
ReducerStrategy = parallelEff < COLORING_EFF_THRESH;
Allocate(*config);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exhibit B

Comment on lines +32 to +36
#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>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exhibit C

Comment on lines 34 to 35
template<class VariableType, ENUM_REGIME FlowRegime>
class CFVMFlowSolverBase : public CSolver {
Copy link
Member Author

@pcarruscag pcarruscag Jul 8, 2020

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.

Comment on lines 61 to 63
template<class V, ENUM_REGIME R>
void CFVMFlowSolverBase<V,R>::Allocate(const CConfig& config) {

Copy link
Member Author

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).

@pcarruscag
Copy link
Member Author

@koodlyakshay can you have a quick look if this will cause too much trouble for the pressure based solver?

@pcarruscag
Copy link
Member Author

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.

Copy link
Member

@talbring talbring left a 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.

Copy link
Contributor

@CatarinaGarbacz CatarinaGarbacz left a 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

@pcarruscag
Copy link
Member Author

Thank you both, now there will be precedent for less duplication :)

@pcarruscag pcarruscag merged commit 16f3836 into develop Jul 22, 2020
@pcarruscag pcarruscag deleted the cleanup_flow_solver_duplication branch July 22, 2020 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants