From ca6790fec20e177447ffba9cbc07a194f3f42d42 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 11 Mar 2015 17:49:28 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13231 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Section_howto.html | 11 +++++++---- doc/Section_howto.txt | 11 +++++++---- doc/Section_python.html | 3 ++- doc/Section_python.txt | 1 + 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/doc/Section_howto.html b/doc/Section_howto.html index 59b4a73590..0e44f150f7 100644 --- a/doc/Section_howto.html +++ b/doc/Section_howto.html @@ -1914,15 +1914,18 @@ void *lammps_extract_atom(void *, char *) void *lammps_extract_compute(void *, char *, int, int) void *lammps_extract_fix(void *, char *, int, int, int, int) void *lammps_extract_variable(void *, char *, char *) +int lammps_set_variable(void *, char *, char *) int lammps_get_natoms(void *) void lammps_get_coords(void *, double *) void lammps_put_coords(void *, double *)

These can extract various global or per-atom quantities from LAMMPS as -well as values calculated by a compute, fix, or variable. The "get" -and "put" operations can retrieve and reset atom coordinates. -See the library.cpp file and its associated header file library.h for -details. +well as values calculated by a compute, fix, or variable. The +"set_variable" function can set an existing string-style variable to a +new value, so that subsequent LAMMPS commands can access the variable. +The "get" and "put" operations can retrieve and reset atom +coordinates. See the library.cpp file and its associated header file +library.h for details.

The key idea of the library interface is that you can write any functions you wish to define how your code talks to LAMMPS and add diff --git a/doc/Section_howto.txt b/doc/Section_howto.txt index 04c6212595..bccfea1882 100644 --- a/doc/Section_howto.txt +++ b/doc/Section_howto.txt @@ -1901,15 +1901,18 @@ void *lammps_extract_atom(void *, char *) void *lammps_extract_compute(void *, char *, int, int) void *lammps_extract_fix(void *, char *, int, int, int, int) void *lammps_extract_variable(void *, char *, char *) +int lammps_set_variable(void *, char *, char *) int lammps_get_natoms(void *) void lammps_get_coords(void *, double *) void lammps_put_coords(void *, double *) :pre These can extract various global or per-atom quantities from LAMMPS as -well as values calculated by a compute, fix, or variable. The "get" -and "put" operations can retrieve and reset atom coordinates. -See the library.cpp file and its associated header file library.h for -details. +well as values calculated by a compute, fix, or variable. The +"set_variable" function can set an existing string-style variable to a +new value, so that subsequent LAMMPS commands can access the variable. +The "get" and "put" operations can retrieve and reset atom +coordinates. See the library.cpp file and its associated header file +library.h for details. The key idea of the library interface is that you can write any functions you wish to define how your code talks to LAMMPS and add diff --git a/doc/Section_python.html b/doc/Section_python.html index efacb615c5..4b0d737b4f 100644 --- a/doc/Section_python.html +++ b/doc/Section_python.html @@ -429,7 +429,8 @@ v3 = lmp.extract_fix(id,style,type,i,j) # extract value(s) from a fix # flag = 0 = equal-style variable # 1 = atom-style variable -

natoms = lmp.get_natoms()                 # total # of atoms as int
+
flag = lmp.set_variable(name,value)       # set existing named string-style variable to value, flag = 0 if successful
+natoms = lmp.get_natoms()                 # total # of atoms as int
 data = lmp.gather_atoms(name,type,count)  # return atom attribute of all atoms gathered into data, ordered by atom ID
                                           # name = "x", "charge", "type", etc
                                           # count = # of per-atom values, 1 or 3, etc
diff --git a/doc/Section_python.txt b/doc/Section_python.txt
index edf4e0e128..192d6cf21d 100644
--- a/doc/Section_python.txt
+++ b/doc/Section_python.txt
@@ -424,6 +424,7 @@ var = lmp.extract_variable(name,group,flag)  # extract value(s) from a variable
 					     # flag = 0 = equal-style variable
 					     #        1 = atom-style variable :pre
 
+flag = lmp.set_variable(name,value)       # set existing named string-style variable to value, flag = 0 if successful
 natoms = lmp.get_natoms()                 # total # of atoms as int
 data = lmp.gather_atoms(name,type,count)  # return atom attribute of all atoms gathered into data, ordered by atom ID
                                           # name = "x", "charge", "type", etc