artifacts in solution gradients after local grid refinement
When plotting the solution after the grid has been locally refined, I find partly structured artifacts appearing in the gradients of the solution. After another time step, they disappear. Since our model has diffusive dynamics, I cannot tell if these artifacts are simply a flawed visualization or if there is some kind of assembly error occuring which actually influences the computation of the next time step. Here's a picture:
For plotting the solution in different parameterizations, we use usual grid functions. For plotting the flux, we use a modified version of the PDELab::DiscreteGridFunctionGradient
. These functions are each set up and plugged into a VTKGridFunctionAdapter
and added to the VTKWriter
before the entire simulation. When we write the solution, we just call the writer. See util_vtk_adapters.hh for our grid function implementations. We plot constant values per cell, i.e. adding the adapters via addCellData
.
We are using UG grid with Pk or QkDG Finite Element Maps in orders 1 - 3. The artifacts can be found in all cases. Our algorithm has the steps
- assemble GFS
- set up grid operators
- compute time step
- adapt grid
- set up grid operators again
- write solution
- repeat from 3.
This is the output of an exemplary simulation (UG grid in two dimensions, QkDG elements in 1st order). Between time step 22 and 23, adaptation occurs and artifacts appear in the gradients (and every component of them). After time step 24, they have disappeared.
flux_error-00022.vtuflux_error-00023.vtuflux_error-00024.vtu
Additionally, there are random flux spikes appearing for FEM order 3: flux_error_3-00004.vtuflux_error_3-00003.vtu