Skip to content

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.

};

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.

*/
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.

{

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