Loading...
Searching...
No Matches
library.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define LAMMPS_SMALLBIG

Typedefs

typedef void(* FixExternalFnPtr) (void *, int64_t, int, int *, double **, double **)

Enumerations

enum  _LMP_DATATYPE_CONST {
  LAMMPS_NONE = -1 , LAMMPS_INT = 0 , LAMMPS_INT_2D = 1 , LAMMPS_DOUBLE = 2 ,
  LAMMPS_DOUBLE_2D = 3 , LAMMPS_INT64 = 4 , LAMMPS_INT64_2D = 5 , LAMMPS_STRING = 6
}
 Data type constants for extracting data from atoms, computes and fixes. More...
enum  _LMP_STYLE_CONST { LMP_STYLE_GLOBAL = 0 , LMP_STYLE_ATOM = 1 , LMP_STYLE_LOCAL = 2 }
 Style constants for extracting data from computes and fixes. More...
enum  _LMP_TYPE_CONST {
  LMP_TYPE_SCALAR = 0 , LMP_TYPE_VECTOR = 1 , LMP_TYPE_ARRAY = 2 , LMP_SIZE_VECTOR = 3 ,
  LMP_SIZE_ROWS = 4 , LMP_SIZE_COLS = 5
}
 Type and size constants for extracting data from computes and fixes. More...
enum  _LMP_ERROR_CONST {
  LMP_ERROR_WARNING = 0 , LMP_ERROR_ONE = 1 , LMP_ERROR_ALL = 2 , LMP_ERROR_WORLD = 4 ,
  LMP_ERROR_UNIVERSE = 8
}
 Error codes to select the suitable function in the Error class. More...
enum  _LMP_VAR_CONST { LMP_VAR_EQUAL = 0 , LMP_VAR_ATOM = 1 , LMP_VAR_VECTOR = 2 , LMP_VAR_STRING = 3 }
 Variable style constants for extracting data from variables. More...

Functions

