Skip to content

Commit 152c38d

Browse files
committed
work on tutorial 1
1 parent f66674c commit 152c38d

File tree

7 files changed

+88
-14
lines changed

7 files changed

+88
-14
lines changed

docs/sphinx/compile.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import subprocess
2+
import re
3+
4+
# Define ANSI escape codes for colors
5+
RED = '\033[91m'
6+
GREEN = '\033[92m'
7+
GRAY = '\033[90m'
8+
RESET = '\033[0m'
9+
10+
def filter_make_output():
11+
12+
# Define multiple patterns to ignore
13+
ignore_patterns = [
14+
"Pygments lexer name 'bw' is not known",
15+
"Pygments lexer name 'lammps' is not known",
16+
".. label:: start_",
17+
".. label:: end_",
18+
"Unknown directive type"
19+
]
20+
21+
# Define a pattern to identify warnings (example pattern, adjust as needed)
22+
warning_pattern = re.compile('|'.join(re.escape(p) for p in ["WARNING:", "ERROR:"]))
23+
24+
# Combine ignore patterns into a single regex pattern
25+
ignore_pattern = re.compile('|'.join(re.escape(p) for p in ignore_patterns))
26+
27+
# Run 'make clean'
28+
subprocess.run(['make', 'clean'], check=True)
29+
30+
# Run 'make html' and capture output
31+
process = subprocess.Popen(['make', 'html'],
32+
stdout=subprocess.PIPE,
33+
stderr=subprocess.STDOUT, text=True)
34+
35+
# Read and filter output
36+
output_lines = []
37+
for line in process.stdout:
38+
if len(line) > 1:
39+
if not ignore_pattern.search(line):
40+
# Determine the color based on whether the line matches the warning pattern
41+
if warning_pattern.search(line):
42+
output_lines.append(RED + line + RESET)
43+
else:
44+
output_lines.append(GRAY + line + RESET)
45+
46+
# Wait for the process to complete
47+
process.wait()
48+
49+
# Print the filtered output
50+
print(''.join(output_lines), end='')
51+
52+
if __name__ == "__main__":
53+
filter_make_output()

docs/sphinx/source/journal-article.bib

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ @book{barrat2003basic
55
publisher={Cambridge University Press}
66
}
77

8+
@article{gravelle2025tutorials,
9+
author = {Simon Gravelle and Jacob R. Gissinger and Axel Kohlmeyer},
10+
title = {A Set of Tutorials for the LAMMPS Simulation Package},
11+
journal = {arXiv preprint},
12+
year = {2025},
13+
archivePrefix = {arXiv},
14+
eprint = {2503.14020},
15+
primaryClass = {physics.comp-ph},
16+
doi = {10.48550/arXiv.2503.14020},
17+
note = {Submitted on 18 Mar 2025}
18+
}
19+
20+
@misc{lammps_code,
21+
author = {Plimpton, Steven J. and Kohlmeyer, Axel and Thompson, Aidan P. and Moore, Stan G. and Berger, Richard},
22+
title = {{LAMMPS: Large-scale Atomic/Molecular Massively
23+
Parallel Simulator}},
24+
month = aug,
25+
year = 2024,
26+
publisher = {Zenodo},
27+
version = {stable\_XXAug2024},
28+
doi = {10.5281/zenodo.3726416},
29+
url = {https://doi.org/10.5281/zenodo.3726416}
30+
}
31+
832
@article{sulpizi2012silica,
933
title={The silica--water interface: how the silanols determine the surface acidity and modulate the water properties},
1034
author={Sulpizi, Marialore and Gaigeot, Marie-Pierre and Sprik, Michiel},

docs/sphinx/source/shared/cite.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
If these tutorials are useful to you, please cite Ref. :cite:`gravelle2025tutorials`.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.. container:: version
22

3-
This tutorial is compatible with the XXXX2024 LAMMPS version.
3+
This tutorial is compatible with the 29Aug2024 (update 2) LAMMPS version.

docs/sphinx/source/tutorial1/introduction.rst

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@
1212
:align: right
1313
:class: only-light
1414

15-
The objective of this tutorial is to perform the simulation of a binary
16-
fluid using LAMMPS.
17-
18-
The system is a Lennard-Jones fluid composed of neutral particles with two
19-
different diameters, contained within a cubic box with periodic boundary conditions
20-
In this tutorial, the temperature of the system is maintained using a Langevin
21-
thermostat :cite:`schneider1978molecular`, and basic quantities are extracted
22-
from the system, including the potential and kinetic energies.
23-
24-
This tutorial illustrates several key ingredients of molecular dynamics
25-
simulations, such as system initialization, energy minimization, integration
26-
of the equations of motion, and trajectory visualization.
15+
The objective of this tutorial is to perform simple MD simulations
16+
using LAMMPS. The system consists of a Lennard-Jones fluid composed of
17+
neutral particles with two different effective diameters, contained
18+
within a cubic box with periodic boundary conditions. In this tutorial, basic MD simulations in
19+
the microcanonical (NVE) and canonical (NVT) ensembles are performed,
20+
and basic quantities are calculated, including the potential and kinetic
21+
energies.

docs/sphinx/source/tutorial1/lennard-jones-fluid.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Lennard-Jones fluid
1010
.. include:: introduction.rst
1111
.. include:: ../../non-tutorials/needhelp.rst
1212
.. include:: ../shared/versionLAMMPS.rst
13+
.. include:: ../shared/cite.rst
1314
.. include:: tutorial.rst
1415
.. include:: ../shared/access-the-files.rst
1516
.. include:: exercises.rst

0 commit comments

Comments
 (0)