Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build the whole de Rham complex in the domain #402

Merged
merged 7 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading