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
Cleanup and document the multigrid agglomeration strategy #1372
Conversation
This pull request fixes 7 alerts when merging cb9fce3 into 5ce84cc - view on LGTM.com fixed alerts:
|
This pull request fixes 7 alerts when merging c4f27dc into 6338bff - 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 taking the time for cleaning up the code and removing the redundancy!
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 for this cleanup 💐
@@ -264,7 +263,7 @@ class CGeometry { | |||
/*! | |||
* \brief Constructor of the class. | |||
*/ | |||
CGeometry(void); |
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.
Fun Fact, there are 1475 (void)
in SU2_CFD and Common ... We/I could make them go extinct (if we are ok with some possible minor merge conflicts in other peoples PR's )
*/ | ||
CMultiGridGeometry(CGeometry **geometry, CConfig *config_container, unsigned short iMesh); | ||
|
||
private: |
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 like all methods were public before
|
||
/*! | ||
* \brief Determine if a can be agglomerated using geometrical criteria. | ||
* \param[in] iPoint - Seed point. | ||
* \param[in] fine_grid - Geometrical definition of the problem. | ||
* \param[in] config - Definition of the particular problem. | ||
*/ | ||
bool GeometricalCheck(unsigned long iPoint, CGeometry *fine_grid, CConfig *config); | ||
bool GeometricalCheck(unsigned long iPoint, const CGeometry *fine_grid, const CConfig *config) const; |
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.
Maybe with that amount of changes clang-format could have been a thing. (Again pointer-Alignment is the rat here)
unsigned long iPoint, Index_CoarseCV, iElem, iVertex, iteration, nVertexS, nVertexR, | ||
nBufferS_Vector, nBufferR_Vector, iParent, jVertex,Local_nPointCoarse, Local_nPointFine, Global_nPointCoarse, Global_nPointFine, | ||
*Buffer_Receive_Parent = nullptr, *Buffer_Send_Parent = nullptr, *Buffer_Receive_Children = nullptr, *Buffer_Send_Children = nullptr, | ||
*Parent_Remote = nullptr, *Children_Remote = nullptr, *Parent_Local = nullptr, *Children_Local = nullptr; | ||
short marker_seed; | ||
bool agglomerate_seed = true; | ||
unsigned short nChildren, iNode, counter, iMarker, jMarker, priority, MarkerS, MarkerR, *nChildren_MPI; | ||
vector<unsigned long> Suitable_Indirect_Neighbors, Aux_Parent; | ||
vector<unsigned long>::iterator it; | ||
|
||
unsigned short nMarker_Max = config->GetnMarker_Max(); | ||
|
||
unsigned short *copy_marker = new unsigned short [nMarker_Max]; | ||
|
||
#ifdef HAVE_MPI | ||
int send_to, receive_from; | ||
SU2_MPI::Status status; | ||
#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.
👍 noice
// unsigned long iPointFree = nPointDomain-1; | ||
// iCoarsePoint = 0; | ||
// | ||
// 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.
haven't seen a do - while
in quite some time.
Good to get rid of those commented code blocks
wall_temperature.fine_grid = fine_grid; | ||
wall_temperature.marker = val_marker; | ||
wall_temperature.target = CustomBoundaryTemperature[val_marker]; | ||
|
||
SetMultiGridWallQuantity(fine_grid, val_marker, wall_temperature); |
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.
Nice cut-paste-specialize
Proposed Changes
In trying to understand the algorithm a little better I also tried to improve the documentation and clean up some redundancy.
PR Checklist