VectorSpin types and functions

VectorSpin.BSplineAdvectionType
struct BSplineAdvection{T} <: VectorSpin.AbstractAdvection

Advection to be computed on each row

  • mesh::Mesh

  • dims::Symbol

  • p::Int64

  • step::Any

  • modes::Vector

  • eig_bspl::Vector

  • eigalpha::Array{Complex{T}, 1} where T

  • fhat::Array{Complex{T}, 2} where T

source
VectorSpin.MeshType
struct Mesh{T}

Mesh type to store domain parameters

  • nv::Int64: Number of points in v

  • nx::Int64: Number of points in x

  • vmin::Any: Domain size v ∈ ]vmin,vmax[

  • vmax::Any: Domain size v ∈ ]vmin,vmax[

  • xmin::Any: Domain size x ∈ [xmin,xmax]

  • xmax::Any: Domain size x ∈ [xmin,xmax]

  • kx::Vector: Wave number vector to compute derivative with FFTs

  • dx::Any: Size step along x

  • dv::Any: Size step along v

  • x::Vector: points along x direction

  • v::Vector: points along v direction

  • vnode::Vector: center points along v direction

source
VectorSpin.advection!Method
advection!(df, adv, v, dt)

interpolate df(x + delta) with Parabolic Spline Method (PSM)

We consider a linear advection problem in $p$ direction

\[\frac{\partial f}{\partial t} + a \frac{\partial f}{\partial x} =0.\]

From the conservation of the volume, we have the following identity

\[f_{j,\ell}(t)=\frac{1}{\Delta p} \int_{p_{\ell-1/2}} ^{p_{\ell+1/2}} f(x_j,p,t)\mathrm{d}{p} =\frac{1}{\Delta p} \int_{p_{\ell-1/2}-at} ^{p_{\ell+1/2}-at} f(x_j,p,0)\mathrm{d}{p}.\]

For simplicity, denote by $q\in [1, M]$ the index such that $p_{\ell+1/2}-at \in [p_{q-1/2},p_{q+1/2}]$ i.e. $p_{\ell+1/2}-at \in C_q$, then we have

\[f_{j,\ell}(t) =\frac{1}{\Delta p} \int_{p_{q-1/2}-at} ^{p_{q-1/2}} f(x_j,p,0)\mathrm{d}{p}+f_{j,q}(0)-\frac{1}{\Delta p} \int_{p_{q+1/2}} ^{p_{q+1/2}-at} f(x_j,p,0)\mathrm{d}{p}.\]

Here we need to reconstruct a polynomial function $f(x_j,p,0)$ using the averages $f_{j,l}(0)$ using the PSM approach.

source
VectorSpin.bf_energyFunction
bf_energy(f1, f2, f3, S1, S2, S3, mesh, tiK)
bf_energy(f1, f2, f3, S1, S2, S3, mesh, tiK, n_i)
bf_energy(f1, f2, f3, S1, S2, S3, mesh, tiK, n_i, mub)
source
VectorSpin.bsplineMethod
bspline(p, j, x)

Return the value at x in [0,1] of the B-spline with integer nodes of degree p with support starting at j. Implemented recursively using the De Boor's Algorithm

\[B_{i,0}(x) := \left\{ \begin{matrix} 1 & \mathrm{if} \quad t_i ≤ x < t_{i+1} \\ 0 & \mathrm{otherwise} \end{matrix} \right.\]

\[B_{i,p}(x) := \frac{x - t_i}{t_{i+p} - t_i} B_{i,p-1}(x) + \frac{t_{i+p+1} - x}{t_{i+p+1} - t_{i+1}} B_{i+1,p-1}(x).\]

source
VectorSpin.s_energyFunction
s_energy(S1, S2, S3, mesh)
s_energy(S1, S2, S3, mesh, mub)
s_energy(S1, S2, S3, mesh, mub, n_i)

\[\]

source
VectorSpin.step!Method
step!(op, f0, f1, f2, f3, E2, E3, A2, A3, dt)

\[\begin{aligned} \dot{p} = (A_y, A_z) \cdot \partial_x (A_y, A_z) \\ \dot{Ey} = -\partial_x^2 A_y + A_y \rho \\ \dot{Ez} = -\partial_x^2 A_z + A_z \rho \\ \end{aligned}\]

documentation

source
VectorSpin.step!Method
step!(op, f0, f1, f2, f3, E1, E2, E3, A2, A3, dt)

compute the first subsystem He()

\[f_t - Ef_v = 0\]

source
VectorSpin.step!Method
step!(op, f0, f1, f2, f3, E1, dt)

subsystem for Hv:

\[f_t + vf_x = 0\]

\[-E_x = \rho - 1\]

source