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

Anasazi preconditioner #195

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

aprokop
Copy link
Collaborator

@aprokop aprokop commented May 31, 2019

Will rebase on master once Anasazi is merged. All relevant changes are in the last commit.

@aprokop aprokop changed the title Anasazi prec Anasazi preconditioner May 31, 2019
@masterleinad
Copy link
Collaborator

Anasazi is merged. You can rebase.

@@ -22,6 +22,19 @@ enum class OperatorMode
TRANS
};

template <typename VectorType>
class OperatorBase
Copy link
Collaborator

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,
Copy link
Collaborator

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
Copy link
Collaborator

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>
Copy link
Collaborator

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.); });
Copy link
Collaborator

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.

@masterleinad
Copy link
Collaborator

Will rebase on master once Anasazi is merged. All relevant changes are in the last commit.

Any explanation what this pull request does at all?

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