aboutsummaryrefslogtreecommitdiff
path: root/Source/Python/WarpX_py.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Python/WarpX_py.H')
-rw-r--r--Source/Python/WarpX_py.H30
1 files changed, 19 insertions, 11 deletions
diff --git a/Source/Python/WarpX_py.H b/Source/Python/WarpX_py.H
index 83fc91f21..a18f9a7f1 100644
--- a/Source/Python/WarpX_py.H
+++ b/Source/Python/WarpX_py.H
@@ -1,40 +1,48 @@
-/* Copyright 2019 David Grote, Maxence Thevenet, Weiqun Zhang
- *
+/* Copyright 2019-2022 The WarpX Community
*
* This file is part of WarpX.
*
+ * Authors: David Grote, Maxence Thevenet, Weiqun Zhang, Roelof Groenewald
+ *
* License: BSD-3-Clause-LBNL
*/
#ifndef WARPX_PY_H_
#define WARPX_PY_H_
-#include "WarpXWrappers.H"
+#include "Utils/export.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, beforeInitEsolve, afterInitEsolve,
- * beforedeposition, afterdeposition, particlescraper,
- * particleloader, beforestep, afterstep, afterdiagnostics, afterrestart,
- * oncheckpointsignal, onbreaksignal, particleinjection and appliedfields.
+ * functions will be called. See ``WarpX/Python/pywarpx/callbacks.py`` for a
+ * list of currently supported callback names.
*/
-extern std::map< std::string, WARPX_CALLBACK_PY_FUNC_0 > warpx_callback_py_map;
+extern WARPX_EXPORT std::map< std::string, std::function<void()> > warpx_callback_py_map;
+
+/**
+ * \brief Function to install the given name and function in warpx_callback_py_map
+ */
+void InstallPythonCallback ( std::string name, std::function<void()> callback );
/**
* \brief Function to check if the given name is a key in warpx_callback_py_map
*/
-bool IsPythonCallBackInstalled ( std::string name );
+bool IsPythonCallbackInstalled ( std::string name );
/**
* \brief Function to look for and execute Python callbacks
*/
void ExecutePythonCallback ( std::string name );
+/**
+ * \brief Function to clear the given callback name from warpx_callback_py_map
+ */
+void ClearPythonCallback ( std::string name );
+
#endif