Skip to content

Commit

Permalink
make whole de rham complex
Browse files Browse the repository at this point in the history
  • Loading branch information
tommbendall committed Jul 27, 2023
1 parent f253414 commit 6146c05
Show file tree
Hide file tree
Showing 5 changed files with 385 additions and 106 deletions.
10 changes: 2 additions & 8 deletions gusto/diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Common diagnostic fields."""

from firedrake import op2, assemble, dot, dx, FunctionSpace, Function, sqrt, \
from firedrake import op2, assemble, dot, dx, Function, sqrt, \
TestFunction, TrialFunction, Constant, grad, inner, curl, \
LinearVariationalProblem, LinearVariationalSolver, FacetNormal, \
ds_b, ds_v, ds_t, dS_v, div, avg, jump, \
Expand Down Expand Up @@ -1368,13 +1368,7 @@ def setup(self, domain, state_fields, vorticity_type=None):
vorticity_types = ["relative", "absolute", "potential"]
if vorticity_type not in vorticity_types:
raise ValueError(f"vorticity type must be one of {vorticity_types}, not {vorticity_type}")
try:
space = domain.spaces("CG")
except ValueError:
dgspace = domain.spaces("DG")
# TODO: should this be degree + 1?
cg_degree = dgspace.ufl_element().degree() + 2
space = FunctionSpace(domain.mesh, "CG", cg_degree, name=f"CG{cg_degree}")
space = domain.spaces("H1")

u = state_fields("u")
if vorticity_type in ["absolute", "potential"]:
Expand Down
4 changes: 2 additions & 2 deletions gusto/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def __init__(self, mesh, dt, family, degree=None,
self.mesh = mesh
self.family = family
self.spaces = Spaces(mesh)
# Build and store compatible spaces
self.compatible_spaces = [space for space in self.spaces.build_compatible_spaces(self.family, self.horizontal_degree, self.vertical_degree)]
self.spaces.build_compatible_spaces(self.family, self.horizontal_degree,
self.vertical_degree)

# -------------------------------------------------------------------- #
# Determine some useful aspects of domain
Expand Down
Loading

0 comments on commit 6146c05

Please sign in to comment.