-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactoring GMGPolar #65
base: main
Are you sure you want to change the base?
Conversation
d55a6c9
to
e3c8bc7
Compare
1567c79
to
842c9bb
Compare
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.
- Smoother files were the most difficult to follow. Will you will be documenting them in your report? (colouring and outside/inside sections)
- A call graph can also be included in the appendix of your report
#include <array> | ||
#include <initializer_list> | ||
|
||
enum class StencilType |
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.
StencilType
may be a bit misleading name here. ( neighbour type ? )
BottomRight, | ||
}; | ||
|
||
class Stencil |
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.
Stencil
is again misleading. When I think of stencil values I would assume they store something like [ 0 1 0 ; 1 -4 1; 0 1 0 ]
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.
May be add a comment that this Stencil
class helps when building sparse matrices
|
||
class LevelCache; | ||
|
||
class Level |
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.
Consider renaming this class and use level
only for indicating multigrid level
const DensityProfileCoefficients& density_profile_coefficients, | ||
const bool DirBC_Interior, const int num_omp_threads, | ||
const StencilDistributionMethod stencil_distribution_method); | ||
void directSolveInPlace(Vector<double>& x) 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.
Does InPlace
imply you overwrite the RHS with the solution? (maybe add a comment)
if (row == column) \ | ||
center_matrix.main_diagonal(row) += value; \ | ||
else if (row == column - 1) \ | ||
center_matrix.sub_diagonal(row) += value; \ | ||
else if (row == 0 && column == center_matrix.columns() - 1) \ | ||
center_matrix.cyclic_corner_element() += value; \ |
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.
You can use an inline function here instead of repeating this pattern (ex. update(matrix, value, row, col))
const int center_index = i_theta; \ | ||
const int left_index = i_theta; \ | ||
const int right_index = (i_r + 1 == numberSmootherCircles) ? 0 : i_theta; \ | ||
const int bottom_index = i_theta_M1; \ | ||
const int top_index = i_theta_P1; \ |
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.
Add a comment about these indices (row inside their local tridiagonal matrix as you explained)
else { | ||
auto& solverMatrix = circle_tridiagonal_solver_[circle_Asc_index]; | ||
|
||
solverMatrix = SymmetricTridiagonalSolver<double>(num_circle_nodes); | ||
solverMatrix.is_cyclic(true); | ||
solverMatrix.cyclic_corner_element() = 0.0; | ||
|
||
for (int i = 0; i < num_circle_nodes; i++) { | ||
solverMatrix.main_diagonal(i) = 0.0; | ||
if (i < num_circle_nodes - 1) { | ||
solverMatrix.sub_diagonal(i) = 0.0; | ||
} | ||
} | ||
} | ||
} |
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.
May be have a different function for zero initializations
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.
Comments/illustrations explaining node coloring should be very helpful
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.
Using GLOB can cause issues when changing or adding files. CMake files are usually recursive (ex. https://gitlab.com/CLIUtils/modern-cmake/-/tree/master/examples/extended-project)
Merge Request - GuideLine Checklist
Guideline to check code before resolve WIP and approval, respectively.
As many checkboxes as possible should be ticked.
Checks by code author:
Always to be checked:
If functions were changed or functionality was added:
If new functionality was added:
If new third party software is used:
If new mathematical methods or epidemiological terms are used:
[ ] The following questions are addressed in the documentation (if need be):
Developers (what did you do?, how can it be maintained?)
For users (how to use your work?)
For admins (how to install and configure your work?)
For documentation: Please write or update the Readme in the current working directory!
Checks by code reviewer(s):