preCICE v3.1.2
Loading...
Searching...
No Matches
PythonAction.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef PRECICE_NO_PYTHON
3
4#include <string>
5#include "action/Action.hpp"
6#include "logging/Logger.hpp"
8
9struct _object;
10using PyObject = _object;
11
12namespace precice::action {
13
15class PythonAction : public Action {
16public:
18 Timing timing,
19 std::string modulePath,
20 std::string moduleName,
21 const mesh::PtrMesh &mesh,
22 int targetDataID,
23 int sourceDataID);
24
25 virtual ~PythonAction();
26
27 virtual void performAction() final override;
28
29private:
30 logging::Logger _log{"action::PythonAction"};
31
33
35
37
39
41
42 bool _isInitialized = false;
43
45
46 PyObject *_module = nullptr;
47
49
51
53
54 void initialize();
55
57};
58
59} // namespace precice::action
60
61#endif
_object PyObject
Abstract base class for configurable actions on data and/or meshes.
Definition Action.hpp:14
Timing
Defines the time and place of application of the action.
Definition Action.hpp:17
virtual void performAction() final override
Performs the action, to be overwritten by subclasses.
This class provides a lightweight logger.
Definition Logger.hpp:16
contains actions to modify exchanged data.
Definition Action.hpp:6