Hello everyone,
I would like to solve step-33 using DG only, instead of mixed cG and DG discretization.
Attached you will find my modified version of step-33, which of course diverges quickly, thus this post.
Here are the main modifications to the original code:
1) we use DG elements and a generic mapping, i.e.
#include <deal.II/fe/mapping.h>
#include <deal.II/fe/fe_dgq.h>
and in the constructor of the ConservationLaw class
fe (FE_DGQ<dim>(degree), EulerEquations<dim>::n_components)
2) the function setup_system uses the function make_flux_sparsity_pattern (as in step-12) and reads
template <int dim>
void ConservationLaw<dim>::setup_system ()
{
DynamicSparsityPattern dsp(dof_handler.n_dofs());
DoFTools::make_flux_sparsity_pattern (dof_handler, dsp);
sparsity_pattern.copy_from(dsp);
system_matrix.reinit (sparsity_pattern);
}
3) after line 1602 of the original file, I have naively added (I am new to DG) the following lines which should take into account
the fact that in DG the solution is discontinuous also across faces shared by cells at the same refinement level.
else
{
// This is 'normal' face, that is a face between two cells
// at the same refinement level. This term is needed for
// pure DG.
const typename DoFHandler<dim>::cell_iterator
neighbor = cell->neighbor(face_no);
Assert(neighbor->level() == cell->level(),
ExcInternalError());
const unsigned int neighbor_face_no=
cell->neighbor_of_neighbor(face_no);
neighbor->get_dof_indices (dof_indices_neighbor);
fe_v_face.reinit (cell, face_no);
fe_v_face_neighbor.reinit (neighbor, neighbor_face_no);
assemble_face_term (face_no, fe_v_face,
fe_v_face_neighbor,
dof_indices,
dof_indices_neighbor,
false,
numbers::invalid_unsigned_int,
cell->face(face_no)->diameter());
}
4) I have commented out the diffusion stabilization term proportional to h^(eta) which, as far as I know, is not needed for DG.
To keep things as easy as possible I have not changed anything else. Also, the input.prm file is the same.
I am aware that for DG we could use the MeshWorker class but I prefer the current implementation because I find it clearer and I would like to retain the possibility to switch to the mixed cG/DG implementation easily.
So the big questions: what am I missing? Is the discretization correct? if so, which solver should I use?
Thanks a lot!
best
giorgio