Squashed commit for MLIAPPY package

Includes CMAKE install, doc updates, example files.
This commit is contained in:
Nicholas Lubbers
2020-11-06 13:12:25 -07:00
parent 280e98b074
commit 7c1634e57f
26 changed files with 635 additions and 32 deletions

View File

@ -26,6 +26,11 @@
#include <cstring>
#include <Python.h> // IWYU pragma: export
#ifdef LMP_MLIAPPY
#include "mliap_model_python.h"
#include "mliap_model_python_couple.h"
#endif
using namespace LAMMPS_NS;
enum{NONE,INT,DOUBLE,STRING,PTR};
@ -51,7 +56,14 @@ PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp)
// one-time initialization of Python interpreter
// pyMain stores pointer to main module
external_interpreter = Py_IsInitialized();
#ifdef LMP_MLIAPPY
// Inform python intialization scheme of the mliappy module.
// This -must- happen before python is initialized.
int err = PyImport_AppendInittab("mliap_model_python_couple", PyInit_mliap_model_python_couple);
// todo: catch if error and report problem.
#endif
Py_Initialize();
PyEval_InitThreads();