-
Notifications
You must be signed in to change notification settings - Fork 20
Example Execution
Build ASGarD with -DASGARD_USE_MATLAB=ON
or no output will be displayed!
- 1D Diffusion equation https://github.com/project-asgard/asgard/blob/develop/src/pde/pde_diffusion1.hpp
Example PDE using the 1D Diffusion Equation with a manufactured solution.
PDE:
Analytic solution:
First, run ASGarD selecting the diffusion_1 PDE, implicit time advance, 1 time step, and real-space output every 1 time step.
./asgard -p diffusion_1 -i -n 1 --plot_freq 1
This matches the analytic solution at t=0.
Next, run for 1000 time-steps. After each calculation the figure will be updated.
./asgard -p diffusion_1 -i -n 1000 --plot_freq 10
The final figure shows
Lastly, let's increase the precision of this calculation. Increasing the number of legendre basis polynomials (-d
) and the starting (-l
)
and maximum (-m
) hierarchical levels (resolution) results in a denser grid.
./asgard -p diffusion_1 -n 1 -d 3 -l 4 -m 4 --plot_freq 1
./asgard -p diffusion_1 -n 1000 -d 3 -l 4 -m 4 --plot_freq 10
Lastly, let's enable adaptivity with the --adapt
option and set --thresh 1e-4
.
./asgard -p diffusion_1 -n 1 -d 3 -l 5 -m 10 --adapt --thresh 1e-4 --plot_freq 1
The refined grid contains 12 elems or 36 DOF. Compared with the full grid solution
./asgard -p diffusion_1 -n 1 -d 3 -l 5 -m 10 -f --plot_freq 1
DOF / FG DOF = 36/96 = 0.375
-
2D Continuity Equation
-
the plotted result may be transposed. See issue #675
Consider the continuity equation in two dimensions
with analytic solution
Note that this solution is a function in
Use the -p continuity_2
option to select the 2D continuity equation. Let's start with a higher precision calculation. Notice that in 2 dimensions and the starting (-l
) hierarchical levels (resolution) takes a string containing two values.
First, start with -n 1
to get the initial values at t=0.
./asgard -p continuity_2 -n 1 -d 3 -l "4 4" -m 4 --plot_freq 1
Note we are in agreement with of analytic solution of 0.
Next, we run for 627 time steps, which should display the greatest amplitude.
./asgard -p continuity_2 -n 627 -d 3 -l "4 4" -m 4 --plot_freq 1
The slices are slightly offset from 0. At
Comparing sparse grid and full grid (-f
) solutions, we observe 432 vs 2304 degrees of freedom. The relative difference between the numeric and analytic solution is 1.055% and 0.065%, respectively.
- 6D Continuity Equation
$f = f(x,y,z,v_x,v_y,v_z)$ where
and
This can be solved for 60 timesteps, degree 3 with the following command-line arguments
./asgard -p continuity_6 -n 60 -d 3
The corresponding full-grid calculation can be solved with the following command-line arguments
./asgard -p continuity_6 -n 60 -d 3 -f
Comparing sparse and full grid solutions, we use 24786 and 2985984 DOF. The relative difference between the numeric andanalytic solution is 0.159% and 0.003%, respectively.
-
Vlasov Problem
-
this currently fails to converge with
KRON_MODE_GLOBAL=ON
-
the plotted result may be transposed. See issue #675
We now solve the Sod Shock Tube example of the Vlasov-Lenard-Bernstein Equation
where
./asgard -p vlasov -d 3 -l "6 5" -x -t 8e-4 -n 125 -m 6 --kron-mode dense --wave_freq 25 --inner_it 50 --tol 1e-6 --adapt --max_adapt_levels "6 5" --thresh 1e-4