I'm pretty new to the DG method and have been writing a 1D code to help me understand the coding aspect. With respect a reference, I've been following these notes https://www3.nd.edu/~zxu2/acms60790S15/DG-general-approach.pdf. Where my confusion is comes from how to define the computational cells. In the notes the author defines
$$ x_{i} = 0.5(x_{i-1/2} + x_{i+1/2})\\ I_{i} = [x_{i-1/2},x_{i+1/2}]. $$
From a practical point of view, I am defining my mesh as follows
do i=1,ne
x_r(i) = a + (i+0.5)*dx
x_l(i) = a + (i-0.5)*dx
x_c(i) = 0.5*(x_r(i) + x_l(i))
end do
As a note, a refers to the left side of the domain, i.e. [a,b]. $x_{i+1/2}$ is x_r and $x_{i-1/2}$ is x_l. So my question is whether or not that is how I am supposed to define the left and right grid points. I know that in structured finite volume methods, thats how you calculate the grid points at the half points (faces). Thanks!
x_c(i) = a + i * dx
. $\endgroup$