chombo-discharge
CD_BoxLoops.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_BoxLoops_H
13 #define CD_BoxLoops_H
14 
15 // Chombo includes
16 #include <Box.H>
17 #include <IntVectSet.H>
18 #include <DenseIntVectSet.H>
19 #include <VoFIterator.H>
20 #include <FaceIterator.H>
21 #include <Vector.H>
22 
23 // Our includes
24 #include <CD_Decorations.H>
25 #include <CD_NamespaceHeader.H>
26 
30 namespace BoxLoops {
31 
40  template <typename Functor>
41  ALWAYS_INLINE void
42  loop(const Box& a_computeBox, Functor&& kernel, const IntVect& a_stride = IntVect::Unit);
43 
49  template <typename Functor>
50  ALWAYS_INLINE void
51  loop(const IntVectSet& a_ivs, Functor&& a_kernel);
52 
58  template <typename Functor>
59  ALWAYS_INLINE void
60  loop(const DenseIntVectSet& a_ivs, Functor&& a_kernel);
61 
67  template <typename Functor>
68  ALWAYS_INLINE void
69  loop(VoFIterator& a_iter, Functor&& a_kernel);
70 
76  template <typename Functor>
77  ALWAYS_INLINE void
78  loop(FaceIterator& a_iter, Functor&& a_kernel);
79 
85  template <typename T, typename Functor>
86  ALWAYS_INLINE void
87  loop(const Vector<T>& a_subset, Functor&& a_kernel);
88 } // namespace BoxLoops
89 
90 #include <CD_NamespaceFooter.H>
91 
92 #include <CD_BoxLoopsImplem.H>
93 
94 #endif
Implementation of CD_BoxLoops.H.
Namespace for encapsulating loop types.
Definition: CD_BoxLoops.H:30
ALWAYS_INLINE void loop(const Box &a_computeBox, Functor &&kernel, const IntVect &a_stride=IntVect::Unit)
Launch a C++ kernel over a regular grid.
Definition: CD_BoxLoopsImplem.H:20