Problem using WorkStream with a hp::DoFHandler

62 views
Skip to first unread message

Claire

unread,
Jul 26, 2016, 10:54:46 AM7/26/16
to deal.II User Group
Dear all,

First of all I would like to thank all the deal.II developers and the community who helped created it and keep it alive.
The more I get into it the more I am impress by its high quality and completeness.

The issue that I am currently facing is that I am trying to implement multithreading using the WorkStream functionalities.
I use for that the Step 9 tutorial.
I have very similar Copy and Scratch data structures and use the suggested path " assemble_local(ScratchData, CopyData) -> copy_local_to_global(CopyData) -> assemble_system() "
The major difference between my program and the Step 9 one is that I use a hp::DoFHandler instead of a DoFHandler.

When compiling I get some errors that I was unable to understand well and fix so far.
They come from the WorkStream::run method.
Please find attached its implementation and the errors that I get.
It seems that the problem comes from the iterator, the compiler has trouble determining which type to use.

I am using the latest released version of the library (v8.4.1)

I hope that I provide enough information. I case anyone needs more details, please feel free to ask.

Thank you very much by advance for all the help or suggestions that I may receive.

Best,

Claire
assemble_system.cc
compilation_errors.txt

Bruno Turcksin

unread,
Jul 26, 2016, 1:15:39 PM7/26/16
to deal.II User Group
Claire,

this looks to be the problem:
/home/claire/Logiciels/deal.II/deal.II-v8.4.1/include/deal.II/base/work_stream.h:1230:3: note:   template argument deduction/substitution failed:
/home/claire/Logiciels/deal.II/deal.II-v8.4.1/Doctorat/slm_v18/slm_v18.cc:1031:17: note:   deduced conflicting types for parameter ‘const Iterator’ (‘dealii::TriaActiveIterator<dealii::DoFCellAccessor<dealii::hp::DoFHandler<3, 3>, false> >’ and ‘dealii::hp::DoFHandler<3, 3>::cell_iterator {aka dealii::TriaIterator<dealii::DoFCellAccessor<dealii::hp::DoFHandler<3, 3>, false> >}’)
  WorkStream::run(dof_handler.begin_active()

can you try something like:
typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(), end_cell = dof_handler.end();
WorkStream::run(cell, end_cell, ...)

This should help your compiler deducing the templated parameters.

Best,

Bruno

Wolfgang Bangerth

unread,
Jul 26, 2016, 5:56:02 PM7/26/16
to dea...@googlegroups.com
On 07/26/2016 08:54 AM, Claire wrote:
>
> I hope that I provide enough information.

Bruno suggestion was a good guess, but not the cause. The real cause is that
your local assemble function takes the following arguments:
const cell_iterator&,
Assembly::ScratchData<3>&,
Assembly::CopyData&
But, because you only work on active cells, the compiler is confused that you
are saying in the first call to WorkStream::run() that you want to use active
iterators, but that the local assembly function takes a (not necessarily
active) iterator argument.

Change the first argument of the local assembly function to
active_cell_iterator and it should all work.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Claire

unread,
Jul 27, 2016, 3:37:37 AM7/27/16
to deal.II User Group
Thank to both of you for your time and answers.

Pr. Bangerth's solution works perfectly  (although I guess I could and should have figured it out by myself...)

Best,

Claire
Reply all
Reply to author
Forward
0 new messages