dune-assembler 2.12
Loading...
Searching...
No Matches
sequentialexecutor.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
3
4#ifndef DUNE_ASSEMBLER_SEQUENTIAL_EXECUTOR_HH
5#define DUNE_ASSEMBLER_SEQUENTIAL_EXECUTOR_HH
6
7#include <algorithm>
8#include <cstddef>
9#include <vector>
10#include <thread>
11
13
15
16namespace Dune::Assembler {
17
18
19
32{
33
34 struct Context
35 {
36 template <class Range, class CallBack>
37 void forEach (Range&& range, CallBack&& callBack) const
38 {
39 for (auto&& entry : range)
40 callBack(entry);
41 }
42 };
43
44public:
45
46 static constexpr bool isParallel = false;
47
50
51 template <class ThreadImpl>
53 threadImpl(Context());
54 }
55
56};
57
58
59
60} // end namespace Dune::Assembler
61
62#endif // DUNE_ASSEMBLER_SEQUENTIAL_EXECUTOR_HH
Definition localboundaryintersectionmatrixassembler.hh:9
static constexpr IntegralRange< T > range(T from, T to) noexcept
virtual void operator()()=0
A sequential executor.
Definition sequentialexecutor.hh:32
SequentialExecutor()
Definition sequentialexecutor.hh:48
static constexpr bool isParallel
Definition sequentialexecutor.hh:46