-
Notifications
You must be signed in to change notification settings - Fork 10
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
Anasazi preconditioner #195
base: master
Are you sure you want to change the base?
Conversation
Anasazi is merged. You can rebase. |
@@ -22,6 +22,19 @@ enum class OperatorMode | |||
TRANS | |||
}; | |||
|
|||
template <typename VectorType> | |||
class OperatorBase |
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.
I don't really think that we need this new class but if you really want to add it at least make Operator
derive from OperatorBase
.
size_type m() const { return _dof_handler.n_dofs(); } | ||
double diag_element(const size_type i) const | ||
{ | ||
auto x = _mesh_evaluator.matrix_free_get_agglomerate_diagonal(_dof_handler, |
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 is not a cheap operation. Can't you just get the whole vector at once.
@@ -120,7 +126,7 @@ struct MatrixFreeAgglomerateOperator | |||
* get_diag_elements() to the correct subspace. | |||
*/ | |||
dealii::AffineConstraints<double> &_constraints; | |||
}; | |||
}; // namespace mfmg |
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 there is a problem in the number of parenthesis.
@@ -24,6 +25,71 @@ | |||
namespace mfmg | |||
{ | |||
|
|||
template <typename VectorType> | |||
class DiagonalOperator : public OperatorBase<VectorType> |
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.
deal.II already has a class DiagonalMatrix
{ | ||
_diag.resize(diag.size()); | ||
std::transform(diag.begin(), diag.end(), _diag.begin(), | ||
[](auto v) { return (v ? 1. / v : 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.
You could have added a function for the inverse of the diagonal directly similar to https://github.com/ORNL-CEES/mfmg/blob/master/tests/test_hierarchy_helpers.hpp#L345 This way you also get a DiagonalMatrix
right away.
Any explanation what this pull request does at all? |
Will rebase on
master
once Anasazi is merged. All relevant changes are in the last commit.