expose numetical version id to library and python interface

This commit is contained in:
Axel Kohlmeyer
2015-09-01 10:31:43 -04:00
parent a91a75bb0d
commit 233a9edfa8
3 changed files with 15 additions and 0 deletions

View File

@ -70,6 +70,9 @@ class lammps:
if self.opened: self.lib.lammps_close(self.lmp)
self.lmp = None
def version(self):
return self.lib.lammps_version(self.lmp)
def file(self,file):
self.lib.lammps_file(self.lmp,file)

View File

@ -19,6 +19,7 @@
#include "stdlib.h"
#include "library.h"
#include "lammps.h"
#include "universe.h"
#include "input.h"
#include "atom.h"
#include "domain.h"
@ -79,6 +80,16 @@ void lammps_close(void *ptr)
delete lmp;
}
/* ----------------------------------------------------------------------
get the numerical representation of the current LAMMPS version
------------------------------------------------------------------------- */
int lammps_version(void *ptr)
{
LAMMPS *lmp = (LAMMPS *) ptr;
return atoi(lmp->universe->num_ver);
}
/* ----------------------------------------------------------------------
process an input script in filename str
------------------------------------------------------------------------- */

View File

@ -27,6 +27,7 @@ extern "C" {
void lammps_open(int, char **, MPI_Comm, void **);
void lammps_open_no_mpi(int, char **, void **);
void lammps_close(void *);
int lammps_version(void *);
void lammps_file(void *, char *);
char *lammps_command(void *, char *);
void lammps_free(void *);