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

Add MGSmootherPrecondition::initialize_matrices() #13343

Merged
merged 1 commit into from Feb 9, 2022

Conversation

peterrum
Copy link
Member

@peterrum peterrum commented Feb 6, 2022

I would like to setup MGSmootherPrecondition level by level, not using the initialize() functions, which also initialize the preconditioners. The best would be to have a function initialize(const MGLevelObject<MatrixType2> &matrices) but that conflicts with the function with the same name that takes optionally an AdditonalData object.

Copy link
Member

@kronbichler kronbichler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK with me, but I must say that I am surprised that we expose the smoothers as public member variables in this class, which makes this way of initialization possible at all. But I guess it is as you say, one might want to have additional flexibility in the solver.

@@ -467,6 +467,15 @@ class MGSmootherPrecondition : public MGSmoother<VectorType>
const typename PreconditionerType::AdditionalData &
additional_data = typename PreconditionerType::AdditionalData());

/**
* In contrast to the function above, only initialize the matrices. The
* smoothers need to be setup manually by the user in the following. This
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* smoothers need to be setup manually by the user in the following. This
* smoothers need to be set up manually by the user as a subsequent step in the code. This

/**
* In contrast to the function above, only initialize the matrices. The
* smoothers need to be setup manually by the user in the following. This
* is useful if one wants full flexibility in the choice of smoothers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can explain a bit more how this works: By manually setting the public member variable smoothers?

@peterrum
Copy link
Member Author

peterrum commented Feb 7, 2022

OK with me, but I must say that I am surprised that we expose the smoothers as public member variables in this class, which makes this way of initialization possible at all.

I was also surprised by this. I think a setter function allowing controlled access to the level smoothers would have been a better choice.

@kronbichler I have addressed your comments!

@kronbichler
Copy link
Member

/rebuild

@peterrum peterrum merged commit fa18f03 into dealii:master Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants