Skip to content

Commit

Permalink
Update solver.py
Browse files Browse the repository at this point in the history
  • Loading branch information
loganbvh committed Sep 22, 2023
1 parent 74d20d3 commit 34dae37
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tdgl/solver/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,32 @@ def update(
psi_laplacian,
options,
)

if use_cupy:
cupy.cuda.get_current_stream().synchronize()

# Compute the supercurrent, scalar potential, and normal current
supercurrent = operators.get_supercurrent(psi)

if use_cupy:
cupy.cuda.get_current_stream().synchronize()

rhs = (divergence @ (supercurrent - dA_dt)) - (
mu_boundary_laplacian @ mu_boundary
)
if options.sparse_solver is SparseSolver.PARDISO:
mu = pypardiso.spsolve(mu_laplacian, rhs)
else:
mu = mu_laplacian_lu(rhs)

if use_cupy:
cupy.cuda.get_current_stream().synchronize()

normal_current = -(mu_gradient @ mu) - dA_dt

if use_cupy:
cupy.cuda.get_current_stream().synchronize()

if not options.include_screening:
break

Expand Down

0 comments on commit 34dae37

Please sign in to comment.