forked from lammps/lammps
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpython_impl.h
146 lines (99 loc) · 3.68 KB
/
python_impl.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, [email protected]
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_PYTHON_IMPL_H
#define LMP_PYTHON_IMPL_H
#include "lmppython.h"
#include "pointers.h"
namespace LAMMPS_NS {
class PythonImpl : protected Pointers, public PythonInterface {
public:
bool external_interpreter;
PythonImpl(class LAMMPS *);
~PythonImpl();
void command(int, char **);
void invoke_function(int, char *);
int find(const char *);
int variable_match(const char *, const char *, int);
char *long_string(int);
int execute_string(char *);
int execute_file(char *);
bool has_minimum_version(int major, int minor);
private:
int ninput, noutput, length_longstr;
char **istr;
char *ostr, *format;
void *pyMain;
struct PyFunc {
char *name;
int ninput, noutput;
int *itype, *ivarflag;
int *ivalue;
double *dvalue;
char **svalue;
int otype;
char *ovarname;
char *longstr;
int length_longstr;
void *pFunc;
};
PyFunc *pfuncs;
int nfunc;
int create_entry(char *);
void deallocate(int);
};
} // namespace LAMMPS_NS
#endif
/* ERROR/WARNING messages:
E: Could not initialize embedded Python
The main module in Python was not accessible.
E: Invalid python command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Python invoke of undefined function
Cannot invoke a function that has not been previously defined.
E: Python variable does not match Python function
This matching is defined by the python-style variable and the python
command.
E: Could not process Python source command
UNDOCUMENTED
E: Could not open Python file
The specified file of Python code cannot be opened. Check that the
path and name are correct.
E: Could not process Python file
The Python code in the specified file was not run successfully by
Python, probably due to errors in the Python code.
E: Could not process Python string
The Python code in the here string was not run successfully by Python,
probably due to errors in the Python code.
E: Could not find Python function
The provided Python code was run successfully, but it not
define a callable function with the required name.
E: Python function is not callable
The provided Python code was run successfully, but it not
define a callable function with the required name.
E: Could not create Python function arguments
This is an internal Python error, possibly because the number
of inputs to the function is too large.
E: Could not evaluate Python function input variable
Self-explanatory.
E: Unsupported variable type
UNDOCUMENTED
E: Python function evaluation failed
The Python function did not run successfully and/or did not return a
value (if it is supposed to return a value). This is probably due to
some error condition in the function.
E: Python command length keyword cannot be used unless output is a string
UNDOCUMENTED
U: Cannot embed Python when also extending Python with LAMMPS
When running LAMMPS via Python through the LAMMPS library interface
you cannot also user the input script python command.
*/