On 4/15/22 07:58, Giang Huynh wrote:
> ---------------------------------------
> error: no matching function for call to ‘interpolate_to_different_mesh(const
> dealii::DoFHandler<2>&, const dealii::Vector<double>&, const
> dealii::DoFHandler<2>&, const dealii::Vector<double>&)’
> VectorTools::interpolate_to_different_mesh(dof_handler, solution,
> reg_dof_handler,reg_sol);
>
> deal.II-v9.2.0/include/deal.II/numerics/vector_tools_interpolate.h:252:3:
> note: template argument deduction/substitution failed:
> /deal.II-v9.2.0/examples/step-3/step-3.cc:591:93: note: ‘const
> dealii::DoFHandler<2>’ is not derived from ‘const
> dealii::InterGridMap<DoFHandlerType<dim, spacedim> >’
> VectorTools::interpolate_to_different_mesh(dof_handler, solution,
> reg_dof_handler,reg_sol);
>
> ----------------------------------------
> DoFHandler<2> dof_handler, reg_dof_handler;
> Vector<double> solution;
> Vector<double> reg_sol;
> VectorTools::interpolate_to_different_mesh(dof_handler, solution,
> reg_dof_handler,reg_sol);
> ----------------------------------------
Giang -- you need to take a look at the arguments in the function call. The
compiler actually tells you what arguments it wants to see and that you are
not providing: The last argument you pass is a 'const Vector', but the
function you are trying to call requires a non-const vector. You can also see
this from the documentation of the function you are trying to call.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/