AQUAgpusph 4.1.2
Loading...
Searching...
No Matches
Python.h
Go to the documentation of this file.
1/*
2 * This file is part of AQUAgpusph, a free CFD program based on SPH.
3 * Copyright (C) 2012 Jose Luis Cercos Pita <jl.cercos@upm.es>
4 *
5 * AQUAgpusph is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * AQUAgpusph is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with AQUAgpusph. If not, see <http://www.gnu.org/licenses/>.
17 */
18
24#ifndef PYTHON_H_INCLUDED
25#define PYTHON_H_INCLUDED
26
27#include <Python.h>
28#include <CalcServer.h>
29#include <CalcServer/Tool.h>
30
31namespace Aqua {
32namespace CalcServer {
33
44{
45 public:
51 Python(const std::string tool_name,
52 const std::string script,
53 bool once = false);
54
56 ~Python();
57
60 void setup();
61
62 protected:
67 cl_event _execute(const std::vector<cl_event> events);
68
75 void initPython();
76
79 void load();
80
81 private:
83 std::string _script;
84
86 PyObject* _module;
88 PyObject* _func;
89};
90
91}
92} // namespace
93
94#endif // PYTHON_H_INCLUDED
The calculation main entry point. (See Aqua::CalcServer::CalcServer for details)
Python script execution tool. (See Aqua::CalcServer::Python for details)
Tools virtual environment to allow the user to define/manipulate the tools used to carry out the simu...
Execute a Python script.
Definition: Python.h:44
cl_event _execute(const std::vector< cl_event > events)
Definition: Python.cpp:291
void initPython()
Initialize the Python interpreter.
Definition: Python.cpp:320
void load()
Load the script and extract the callable function.
Definition: Python.cpp:351
void setup()
Initialize the tool.
Definition: Python.cpp:279
~Python()
Destructor.
Definition: Python.cpp:268
Tools base class. The way that AQUAgpusph compute each problem is set through a set of tools that are...
Definition: Tool.h:46
Main AQUAgpusph namespace.
Definition: ArgumentsManager.cpp:45