On 06/19/2016 04:12 PM, Daniel Shapero wrote:
I'm working on a problem which involves iterating over the DoFHandlers of both
a scalar and a vector field at the same time, similar to step 31
<https://urldefense.proofpoint.com/v2/url?u=https-3A__dealii.org_developer_doxygen_deal.II_step-5F31.html-23BoussinesqFlowProblemassemble-5Fstokes-5Fsystem&d=AwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=bn1clvQAiDQrfAC4yKbN0PlSr7RWRs-U3WJ0zRBB2qM&m=LKWtqGDlr1IIKNzL19q-BeEv113uSM-htWgg0-mfxtg&s=ZhkrkZJVtq3qsxTuL_dfYkgGkRnWYG_k859WMeIjWYQ&e=>.
I'm creating an iterator class which will wrap up the iterators for both the
scalar and vector field into one object using a std::array of
active_cell_iterators. The increment operator is implemented by incrementing
each active_cell_iterator in the array; the dereference operator returns a
reference to the array; etc. I've tested this out and it works fine.
I'd like to be able to parallelize the assembly using WorkStream, which uses
an iterator range. What operations are required of the iterators passed to
WorkStream? From the comments in the source code, it looks like the iterator
must have operator- defined, so I take it that it must be a random-access
iterator
<https://urldefense.proofpoint.com/v2/url?u=http-3A__en.cppreference.com_w_cpp_concept_RandomAccessIterator&d=AwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=bn1clvQAiDQrfAC4yKbN0PlSr7RWRs-U3WJ0zRBB2qM&m=LKWtqGDlr1IIKNzL19q-BeEv113uSM-htWgg0-mfxtg&s=vlOxQjDUZgqn4d-Y5UwVkuANFbQJHZSsP3ooIzECGyc&e=>.
The simple multi-iterator implementation I have now is only a forward
iterator, since that was the bare minimum needed to get things working in
single-threaded mode.
Daniel,
you are looking for the SynchronousIterator class :-)
Cheers
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bange...@math.tamu.edu
www: http://www.math.tamu.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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.