diff --git a/tools/swig/lammps.i b/tools/swig/lammps.i index 2e0659a00d..47c0e45e19 100644 --- a/tools/swig/lammps.i +++ b/tools/swig/lammps.i @@ -2,11 +2,18 @@ %include "carrays.i" %include "cdata.i" -%array_functions(char, charp); -%pointer_functions(int, intp); -%pointer_functions(double, doublep); -%pointer_cast(void *, int *, void_to_int); -%pointer_cast(void *, double *, void_to_double); +%array_functions(char, char_p); + +%pointer_functions(int, int_p); +%pointer_functions(int, int64_p); +%pointer_functions(double, double_p); + +%pointer_cast(void *, int *, void_p_to_int_p); +%pointer_cast(void *, int **, void_p_to_int2d_p); +%pointer_cast(void *, int *, void_p_to_int64_p); +%pointer_cast(void *, int **, void_p_to_int64_2d_p); +%pointer_cast(void *, double *, void_p_to_double_p); +%pointer_cast(void *, double **, void_p_to_double_2d_p); %{ enum _LMP_DATATYPE_CONST { diff --git a/tools/swig/run_lua_example.sh b/tools/swig/run_lua_example.sh index 4cfd7ec586..0e2e74039b 100755 --- a/tools/swig/run_lua_example.sh +++ b/tools/swig/run_lua_example.sh @@ -14,7 +14,7 @@ lualammps.lammps_command(lmp, "create_atoms 1 box") print("LAMMPS version ", ver) print("Number of created atoms: ", lualammps.lammps_get_natoms(lmp)) -print("Current size of timestep: ", lualammps.doublep_value(lualammps.void_to_double(lualammps.lammps_extract_global(lmp,"dt")))) +print("Current size of timestep: ", lualammps.double_p_value(lualammps.void_p_to_double_p(lualammps.lammps_extract_global(lmp,"dt")))) lualammps.lammps_close(lmp) EOF diff --git a/tools/swig/run_perl_example.sh b/tools/swig/run_perl_example.sh index 689fa0e10a..54c7b5b326 100755 --- a/tools/swig/run_perl_example.sh +++ b/tools/swig/run_perl_example.sh @@ -14,7 +14,7 @@ pllammps::lammps_command(\$lmp, "create_atoms 1 box"); print("LAMMPS version ",\$ver,"\n"); print("Number of created atoms: ", pllammps::lammps_get_natoms(\$lmp), "\n"); -print("Current size of timestep: ", pllammps::doublep_value(pllammps::void_to_double(pllammps::lammps_extract_global(\$lmp,"dt"))), "\n"); +print("Current size of timestep: ", pllammps::double_p_value(pllammps::void_p_to_double_p(pllammps::lammps_extract_global(\$lmp,"dt"))), "\n"); pllammps::lammps_close(\$lmp) EOF diff --git a/tools/swig/run_python_example.sh b/tools/swig/run_python_example.sh index 7b7f97c99e..5ca5bca1cb 100755 --- a/tools/swig/run_python_example.sh +++ b/tools/swig/run_python_example.sh @@ -13,7 +13,7 @@ lammps_command(lmp, "create_atoms 1 box") print("LAMMPS version ",ver) print("Number of created atoms: %g" % lammps_get_natoms(lmp)) -print("Current size of timestep: %g" % doublep_value(void_to_double(lammps_extract_global(lmp,'dt')))) +print("Current size of timestep: %g" % double_p_value(void_p_to_double_p(lammps_extract_global(lmp,'dt')))) lammps_close(lmp) EOF diff --git a/tools/swig/run_ruby_example.sh b/tools/swig/run_ruby_example.sh index b5d3051be6..ff946ba501 100755 --- a/tools/swig/run_ruby_example.sh +++ b/tools/swig/run_ruby_example.sh @@ -14,6 +14,7 @@ Rubylammps.lammps_command(lmp, "create_atoms 1 box") print("LAMMPS version ", ver, "\n") print("Number of created atoms: ", Rubylammps.lammps_get_natoms(lmp), "\n") +print("Current size of timestep: ", Rubylammps.double_p_value(Rubylammps.void_p_to_double_p(Rubylammps.lammps_extract_global(lmp,"dt"))), "\n") Rubylammps.lammps_close(lmp) EOF diff --git a/tools/swig/run_tcl_example.sh b/tools/swig/run_tcl_example.sh index 5f9a3bc77f..363391e5a7 100755 --- a/tools/swig/run_tcl_example.sh +++ b/tools/swig/run_tcl_example.sh @@ -12,7 +12,7 @@ lammps_command \$lmp "region box block -5 5 -5 5 -5 5" lammps_command \$lmp "create_box 1 box" lammps_command \$lmp "create_atoms 1 box" -set dt [doublep_value [void_to_double [lammps_extract_global \$lmp dt]]] +set dt [double_p_value [void_p_to_double_p [lammps_extract_global \$lmp dt]]] puts "LAMMPS version \$ver" puts [format "Number of created atoms: %g" [lammps_get_natoms \$lmp]] puts "Current size of timestep: \$dt"