Skip to content

Commit

Permalink
remove print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
nschloe committed Dec 21, 2021
1 parent aa0ee53 commit 3cffdf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ def callback(k, lmbda, sol):
# Natural parameter continuation
# pacopy.natural(problem, u0, lmbda0, callback, max_steps=100)

pacopy.euler_newton(problem, u0, lmbda0, callback, max_steps=500, newton_tol=1.0e-10)
pacopy.euler_newton(
problem, u0, lmbda0, callback, max_steps=500, max_num_retries=10, newton_tol=1.0e-10
)
```

#### Ginzburg–Landau
Expand Down
14 changes: 0 additions & 14 deletions src/pacopy/euler_newton.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,6 @@ def _newton_corrector(
newton_success = False

while True:
print()
print("u", problem.inner(u, u))
print("lmbda", lmbda)
r = problem.f(u, lmbda)
du_ds_1 = (u - u_current) / ds
dlmbda_ds_1 = (lmbda - lmbda_current) / ds
Expand Down Expand Up @@ -490,22 +487,11 @@ def _newton_corrector(
z1 = problem.jacobian_solver(u, lmbda, -r)
z2 = problem.jacobian_solver(u, lmbda, -problem.df_dlmbda(u, lmbda))

dfdl = problem.df_dlmbda(u, lmbda)

print("df/dl", math.sqrt(problem.inner(dfdl, dfdl)))
print("f", math.sqrt(problem.inner(r, r)))
print("z1", math.sqrt(problem.inner(z1, z1)))
print("z2", math.sqrt(problem.inner(z2, z2)))
print("ds", ds)

# secant variant:
tz1 = theta2 * problem.inner(du_ds_1, z1)
tz2 = theta2 * problem.inner(du_ds_1, z2)
# The division by 2 is from the the squared terms in rho
print("frac1", -rho * ds / 2 - tz1)
print("frac2", dlmbda_ds_1 + tz2)
dlmbda = (-rho * ds / 2 - tz1) / (dlmbda_ds_1 + tz2)
print("l", dlmbda)

# tangent variant:
# # dlmbda = alpha
Expand Down

0 comments on commit 3cffdf8

Please sign in to comment.