Dear Wolfgang,
Thank you so much for your inputs. Indeed, Step-31 is a good example for what I am looking for. However, I have a follow-up question regarding using the WorkStream class based on TBB during the assembly stage when two different dof_handlers are involved.
To be specific, in Step-31, two different dof_handlers are defined, one for the Stoke sub-problem and the other for the thermal sub-problem. Since the thermal sub-problem depends on the velocity field solved from the Stokes sub-problem, the following is done to ensure that the cell from the two dof_handlers are in sync:
auto cell = stokes_dof_handler.begin_active();
const auto endc = stokes_dof_handler.end();
auto temperature_cell = temperature_dof_handler.begin_active();
for (; cell != endc; ++cell, ++temperature_cell)
{
stokes_fe_values.reinit(cell);
temperature_fe_values.reinit(temperature_cell);
...
}
My question is, is there a way to involve two different dof_handlers when using the WorkStream class, something like the following:
WorkStream::run(
m_dof_handler_mechanical.active_cell_iterators(),
[this](const typename DoFHandler<dim>::active_cell_iterator &cell,
ScratchData_ASM_mechanical & scratch,
PerTaskData_ASM_mechanical & data) {
this->assemble_system_one_cell_mechanical(cell, scratch, data);
},
[this](const PerTaskData_ASM_mechanical &data) {
this->m_constraints_mechanical.distribute_local_to_global(data.m_cell_matrix,
data.m_cell_rhs,
data.m_local_dof_indices,
m_tangent_matrix_mechanical,
m_system_rhs_mechanical);
},
scratch_data,
per_task_data);
Thank you so much!
Best,
Tao