Unverified Commit 6813ab4c authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1832 from akohlmey/doc-styles-check

Check style command lists against existing styles in sources
parents eed85bb6 64e72b1c
Loading
Loading
Loading
Loading
+29 −17
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocess
SOURCES=$(filter-out $(wildcard $(TXTDIR)/lammps_commands*.txt) $(TXTDIR)/lammps_support.txt $(TXTDIR)/lammps_tutorials.txt,$(wildcard $(TXTDIR)/*.txt))
SOURCES=$(filter-out $(wildcard $(TXTDIR)/lammps_commands*.txt) $(TXTDIR)/lammps_support.txt $(TXTDIR)/lammps_tutorials.txt,$(wildcard $(TXTDIR)/*.txt))
OBJECTS=$(SOURCES:$(TXTDIR)/%.txt=$(RSTDIR)/%.rst)
OBJECTS=$(SOURCES:$(TXTDIR)/%.txt=$(RSTDIR)/%.rst)


.PHONY: help clean-all clean epub mobi rst html pdf venv spelling anchor_check
.PHONY: help clean-all clean epub mobi rst html pdf venv spelling anchor_check style_check


# ------------------------------------------
# ------------------------------------------


@@ -46,6 +46,7 @@ help:
	@echo "  clean      remove all intermediate RST files"
	@echo "  clean      remove all intermediate RST files"
	@echo "  clean-all  reset the entire build environment"
	@echo "  clean-all  reset the entire build environment"
	@echo "  anchor_check  scan for duplicate anchor labels"
	@echo "  anchor_check  scan for duplicate anchor labels"
	@echo "  style_check   check for complete and consistent style lists"
	@echo "  spelling   spell-check the manual"
	@echo "  spelling   spell-check the manual"


# ------------------------------------------
# ------------------------------------------
@@ -69,6 +70,7 @@ html: $(OBJECTS) $(ANCHORCHECK)
		echo "############################################" ;\
		echo "############################################" ;\
		rst_anchor_check src/*.rst ;\
		rst_anchor_check src/*.rst ;\
		env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
		env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
		python utils/check-styles.py -s ../src -d src ;\
		echo "############################################" ;\
		echo "############################################" ;\
		deactivate ;\
		deactivate ;\
	)
	)
@@ -126,6 +128,8 @@ pdf: $(OBJECTS) $(ANCHORCHECK)
		sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
		sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
		echo "############################################" ;\
		echo "############################################" ;\
		rst_anchor_check src/*.rst ;\
		rst_anchor_check src/*.rst ;\
		env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
		python utils/check-styles.py -s ../src -d src ;\
		echo "############################################" ;\
		echo "############################################" ;\
		deactivate ;\
		deactivate ;\
	)
	)
@@ -138,6 +142,7 @@ pdf: $(OBJECTS) $(ANCHORCHECK)
		mv tmp.tex LAMMPS.tex && \
		mv tmp.tex LAMMPS.tex && \
		make && \
		make && \
		make && \
		make && \
		make && \
		mv LAMMPS.pdf ../Manual.pdf && \
		mv LAMMPS.pdf ../Manual.pdf && \
		cd ../;
		cd ../;
	@rm -rf latex/_sources
	@rm -rf latex/_sources
@@ -166,6 +171,13 @@ anchor_check : $(ANCHORCHECK)
		deactivate ;\
		deactivate ;\
	)
	)


style_check :
	@(\
		. $(VENV)/bin/activate ;\
		python utils/check-styles.py -s ../src -d src ;\
		deactivate ;\
	)

# ------------------------------------------
# ------------------------------------------


$(RSTDIR)/%.rst : $(TXTDIR)/%.txt $(TXT2RST)
$(RSTDIR)/%.rst : $(TXTDIR)/%.txt $(TXT2RST)
+3 −3
Original line number Original line Diff line number Diff line
@@ -55,8 +55,8 @@ the doc dir.
   make mobi         # generate LAMMPS.mobi in MOBI format using ebook-convert
   make mobi         # generate LAMMPS.mobi in MOBI format using ebook-convert
   make clean        # remove intermediate RST files created by HTML build
   make clean        # remove intermediate RST files created by HTML build
   make clean-all    # remove entire build folder and any cached data
   make clean-all    # remove entire build folder and any cached data

   make anchor_check # check for duplicate anchor labels
make anchor\_check # check for duplicate anchor labels
   style_check       # check for complete and consistent style lists
   make spelling     # spell-check the manual
   make spelling     # spell-check the manual




+1 −0
Original line number Original line Diff line number Diff line
@@ -100,6 +100,7 @@ accelerated styles exist.
* :doc:`nonlinear <bond_nonlinear>` - nonlinear bond
* :doc:`nonlinear <bond_nonlinear>` - nonlinear bond
* :doc:`oxdna/fene <bond_oxdna>` - modified FENE bond suitable for DNA modeling
* :doc:`oxdna/fene <bond_oxdna>` - modified FENE bond suitable for DNA modeling
* :doc:`oxdna2/fene <bond_oxdna>` - same as oxdna but used with different pair styles
* :doc:`oxdna2/fene <bond_oxdna>` - same as oxdna but used with different pair styles
* :doc:`oxrna2/fene <bond_oxdna>` - modified FENE bond suitable for RNA modeling
* :doc:`quartic <bond_quartic>` - breakable quartic bond
* :doc:`quartic <bond_quartic>` - breakable quartic bond
* :doc:`table <bond_table>` - tabulated by bond length
* :doc:`table <bond_table>` - tabulated by bond length


+12 −10
Original line number Original line Diff line number Diff line
@@ -64,16 +64,16 @@ with new settings). This is the same as if an "unfix" command were
first performed on the old fix, except that the new fix is kept in the
first performed on the old fix, except that the new fix is kept in the
same order relative to the existing fixes as the old one originally
same order relative to the existing fixes as the old one originally
was.  Note that this operation also wipes out any additional changes
was.  Note that this operation also wipes out any additional changes
made to the old fix via the :doc:`fix\_modify <fix_modify>` command.
made to the old fix via the :doc:`fix_modify <fix_modify>` command.


The :doc:`fix modify <fix_modify>` command allows settings for some
The :doc:`fix modify <fix_modify>` command allows settings for some
fixes to be reset.  See the doc page for individual fixes for details.
fixes to be reset.  See the doc page for individual fixes for details.


Some fixes store an internal "state" which is written to binary
Some fixes store an internal "state" which is written to binary
restart files via the :doc:`restart <restart>` or
restart files via the :doc:`restart <restart>` or
:doc:`write\_restart <write_restart>` commands.  This allows the fix to
:doc:`write_restart <write_restart>` commands.  This allows the fix to
continue on with its calculations in a restarted simulation.  See the
continue on with its calculations in a restarted simulation.  See the
:doc:`read\_restart <read_restart>` command for info on how to re-specify
:doc:`read_restart <read_restart>` command for info on how to re-specify
a fix in an input script that reads a restart file.  See the doc pages
a fix in an input script that reads a restart file.  See the doc pages
for individual fixes for info on which ones can be restarted.
for individual fixes for info on which ones can be restarted.


@@ -133,7 +133,7 @@ various commands explain the details.


In LAMMPS, the values generated by a fix can be used in several ways:
In LAMMPS, the values generated by a fix can be used in several ways:


* Global values can be output via the :doc:`thermo\_style custom <thermo_style>` or :doc:`fix ave/time <fix_ave_time>` command.
* Global values can be output via the :doc:`thermo_style custom <thermo_style>` or :doc:`fix ave/time <fix_ave_time>` command.
  Or the values can be referenced in a :doc:`variable equal <variable>` or
  Or the values can be referenced in a :doc:`variable equal <variable>` or
  :doc:`variable atom <variable>` command.
  :doc:`variable atom <variable>` command.
* Per-atom values can be output via the :doc:`dump custom <dump>` command.
* Per-atom values can be output via the :doc:`dump custom <dump>` command.
@@ -257,6 +257,7 @@ accelerated styles exist.
* :doc:`mvv/edpd <fix_mvv_dpd>` - constant energy DPD using the modified velocity-Verlet algorithm
* :doc:`mvv/edpd <fix_mvv_dpd>` - constant energy DPD using the modified velocity-Verlet algorithm
* :doc:`mvv/tdpd <fix_mvv_dpd>` - constant temperature DPD using the modified velocity-Verlet algorithm
* :doc:`mvv/tdpd <fix_mvv_dpd>` - constant temperature DPD using the modified velocity-Verlet algorithm
* :doc:`neb <fix_neb>` - nudged elastic band (NEB) spring forces
* :doc:`neb <fix_neb>` - nudged elastic band (NEB) spring forces
* :doc:`neb/spin <fix_neb_spin>` - nudged elastic band (NEB) spring forces for spins
* :doc:`nph <fix_nh>` - constant NPH time integration via Nose/Hoover
* :doc:`nph <fix_nh>` - constant NPH time integration via Nose/Hoover
* :doc:`nph/asphere <fix_nph_asphere>` - NPH for aspherical particles
* :doc:`nph/asphere <fix_nph_asphere>` - NPH for aspherical particles
* :doc:`nph/body <fix_nph_body>` - NPH for body particles
* :doc:`nph/body <fix_nph_body>` - NPH for body particles
@@ -339,15 +340,16 @@ accelerated styles exist.
* :doc:`rx <fix_rx>` -
* :doc:`rx <fix_rx>` -
* :doc:`saed/vtk <fix_saed_vtk>` -
* :doc:`saed/vtk <fix_saed_vtk>` -
* :doc:`setforce <fix_setforce>` - set the force on each atom
* :doc:`setforce <fix_setforce>` - set the force on each atom
* :doc:`setforce/spin <fix_setforce>` - set magnetic precession vectors on each atom
* :doc:`shake <fix_shake>` - SHAKE constraints on bonds and/or angles
* :doc:`shake <fix_shake>` - SHAKE constraints on bonds and/or angles
* :doc:`shardlow <fix_shardlow>` - integration of DPD equations of motion using the Shardlow splitting
* :doc:`shardlow <fix_shardlow>` - integration of DPD equations of motion using the Shardlow splitting
* :doc:`smd <fix_smd>` - applied a steered MD force to a group
* :doc:`smd <fix_smd>` - applied a steered MD force to a group
* :doc:`smd/adjust\_dt <fix_smd_adjust_dt>` -
* :doc:`smd/adjust_dt <fix_smd_adjust_dt>` -
* :doc:`smd/integrate\_tlsph <fix_smd_integrate_tlsph>` -
* :doc:`smd/integrate_tlsph <fix_smd_integrate_tlsph>` -
* :doc:`smd/integrate\_ulsph <fix_smd_integrate_ulsph>` -
* :doc:`smd/integrate_ulsph <fix_smd_integrate_ulsph>` -
* :doc:`smd/move\_tri\_surf <fix_smd_move_triangulated_surface>` -
* :doc:`smd/move_tri_surf <fix_smd_move_triangulated_surface>` -
* :doc:`smd/setvel <fix_smd_setvel>` -
* :doc:`smd/setvel <fix_smd_setvel>` -
* :doc:`smd/wall\_surface <fix_smd_wall_surface>` -
* :doc:`smd/wall_surface <fix_smd_wall_surface>` -
* :doc:`spring <fix_spring>` - apply harmonic spring force to group of atoms
* :doc:`spring <fix_spring>` - apply harmonic spring force to group of atoms
* :doc:`spring/chunk <fix_spring_chunk>` - apply harmonic spring force to each chunk of atoms
* :doc:`spring/chunk <fix_spring_chunk>` - apply harmonic spring force to each chunk of atoms
* :doc:`spring/rg <fix_spring_rg>` - spring on radius of gyration of group of atoms
* :doc:`spring/rg <fix_spring_rg>` - spring on radius of gyration of group of atoms
@@ -399,7 +401,7 @@ individual fixes tell if it is part of a package.
Related commands
Related commands
""""""""""""""""
""""""""""""""""


:doc:`unfix <unfix>`, :doc:`fix\_modify <fix_modify>`
:doc:`unfix <unfix>`, :doc:`fix_modify <fix_modify>`


**Default:** none
**Default:** none


+20 −13
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@ Description
Set the formula(s) LAMMPS uses to compute pairwise interactions.  In
Set the formula(s) LAMMPS uses to compute pairwise interactions.  In
LAMMPS, pair potentials are defined between pairs of atoms that are
LAMMPS, pair potentials are defined between pairs of atoms that are
within a cutoff distance and the set of active interactions typically
within a cutoff distance and the set of active interactions typically
changes over time.  See the :doc:`bond\_style <bond_style>` command to
changes over time.  See the :doc:`bond_style <bond_style>` command to
define potentials between pairs of bonded atoms, which typically
define potentials between pairs of bonded atoms, which typically
remain in place for the duration of a simulation.
remain in place for the duration of a simulation.


@@ -48,11 +48,11 @@ different pair potentials can be setup using the *hybrid* pair style.


The coefficients associated with a pair style are typically set for
The coefficients associated with a pair style are typically set for
each pair of atom types, and are specified by the
each pair of atom types, and are specified by the
:doc:`pair\_coeff <pair_coeff>` command or read from a file by the
:doc:`pair_coeff <pair_coeff>` command or read from a file by the
:doc:`read\_data <read_data>` or :doc:`read\_restart <read_restart>`
:doc:`read_data <read_data>` or :doc:`read_restart <read_restart>`
commands.
commands.


The :doc:`pair\_modify <pair_modify>` command sets options for mixing of
The :doc:`pair_modify <pair_modify>` command sets options for mixing of
type I-J interaction coefficients and adding energy offsets or tail
type I-J interaction coefficients and adding energy offsets or tail
corrections to Lennard-Jones potentials.  Details on these options as
corrections to Lennard-Jones potentials.  Details on these options as
they pertain to individual potentials are described on the doc page
they pertain to individual potentials are described on the doc page
@@ -70,11 +70,11 @@ cutoffs for all pairs of atom types. The distance(s) can be smaller
or larger than the dimensions of the simulation box.
or larger than the dimensions of the simulation box.


Typically, the global cutoff value can be overridden for a specific
Typically, the global cutoff value can be overridden for a specific
pair of atom types by the :doc:`pair\_coeff <pair_coeff>` command.  The
pair of atom types by the :doc:`pair_coeff <pair_coeff>` command.  The
pair style settings (including global cutoffs) can be changed by a
pair style settings (including global cutoffs) can be changed by a
subsequent pair\_style command using the same style.  This will reset
subsequent pair\_style command using the same style.  This will reset
the cutoffs for all atom type pairs, including those previously set
the cutoffs for all atom type pairs, including those previously set
explicitly by a :doc:`pair\_coeff <pair_coeff>` command.  The exceptions
explicitly by a :doc:`pair_coeff <pair_coeff>` command.  The exceptions
to this are that pair\_style *table* and *hybrid* settings cannot be
to this are that pair\_style *table* and *hybrid* settings cannot be
reset.  A new pair\_style command for these styles will wipe out all
reset.  A new pair\_style command for these styles will wipe out all
previously specified pair\_coeff values.
previously specified pair\_coeff values.
@@ -88,7 +88,7 @@ also listed in more compact form on the :doc:`Commands pair <Commands_pair>` doc


Click on the style to display the formula it computes, any additional
Click on the style to display the formula it computes, any additional
arguments specified in the pair\_style command, and coefficients
arguments specified in the pair\_style command, and coefficients
specified by the associated :doc:`pair\_coeff <pair_coeff>` command.
specified by the associated :doc:`pair_coeff <pair_coeff>` command.


There are also additional accelerated pair styles included in the
There are also additional accelerated pair styles included in the
LAMMPS distribution for faster performance on CPUs, GPUs, and KNLs.
LAMMPS distribution for faster performance on CPUs, GPUs, and KNLs.
@@ -170,6 +170,7 @@ accelerated styles exist.
* :doc:`gauss <pair_gauss>` - Gaussian potential
* :doc:`gauss <pair_gauss>` - Gaussian potential
* :doc:`gauss/cut <pair_gauss>` - generalized Gaussian potential
* :doc:`gauss/cut <pair_gauss>` - generalized Gaussian potential
* :doc:`gayberne <pair_gayberne>` - Gay-Berne ellipsoidal potential
* :doc:`gayberne <pair_gayberne>` - Gay-Berne ellipsoidal potential
* :doc:`granular <pair_granular>` - Generalized granular potential
* :doc:`gran/hertz/history <pair_gran>` - granular potential with Hertzian interactions
* :doc:`gran/hertz/history <pair_gran>` - granular potential with Hertzian interactions
* :doc:`gran/hooke <pair_gran>` - granular potential with history effects
* :doc:`gran/hooke <pair_gran>` - granular potential with history effects
* :doc:`gran/hooke/history <pair_gran>` - granular potential without history effects
* :doc:`gran/hooke/history <pair_gran>` - granular potential without history effects
@@ -267,6 +268,12 @@ accelerated styles exist.
* :doc:`oxdna2/hbond <pair_oxdna2>` -
* :doc:`oxdna2/hbond <pair_oxdna2>` -
* :doc:`oxdna2/stk <pair_oxdna2>` -
* :doc:`oxdna2/stk <pair_oxdna2>` -
* :doc:`oxdna2/xstk <pair_oxdna2>` -
* :doc:`oxdna2/xstk <pair_oxdna2>` -
* :doc:`oxrna2/coaxstk <pair_oxrna2>` -
* :doc:`oxrna2/dh <pair_oxrna2>` -
* :doc:`oxrna2/excv <pair_oxrna2>` -
* :doc:`oxrna2/hbond <pair_oxrna2>` -
* :doc:`oxrna2/stk <pair_oxrna2>` -
* :doc:`oxrna2/xstk <pair_oxrna2>` -
* :doc:`peri/eps <pair_peri>` - peridynamic EPS potential
* :doc:`peri/eps <pair_peri>` - peridynamic EPS potential
* :doc:`peri/lps <pair_peri>` - peridynamic LPS potential
* :doc:`peri/lps <pair_peri>` - peridynamic LPS potential
* :doc:`peri/pmb <pair_peri>` - peridynamic PMB potential
* :doc:`peri/pmb <pair_peri>` - peridynamic PMB potential
@@ -280,7 +287,7 @@ accelerated styles exist.
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>` - smoothed dissipative particle dynamics for water at isothermal conditions
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>` - smoothed dissipative particle dynamics for water at isothermal conditions
* :doc:`smd/hertz <pair_smd_hertz>` -
* :doc:`smd/hertz <pair_smd_hertz>` -
* :doc:`smd/tlsph <pair_smd_tlsph>` -
* :doc:`smd/tlsph <pair_smd_tlsph>` -
* :doc:`smd/tri\_surface <pair_smd_triangulated_surface>` -
* :doc:`smd/tri_surface <pair_smd_triangulated_surface>` -
* :doc:`smd/ulsph <pair_smd_ulsph>` -
* :doc:`smd/ulsph <pair_smd_ulsph>` -
* :doc:`smtbq <pair_smtbq>` -
* :doc:`smtbq <pair_smtbq>` -
* :doc:`snap <pair_snap>` - SNAP quantum-accurate potential
* :doc:`snap <pair_snap>` - SNAP quantum-accurate potential
@@ -328,8 +335,8 @@ Restrictions




This command must be used before any coefficients are set by the
This command must be used before any coefficients are set by the
:doc:`pair\_coeff <pair_coeff>`, :doc:`read\_data <read_data>`, or
:doc:`pair_coeff <pair_coeff>`, :doc:`read_data <read_data>`, or
:doc:`read\_restart <read_restart>` commands.
:doc:`read_restart <read_restart>` commands.


Some pair styles are part of specific packages.  They are only enabled
Some pair styles are part of specific packages.  They are only enabled
if LAMMPS was built with that package.  See the :doc:`Build package <Build_package>` doc page for more info.  The doc pages for
if LAMMPS was built with that package.  See the :doc:`Build package <Build_package>` doc page for more info.  The doc pages for
@@ -338,9 +345,9 @@ individual pair potentials tell if it is part of a package.
Related commands
Related commands
""""""""""""""""
""""""""""""""""


:doc:`pair\_coeff <pair_coeff>`, :doc:`read\_data <read_data>`,
:doc:`pair_coeff <pair_coeff>`, :doc:`read_data <read_data>`,
:doc:`pair\_modify <pair_modify>`, :doc:`kspace\_style <kspace_style>`,
:doc:`pair_modify <pair_modify>`, :doc:`kspace_style <kspace_style>`,
:doc:`dielectric <dielectric>`, :doc:`pair\_write <pair_write>`
:doc:`dielectric <dielectric>`, :doc:`pair_write <pair_write>`


Default
Default
"""""""
"""""""
Loading