Skip to content

Commit

Permalink
Merge pull request #519 from firedrakeproject/TBendall/GreatReorganis…
Browse files Browse the repository at this point in the history
…ation

Restructure codebase
  • Loading branch information
jshipton committed Jul 23, 2024
2 parents e391418 + 295f096 commit 9930f6e
Show file tree
Hide file tree
Showing 82 changed files with 8,987 additions and 7,068 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Firedrake
Copyright (c) 2016 Gusto

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion examples/shallow_water/moist_thermal_williamson5.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
from gusto import *
from firedrake import (IcosahedralSphereMesh, SpatialCoordinate,
as_vector, pi, sqrt, min_value, exp, cos)
as_vector, pi, sqrt, min_value, exp, cos, sin)
import sys

# ----------------------------------------------------------------- #
Expand Down
24 changes: 5 additions & 19 deletions gusto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@

# Start logging first, incase anything goes wrong
from gusto.logging import * # noqa
from gusto.core.logging import * # noqa
set_log_handler()

from gusto.active_tracers import * # noqa
from gusto.common_forms import * # noqa
from gusto.configuration import * # noqa
from gusto.coord_transforms import * # noqa
from gusto.domain import * # noqa
from gusto.core import * # noqa
from gusto.diagnostics import * # noqa
from gusto.diffusion_methods import * # noqa
from gusto.equations import * # noqa
from gusto.forcing import * # noqa
from gusto.initialisation_tools import * # noqa
from gusto.io import * # noqa
from gusto.labels import * # noqa
from gusto.limiters import * # noqa
from gusto.linear_solvers import * # noqa
from gusto.meshes import * # noqa
from gusto.numerical_integrator import * # noqa
from gusto.initialisation import * # noqa
from gusto.physics import * # noqa
from gusto.preconditioners import * # noqa
from gusto.recovery import * # noqa
from gusto.solvers import * # noqa
from gusto.spatial_methods import * # noqa
from gusto.time_discretisation import * # noqa
from gusto.timeloop import * # noqa
from gusto.transport_methods import * # noqa
from gusto.wrappers import * # noqa
from gusto.timestepping import * # noqa
11 changes: 11 additions & 0 deletions gusto/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from gusto.core.configuration import * # noqa
from gusto.core.coordinates import * # noqa
from gusto.core.coord_transforms import * # noqa
from gusto.core.domain import * # noqa
from gusto.core.fields import * # noqa
from gusto.core.function_spaces import * # noqa
from gusto.core.io import * # noqa
from gusto.core.kernels import * # noqa
from gusto.core.labels import * # noqa
from gusto.core.logging import * # noqa
from gusto.core.meshes import * # noqa
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions gusto/coordinates.py → gusto/core/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Coordinate fields are stored in specified VectorFunctionSpaces.
"""

from gusto.coord_transforms import lonlatr_from_xyz, rotated_lonlatr_coords
from gusto.logging import logger
from gusto.core.coord_transforms import lonlatr_from_xyz, rotated_lonlatr_coords
from gusto.core.logging import logger
from firedrake import SpatialCoordinate, Function
import numpy as np
import pandas as pd
Expand Down
4 changes: 2 additions & 2 deletions gusto/domain.py → gusto/core/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
model's time interval.
"""

from gusto.coordinates import Coordinates
from gusto.function_spaces import Spaces, check_degree_args
from gusto.core.coordinates import Coordinates
from gusto.core.function_spaces import Spaces, check_degree_args
from firedrake import (Constant, SpatialCoordinate, sqrt, CellNormal, cross,
inner, grad, VectorFunctionSpace, Function, FunctionSpace,
perp)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion gusto/function_spaces.py → gusto/core/function_spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
used by the model.
"""

from gusto import logger
from gusto.core.logging import logger
from firedrake import (HCurl, HDiv, FunctionSpace, FiniteElement,
TensorProductElement, interval)

Expand Down
4 changes: 2 additions & 2 deletions gusto/io.py → gusto/core/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import sys
import time
from gusto.diagnostics import Diagnostics, CourantNumber
from gusto.meshes import get_flat_latlon_mesh
from gusto.core.meshes import get_flat_latlon_mesh
from firedrake import (Function, functionspaceimpl, Constant,
DumbCheckpoint, FILE_CREATE, FILE_READ, CheckpointFile)
from firedrake.output import VTKFile
from pyop2.mpi import MPI
import numpy as np
from gusto.logging import logger, update_logfile_location
from gusto.core.logging import logger, update_logfile_location

__all__ = ["pick_up_mesh", "IO"]

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion gusto/labels.py → gusto/core/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ufl
from firedrake import Function
from firedrake.fml import Term, Label, LabelledForm
from gusto.configuration import IntegrateByParts, TransportEquationType
from gusto.core.configuration import IntegrateByParts, TransportEquationType
from types import MethodType

dynamics_label = Label("dynamics", validator=lambda value: type(value) is str)
Expand Down
2 changes: 1 addition & 1 deletion gusto/logging.py → gusto/core/logging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Gusto Logging Module
All logging functionality for Gusto is controlled from
``gusto.logging``. A logger object ``logging.getLogger("gusto")`` is
``gusto.core.logging``. A logger object ``logging.getLogger("gusto")`` is
created internally.
The primary means of configuration is via environment variables, the
Expand Down
File renamed without changes.
Loading

0 comments on commit 9930f6e

Please sign in to comment.