Skip to content

Commit

Permalink
naming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dc-luo committed Aug 3, 2023
1 parent 7958cd9 commit d23cff8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions soupy/solver/newtonBacktrackSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import hippylib as hp

def applyBC(bcs, u):
def apply_BC(bcs, u):
"""
Applies a single or a list of :code:`dolfin.DirichletBC`
to the vector :code:`u`
Expand All @@ -35,7 +35,7 @@ def applyBC(bcs, u):
else:
bcs.apply(u)

def homogenizeBC(bcs):
def homogenize_BC(bcs):
"""
Converts a single or a list of :code:`dolfin.DirichletBC`
to their homogenized (zeroed) forms
Expand Down Expand Up @@ -131,14 +131,14 @@ def solve(self, residual_form, u, bcs=None, J_form = None, energy_form=None, sol
my_rank = MPI.COMM_WORLD.Get_rank()

# Apply BC to initial guess
applyBC(bcs, u.vector())
apply_BC(bcs, u.vector())

# Homogenize the dirichlet BCs if they exist
bcs0 = homogenizeBC(bcs)
bcs0 = homogenize_BC(bcs)

# Assemble initial residual
residual = dl.assemble(residual_form)
# applyBC(bcs0, residual)
# apply_BC(bcs0, residual)
r_norm = residual.norm("l2")
tol = max(r_norm*rtol, atol)
if energy_form is not None:
Expand Down Expand Up @@ -204,7 +204,7 @@ def solve(self, residual_form, u, bcs=None, J_form = None, energy_form=None, sol
else:
# Backtrack on residual norm
residual_new = dl.assemble(residual_form)
applyBC(bcs0, residual_new)
apply_BC(bcs0, residual_new)
r_new_norm = residual_new.norm('l2')
if r_new_norm < r_norm:
backtrack_converged = True
Expand All @@ -226,7 +226,7 @@ def solve(self, residual_form, u, bcs=None, J_form = None, energy_form=None, sol

# Compute residual norm
residual = dl.assemble(residual_form)
applyBC(bcs0, residual)
apply_BC(bcs0, residual)
r_norm = residual.norm("l2")

# Print new residual norms
Expand Down

0 comments on commit d23cff8

Please sign in to comment.