Dear Jaekwang,

Step-31 <https://www.dealii.org/8.4.1/doxygen/deal.II/step_31.html> 
demonstrates 
how to use the SolutionTransfer class with BlockVectors. In short, you need 
to specify the vector type as a template argument to the class. Here's how 
its done in that tutorial:

SolutionTransfer<dim,TrilinosWrappers::MPI::Vector> 
<https://www.dealii.org/8.4.1/doxygen/deal.II/classSolutionTransfer.html>
temperature_trans(temperature_dof_handler); // non-block vector
SolutionTransfer<dim,TrilinosWrappers::MPI::BlockVector> 
<https://www.dealii.org/8.4.1/doxygen/deal.II/classSolutionTransfer.html>
stokes_trans(stokes_dof_handler); // block vector
triangulation.prepare_coarsening_and_refinement 
<https://www.dealii.org/8.4.1/doxygen/deal.II/classTriangulation.html#ab9fa3177e0e43ab0cf243215d284a35a>
();
temperature_trans.prepare_for_coarsening_and_refinement(x_temperature);
stokes_trans.prepare_for_coarsening_and_refinement(x_stokes);

I hope this helps,
Jean-Paul

On Tuesday, March 21, 2017 at 12:26:59 AM UTC+1, Jaekwang Kim wrote:
>
> Dear, Dr. Bangerth
>
> Adding up to this, may I ask you one more question?
>
> After this,,, I was trying to transfer my block vector solution through 
> Solutiontransfer class. but I am having difficulty in this. 
>
> For example, I have fluid problem vector value solution (u_x, u_y, 
> pressure)
>
> at refie_mesh function, I tried...
>
>     template <int dim>
>
>     void
>
>     StokesProblem<dim>::refine_mesh () //AMR based on VELOCITY GRADIENT
>
>     {
>
>
>          const FEValuesExtractors::Vector velocities (0);
>
>             
>
>          Vector<float> estimated_error_per_cell 
> (triangulation.n_active_cells());
>
>         
>
>          KellyErrorEstimator<dim>::estimate (dof_handler,QGauss<dim-1
> >(degree+1),typename FunctionMap<dim>::type(),
>
>          solution,estimated_error_per_cell, fe.component_mask(velocities));
>
>          
>
>          GridRefinement::refine_and_coarsen_fixed_number 
> (triangulation,estimated_error_per_cell,0.3, 0.0);
>
>                 
>
>         triangulation.prepare_coarsening_and_refinement ();
>
>        
>
>         SolutionTransfer<dim> solution_transfer(dof_handler); *// Here 
> my doc hander might include all (u,v,p) solution *
>
>
>
>
>
> After this I reinitialized my previous solution, where my current solution 
> will be interpolated, for newly refined dof_handler. 
>
> And When I tried to transfer my solution.... 
>
>
>         
> solution_transfer.prepare_for_coarsening_and_refinement(solution.block(0
> ));
>
>         *//since this function only takes vector type inputs... I assume 
> that I cannot transfer whole solution (u,v,p) at once? *
>
>         
>
>         triangulation.execute_coarsening_and_refinement();
>
>         
>
>         
>
>         //Transfer solution
>
>         solution_transfer.interpolate(solution.block(0), 
> previous_solution.block(0));
>
>         
>
>         
> solution_transfer.prepare_for_coarsening_and_refinement(solution.block(1
> ));
>
>         
>
>         solution_transfer.interpolate(solution.block(1), 
> previous_solution.block(1));
>
>
> but I run into this error. 
> I think it is because there two lines are conflicting....  because they 
> don't have same number of dof_handler...
>
> 1. SolutionTransfer<dim> solution_transfer(dof_handler);
>
> 2. solution_transfer.prepare_for_coarsening_and_refinement(solution.block(
> 0));
>
> will there be other easy way I can transfer vector-valued solution without 
> having this difficulty? 
>
> I always appreciate your help !
>
> Thanks
>
> Jaekwang Kim 
>
> *An error occurred in line <253> of file 
> </Users/kimjaekwang/dealii-8.4.1/source/numerics/solution_transfer.cc> in 
> function*
>
> *    void dealii::SolutionTransfer<2, dealii::Vector<double>, 
> dealii::DoFHandler<2, 2> >::prepare_for_coarsening_and_refinement(const 
> std::vector<VectorType> &) [dim = 2, VectorType = dealii::Vector<double>, 
> DoFHandlerType = dealii::DoFHandler<2, 2>]*
>
> *The violated condition was: *
>
> *    all_in[i].size()==n_dofs_old*
>
> *The name and call sequence of the exception was:*
>
> *    ExcDimensionMismatch(all_in[i].size(),n_dofs_old)*
>
> *Additional Information: *
>
> *Dimension 238 not equal to 274*
>
>
>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to