chombo-discharge
Loading...
Searching...
No Matches
CD_OpenMP.H
Go to the documentation of this file.
1/* chombo-discharge
2 * Copyright © 2023 SINTEF Energy Research.
3 * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4 */
5
12#ifndef CD_OpenMP_H
13#define CD_OpenMP_H
14
15// Chombo includes
16#include <IntVectSet.H>
17#include <List.H>
18
19// Our includes
20#include <CD_NamespaceHeader.H>
21
22#ifdef _OPENMP
23
24// Thread-safe reduction operator for taking the union of IntVectSet
25inline void
27{
28 ivsInOut |= ivsIn;
29}
30#pragma omp declare reduction(+ : IntVectSet : ThreadSafeIVSUnion(omp_out, omp_in))
31
32// Thread-safe catenation for a particle list.
33template <typename P>
34inline void
36{
37 particlesOut.catenate(particlesIn);
38}
39
40// Thread-safe join for a particle list.
41template <typename P>
42inline void
44{
46}
47
48// Thread-safe minimum of pair<Real, RealVect>.
49inline void
51{
52 ompOut = (ompIn.first < ompOut.first) ? ompIn : ompOut;
53}
54#pragma omp declare reduction(pairmin : std::pair<Real, RealVect> : ThreadSafePairMin(omp_out, omp_in)) \
55 initializer(omp_priv = omp_orig)
56
57#endif
58
59#include <CD_NamespaceFooter.H>
60
61#endif
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25