Skip to content

Commit 4651825

Browse files
committed
added minimalistic example of running lammps though command line
1 parent 0bf508b commit 4651825

File tree

2 files changed

+32
-34
lines changed

2 files changed

+32
-34
lines changed

journal-article.bib

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,12 @@ @misc{lammps_gui_docs
674674
note = {Accessed: 2024-07-15}
675675
}
676676

677+
@misc{lammps_run_docs,
678+
title = {{Run LAMMPS} Online Documentation for latest stable version},
679+
howpublished = {\url{https://docs.lammps.org/Run_head.html}},
680+
note = {Accessed: 2024-12-14}
681+
}
682+
677683
@article{typelabel_paper,
678684
author = {Gissinger, Jacob R. and Nikiforov, Ilia and Afshar,
679685
Yaser and Waters, Brendon and Choi, Moon-ki and Karls,

lammps-tutorials.tex

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,8 @@ \subsection{Software/system requirements}
372372
visualization, suitable external tools include VMD \cite{vmd_home,humphrey1996vmd}
373373
and OVITO \cite{ovito_home,ovito_paper}.
374374

375-
\hyperref[compiling-lammps-label]{Appendix \ref{compiling-lammps-label}}
376-
has instructions for compiling LAMMPS from source for use with this
377-
tutorial in case there is no suitable precompiled version available
378-
for your platform or environment.
379-
380-
\hyperref[parallel-lammps-label]{Appendix \ref{parallel-lammps-label}}
381-
provides instructions for running LAMMPS in parallel using MPI when
382-
using LAMMPS executables compiled with MPI enabled, for example on HPC
383-
clusters.
375+
\hyperref[command-line-label]{Appendix \ref{command-line-label}} has instructions
376+
for running LAMMPS from the command line.
384377

385378
\subsection{About LAMMPS--GUI}
386379

@@ -1636,7 +1629,7 @@ \subsubsection{Breakable bonds}
16361629
\paragraph{Launch the deformation}
16371630

16381631
After equilibration, let us set the velocity of the edges equal to
1639-
$75~\text{m/s}$ (or $0.75~\text{\AA{}/fs}$) and run for a longer duration than
1632+
$75~\text{m/s}$ (or $0.75~\text{\AA{}/ps}$) and run for a longer duration than
16401633
previously. Add the following lines into \flecmd{breakable.lmp}:
16411634
\begin{lstlisting}
16421635
velocity cnt_top set 0.75 0 0
@@ -1655,7 +1648,9 @@ \subsubsection{Breakable bonds}
16551648
\label{fig:CNT-deformed-breakable}
16561649
\end{figure}
16571650

1658-
Looking at the evolution of the energy, one can see that the total energy $E_\text{tot}$ is initially increasing with the deformation. When bonds break, the energy relaxes abruptly,
1651+
Looking at the evolution of the energy, one can see that the total
1652+
energy $E_\text{tot}$ is initially increasing with the deformation. When
1653+
bonds break, the energy relaxes abruptly,
16591654
as can be seen near $t=110~\text{ps}$ and again near $t=130~\text{ps}$ in
16601655
Fig.\,\ref{fig:CNT-deformed-breakable}\,a. Using the same script as previously to
16611656
import the data into Python, the stress-strain
@@ -4453,31 +4448,28 @@ \subsection{Preferences}
44534448
\end{itemize}
44544449
See Ref.\,\citenum{lammps_gui_docs} for a full list of options.
44554450

4456-
\section{Compiling LAMMPS from Source on Linux}
4457-
\label{compiling-lammps-label}
4458-
FIXME: add section
4459-
4460-
% AK: For beginner we recommend CMake and a current Linux OS (at least Ubuntu 22.04LTS, RHEL 9 (and Alma, or Rocky), Fedora 39)
4461-
% The Linux system must support packages for software development installed and the corresponding development packages for compiling with MPI
4462-
4463-
% AK: a mostly complete list of packages for different Linux flavors can be inferred from singularity/apptainer container definition files in "tools/singularity"
4464-
4465-
%Depending on your operating system (i.e.~Linux, macOS, or Windows), the procedure may differ. LAMMPS must be compiled with the following packages:
4466-
%\begin{itemize}
4467-
%\item MANYBODY
4468-
%\item MOLECULE
4469-
%\item KSPACE
4470-
%\item RIGID
4471-
%\item REAXFF
4472-
%\item EXTRA-DUMP
4473-
%\end{itemize}
4474-
4475-
% AK: for non-Linux OS please refer to LAMMPS Manual.
4451+
\section{Running LAMMPS via Command Line}
4452+
\label{command-line-label}
44764453

4454+
LAMMPS can be executed from the command line on Linux, macOS,
4455+
as well as Windows. On Linux/macOS, first navigate to the directory containing
4456+
the \flecmd{input.lmp} file and execute:
4457+
\begin{lstlisting}
4458+
lmp -in input.lmp
4459+
\end{lstlisting}
4460+
where \flecmd{lmp} is the LAMMPS executable.
4461+
For parallel execution on 4 processors, use:
4462+
\begin{lstlisting}[language=bash]
4463+
mpirun -np 4 lmp -in input.lmp
4464+
\end{lstlisting}
4465+
On Windows, run the following command via Command Prompt or PowerShell:
4466+
\begin{lstlisting}
4467+
lmp.exe -in input.lmp
4468+
\end{lstlisting}
4469+
where \flecmd{lmp.exe} is the Windows executable version of LAMMPS. See
4470+
Ref.\,\citenum{lammps_run_docs} for a complete description on how to run
4471+
LAMMPS.
44774472

4478-
\section{Running LAMMPS in Parallel with MPI}
4479-
\label{parallel-lammps-label}
4480-
FIXME: add section
44814473
\end{appendices}
44824474

44834475
\end{document}

0 commit comments

Comments
 (0)