void * lammps_open_no_mpi (int argc, char **argv, void **ptr)
void * lammps_open_fortran (int argc, char **argv, int f_comm)
void lammps_close (void *handle)
void lammps_mpi_init ()
void lammps_mpi_finalize ()
void lammps_kokkos_finalize ()
void lammps_python_finalize ()
void lammps_error (void *handle, int error_type, const char *error_text)
void lammps_file (void *handle, const char *file)
char * lammps_command (void *handle, const char *cmd)
void lammps_commands_list (void *handle, int ncmd, const char **cmds)
void lammps_commands_string (void *handle, const char *str)
double lammps_get_natoms (void *handle)
double lammps_get_thermo (void *handle, const char *keyword)
void * lammps_last_thermo (void *handle, const char *what, int index)
void lammps_extract_box (void *handle, double *boxlo, double *boxhi, double *xy, double *yz, double *xz, int *pflags, int *boxflag)
void lammps_reset_box (void *handle, double *boxlo, double *boxhi, double xy, double yz, double xz)
void lammps_memory_usage (void *handle, double *meminfo)
int lammps_get_mpi_comm (void *handle)
int lammps_extract_setting (void *handle, const char *keyword)
int lammps_extract_global_datatype (void *handle, const char *name)
void * lammps_extract_global (void *handle, const char *name)
int lammps_map_atom (void *handle, const void *id)
int lammps_extract_atom_datatype (void *handle, const char *name)
void * lammps_extract_atom (void *handle, const char *name)
void * lammps_extract_compute (void *handle, const char *id, int style, int type)
void * lammps_extract_fix (void *handle, const char *id, int style, int type, int nrow, int ncol)
void * lammps_extract_variable (void *handle, const char *name, const char *group)
int lammps_extract_variable_datatype (void *handle, const char *name)
int lammps_set_variable (void *handle, const char *name, const char *str)
int lammps_set_string_variable (void *handle, const char *name, const char *str)
int lammps_set_internal_variable (void *handle, const char *name, double value)
int lammps_variable_info (void *handle, int idx, char *buf, int bufsize)
void lammps_gather_atoms (void *handle, const char *name, int type, int count, void *data)
void lammps_gather_atoms_concat (void *handle, const char *name, int type, int count, void *data)
void lammps_gather_atoms_subset (void *handle, const char *name, int type, int count, int ndata, int *ids, void *data)
void lammps_scatter_atoms (void *handle, const char *name, int type, int count, void *data)
void lammps_scatter_atoms_subset (void *handle, const char *name, int type, int count, int ndata, int *ids, void *data)
void lammps_gather_bonds (void *handle, void *data)
void lammps_gather_angles (void *handle, void *data)
void lammps_gather_dihedrals (void *handle, void *data)
void lammps_gather_impropers (void *handle, void *data)
void lammps_gather (void *handle, const char *name, int type, int count, void *data)
void lammps_gather_concat (void *handle, const char *name, int type, int count, void *data)
void lammps_gather_subset (void *handle, const char *name, int type, int count, int ndata, int *ids, void *data)
void lammps_scatter (void *handle, const char *name, int type, int count, void *data)
void lammps_scatter_subset (void *handle, const char *name, int type, int count, int ndata, int *ids, void *data)
int lammps_create_atoms (void *handle, int n, const int *id, const int *type, const double *x, const double *v, const int *image, int bexpand)
int lammps_find_pair_neighlist (void *handle, const char *style, int exact, int nsub, int request)
int lammps_find_fix_neighlist (void *handle, const char *id, int request)
int lammps_find_compute_neighlist (void *handle, const char *id, int request)
int lammps_neighlist_num_elements (void *handle, int idx)
void lammps_neighlist_element_neighbors (void *handle, int idx, int element, int *iatom, int *numneigh, int **neighbors)
int lammps_version (void *handle)
void lammps_get_os_info (char *buffer, int buf_size)
int lammps_config_has_mpi_support ()
int lammps_config_has_gzip_support ()
int lammps_config_has_png_support ()
int lammps_config_has_jpeg_support ()
int lammps_config_has_ffmpeg_support ()
int lammps_config_has_exceptions ()
int lammps_config_has_package (const char *)
int lammps_config_package_count ()
int lammps_config_package_name (int, char *, int)
int lammps_config_accelerator (const char *, const char *, const char *)
int lammps_has_gpu_device ()
void lammps_get_gpu_device_info (char *buffer, int buf_size)
int lammps_has_style (void *, const char *, const char *)
int lammps_style_count (void *, const char *)
int lammps_style_name (void *, const char *, int, char *, int)
int lammps_has_id (void *, const char *, const char *)
int lammps_id_count (void *, const char *)
int lammps_id_name (void *, const char *, int, char *, int)
int lammps_plugin_count ()
int lammps_plugin_name (int, char *, char *, int)
int lammps_encode_image_flags (int ix, int iy, int iz)
void lammps_decode_image_flags (int image, int *flags)
void lammps_set_fix_external_callback (void *handle, const char *id, FixExternalFnPtr funcptr, void *ptr)
double ** lammps_fix_external_get_force (void *handle, const char *id)
void lammps_fix_external_set_energy_global (void *handle, const char *id, double eng)
void lammps_fix_external_set_energy_peratom (void *handle, const char *id, double *eng)
void lammps_fix_external_set_virial_global (void *handle, const char *id, double *virial)
void lammps_fix_external_set_virial_peratom (void *handle, const char *id, double **virial)
void lammps_fix_external_set_vector_length (void *handle, const char *id, int len)
void lammps_fix_external_set_vector (void *handle, const char *id, int idx, double val)
void lammps_flush_buffers (void *ptr)
void lammps_free (void *ptr)
int lammps_is_running (void *handle)
void lammps_force_timeout (void *handle)
int lammps_has_error (void *handle)
int lammps_get_last_error_message (void *handle, char *buffer, int buf_size)
int lammps_python_api_version ()

Macro Definition Documentation

◆ LAMMPS_SMALLBIG

#define LAMMPS_SMALLBIG

Definition at line 29 of file library.h.

Typedef Documentation

◆ FixExternalFnPtr

