Skip to content

Commit

Permalink
use Galewsky.H0 in checkpointing script
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins committed Apr 23, 2024
1 parent 2327d81 commit 9e491f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from utils import units
from utils import mg
from utils.misc import function_mean
from utils.planets import earth
import utils.shallow_water as swe
from utils.shallow_water import galewsky
Expand Down Expand Up @@ -75,7 +74,7 @@
w1 = fd.Function(W).assign(w_initial)

# mean height
H = function_mean(h_initial)
H = galewsky.H0


# shallow water equation forms
Expand Down
12 changes: 0 additions & 12 deletions utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ def function_minimum(f):
return fmin.data[0]


def function_mean(f):
"""
Find the volume averaged mean of a function.
"""
mesh = f.function_space().mesh()
cells = fd.Function(fd.FunctionSpace(mesh, "DG", 0))
cells.assign(1)
area = fd.assemble(cells*fd.dx)
ftotal = fd.assemble(f*fd.dx)
return ftotal / area


def curl0(u):
"""
Curl function from y-cpt field to x-z field
Expand Down

0 comments on commit 9e491f9

Please sign in to comment.