gauss_legendre

moment_kinetics.gauss_legendre.GaussLegendre_derivative_vector!Method

Gauss-Legendre derivative at arbitrary x values, for boundary condition on radau points D0 – the vector xj – the x location where the derivative is evaluated ngrid – number of points in x x – the grid from -1, 1 Note that D0 is not scaled to the physical grid

source
moment_kinetics.gauss_legendre.gausslobattolegendre_differentiation_matrix!Method

Formula for differentiation matrix taken from p196 of Chpt The Spectral Elemtent Method' ofComputational Seismology'. Heiner Igel First Edition. Published in 2017 by Oxford University Press. Or https://doc.nektar.info/tutorials/latest/fundamentals/differentiation/fundamentals-differentiationch2.html

D – differentiation matrix x – Gauss-Legendre-Lobatto points in [-1,1] ngrid – number of points per element (incl. boundary points)

Note that D has does not include a scaling factor

source
moment_kinetics.gauss_legendre.setup_global_strong_form_matrix!Method

A function that assigns the local matrices to a global array QQ_global for later evaluating strong form of required 1D equation.

The 'option' variable is a flag for choosing the type of matrix to be constructed. Currently the function is set up to assemble the elemental matrices without imposing boundary conditions on the first and final rows of the matrix. This means that the operators constructed from this function can only be used for differentiation, and not solving 1D ODEs. The shared points in the element assembly are averaged (instead of simply added) to be consistent with the derivativeelementstofullgrid!() function in calculus.jl.

source
moment_kinetics.gauss_legendre.setup_global_weak_form_matrix!Method

A function that assigns the local weak-form matrices to a global array QQ_global for later solving weak form of required 1D equation.

The 'option' variable is a flag for choosing the type of matrix to be constructed. Currently the function is set up to assemble the elemental matrices without imposing boundary conditions on the first and final rows of the matrix by default. This means that the operators constructed from this function can only be used for differentiation, and not solving 1D ODEs. This assembly function assumes that the coordinate is not distributed. To extend this function to support distributed-memory MPI, addition of off-memory matrix elements to the exterior points would be required.

The typical use of this function is to assemble matrixes M and K in

M * d2f = K * f

where M is the mass matrix and K is the stiffness matrix, and we wish to solve for d2f given f. To solve 1D ODEs

K * f = b = M * d2f

for f given boundary data on f with periodic or dirichlet boundary conditions, set

periodic_bc = true, b[end] = 0

or

dirichlet_bc = true, b[1] = f[1] (except for cylindrical coordinates), b[end] = f[end]

in the function call, and create new matrices for this purpose in the gausslegendre_info struct. Currently the Laplacian matrix is supported with boundary conditions.

source