typedef void(* FixExternalFnPtr) (void *, int64_t, int, int *, double **, double **)

Definition at line 299 of file library.h.

Enumeration Type Documentation

◆ _LMP_DATATYPE_CONST

Data type constants for extracting data from atoms, computes and fixes.

Must be kept in sync with the equivalent constants in python/lammps/constants.py, fortran/lammps.f90, tools/swig/lammps.i, src/lmptype.h, and examples/COUPLE/plugin/liblammpsplugin.h

Enumerator
LAMMPS_NONE 

no data type assigned (yet)

LAMMPS_INT 

32-bit integer (array)

LAMMPS_INT_2D 

two-dimensional 32-bit integer array

LAMMPS_DOUBLE 

64-bit double (array)

LAMMPS_DOUBLE_2D 

two-dimensional 64-bit double array

LAMMPS_INT64 

64-bit integer (array)

LAMMPS_INT64_2D 

two-dimensional 64-bit integer array

LAMMPS_STRING 

C-String

Definition at line 49 of file library.h.

49 {
50 LAMMPS_NONE = -1,
51 LAMMPS_INT = 0,
52 LAMMPS_INT_2D = 1,
53 LAMMPS_DOUBLE = 2,
55 LAMMPS_INT64 = 4,
56 LAMMPS_INT64_2D = 5,
57 LAMMPS_STRING = 6
58};
@ LAMMPS_NONE
Definition library.h:50
@ LAMMPS_INT64
Definition library.h:55
@ LAMMPS_DOUBLE_2D
Definition library.h:54
@ LAMMPS_DOUBLE
Definition library.h:53
@ LAMMPS_INT
Definition library.h:51
@ LAMMPS_INT64_2D
Definition library.h:56
@ LAMMPS_INT_2D
Definition library.h:52
@ LAMMPS_STRING
Definition library.h:57

◆ _LMP_ERROR_CONST

Error codes to select the suitable function in the Error class.

Must be kept in sync with the equivalent constants in python/lammps/constants.py, fortran/lammps.f90, tools/swig/lammps.i, and examples/COUPLE/plugin/liblammpsplugin.h

Enumerator
LMP_ERROR_WARNING 

call Error::warning()

LMP_ERROR_ONE 

called from one MPI rank

LMP_ERROR_ALL 

called from all MPI ranks

LMP_ERROR_WORLD 

error on Comm::world

LMP_ERROR_UNIVERSE 

error on Comm::universe

Definition at line 96 of file library.h.

96 {
98 LMP_ERROR_ONE = 1,
99 LMP_ERROR_ALL = 2,
100 LMP_ERROR_WORLD = 4,
102};
@ LMP_ERROR_WARNING
Definition library.h:97
@ LMP_ERROR_UNIVERSE
Definition library.h:101
@ LMP_ERROR_ALL
Definition library.h:99
@ LMP_ERROR_WORLD
Definition library.h:100
@ LMP_ERROR_ONE
Definition library.h:98

◆ _LMP_STYLE_CONST

Style constants for extracting data from computes and fixes.

Must be kept in sync with the equivalent constants in python/lammps/constants.py, fortran/lammps.f90, tools/swig/lammps.i, and examples/COUPLE/plugin/liblammpsplugin.h

Enumerator
LMP_STYLE_GLOBAL 

return global data

LMP_STYLE_ATOM 

return per-atom data

LMP_STYLE_LOCAL 

return local data

Definition at line 67 of file library.h.

67 {
69 LMP_STYLE_ATOM = 1,
71};
@ LMP_STYLE_GLOBAL
Definition library.h:68
@ LMP_STYLE_LOCAL
Definition library.h:70
@ LMP_STYLE_ATOM
Definition library.h:69

◆ _LMP_TYPE_CONST

Type and size constants for extracting data from computes and fixes.

Must be kept in sync with the equivalent constants in python/lammps/constants.py, fortran/lammps.f90, tools/swig/lammps.i, and examples/COUPLE/plugin/liblammpsplugin.h

Enumerator
LMP_TYPE_SCALAR 

return scalar

LMP_TYPE_VECTOR 

return vector

