make char * argument of lammps_get_thermo() const

This commit is contained in:
Axel Kohlmeyer
2020-09-13 16:46:13 -04:00
parent 101d39142e
commit 5a0623595b
2 changed files with 3 additions and 3 deletions

View File

@ -594,7 +594,7 @@ double lammps_get_natoms(void *handle)
{ {
LAMMPS *lmp = (LAMMPS *) handle; LAMMPS *lmp = (LAMMPS *) handle;
double natoms = static_cast<double> (lmp->atom->natoms); double natoms = static_cast<double>(lmp->atom->natoms);
if (natoms > 9.0e15) return 0; // TODO:XXX why not -1? if (natoms > 9.0e15) return 0; // TODO:XXX why not -1?
return natoms; return natoms;
} }
@ -616,7 +616,7 @@ a double, so it can also return information that is computed on-the-fly.
* \param keyword string with the name of the thermo keyword * \param keyword string with the name of the thermo keyword
* \return value of the requested thermo property or 0.0 */ * \return value of the requested thermo property or 0.0 */
double lammps_get_thermo(void *handle, char *keyword) double lammps_get_thermo(void *handle, const char *keyword)
{ {
LAMMPS *lmp = (LAMMPS *) handle; LAMMPS *lmp = (LAMMPS *) handle;
double dval = 0.0; double dval = 0.0;

View File

@ -100,7 +100,7 @@ void lammps_commands_string(void *handle, const char *str);
int lammps_version(void *handle); int lammps_version(void *handle);
int lammps_get_mpi_comm(void* handle); int lammps_get_mpi_comm(void* handle);
double lammps_get_natoms(void *handle); double lammps_get_natoms(void *handle);
double lammps_get_thermo(void *handle, char *keyword); double lammps_get_thermo(void *handle, const char *keyword);
void lammps_extract_box(void *handle, double *boxlo, double *boxhi, void lammps_extract_box(void *handle, double *boxlo, double *boxhi,
double *xy, double *yz, double *xz, double *xy, double *yz, double *xz,