Hi there,
I've been playing with mesh refinement and solution transfer with the Raviart-Thomas field, but found a very strange thing: in areas where the mesh is coarsened, the solution becomes wrong.
In a very simple 2D test, I first created a uniform RT field, i.e. (1, 0), with the help of `VectorTools::interpolate`, and then tried to refine the left half of a square domain, while coarsening the rest. Of course, I also tried to transfer the solution onto the new mesh. This function `refine_mesh` is as follows.
```
template <int dim>
void
TestProblem<dim>::refine_mesh()
{
unsigned int cell_no = 0;
for (const auto &cell : dof_handler.active_cell_iterators())
{
Point<dim> center = cell->center();
if (center[0]<0.5)
{
cell->set_refine_flag();
}
else
{
cell->set_coarsen_flag();
}
}
SolutionTransfer<dim> solution_trans(dof_handler);
Vector<double> previous_solution;
previous_solution = solution;
triangulation.prepare_coarsening_and_refinement();
solution_trans.prepare_for_coarsening_and_refinement(previous_solution);
triangulation.execute_coarsening_and_refinement();
setup_dofs();
solution_trans.interpolate(previous_solution, solution);
constraints.distribute(solution);
}
```
As you can see in the attached plot, however, the transferred solution in the coarsened area is wrong but OK in the refined part. I'm not sure what goes wrong here in my code and would very much appreciate it if you could give me a hint. A minimal but complete code to reproduce this plot is also attached.
Thanks.
Charlie