### Example LIGGGHTS Command-Line Launches Source: https://www.cfdem.com/media/DEM/docu/Section_start Demonstrates two equivalent ways to launch LIGGGHTS using command-line arguments, specifying output files and input scripts. These examples show the flexibility in choosing abbreviations or full option names. ```bash mpirun -np 16 lmp_auto -v f tmp.out -l my.log -sc none < in.alloy ``` ```bash mpirun -np 16 lmp_auto -var f tmp.out -log my.log -screen none < in.alloy ``` -------------------------------- ### LIGGGHTS Command-line Options Source: https://www.cfdem.com/media/DEM/docu/Section_start Overview of LIGGGHTS-PUBLIC command-line options and their functionalities. ```APIDOC ## Command-line Options LIGGGHTS(R)-PUBLIC recognizes several optional command-line switches which may be used in any order. Either the full word or a one-or-two letter abbreviation can be used. ### Available Options: * `-e` or `-echo style` * `-i` or `-in file` * `-h` or `-help` * `-l` or `-log file` * `-nc` or `-nocite` * `-p` or `-partition args` * `-pl` or `-plog file` * `-ps` or `-pscreen file` * `-r` or `-restart file` * `-ro` or `-reorder file` * `-sc` or `-screen file` * `-sf` or `-suffix type` * `-v` or `-var name value` ### Detailed Option Descriptions: #### `-echo style` **Description:** Set the style of command echoing. The style can be `none`, `screen`, `log`, or `both`. Depending on the style, each command read from the input script will be echoed to the screen and/or logfile. This can be useful to figure out which line of your script is causing an input error. **Default:** `log` **Note:** The echo style can also be set by using the `echo` command in the input script itself. #### `-in file` **Description:** Specify a file to use as an input script. This is an optional switch when running LIGGGHTS(R)-PUBLIC in one-partition mode. If it is not specified, LIGGGHTS(R)-PUBLIC reads its input script from stdin (e.g., `lmp_auto < in.run`). This is a required switch when running LIGGGHTS(R)-PUBLIC in multi-partition mode, since multiple processors cannot all read from stdin. #### `-help` **Description:** Print a list of options compiled into this executable for each LIGGGHTS(R)-PUBLIC style (atom_style, fix, compute, pair_style, bond_style, etc). This can help you know if the command you want to use was included via the appropriate package. LIGGGHTS(R)-PUBLIC will print the info and immediately exit if this switch is used. #### `-log file` **Description:** Specify a log file for LIGGGHTS(R)-PUBLIC to write status information to. In one-partition mode, if the switch is not used, LIGGGHTS(R)-PUBLIC writes to the file `log.lammps`. If this switch is used, LIGGGHTS(R)-PUBLIC writes to the specified file. In multi-partition mode, if the switch is not used, a `log.lammps` file is created with high-level status information. Each partition also writes to a `log.lammps.N` file where N is the partition ID. If the switch is specified in multi-partition mode, the high-level logfile is named `file` and each partition also logs information to a `file.N`. For both one-partition and multi-partition mode, if the specified file is `none`, then no log files are created. **Note:** Using a `log` command in the input script will override this setting. Option `-plog` will override the name of the partition log files `file.N`. #### `-nocite` **Description:** Disable writing the `log.cite` file which is normally written to list references for specific cite-able features used during a LIGGGHTS(R)-PUBLIC run. See the citation page for more details. #### `-partition args` **Description:** Invoke LIGGGHTS(R)-PUBLIC in multi-partition mode. When LIGGGHTS(R)-PUBLIC is run on P processors and this switch is not used, LIGGGHTS(R)-PUBLIC runs in one partition, i.e., all P processors run a single simulation. If this switch is used, the P processors are split into separate partitions and each partition runs its own simulation. The arguments to the switch specify the number of processors in each partition. Arguments of the form `MxN` mean M partitions, each with N processors. Arguments of the form `N` mean a single partition with N processors. The sum of processors in all partitions must equal P. Thus the command `-partition 8x2 4 5` has 10 partitions and runs on a total of 25 processors. **Note:** To run multiple independent simulations from one input script, using multiple partitions, see Section_howto 4 of the manual. World- and universe-style variables are useful in this context. #### `-plog file` **Description:** Specify the base name for the partition log files, so partition N writes log information to `file.N`. If `file` is `none`, then no partition log files are created. This overrides the filename specified in the `-log` command-line option. This option is useful when working with large numbers of partitions, allowing the partition log files to be suppressed (`-plog none`) or placed in a sub-directory (`-plog replica_files/log.lammps`). If this option is not used the log file for partition N is `log.lammps.N` or whatever is specified by the `-log` command-line option. #### `-pscreen file` **Description:** Specify the base name for the partition screen file, so partition N writes screen information to `file.N`. If `file` is `none`, then no partition screen files are created. This overrides the filename specified in the `-screen` command-line option. This option is useful when working with large numbers of partitions, allowing the partition screen files to be suppressed (`-pscreen none`) or placed in a sub-directory (`-pscreen replica_files/screen`). If this option is not used the screen file for partition N is `screen.N` or whatever is specified by the `-screen` command-line option. #### `-restart file` **Description:** [Description not fully provided in the input text.] #### `-reorder file` **Description:** [Description not fully provided in the input text.] #### `-screen file` **Description:** [Description not fully provided in the input text.] #### `-suffix type` **Description:** [Description not fully provided in the input text.] #### `-var name value` **Description:** [Description not fully provided in the input text.] ### Example Usage: ```bash mpirun -np 16 lmp_auto -v f tmp.out -l my.log -sc none < in.alloy mpirun -np 16 lmp_auto -var f tmp.out -log my.log -screen none < in.alloy ``` ``` -------------------------------- ### Install Git on Ubuntu/Debian Source: https://www.cfdem.com/media/DEM/docu/Section_start Installs the Git version control system on Debian-based Linux distributions using the apt package manager. This is a prerequisite for cloning the LIGGGHTS-PUBLIC repository. ```shell sudo apt-get install git ``` -------------------------------- ### Building and Installing MPICH as a Shared Library Source: https://www.cfdem.com/media/DEM/docu/_sources/Section_start This example shows the steps to build and install the MPICH library as a shared library. This is a prerequisite for LIGGGHTS(R)-PUBLIC if MPI is required and needs to be dynamically linked. ```bash ./configure --enable-shared make make install ``` -------------------------------- ### Example Usage of Make.py Help Switch Source: https://www.cfdem.com/media/DEM/docu/_sources/Section_start Demonstrates how to use the -h switch with Make.py to get help on specific options. This is useful for understanding the detailed functionality of each switch and their parameters. ```bash Make.py -h -i -p ``` -------------------------------- ### Install Prerequisites and Configure Environment for Fedora 25 Source: https://www.cfdem.com/media/DEM/docu/_sources/Section_start Installs Open MPI, VTK, and GCC C++ on Fedora 25, then configures environment variables for parallel execution and library paths. Requires root privileges for installation and user privileges for environment setup. ```bash su - dnf install openmpi openmpi-devel paraview-openmpi paraview-openmpi-devel gcc-c++ exit echo "export PATH=$PATH:/usr/lib64/openmpi/bin" >> ~/.bashrc echo "export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib64/openmpi/lib:/usr/lib64/openmpi/lib/paraview" >> ~/.bashrc echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib:/usr/lib64/openmpi/lib/paraview" >> ~/.bashrc echo "export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/lib64/openmpi/include/paraview" >> ~/.bashrc echo "export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/lib64/openmpi/include/paraview" >> ~/.bashrc ``` -------------------------------- ### Run LIGGGHTS(R)-PUBLIC (MPI) on Windows Source: https://www.cfdem.com/media/DEM/docu/Section_start This outlines the steps to execute the parallel (MPI) version of LIGGGHTS(R)-PUBLIC on Windows. It requires MPICH2 installation and utilization of its mpiexec.exe. The example shows parallel execution and also mentions serial execution as an alternative. ```batch cd "Documents" # Example directory change ... mpiexec -np 4 -localonly lmp_win_mpi -in in.lj # Or for serial execution: lmp_win_mpi -in in.lj ``` -------------------------------- ### LIGGGHTS -help Option for Listing Compiled Options Source: https://www.cfdem.com/media/DEM/docu/Section_start Prints a list of all available command-line options and styles compiled into the LIGGGHTS executable. This is useful for verifying if specific features or packages are included. The program exits after displaying this information. ```text -help Print a list of options compiled into this executable for each LIGGGHTS(R)-PUBLIC style (atom_style, fix, compute, pair_style, bond_style, etc). This can help you know if the command you want to use was included via the appropriate package. LIGGGHTS(R)-PUBLIC will print the info and immediately exit if this switch is used. ``` -------------------------------- ### Build LIGGGHTS(R)-PUBLIC for Mac (OS X) Source: https://www.cfdem.com/media/DEM/docu/Section_start Offers build commands for macOS systems, leveraging its Unix-like nature. It suggests 'make auto' as the primary method and 'make serial' as a fallback. ```makefile make auto make serial ``` -------------------------------- ### Update LIGGGHTS-PUBLIC Code Source: https://www.cfdem.com/media/DEM/docu/Section_start Fetches the latest version of the LIGGGHTS-PUBLIC code from the repository to the local directory. This command should be executed within the cloned LIGGGHTS-PUBLIC folder and is used after an initial clone. ```shell git pull ``` -------------------------------- ### Creating a System-Wide Symbolic Link Source: https://www.cfdem.com/media/DEM/docu/Section_start This command creates a symbolic link to the compiled LIGGGHTS(R)-PUBLIC executable, allowing it to be run from any directory by simply typing 'liggghts'. Administrator privileges are required. An alternative command for systems without 'sudo' is also provided. ```bash sudo ln -s lmp_auto /usr/local/bin ``` ```bash su -c "ln -s lmp_auto /usr/local/bin" ``` -------------------------------- ### LIGGGHTS -partition Option for Multi-Partition Mode Source: https://www.cfdem.com/media/DEM/docu/Section_start Enables multi-partition mode, allowing the total number of processors to be divided into independent simulation partitions. Arguments specify the number and configuration of partitions. The sum of processors across all partitions must equal the total processors available. ```text -partition 8x2 4 5 ... Invoke LIGGGHTS(R)-PUBLIC in multi-partition mode. When LIGGGHTS(R)-PUBLIC is run on P processors and this switch is not used, LIGGGHTS(R)-PUBLIC runs in one partition, i.e. all P processors run a single simulation. If this switch is used, the P processors are split into separate partitions and each partition runs its own simulation. The arguments to the switch specify the number of processors in each partition. Arguments of the form MxN mean M partitions, each with N processors. Arguments of the form N mean a single partition with N processors. The sum of processors in all partitions must equal P. Thus the command “-partition 8x2 4 5” has 10 partitions and runs on a total of 25 processors. To run multiple independent simulatoins from one input script, using multiple partitions, see Section_howto 4 of the manual. World- and universe-style _variables_ are useful in this context. ``` -------------------------------- ### Compiling LIGGGHTS(R)-PUBLIC with a Custom Postfix Source: https://www.cfdem.com/media/DEM/docu/Section_start This command allows for custom builds by appending a string to the Makefile name and the resulting executable. For instance, 'postfix=myString' will look for 'Makefile.user_myString_' and produce an executable named 'lmp_auto_myString_'. This is useful for managing multiple configurations. ```bash make auto postifx=myString ``` -------------------------------- ### Defining Optimized Model Combinations for LIGGGHTS(R)-PUBLIC Source: https://www.cfdem.com/media/DEM/docu/Section_start This example shows how to create a whitelist file to specify model combinations that should be compiled in an optimized manner. By listing desired combinations in 'style_contact_model_user.whitelist', users can improve performance for specific use cases. Recompilation is required after modifying this file. ```plaintext GRAN_MODEL(HERTZ, TANGENTIAL_OFF, COHESION_OFF, ROLLING_OFF, SURFACE_DEFAULT) GRAN_MODEL(HERTZ, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_EPSD, SURFACE_DEFAULT) ``` -------------------------------- ### Building LIGGGHTS(R)-PUBLIC with Optional Packages Source: https://www.cfdem.com/media/DEM/docu/Section_start This snippet shows the final compilation commands for LIGGGHTS(R)-PUBLIC after all dependencies and optional packages have been configured and potentially pre-built. It demonstrates using `make` with a custom target (e.g., `foo`) to generate the executable (e.g., `lmp_foo`). ```bash make foo or gmake foo ``` -------------------------------- ### Fix Freeze Command Example Source: https://www.cfdem.com/media/DEM/docu/fix_freeze Provides a practical example of using the 'fix freeze' command in a simulation setup. This example demonstrates how to apply the freeze fix to a specific group of particles. ```bash fix 2 bottom freeze ``` -------------------------------- ### Python Shebang Line Examples Source: https://www.cfdem.com/media/DEM/docu/_sources/Section_python Examples of shebang lines used at the beginning of a Python script to make it directly executable. The path should point to the correct Python interpreter installation. ```python #!/usr/local/bin/python ``` ```python #!/usr/local/bin/python -i ``` -------------------------------- ### FFTW Library Compilation and Configuration Source: https://www.cfdem.com/media/DEM/docu/Section_start Instructions for compiling and configuring the FFTW library, a fast and portable FFT implementation. It covers downloading FFTW, building it using standard commands, and handling cases where FFTW2 might use renamed header files for different precisions (e.g., sfftw.h, dfftw.h). Specific flags for `make` are shown. ```bash # Download FFTW from www.fftw.org # Build FFTW: ./configure make # Example for LIGGGHTS(R)-PUBLIC if using single/double precision FFTW2: # Ensure FFT_INC is set to -DFFTW_SIZE # Ensure FFT_LIB is set to -lsfftw or -ldfftw respectively ``` -------------------------------- ### Compile and Run LIGGGHTS(R)-PUBLIC on Linux Source: https://www.cfdem.com/media/DEM/docu/Section_start This snippet demonstrates the process of compiling LIGGGHTS(R)-PUBLIC on a Linux system using 'make auto', copying the executable, and then running a benchmark simulation using mpirun for parallel execution. It assumes the user is in the 'src' directory initially. ```bash cd src make auto cp lmp_auto ../examples/LIGGGHTS/Tutorials_public/chute_wear cd ../examples/LIGGGHTS/Tutorials_public/chute_wear mpirun -np 4 lmp_auto < in.chute_wear ``` -------------------------------- ### Compute Pressure Command Examples Source: https://www.cfdem.com/media/DEM/docu/compute_pressure Provides example usage of the 'compute pressure' command. These examples demonstrate how to set up the command with different keyword arguments for temperature and virial calculations. ```bash compute 1 all pressure myTemp compute 1 all pressure thermo_temp pair bond ``` -------------------------------- ### Compute MSD per Molecule Example Source: https://www.cfdem.com/media/DEM/docu/compute_msd_molecule Provides a basic example of using the 'compute msd/molecule' command. This specific example calculates the mean-squared displacement for all molecules ('all' group) and assigns it the compute ID '1'. This is a common starting point for MSD calculations. ```bash compute 1 all msd/molecule ``` -------------------------------- ### Compute Reduce Examples Source: https://www.cfdem.com/media/DEM/docu/compute_reduce Provides practical examples of using the 'compute reduce' and 'compute reduce/region' commands with different modes and input types, including the 'replace' keyword. ```text compute 1 all reduce sum c_force compute 1 all reduce/region subbox sum c_force compute 2 all reduce min c_press**2** f_ave v_myKE compute 3 fluid reduce max c_index**1** c_index**2** c_dist replace 1 3 replace 2 3 ``` -------------------------------- ### Uncommenting VTK Libraries for Compilation Source: https://www.cfdem.com/media/DEM/docu/Section_start This snippet shows how to uncomment specific lines in a configuration file to include additional VTK libraries. These lines, typically starting with '#VTK_ADDLIBS_USR=', need to be modified to include the necessary library paths for compilation. ```makefile #VTK_ADDLIBS_USR= ``` -------------------------------- ### LIGGGHTS(R)-PUBLIC Library Initialization and Execution Source: https://www.cfdem.com/media/DEM/docu/_sources/Section_howto Demonstrates how to open an instance of LIGGGHTS(R)-PUBLIC, pass input commands via file or string, and subsequently close the instance. These functions allow external control over LIGGGHTS(R)-PUBLIC simulations. ```c++ void *lmp = lammps_open(argc, argv); // ... setup and run simulation using lammps_file() or lammps_command() ... lammps_close(lmp); ``` -------------------------------- ### Install Prerequisites for Ubuntu 16.04 LTS Source: https://www.cfdem.com/media/DEM/docu/_sources/Section_start Installs Open MPI, VTK, and related development libraries on Ubuntu 16.04 LTS. Requires root privileges. ```bash sudo apt-get install openmpi-bin libopenmpi-dev libvtk6.2 libvtk6-dev ``` -------------------------------- ### LIGGGHTS -nocite Option to Disable Citation Logging Source: https://www.cfdem.com/media/DEM/docu/Section_start Disables the creation of the 'log.cite' file, which normally lists references for cite-able features used in a simulation. This is useful for runs where citation tracking is not required. ```text -nocite Disable writing the log.cite file which is normally written to list references for specific cite-able features used during a LIGGGHTS(R)-PUBLIC run. See the citation page for more details. ``` -------------------------------- ### Initialization Commands in LIGGGHTS Source: https://www.cfdem.com/media/DEM/docu/_sources/Section_input_script Lists essential commands for initializing a LIGGGHTS simulation, including setting units, dimensions, boundary conditions, atom style, and force field parameters. ```liggghts units metal dimension 3 newton on processors 4 boundary p p p atom_style atomic atom_modify map array pair_style lj/cut 10.0 bond_style harmonic fix wall/gran 1.0 point 0.0 0.0 0.0 10.0 ``` -------------------------------- ### LIGGGHTS -in Option for Input Script Specification Source: https://www.cfdem.com/media/DEM/docu/Section_start Specifies the input script file for LIGGGHTS. If not provided in single-partition mode, input is read from standard input. This is a mandatory option for multi-partition mode. ```text -in file Specify a file to use as an input script. This is an optional switch when running LIGGGHTS(R)-PUBLIC in one-partition mode. If it is not specified, LIGGGHTS(R)-PUBLIC reads its input script from stdin - e.g. lmp_auto < in.run. This is a required switch when running LIGGGHTS(R)-PUBLIC in multi-partition mode, since multiple processors cannot all read from stdin. ``` -------------------------------- ### Compute Reduce Example: Finding Bond with Maximum Stretch Source: https://www.cfdem.com/media/DEM/docu/compute_reduce This example demonstrates how to use the 'compute reduce' command with the 'replace' keyword to find the bond with maximum stretch. It utilizes 'compute property/local' to get atom IDs and 'compute bond/local' for bond distances. The 'replace' keyword extracts atom IDs corresponding to the maximum stretch bond for thermodynamic output. ```liggghts compute 1 all property/local batom1 batom2 compute 2 all bond/local dist compute 3 all reduce max c_1[1] c_1[2] c_2 replace 1 3 replace 2 3 thermo_style custom step temp c_3[1] c_3[2] c_3[3] ``` -------------------------------- ### Install Python Wrapper using Make Command Source: https://www.cfdem.com/media/DEM/docu/Section_python Installs the Python wrapper by executing the 'make install-python' command from the src directory. This method does not allow for optional arguments and may require 'sudo'. ```bash % make install-python ``` ```bash % sudo make install-python ``` -------------------------------- ### Install Prerequisites for Ubuntu 17.10 Source: https://www.cfdem.com/media/DEM/docu/_sources/Section_start Installs Open MPI, VTK, and related development libraries on Ubuntu 17.10. Requires root privileges. ```bash sudo apt-get install openmpi-bin libopenmpi-dev libvtk6.3 libvtk6-dev ``` -------------------------------- ### LIGGGHTS -echo Option for Command Echoing Source: https://www.cfdem.com/media/DEM/docu/Section_start Controls the echoing of commands from the input script to the screen, log file, or both. This option aids in debugging by showing which commands are being processed. The default behavior is to echo to the log file. ```text -echo style Set the style of command echoing. The style can be _none_ or _screen_ or _log_ or _both_. Depending on the style, each command read from the input script will be echoed to the screen and/or logfile. This can be useful to figure out which line of your script is causing an input error. The default value is _log_. The echo style can also be set by using the _echo_ command in the input script itself. ```