Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR is in line with #987 and should be understood as later extension - therefore current work is stopped. The goal for later will be a unified suite for measuring lengths of vectors (increments and residuals in mixed-dimensional sense).
For increased modularization, the existing functionality for checking convergence as part of the solution strategy is suggested to be splitted, such that specifying the norm to be used can be performed in an isolated manner. In addition, an example implementation of an L2-norm (in Lebesgue) sense is added. User-defined / or model-tailored choices e.g. depending on material parameters can be added in a simple fashion, especially starting from the latter.
This PR is first of all a suggestion. This means, feedback is requested whether such modularization (i.e., an explicit interface) is wished; off-the-shelf examples for different choices than the Euclidean norm is useful (then a dedicated test would be added to test the implementation for exactness).
Note the structure of method placement as well as modifications of
pp.ad.Variable
are light suggestions, but serve especially for completeness of this PR as ground for presenting a concept. In case of rejection, removing this PR is recommended. If accepted, smaller modifications of the core may be benefitial to make some present implementation choices less hardcoded.Types of changes
What types of changes does this PR introduce to PorePy?
Put an
x
in the boxes that apply.Checklist
Put an
x
in the boxes that apply or explain briefly why the box is not relevant.pytest
was run with the--run-skipped
flag.