Functions

Defining the Volume

Mire.EllipsoidType
Ellipsoid{T<:Number} <: Volume{T}

Volume type Ellipsoid. Create by calling Ellipsoid(a,b,c), with a,b,c the semi-axes. a,b,c can be of any Number type.

Examples: Ellipsoid(1.1,1.0,0.9) is a Ellipsoid{Float64}, Ellipsoid(1//1,1//2,1//5) is a Ellispoid{Rational{Int64}}.

source
Mire.SphereType
Sphere{T<:Number} <: Volume{T}

Volume type Sphere. Create by calling Sphere{T}(), with T any Number type. Default: Sphere(T) gives a Sphere{Float64}(). For other types use, e.g. Sphere{Rational{BigInt}}().

source

Vector bases

Mire.LebovitzBasisType
LebovitzBasis{T<:Number,Vol<:Volume{T}} <: VectorBasis{T,Vol}

Basis of 3-D vector field, so that $\mathbf{u}\cdot\mathbf{n} = 0$ at $\partial\mathcal{V}$ and $\nabla\cdot\mathbf{u} = 0$ after Lebovitz (1989).

source
Mire.QGBasisType
QGBasis{T<:Number,Vol<:Volume{T}} <: VectorBasis{T,Vol}

Basis of QG vector field (Gerick et al., 2020), so that $\mathbf{u}=\nabla(h^3x^ny^m)\times\nabla(z/h)$.

source
Mire.QGIMBasisType
QGIMBasis{T<:Number,Vol<:Sphere{T}} <: VectorBasis{T,Vol}

Basis of complex QG inertial modes (Maffei et al., 2017). This basis is orthonormal.

source
Mire.QGRIMBasisType
QGRIMBasis{T<:Number,Vol<:Sphere{T}} <: VectorBasis{T,Vol}

Real basis similar to the QG inertial modes (Maffei et al., 2017). They are not the solutions to the QG inertial mode equation and they are not orthogonal.

source
Mire.ConductingMFBasisType
ConductingMFBasis{T<:Number,Vol<:Volume{T}} <: VectorBasis{T,Vol}

Basis of 3-D magnetic field, so that $\mathbf{B}\cdot\mathbf{n} = 0$ at $\partial\mathcal{V}$ and $\nabla\cdot\mathbf{B} = 0$ after Lebovitz (1989). It is exactly the same as LebovitzBasis.

source
Mire.InsulatingMFBasisType

InsulatingMFBasis{T<:Number,Vol<:Sphere{T}} <: VectorBasis{T,Vol}

Basis of insulating magnetic fields following Gerick et al. (2021). For now, only for Vol<:Sphere{T}, i.e. in a spherical domain.

source

Setting up the problem

Mire.HDProblemType
HDProblem{T<:Number,Vol<:Volume{T}} <: MireProblem{T, Vol}

Defines hydrodynamic problem.

Example:

N = 5
Ω = [0,0,1.0]
V = Ellipsoid(1.1,1.0,0.9)
problem = HDProblem(N,V,Ω,LebovitzBasis)
source
Mire.MHDProblemType
MHDProblem{T<:Number,Vol<:Volume{T}} <: MireProblem{T,Vol}

Defines magnetohydrodynamic problem.

Example for a hybrid QG model with 3-D magnetic field with conducting boundary condition and QG velocities:

N = 5
Ω = [0,0,1.0]
a,b,c = 1.1,1.0,0.9
V = Ellipsoid(a,b,c)
B0 = [-y/b^2,x/a^2,0] #Malkus field
problem = MHDProblem(N,V,Ω,B0,QGBasis,ConductingMFBasis)
source
Mire.assemble!Function
assemble!(P::HDProblem{T,V}; threads=false, verbose=false, kwargs...) where {T,V}

Assembles the matrices P.LHS and P.RHS, i.e. projecting the velocity basis P.vbasis on the inertial acceleration and Coriolis force.

source
assemble!(P::MHDProblem{T,V}) where {T,V}

Assembles the matrices P.LHS and P.RHS, i.e. projecting the velocity and magnetic field bases on the inertial acceleration, Coriolis force, Lorentz force and mgnetic advection.

source

Low level functions

Functions for low level control of the problem.

Mire.projectforceFunction
projectforce(vs_i, vs_j, cmat, forcefun, args...; kwargs...)

Project basis vs_i onto the forcing forcefun(vs_j, args...) using precached monomials in cmat.

source
Mire.projectforce!Function
projectforce!(i0, j0, itemps, jtemps, valtemps, cmat, vs_i, vs_j, forcefun, args...; verbose=false, thresh=10eps())

Project basis vs_i onto the forcing forcefun(vs_j, args...). Pushes indices and values of non-zero entries into the itemps,jtemps and valtems arrays. i0 and j0 are the origin of indices (useful for combining multiple equations, should be 0 to have no shift in indices). See projectforce to construct a sparse array from the indices and values.

source
Mire.projectforcet!Function
projectforcet!(args...)

Multithreaded version of projectforce!. Input has to be adapted to number of threads!

source
Mire.inner_productFunction
inner_product(u, v, cmat)

Inner product in an ellipsoidal volume $\int \mathbf{u}\cdot \mathbf{v} dV$, using precached monomial integrations in cmat.

source
inner_product(u, v, a, b, c)

Inner product in an ellipsoidal volume $\int \mathbf{u}\cdot \mathbf{v} dV$.

Missing factor

The factor $\pi$ is removed in the integration to be able to use exact integration using Rational. Remember to reintroduce it when the actual value of the integration is needed!

source