gauss_legendre
moment_kinetics.gauss_legendre
— Modulemodule for Gauss-Legendre-Lobatto and Gauss-Legendre-Radau spectral element grids
moment_kinetics.gauss_legendre.gausslegendre_base_info
— Typestructs for passing around matrices for taking the derivatives on Gauss-Legendre points in 1D
moment_kinetics.gauss_legendre.GaussLegendre_derivative_vector!
— MethodGauss-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
moment_kinetics.gauss_legendre.GaussLegendre_weak_product_matrix!
— Methodassign abitrary weak inner product matrix Q on a 1D line with Jacobian = 1 matrix Q acts on two vectors x1 and x2 such that the quadratic form y = x1 * Q * x2 is also a vector
moment_kinetics.gauss_legendre.GaussLegendre_weak_product_matrix!
— Methodassign abitrary weak inner product matrix Q on a 1D line with Jacobian = 1 matrix Q acts on a single vector x such that y = Q * x is also a vector
moment_kinetics.gauss_legendre.Legendre_h_n
— Methodresult of the inner product of Legendre polys of order k
moment_kinetics.gauss_legendre.gausslobattolegendre_differentiation_matrix!
— MethodFormula for differentiation matrix taken from p196 of Chpt The Spectral Elemtent Method' of
Computational 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
moment_kinetics.gauss_legendre.gaussradaulegendre_differentiation_matrix!
— MethodFrom https://doc.nektar.info/tutorials/latest/fundamentals/differentiation/fundamentals-differentiationch2.html
D – differentiation matrix x – Gauss-Legendre-Radau points in [-1,1) ngrid – number of points per element (incl. boundary points)
Note that D has does not include a scaling factor
moment_kinetics.gauss_legendre.scaled_gauss_legendre_lobatto_grid
— Methodfunction for setting up the full Gauss-Legendre-Lobatto grid and collocation point weights
moment_kinetics.gauss_legendre.scaled_gauss_legendre_radau_grid
— Methodfunction for setting up the full Gauss-Legendre-Radau grid and collocation point weights see comments of Gauss-Legendre-Lobatto routine above
moment_kinetics.gauss_legendre.setup_global_strong_form_matrix!
— MethodA 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.
moment_kinetics.gauss_legendre.setup_global_weak_form_matrix!
— MethodA 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.