Skip to content

Commit

Permalink
fix: remove the extra safety factor when printing
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbdsantos committed Jun 27, 2024
1 parent 3ab27c5 commit 1b8335b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,20 @@
$ gcat gci --h1 8.30 --h2 10.84 --h3 14.14 --f1 1 --f2 1.02 --f3 1.08
# Grid summary
+ ---------------------------------------
h1 = 8.300000e+00 m, f1 = 1.000000e+00
h2 = 1.084000e+01 m, f2 = 1.020000e+00
h3 = 1.414000e+01 m, f3 = 1.080000e+00
h1 = 8.300000e+00 m, f1 = 1.000000e+00
h2 = 1.084000e+01 m, f2 = 1.020000e+00
h3 = 1.414000e+01 m, f3 = 1.080000e+00

# GCI (safety factor = 1.25)
+ ---------------------------------------
GCI21_fine = 1.562500e-02
GCI21_coarse = 4.687500e-02
GCI21_fine = 1.235897e-02
GCI21_coarse = 3.735897e-02

GCI32_fine = 4.630449e-02
GCI32_coarse = 1.382163e-01
GCI32_fine = 3.662651e-02
GCI32_coarse = 1.101559e-01

Asymptotic ratio = 1.012321
Asymptotic ratio = 1.019998
Observed order of convergence = 4.143231


## References
Expand Down
16 changes: 8 additions & 8 deletions gcat/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ def gci(
r21 = h2 / h1
r32 = h3 / h2

gci21_fine = gcat.convergence.gci_fine(f1, f2, r21, p)
gci21_coarse = gcat.convergence.gci_coarse(f1, f2, r21, p)
gci21_fine = gcat.convergence.gci_fine(f1, f2, r21, p, safety)
gci21_coarse = gcat.convergence.gci_coarse(f1, f2, r21, p, safety)

gci32_fine = gcat.convergence.gci_fine(f2, f3, r32, p)
gci32_coarse = gcat.convergence.gci_coarse(f2, f3, r32, p)
gci32_fine = gcat.convergence.gci_fine(f2, f3, r32, p, safety)
gci32_coarse = gcat.convergence.gci_coarse(f2, f3, r32, p, safety)

r = gcat.convergence.asymptotic_ratio(gci21_fine, gci32_fine, r21, p)

Expand All @@ -187,11 +187,11 @@ def gci(
"",
f"# GCI (safety factor = {safety})",
"+ ---------------------------------------",
f" GCI21_fine = {gci21_fine * safety:.6e}",
f" GCI21_coarse = {gci21_coarse * safety:.6e}",
f" GCI21_fine = {gci21_fine:.6e}",
f" GCI21_coarse = {gci21_coarse:.6e}",
"",
f" GCI32_fine = {gci32_fine * safety:.6e}",
f" GCI32_coarse = {gci32_coarse * safety:.6e}",
f" GCI32_fine = {gci32_fine:.6e}",
f" GCI32_coarse = {gci32_coarse:.6e}",
"",
f" Asymptotic ratio = {r:.6f}",
f" Observed order of convergence = {p:.6f}",
Expand Down

0 comments on commit 1b8335b

Please sign in to comment.