aboutsummaryrefslogtreecommitdiff
path: root/Source/Python/WarpX_py.H
blob: a0392a2033299b871344169407a4843a64c29288 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Copyright 2019 David Grote, Maxence Thevenet, Weiqun Zhang
 *
 *
 * This file is part of WarpX.
 *
 * License: BSD-3-Clause-LBNL
 */
#ifndef WARPX_PY_H_
#define WARPX_PY_H_

#include "WarpXWrappers.H"
#include "Utils/WarpXProfilerWrapper.H"

#include <map>
#include <string>

/**
 * Declare global map to hold python callback functions.
 *
 * The keys of the map describe at what point in the simulation the python
 * functions will be called. Currently supported keys (callback points) are
 * afterinit, beforecollisions, aftercollisions, beforeEsolve, poissonsolver,
 * afterEsolve, beforedeposition, afterdeposition, particlescraper,
 * particleloader, beforestep, afterstep, afterdiagnostics, afterrestart,
 * particleinjection and appliedfields.
*/
extern std::map< std::string, WARPX_CALLBACK_PY_FUNC_0 > warpx_callback_py_map;

/**
 * \brief Function to check if the given name is a key in warpx_callback_py_map
 */
bool IsPythonCallBackInstalled ( std::string name );

/**
 * \brief Function to look for and execute Python callbacks
 */
void ExecutePythonCallback ( std::string name );

#endif