Skip to content
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

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open

Refactoring GMGPolar #65

wants to merge 41 commits into from

Conversation

mknaranja
Copy link
Member

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:

  • There is at least one issue associated with the pull request.
  • New code adheres with the coding guidelines
  • No large data files have been added to the repository. Maximum size for files should be of the order of KB not MB. In particular avoid adding of pdf, word, or other files that cannot be change-tracked correctly by git.

If functions were changed or functionality was added:

  • Tests for new functionality has been added
  • A local test was succesful

If new functionality was added:

  • There is appropriate documentation of your work. (use doxygen style comments)

If new third party software is used:

  • Did you pay attention to its license? Please remember to add it to the wiki after successful merging.

If new mathematical methods or epidemiological terms are used:

  • Are new methods referenced? Did you provide further documentation?

[ ] 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):

  • Is the code clean of development artifacts e.g., unnecessary comments, prints, ...
  • The ticket goals for each associated issue are reached or problems are clearly addressed (i.e., a new issue was introduced).
  • There are appropriate unit tests and they pass.
  • The git history is clean and linearized for the merge request. All reviewers should squash commits and write a simple and meaningful commit message.
  • Coverage report for new code is acceptable.
  • No large data files have been added to the repository. Maximum size for files should be of the order of KB not MB. In particular avoid adding of pdf, word, or other files that cannot be change-tracked correctly by git.

.vscode/settings.json Outdated Show resolved Hide resolved
CITATION.cff Show resolved Hide resolved
LICENSE Outdated Show resolved Hide resolved
.clang-format Outdated Show resolved Hide resolved
Copy link

@ds-aakash ds-aakash left a 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

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

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 ]

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

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;

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)

Comment on lines +96 to +101
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; \

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

Comment on lines +61 to +65
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; \

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)

Comment on lines +895 to +909
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;
}
}
}
}

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

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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants