Closed dlg0 closed 4 years ago
The "nodes" is generated from file "matrix_plot_D.m". On line 26, we are using Gaussian quadrature (non-uniform points) and on the first and last cells we include left and right boundary points. If we want to use uniform points we can do:
[quad_x_interior_element,quad_w] = linspace(-1,1,Num_Pts_Plot); or [quad_x_interior_element,quad_w] = linspace(-1+delta,1-delta,Num_Pts_Plot);
The first one will generate the same points but with different function values for DG and will show wiggling. The second one will move the cell boundary a little bit (depending on the value of delta), and thus deal with the wiggling plot.
If we have the function values at quadrature points, perhaps we can use interpolation to evaluate the function on another set of uniform points. The whole process may be viewed as a matrix-vector multiply. Maybe something like f_uniform = T f_gaussian, if T is square and well conditioned, perhaps inv(T) f_uniform = f_gaussian. Would this help? Just a thought.
@MollyRaver There seems to be a challenge here that if we want a uniform sampling AND to include the boundary points, then we MUST sample at the interior element boundaries - which means dual values at the interior element boundaries?
Is there a "correct" way to average together the dual values at the element boundaries?
I have pushed an update to reference
which provided for an 'uniform_output',true
option which gives the realspace output on a uniform grid. However, it "solves" the dual value at interior element boundary problem by simply picking the left element. For values of deg >=3 this has no practical issues, but below that things look strange as expected.
Could you please comment on the code and let me reproduce the plotting? I tried with advection equation, and deg = 1 or 2 look ok to me. @dlg0
OK, this is all good. Closing.
@MollyRaver
The
nodes
variable, say for running the following (with a stop at line 101 ofasgard.m
) ...you will see non-uniform grid spacing (beyond just the end points). So this has be somewhat confused. Any thoughts on this?