LMP_TYPE_ARRAY 

return array

LMP_SIZE_VECTOR 

return length of vector

LMP_SIZE_ROWS 

return number of rows

LMP_SIZE_COLS 

return number of columns

Definition at line 80 of file library.h.

80 {
81 LMP_TYPE_SCALAR = 0,
82 LMP_TYPE_VECTOR = 1,
83 LMP_TYPE_ARRAY = 2,
84 LMP_SIZE_VECTOR = 3,
85 LMP_SIZE_ROWS = 4,
86 LMP_SIZE_COLS = 5
87};
@ LMP_SIZE_COLS
Definition library.h:86
@ LMP_TYPE_SCALAR
Definition library.h:81
@ LMP_SIZE_ROWS
Definition library.h:85
@ LMP_TYPE_ARRAY
Definition library.h:83
@ LMP_SIZE_VECTOR
Definition library.h:84
@ LMP_TYPE_VECTOR
Definition library.h:82

◆ _LMP_VAR_CONST

Variable style constants for extracting data from variables.

Must be kept in sync with the equivalent constants in python/lammps/constants.py, fortran/lammps.f90, tools/swig/lammps.i, and examples/COUPLE/plugin/liblammpsplugin.h

Enumerator
LMP_VAR_EQUAL 

compatible with equal-style variables

LMP_VAR_ATOM 

compatible with atom-style variables

LMP_VAR_VECTOR 

compatible with vector-style variables

LMP_VAR_STRING 

return value will be a string (catch-all)

Definition at line 111 of file library.h.

111 {
112 LMP_VAR_EQUAL = 0,
113 LMP_VAR_ATOM = 1,
114 LMP_VAR_VECTOR = 2,
115 LMP_VAR_STRING = 3
116};
@ LMP_VAR_VECTOR
Definition library.h:114
@ LMP_VAR_ATOM
Definition library.h:113
@ LMP_VAR_STRING
Definition library.h:115
@ LMP_VAR_EQUAL
Definition library.h:112

Function Documentation

◆ lammps_close()

void lammps_close ( void * handle)

◆ lammps_command()

char * lammps_command ( void * handle,
const char * cmd )

◆ lammps_commands_list()

void lammps_commands_list ( void * handle,
int ncmd,
const char ** cmds )

◆ lammps_commands_string()

void lammps_commands_string ( void * handle,
const char * str )

◆ lammps_config_accelerator()

int lammps_config_accelerator ( const char * ,
const char * ,
const char *  )

◆ lammps_config_has_exceptions()

int lammps_config_has_exceptions ( )

◆ lammps_config_has_ffmpeg_support()

int lammps_config_has_ffmpeg_support ( )

◆ lammps_config_has_gzip_support()

int lammps_config_has_gzip_support ( )

◆ lammps_config_has_jpeg_support()

int lammps_config_has_jpeg_support ( )

◆ lammps_config_has_mpi_support()

int lammps_config_has_mpi_support ( )

◆ lammps_config_has_package()

int lammps_config_has_package ( const char * )

◆ lammps_config_has_png_support()

int lammps_config_has_png_support ( )

◆ lammps_config_package_count()

int lammps_config_package_count ( )

◆ lammps_config_package_name()

int lammps_config_package_name ( int ,
char * ,
int  )

◆ lammps_create_atoms()

int lammps_create_atoms ( void * handle,
int n,
const int * id,
const int * type,
const double * x,
const double * v,
const int * image,
int bexpand )

◆ lammps_decode_image_flags()

void lammps_decode_image_flags ( int image,
int * flags )

◆ lammps_encode_image_flags()

int lammps_encode_image_flags ( int ix,
int iy,
int iz )

◆ lammps_error()

void lammps_error ( void * handle,
int error_type,
const char * error_text )

◆ lammps_extract_atom()

void * lammps_extract_atom ( void * handle,
const char * name )

◆ lammps_extract_atom_datatype()

int lammps_extract_atom_datatype ( void * handle,
const char * name )

◆ lammps_extract_box()

