Dear Wolfgang,

Thank you so much for your guidance. Step-35 is the example where  
"SynchronousIterators" is used.

""
    using IteratorTuple =
      std::tuple<typename DoFHandler<dim>::active_cell_iterator,
                 typename DoFHandler<dim>::active_cell_iterator>;
 
    using IteratorPair = SynchronousIterators<IteratorTuple>;

    ...
        WorkStream::run(
          IteratorPair(IteratorTuple(dof_handler_velocity.begin_active(),
                                                        
dof_handler_pressure.begin_active())),
          IteratorPair(IteratorTuple(dof_handler_velocity.end(),
                                                        
dof_handler_pressure.end())),
          *this,
          &NavierStokesProjection<dim>::assemble_one_cell_of_gradient,
          &NavierStokesProjection<dim>::copy_gradient_local_to_global,
          scratch_data,
          per_task_data);

"""

Best,

Tao

On Thursday, April 20, 2023 at 9:22:11 PM UTC-4 Wolfgang Bangerth wrote:

> On 4/20/23 17:27, Tao Jin wrote:
> > 
> > My question is, is there a way to involve two different dof_handlers 
> when 
> > using the WorkStream class, something like the following:
>
> What you are looking for is an object that looks like a *pair* of iterators
> and when you call ++it on it, then it increments both elements of the 
> pair. 
> The class SynchronousIterator does exactly this.
>
> Alternatively, it is possible to convert an iterator into one DoFHandler 
> to an 
> iterator into another DoFHandler, like in
> typename DoFHandler::active_cell_iterator cell_stokes
> = stokes_dof_handler.begin_active();
>
> for (..., ++cell_stokes)
> {
> typename DoFHandler::active_cell_iterator
> cell_T (cell_stokes->get_triangulation(),
> cell_stokes->level(),
> cell_stokes->index(),
> &temperature_dof_handler);
> ...do something with both iterators...
> }
>
> Best
> W.
>
> -- 
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> www: http://www.math.colostate.edu/~bangerth/
>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/0f1c7da6-773c-46e2-8c3a-f1683085f950n%40googlegroups.com.

Reply via email to