Thank you Daniel.

在2022年9月26日星期一 UTC+8 20:42:54<d.arnd...@gmail.com> 写道:

> cell_worker and copier are lambda functions. You can think of them as 
> in-place structs with a call operator (operator()) with the specified 
> signature. We define a new cell_worker object because the place we are 
> passing it into expects the object to have a call operator that does what 
> this->cell_worker implements.
>
> Best,
> Daniel
>
> On Sun, Sep 25, 2022 at 11:02 PM 'yy.wayne' via deal.II User Group <
> dea...@googlegroups.com> wrote:
>
>> In step16 function assemble_system() and assemble_multigrid(), there are 
>> 2 variables/functions defined as:
>> auto cell_worker =   
>>     [&](const typename DoFHandler<dim>::active_cell_iterator &cell, 
>>         ScratchData<dim> & scratch_data, 
>>         CopyData & copy_data) 
>>        { this->cell_worker(cell, scratch_data, copy_data); }; 
>> auto copier = 
>>     [&](const CopyData &cd) 
>>        { this->constraints.distribute_local_to_global(cd.cell_matrix,
>>                                                                           
>>              cd.cell_rhs, 
>>                                                                           
>>              cd.local_dof_indices, 
>>                                                                           
>>              system_matrix, system_rhs); };
>> I'm not expert in C++ and these codes seem confusing to me. Are 
>> *cell_worker* and *copier* defined here variables or functions? And why 
>> we define a new cell_worker here (is it because we cannot directly pass 
>> this->cell_worker to MeshWorker::mesh_loop) ? Sorry it might be silly. 
>> Should I know the terminology for this "technique" I can google myself.
>> Thank you.
>>
>> -- 
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/c284ce35-13ec-4afd-8ef3-5fdde8fd68can%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/dealii/c284ce35-13ec-4afd-8ef3-5fdde8fd68can%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/360f2ab1-1faa-4386-908e-dd37fbfee07bn%40googlegroups.com.

Reply via email to