Hello,
I am new to deal.II. I want to learn how to solve a very simple convection-diffusion equation using adaptive mesh refinement with deal.II on distributed memory machines. I'd like to distribute all stuffs, including DoFs, matrices, vectors and triangulations. The boundary value function and initial value function of the PDE are known. During each time step, I want to refine/coarsen the mesh multiple times.
I am now stuck in transferring the old solution from the old mesh to the new mesh. In each refinement step, I have the following code
// old_locally_relevant_solution and locally_relevant_solution are two solution vectors for previous time step and current time step.
SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans(dof_handler);
PETScWrappers::MPI::Vector previous_solution = old_locally_relevant_solution;
triangulation.prepare_coarsening_and_refinement();
triangulation.execute_coarsening_and_refinement ();
setup_system();
soltrans.interpolate(previous_solution, old_locally_relevant_solution);
constraints.distribute (old_locally_relevant_solution);
I met a runtime error at the red line. It seems I should use vectors without ghost. But how to do that? Is there a deal.II example close to my problem? I could not find one.
Thank you!
--Junchao Zhang