SimVascular / SimVascular/svMultiPhysics

svMultiPhysics Documentation error: description on Ri/R1

Open
#433 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
C++
Stars
45
Forks
60
Avg merge
5d 23h
Merged PRs (30d)
11

Description

Problem

The current documentation on svMultiPhysics says:
Ri/R1 = (Initial linear system norm / Initial nonlinear norm) / (First nonlinear iteration norm)

But I believe the definition is somewhat subtly misleading.

in pic.cpp (svMultiPhysics) (first Newton iteration of the current time-step):

if (eq.itr == 1) {               // only when Newton iter = 1
    eq.pNorm = eq.FSILS.RI.iNorm // ‖R_linear,0‖
              / eq.iNorm;        // ‖R_nonlinear,0‖
}

-> From these lines, we can know that eq.pNorm stores the step-local ratio:
(Ri/R0)_iter1 = ||R_lin,0|| / |R_nonlinear,0||

in output.cpp (svMultiPhysics) (whenever a Newton line is printed)

tmp  = eq.FSILS.RI.iNorm / eq.iNorm;  // Ri/R0 for this Newton iter
tmp1 = tmp / eq.pNorm;                // Ri/R1 = (Ri/R0)_this iter/(Ri/R0)_iter1

-> For Newton 1 of a step, tmp equals eq.pNorm, so tmp1 = 1.
-> For later Newton iterations, the denominator stays fixed while the numerator changes, giving a true convergence measure.

Let
L_i = ‖R_(i)lin,0‖ (initial linear residual at Newton i)
N_i = ‖R_(i)nonlinear,0|| (initial non-linear residual at Newton i)

Then the code prints
Ri/R0 = Ri/Ni
Ri/R1 = (Li/Ni) / (L1/N1)

So the definition should be fixed as “Ri/R1 = (Initial linear / Initial non-linear) / (First linear / First non-linear-iteration norm)"

Solution

The definition should be fixed
from Ri/R1 = (Initial linear system norm / Initial nonlinear norm) / (First nonlinear iteration norm)
to as Ri/R1 = (Initial linear / Initial non-linear) / (First linear / First non-linear-iteration norm)

Additional context

P.S. I wanted to put documentation label, not enhancement label on this post, but I couldn't find a way to do so...

Code of Conduct
  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the Ri/R1 documentation entry together with the referenced pic.cpp and output.cpp snippets. Locate the documentation text containing the current definition, update it to match the stated ratio using the first linear/nonlinear values, and verify that the published wording reflects the issue’s formula.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.