Clean up after renaming back to fix python/move

This commit is contained in:
Richard Berger
2017-12-15 13:20:13 -05:00
parent 4d725c3153
commit 950bfb84a9
6 changed files with 24 additions and 24 deletions

View File

@ -42,7 +42,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) :
python->init();
py_integrator = NULL;
py_move = NULL;
PyGILState_STATE gstate = PyGILState_Ensure();
@ -80,8 +80,8 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) :
// create LAMMPS atom type to potential file type mapping in python class
// by calling 'lammps_pair_style.map_coeff(name,type)'
PyObject *py_integrator_type = PyObject_GetAttrString(pModule, cls_name);
if (!py_integrator_type) {
PyObject *py_move_type = PyObject_GetAttrString(pModule, cls_name);
if (!py_move_type) {
PyErr_Print();
PyErr_Clear();
PyGILState_Release(gstate);
@ -93,10 +93,10 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) :
PyObject * ptr = PY_VOID_POINTER(lmp);
PyObject * arglist = Py_BuildValue("(O)", ptr);
PyObject * py_integrator_obj = PyObject_CallObject(py_integrator_type, arglist);
PyObject * py_move_obj = PyObject_CallObject(py_move_type, arglist);
Py_DECREF(arglist);
if (!py_integrator_obj) {
if (!py_move_obj) {
PyErr_Print();
PyErr_Clear();
PyGILState_Release(gstate);
@ -104,7 +104,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) :
}
// check object interface
py_integrator = (void *) py_integrator_obj;
py_move = (void *) py_move_obj;
PyGILState_Release(gstate);
}
@ -114,7 +114,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) :
FixPythonMove::~FixPythonMove()
{
PyGILState_STATE gstate = PyGILState_Ensure();
if(py_integrator) Py_DECREF((PyObject*) py_integrator);
if(py_move) Py_DECREF((PyObject*) py_move);
PyGILState_Release(gstate);
}
@ -135,8 +135,8 @@ int FixPythonMove::setmask()
void FixPythonMove::init()
{
PyGILState_STATE gstate = PyGILState_Ensure();
PyObject *py_integrator_obj = (PyObject *) py_integrator;
PyObject *py_init = PyObject_GetAttrString(py_integrator_obj,"init");
PyObject *py_move_obj = (PyObject *) py_move;
PyObject *py_init = PyObject_GetAttrString(py_move_obj,"init");
if (!py_init) {
PyErr_Print();
PyErr_Clear();
@ -152,8 +152,8 @@ void FixPythonMove::init()
void FixPythonMove::initial_integrate(int vflag)
{
PyGILState_STATE gstate = PyGILState_Ensure();
PyObject *py_integrator_obj = (PyObject *) py_integrator;
PyObject *py_initial_integrate = PyObject_GetAttrString(py_integrator_obj,"initial_integrate");
PyObject *py_move_obj = (PyObject *) py_move;
PyObject *py_initial_integrate = PyObject_GetAttrString(py_move_obj,"initial_integrate");
if (!py_initial_integrate) {
PyErr_Print();
PyErr_Clear();
@ -171,8 +171,8 @@ void FixPythonMove::initial_integrate(int vflag)
void FixPythonMove::final_integrate()
{
PyGILState_STATE gstate = PyGILState_Ensure();
PyObject *py_integrator_obj = (PyObject *) py_integrator;
PyObject *py_final_integrate = PyObject_GetAttrString(py_integrator_obj,"final_integrate");
PyObject *py_move_obj = (PyObject *) py_move;
PyObject *py_final_integrate = PyObject_GetAttrString(py_move_obj,"final_integrate");
if (!py_final_integrate) {
PyErr_Print();
PyErr_Clear();
@ -188,8 +188,8 @@ void FixPythonMove::final_integrate()
void FixPythonMove::initial_integrate_respa(int vflag, int ilevel, int iloop)
{
PyGILState_STATE gstate = PyGILState_Ensure();
PyObject *py_integrator_obj = (PyObject *) py_integrator;
PyObject *py_initial_integrate_respa = PyObject_GetAttrString(py_integrator_obj,"initial_integrate_respa");
PyObject *py_move_obj = (PyObject *) py_move;
PyObject *py_initial_integrate_respa = PyObject_GetAttrString(py_move_obj,"initial_integrate_respa");
if (!py_initial_integrate_respa) {
PyErr_Print();
PyErr_Clear();
@ -207,8 +207,8 @@ void FixPythonMove::initial_integrate_respa(int vflag, int ilevel, int iloop)
void FixPythonMove::final_integrate_respa(int ilevel, int iloop)
{
PyGILState_STATE gstate = PyGILState_Ensure();
PyObject *py_integrator_obj = (PyObject *) py_integrator;
PyObject *py_final_integrate_respa = PyObject_GetAttrString(py_integrator_obj,"final_integrate_respa");
PyObject *py_move_obj = (PyObject *) py_move;
PyObject *py_final_integrate_respa = PyObject_GetAttrString(py_move_obj,"final_integrate_respa");
if (!py_final_integrate_respa) {
PyErr_Print();
PyErr_Clear();
@ -226,8 +226,8 @@ void FixPythonMove::final_integrate_respa(int ilevel, int iloop)
void FixPythonMove::reset_dt()
{
PyGILState_STATE gstate = PyGILState_Ensure();
PyObject *py_integrator_obj = (PyObject *) py_integrator;
PyObject *py_reset_dt = PyObject_GetAttrString(py_integrator_obj,"reset_dt");
PyObject *py_move_obj = (PyObject *) py_move;
PyObject *py_reset_dt = PyObject_GetAttrString(py_move_obj,"reset_dt");
if (!py_reset_dt) {
PyErr_Print();
PyErr_Clear();