Mihai,
> How can I transfer a discrete solution from one grid to another? My two
> grids are fixed - I am reading them from a file, and grid #2 holds my
> discontinuous Galerkin solution u^h. Grid #2 has been obtained through
> refinement and coarsening directly from grid #1. I want to transfer u^h
> back from grid #2 to grid #1. Is there an API function for doing this? I
> came upon static void VectorTools::interpolate, and I am wondering how I
> can set up my "transfer" matrix beforehand such that I successfully do
> the solution transfer.
Do you need the this as a matrix (i.e. for which you know the matrix
entries), or would a function that does the job suffice?
In the latter case, this is what I would do:
std::list<see doc> finest_common_cells
= GridTools::get_finest_common_cells (dof_handler_1,
dof_handler_2);
std::vector<double> local_dof_values (...);
for (cell_pair=finest_common_cells.begin(); ...)
{
cell_pair.first->get_interpolated_function_values
(solution_1, local_dof_values);
cell_pair.first->set_function_values_by_interpolation
(local_dof_values, solution_2);
}
Does this setup make sense?
Best
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.tamu.edu/~bangerth/
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii