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

Componentwise norm computation #1349

Merged
merged 11 commits into from
Aug 18, 2016
Merged

Componentwise norm computation #1349

merged 11 commits into from
Aug 18, 2016

Conversation

chleh
Copy link
Collaborator

@chleh chleh commented Aug 12, 2016

Used by the convergence criteria of #1342.
Predecessor of #1342.

This PR also removes some old norm-related code.

Note: The provided code will not work with PETSc. To be done later on.

@ogsbot
Copy link
Member

ogsbot commented Aug 12, 2016

Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/2521/

@ogsbot
Copy link
Member

ogsbot commented Aug 12, 2016

Jenkins: OGS-6/Linux-PRs-dynamic failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs-dynamic/744/

// TODO that also includes ghost nodes.
std::size_t const n_nodes = mesh.getNumberOfNodes();

// TODO for PETSc some global accumulation is necessary.
Copy link
Member

Choose a reason for hiding this comment

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

If x is a PETSc vector, PETSc routine can be called to compute the norms, which collects the distributed data. How about to add members to global vector classes for computing the norms?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For the norms of whole vectors there are already functions in MathLib/LinAlg/LinAlg.h, which use the PETSc routines in the respective case.
The norm function introduced here, however, only picks, e.g., every third element of the vector and computes a norm involving only those elements. Therefore I think this function should not be moved to the vector classes.
And I didn't check if PETSc supports such "masked" norm computations out of the box.

Copy link
Member

Choose a reason for hiding this comment

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

I see.

Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI PETSc provides VecGetSubVector () based on Index Set which basically stores mapping information. see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetSubVector.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@norihiro-w Thanks for the info. I'd like to make the PETSc information later on. I'm a bit skeptical concerning the index set, because it takes additional storage and one has to build it first of all. (Maybe a manual gather is not more complicated)

@ogsbot
Copy link
Member

ogsbot commented Aug 17, 2016

Jenkins: OGS-6/Mac-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Mac-PRs/2432/

@ogsbot
Copy link
Member

ogsbot commented Aug 17, 2016

Jenkins: OGS-6/Gui/Gui-Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Gui/job/Gui-Linux-PRs/2513/

@ogsbot
Copy link
Member

ogsbot commented Aug 17, 2016

Jenkins: OGS-6/Linux-PRs-dynamic failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs-dynamic/791/

@ogsbot
Copy link
Member

ogsbot commented Aug 17, 2016

Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/2568/

@ogsbot
Copy link
Member

ogsbot commented Aug 17, 2016

Jenkins: OGS-6/Gui/Mac-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Gui/job/Mac-PRs/2417/

@chleh chleh force-pushed the comp-norm branch 2 times, most recently from fe049c0 to 532b616 Compare August 17, 2016 16:59
@chleh
Copy link
Collaborator Author

chleh commented Aug 17, 2016

Rebased and squashed as requested.

double norm(MatrixOrVector const& x, MathLib::VecNormType type)
{
switch (type) {
case MathLib::VecNormType::NORM1:
Copy link
Member

@endJunction endJunction Aug 17, 2016

Choose a reason for hiding this comment

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

indentation... ✅

@endJunction
Copy link
Member

Nice!

@TomFischer
Copy link
Member

👍

@chleh chleh merged commit 91929e3 into ufz:master Aug 18, 2016
@chleh chleh deleted the comp-norm branch August 18, 2016 14:06
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

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.

6 participants