-
Notifications
You must be signed in to change notification settings - Fork 277
Cleanup: remove unneeded argument for Preconditioner::Update
#7234
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
Changes from all commits
83b6cda
d80b0f8
23092a5
8545f27
0a7d1f9
10f277c
afed726
cbaedcb
1fd23b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,7 +104,7 @@ class MatrixPC : public Preconditioner<T,Ops> | |
| /** | ||
| * \brief Update the preconditioner | ||
| */ | ||
| void Update (const T& a_U) override; | ||
| void Update () override; | ||
|
|
||
| /** | ||
| * \brief Assemble the matrix | ||
|
|
@@ -114,7 +114,7 @@ class MatrixPC : public Preconditioner<T,Ops> | |
| * non-zero elements (return value is difference in current number | ||
| * of nonzero elements and the desired number). | ||
| */ | ||
| int Assemble (const T& a_U); | ||
| int Assemble (); | ||
|
|
||
| /** | ||
| * \brief Apply (solve) the preconditioner given a RHS | ||
|
|
@@ -185,6 +185,7 @@ class MatrixPC : public Preconditioner<T,Ops> | |
|
|
||
| int m_ndofs_l = 0; | ||
| int m_ndofs_g = 0; | ||
|
|
||
| bool m_pc_diag_only = false; | ||
| int m_pc_mat_nnz = 1; | ||
| bool m_include_mass_matrices = false; | ||
|
|
@@ -247,9 +248,6 @@ void MatrixPC<T,Ops>::Define ( const T& a_U, | |
| // read preconditioner parameters | ||
| readParameters(); | ||
|
|
||
| // a_U is not needed | ||
| amrex::ignore_unused(a_U); | ||
|
|
||
| // Set number of AMR levels and create geometry, grids, and | ||
| // distribution mapping vectors. | ||
| m_num_amr_levels = m_ops->numAMRLevels(); | ||
|
|
@@ -282,7 +280,7 @@ void MatrixPC<T,Ops>::Define ( const T& a_U, | |
| } | ||
|
|
||
| template <class T, class Ops> | ||
| void MatrixPC<T,Ops>::Update (const T& a_U) | ||
| void MatrixPC<T,Ops>::Update () | ||
| { | ||
| BL_PROFILE("MatrixPC::Update()"); | ||
| using namespace amrex; | ||
|
|
@@ -293,7 +291,7 @@ void MatrixPC<T,Ops>::Update (const T& a_U) | |
|
|
||
| while(true) { | ||
|
|
||
| auto nnz_diff = Assemble(a_U); | ||
| auto nnz_diff = Assemble(); | ||
| AMREX_ALWAYS_ASSERT(nnz_diff >= 0); | ||
| if (nnz_diff) { | ||
|
|
||
|
|
@@ -315,7 +313,7 @@ void MatrixPC<T,Ops>::Update (const T& a_U) | |
| } | ||
|
|
||
| template <class T, class Ops> | ||
| int MatrixPC<T,Ops>::Assemble (const T& a_U) | ||
| int MatrixPC<T,Ops>::Assemble () | ||
| { | ||
| // Assemble the sparse matrix representation of the preconditioner | ||
| // A = curl (alpha * curl []) + M | ||
|
|
@@ -347,11 +345,8 @@ int MatrixPC<T,Ops>::Assemble (const T& a_U) | |
| << "alpha = " << alpha << "\n"; | ||
| } | ||
|
|
||
| // Get DOF object from a_U | ||
| const auto& dofs_obj = a_U.getDOFsObject(); | ||
| const auto& dofs_mfarrvec = dofs_obj->m_array; | ||
| AMREX_ALWAYS_ASSERT(m_ndofs_l == dofs_obj->m_nDoFs_l); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR removes the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @debog I'll let Debo answer that question. It may not be needed, but I"m not sure. |
||
| AMREX_ALWAYS_ASSERT(m_ndofs_g == dofs_obj->m_nDoFs_g); | ||
| // The DOF object is shared by every solver vector. | ||
| const auto& dofs_mfarrvec = T::getDOFsObject()->m_array; | ||
|
|
||
| m_r_indices_g.clear(); | ||
| m_num_nz.clear(); | ||
|
|
||
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.
This function can be made
statichere (i.e., it can be called withWarpXSolverVec::getDOFsObjectinstead of requiring an instance ofWarpXSolverVec) sincem_dofsitself is declared as a static member (i.e. onem_dofsobject per class, not per instance)