chombo-discharge
Loading...
Searching...
No Matches
CD_OpenMP.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_OPENMP_H
14#define CD_OPENMP_H
15
16// Chombo includes
17#include <IntVectSet.H>
18#include <List.H>
19
20// Our includes
21#include <CD_NamespaceHeader.H>
22
23#ifdef _OPENMP
24
25// Thread-safe reduction operator for taking the union of IntVectSet
26inline void
28{
29 ivsInOut |= ivsIn;
30}
31#pragma omp declare reduction(+ : IntVectSet : ThreadSafeIVSUnion(omp_out, omp_in))
32
33// Thread-safe catenation for a particle list.
34template <typename P>
35inline void
37{
38 particlesOut.catenate(particlesIn);
39}
40
41// Thread-safe join for a particle list.
42template <typename P>
43inline void
45{
47}
48
49// Thread-safe minimum of pair<Real, RealVect>.
50inline void
52{
53 ompOut = (ompIn.first < ompOut.first) ? ompIn : ompOut;
54}
55#pragma omp declare reduction(pairmin : std::pair<Real, RealVect> : ThreadSafePairMin(omp_out, omp_in)) \
56 initializer(omp_priv = omp_orig)
57
58// Thread-safe maximum of pair<Real, RealVect>.
59inline void
61{
62 ompOut = (ompIn.first > ompOut.first) ? ompIn : ompOut;
63}
64#pragma omp declare reduction(pairmax : std::pair<Real, RealVect> : ThreadSafePairMax(omp_out, omp_in)) \
65 initializer(omp_priv = omp_orig)
66
67#endif
68
69#include <CD_NamespaceFooter.H>
70
71#endif
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26