From 8f2843a01fbd8aeed892b917e5f4db7832167b33 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Sat, 21 Sep 2024 14:18:16 +0100 Subject: [PATCH] Add a few comments to 1D ODE solver tests --- moment_kinetics/test/calculus_tests.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/moment_kinetics/test/calculus_tests.jl b/moment_kinetics/test/calculus_tests.jl index 5ae798d5f..23a77e71a 100644 --- a/moment_kinetics/test/calculus_tests.jl +++ b/moment_kinetics/test/calculus_tests.jl @@ -1651,13 +1651,15 @@ function runtests() element_spacing_option=element_spacing_option, collision_operator_dim=false) expected_f = @. exp(-x.grid^2) - d2f = @. 4.0*(x.grid^2 - 1.0)*exp(-x.grid^2) + # Test solver for + # Laplacian_f = 1/x * d/dx(x*df/dx) + Laplacian_f = @. 4.0*(x.grid^2 - 1.0)*exp(-x.grid^2) # create array for the numerical solution f = similar(expected_f) # create array for RHS vector b b = similar(expected_f) # solve for f - mul!(b,spectral.mass_matrix,d2f) + mul!(b,spectral.mass_matrix,Laplacian_f) # Dirichlet zero BC at upper endpoint b[end] = 0.0 # solve ODE @@ -1742,6 +1744,8 @@ function runtests() element_spacing_option=element_spacing_option, collision_operator_dim=false) expected_f = @. exp(-x.grid^2) + # Test solver for + # d2f = d^2f/dx^2 d2f = @. (4.0*x.grid^2 - 2.0)*exp(-x.grid^2) # create array for the numerical solution f = similar(expected_f) @@ -1836,6 +1840,8 @@ function runtests() element_spacing_option=element_spacing_option, collision_operator_dim=false) expected_f = @. sin((2.0*pi*x.grid/x.L) + phase) + # Test solver for + # d2f = d^2f/dx^2 d2f = @. -((2.0*pi/x.L)^2)*sin((2.0*pi*x.grid/x.L)+phase) # create array for the numerical solution f = similar(expected_f)