Hi Karthi,

if you work on the same DoFHandler, one SolutionTransfer object is 
sufficient.

There are already member functions that take a container of solutions like 
yours as a parameter. Have a look at 
SolutionTransfer::prepare_for_coarsening_and_refinement 
<https://www.dealii.org/developer/doxygen/deal.II/classSolutionTransfer.html#ae6dc5e5a74b166b0dea35f5a64694e69>
 
and SolutionTransfer::interpolate 
<https://www.dealii.org/developer/doxygen/deal.II/classSolutionTransfer.html#ae067f9b520ed50c86a9ff4c7776d16cb>
.

Best,
Marc

On Saturday, January 23, 2021 at 6:30:34 AM UTC-7 Karthi wrote:

> Dear All,
>
> I have a fourth order parabolic equation, which is split into two second 
> order equations. Hence I solve using components by 
> declaring FESystem<dim>  fe(FE_Q<dim>(degree,2). I have in total three such 
> sub-problems, which are coupled to each other in a semi-implicit manner. 
> Therefore I have a std::vector of solution for the entire system.
>
> std::vector<Vector<double>> solution.
>
> In addition, I am employing mesh adaptivity. After estimating the error 
> using Kelly, I would like to perform a solution transfer from old to new 
> mesh. Do I need to create a std::vector of SolutionTransfer objects; one 
> for each solution?
>
> The below code copied from step-26 seems to work. Is this the correct 
> approach?
>
> std::vector<SolutionTransfer<dim>> solution_trans(3,dof_handler);
>
> std::vector<Vector<double>> previous_solution(num_index);
>
> for(unsigned int i=0; i < num_index; i++){previous_solution[i] = 
> solution[i];}
>
> triangulation.prepare_coarsening_and_refinement();
>
> for(unsigned int i=0; i < num_index; 
> i++){solution_trans[i].prepare_for_coarsening_and_refinement(previous_solution[i]);}
>
> triangulation.execute_coarsening_and_refinement();
>
> setup_system();
>
> for(unsigned int i=0; i < num_index; i++){
>
> solution_trans[i].interpolate(previous_solution[i], solution[i]);
>
> constraints.distribute(solution[i]);}
>
> I look forward to your response. 
>
> Best regards,
>
> Karthi.
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/26b50c8f-90ec-4b34-9f64-2dae588a1cdfn%40googlegroups.com.

Reply via email to