API Reference

┌─────────────────────────────────────────────────────────────────────────┐
│                        GeoDynamo.jl API                                 │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                         │
│   GeoDynamo                                                             │
│   ├── High-level API (GeodynamoModel, Simulation, run!, set!, …)        │
│   ├── Core Types & Functions                                            │
│   ├── bcs (Boundary Conditions)                                         │
│   │   └── topography                                                    │
│   ├── InitialConditions                                                 │
│   ├── GPU solver port (gpu_solver_step!, gpu_run!)                      │
│   ├── GeoDynamoShell                                                    │
│   └── GeoDynamoBall                                                     │
│                                                                         │
└─────────────────────────────────────────────────────────────────────────┘

This is the reference for all exported types and functions. The reference is split across several pages to keep each one fast to load; use the table below to jump to a section.


Reference Map

Quick Navigation
PageContents
Solver & TimestepGrids, model, simulation driver, time integration, output
Physics & FieldsVelocity, magnetic, temperature, composition fields and field infrastructure
Transforms & SpectralSHTnsKit configs, parallel layout, spectral operators
InternalsRemaining documented GeoDynamo symbols
Boundary ConditionsGeoDynamo.bcs loading, interpolation, application
Boundary TopographyGeoDynamo.bcs.topography coupling
Initial ConditionsGeoDynamo.InitialConditions field setup
Shell GeometryGeoDynamo.GeoDynamoShell domain setup
Ball GeometryGeoDynamo.GeoDynamoBall domain setup

Module Layout

ModuleDescription
GeoDynamoCore types and simulation
GeoDynamo.bcsBoundary conditions
GeoDynamo.bcs.topographyNon-spherical boundaries
GeoDynamo.InitialConditionsField initialization
GeoDynamo.GeoDynamoShellShell geometry
GeoDynamo.GeoDynamoBallBall geometry

Simulation

using GeoDynamo

grid  = SphericalShellGrid(CPU(); lmax=32, nr=64, nr_inner=16)
model = GeodynamoModel(grid; Ek=1e-4, Ra=1e6, include_magnetic=true)

sim = Simulation(model; Δt=1e-5, stop_time=0.1, stop_iteration=10_000)
add_callback!(sim, sim -> @info("step", n=sim.model.clock.iteration);
              schedule=IterationInterval(100))
run!(sim)
Δt and dt

Δt is the canonical timestep keyword (Oceananigans convention); dt is accepted as an alias. sim.Δt reads and writes the same value as sim.dt.

prettytime(t) formats wall-clock durations ("2.341 seconds", "1.500 days"). Model time is nondimensional and prints compactly (e.g. time = 0.25).

Four callbacks are registered automatically on every new Simulation: stop_time_exceeded, stop_iteration_exceeded, wall_time_limit_exceeded, and nan_checker. A user callback registered under one of those names replaces the built-in stop guard — pick a different name unless that is what you want. Use SpecifiedTimes(t1, t2, ...) as a schedule to trigger output or callbacks at exact model times.


Boundary Conditions

Boundary conditions use Oceananigans-style names: ValueBoundaryCondition (Dirichlet), FluxBoundaryCondition (Neumann), wrapped per field in FieldBoundaryConditions(inner=…, outer=…). The original names (FixedTemperature, FixedFlux, BoundaryConditions) remain as aliases. They can be passed per field or as one NamedTuple:

model = GeodynamoModel(grid;
    boundary_conditions = (
        temperature = FieldBoundaryConditions(
            inner = ValueBoundaryCondition(1.0),
            outer = ValueBoundaryCondition(0.0)),
    ))

set! accepts numbers, functions of (r, θ, φ), and physical-grid arrays for scalar fields:

set!(model; temperature = (r, θ, φ) -> 1 - r)

External Dependencies

GeoDynamo.jl builds on these Julia packages:

PackagePurposeDocumentation
SHTnsKit.jlSpherical harmonic transformsGitHub
PencilArrays.jlDomain decompositionDocs
MPI.jlMessage passingDocs
NetCDF.jlFile I/ODocs

See Also