void lammps_extract_box ( void * handle,
double * boxlo,
double * boxhi,
double * xy,
double * yz,
double * xz,
int * pflags,
int * boxflag )

◆ lammps_extract_compute()

void * lammps_extract_compute ( void * handle,
const char * id,
int style,
int type )

◆ lammps_extract_fix()

void * lammps_extract_fix ( void * handle,
const char * id,
int style,
int type,
int nrow,
int ncol )

◆ lammps_extract_global()

void * lammps_extract_global ( void * handle,
const char * name )

◆ lammps_extract_global_datatype()

int lammps_extract_global_datatype ( void * handle,
const char * name )

◆ lammps_extract_setting()

int lammps_extract_setting ( void * handle,
const char * keyword )

◆ lammps_extract_variable()

void * lammps_extract_variable ( void * handle,
const char * name,
const char * group )

◆ lammps_extract_variable_datatype()

int lammps_extract_variable_datatype ( void * handle,
const char * name )

◆ lammps_file()

void lammps_file ( void * handle,
const char * file )

◆ lammps_find_compute_neighlist()

int lammps_find_compute_neighlist ( void * handle,
const char * id,
int request )

◆ lammps_find_fix_neighlist()

int lammps_find_fix_neighlist ( void * handle,
const char * id,
int request )

◆ lammps_find_pair_neighlist()

int lammps_find_pair_neighlist ( void * handle,
const char * style,
int exact,
int nsub,
int request )

◆ lammps_fix_external_get_force()

double ** lammps_fix_external_get_force ( void * handle,
const char * id )

◆ lammps_fix_external_set_energy_global()

void lammps_fix_external_set_energy_global ( void * handle,
const char * id,
double eng )

◆ lammps_fix_external_set_energy_peratom()

void lammps_fix_external_set_energy_peratom ( void * handle,
const char * id,
double * eng )

◆ lammps_fix_external_set_vector()

void lammps_fix_external_set_vector ( void * handle,
const char * id,
int idx,
double val )

◆ lammps_fix_external_set_vector_length()

void lammps_fix_external_set_vector_length ( void * handle,
const char * id,
int len )

◆ lammps_fix_external_set_virial_global()

void lammps_fix_external_set_virial_global ( void * handle,
const char * id,
double * virial )

◆ lammps_fix_external_set_virial_peratom()

void lammps_fix_external_set_virial_peratom ( void * handle,
const char * id,
double ** virial )

◆ lammps_flush_buffers()

void lammps_flush_buffers ( void * ptr)

◆ lammps_force_timeout()

void lammps_force_timeout ( void * handle)

◆ lammps_free()

void lammps_free ( void * ptr)

◆ lammps_gather()

void lammps_gather ( void * handle,
const char * name,
int type,
int count,
void * data )

◆ lammps_gather_angles()

void lammps_gather_angles ( void * handle,
void * data )

◆ lammps_gather_atoms()

void lammps_gather_atoms ( void * handle,
const char * name,
int type,
int count,
void * data )

◆ lammps_gather_atoms_concat()

void lammps_gather_atoms_concat ( void * handle,
const char * name,
int type,
int count,
void * data )

◆ lammps_gather_atoms_subset()

void lammps_gather_atoms_subset ( void * handle,
const char * name,
int type,
int count,
int ndata,
int * ids,
void * data )

◆ lammps_gather_bonds()

void lammps_gather_bonds ( void * handle,
void * data )

◆ lammps_gather_concat()

void lammps_gather_concat ( void * handle,
const char * name,
int type,
int count,
void * data )

◆ lammps_gather_dihedrals()

void lammps_gather_dihedrals ( void * handle,
void * data )

◆ lammps_gather_impropers()

void lammps_gather_impropers ( void * handle,
void * data )

◆ lammps_gather_subset()

void lammps_gather_subset ( void * handle,
const char * name,
int type,
int count,
int ndata,
int * ids,
void * data )

◆ lammps_get_gpu_device_info()

void lammps_get_gpu_device_info ( char * buffer,
int buf_size )

◆ lammps_get_last_error_message()

int lammps_get_last_error_message ( void * handle,
char * buffer,
int buf_size )

