-
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
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 4"
The slices are slightly offset from 0. At
432 DOF Relative difference (numeric-analytic) [wavelet]: 1.05497 %
2304 DOF Relative difference (numeric-analytic) [wavelet]: 0.0653147 %
- 6D Continuity Equation
$f = f(x,y,z,v_x,v_y,v_z)$ where
./asgard -p continuity_6 -n 60 -d 3
degrees of freedom: 24786 Relative difference (numeric-analytic) [wavelet]: 0.158717 %
./asgard -p continuity_6 -n 60 -d 3 -f
degrees of freedom: 2985984 Relative difference (numeric-analytic) [wavelet]: 0.00313217 %
- Vlasov Problem
We now solve the Sod Shock Tube example of the Vlasov-Lenard-Bernstein Equation
where