◆ lammps_get_mpi_comm()

int lammps_get_mpi_comm ( void * handle)

◆ lammps_get_natoms()

double lammps_get_natoms ( void * handle)

◆ lammps_get_os_info()

void lammps_get_os_info ( char * buffer,
int buf_size )

◆ lammps_get_thermo()

double lammps_get_thermo ( void * handle,
const char * keyword )

◆ lammps_has_error()

int lammps_has_error ( void * handle)

◆ lammps_has_gpu_device()

int lammps_has_gpu_device ( )

◆ lammps_has_id()

int lammps_has_id ( void * ,
const char * ,
const char *  )

◆ lammps_has_style()

int lammps_has_style ( void * ,
const char * ,
const char *  )

◆ lammps_id_count()

int lammps_id_count ( void * ,
const char *  )

◆ lammps_id_name()

int lammps_id_name ( void * ,
const char * ,
int ,
char * ,
int  )

◆ lammps_is_running()

int lammps_is_running ( void * handle)

◆ lammps_kokkos_finalize()

void lammps_kokkos_finalize ( )

◆ lammps_last_thermo()

void * lammps_last_thermo ( void * handle,
const char * what,
int index )

◆ lammps_map_atom()

int lammps_map_atom ( void * handle,
const void * id )

◆ lammps_memory_usage()

void lammps_memory_usage ( void * handle,
double * meminfo )

◆ lammps_mpi_finalize()

void lammps_mpi_finalize ( )

◆ lammps_mpi_init()

void lammps_mpi_init ( )

◆ lammps_neighlist_element_neighbors()

void lammps_neighlist_element_neighbors ( void * handle,
int idx,
int element,
int * iatom,
int * numneigh,
int ** neighbors )

◆ lammps_neighlist_num_elements()

int lammps_neighlist_num_elements ( void * handle,
int idx )

◆ lammps_open_fortran()

void * lammps_open_fortran ( int argc,
char ** argv,
int f_comm )

◆ lammps_open_no_mpi()

void * lammps_open_no_mpi ( int argc,
char ** argv,
void ** ptr )

◆ lammps_plugin_count()

int lammps_plugin_count ( )

◆ lammps_plugin_name()

int lammps_plugin_name ( int ,
char * ,
char * ,
int  )

◆ lammps_python_api_version()

int lammps_python_api_version ( )

◆ lammps_python_finalize()

void lammps_python_finalize ( )

◆ lammps_reset_box()

void lammps_reset_box ( void * handle,
double * boxlo,
double * boxhi,
double xy,
double yz,
double xz )

◆ lammps_scatter()

void lammps_scatter ( void * handle,
const char * name,
int type,
int count,
void * data )

◆ lammps_scatter_atoms()

void lammps_scatter_atoms ( void * handle,
const char * name,
int type,
int count,
void * data )

◆ lammps_scatter_atoms_subset()

void lammps_scatter_atoms_subset ( void * handle,
const char * name,
int type,
int count,
int ndata,
int * ids,
void * data )

◆ lammps_scatter_subset()

void lammps_scatter_subset ( void * handle,
const char * name,
int type,
int count,
int ndata,
int * ids,
void * data )

◆ lammps_set_fix_external_callback()

void lammps_set_fix_external_callback ( void * handle,
const char * id,
FixExternalFnPtr funcptr,
void * ptr )

◆ lammps_set_internal_variable()

int lammps_set_internal_variable ( void * handle,
const char * name,
double value )

◆ lammps_set_string_variable()

int lammps_set_string_variable ( void * handle,
const char * name,
const char * str )

◆ lammps_set_variable()

int lammps_set_variable ( void * handle,
const char * name,
const char * str )

◆ lammps_style_count()

int lammps_style_count ( void * ,
const char *  )

◆ lammps_style_name()

int lammps_style_name ( void * ,
const char * ,
int ,
char * ,
int  )

◆ lammps_variable_info()

int lammps_variable_info ( void * handle,
int idx,
char * buf,
int bufsize )

◆ lammps_version()

int lammps_version ( void * handle)