You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/etc.rst
+66-3Lines changed: 66 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
1
2
.. _etc:
2
3
3
4
ChIMES in LAMMPS
@@ -63,13 +64,75 @@ Note that the following must also be set in the main LAMMPS input file, to use C
63
64
atom_style atomic
64
65
atom_modify sort 0 0.0
65
66
67
+
**Important Considerations:**
68
+
69
+
Atom Type Mass Matching
70
+
"""""""""""""""""""""
71
+
72
+
The element masses defined in the ChIMES parameter file must match the masses defined in the LAMMPS data file. The matching is done by comparing masses to within 0.001 atomic mass units. The order of atom types in the files does not matter - only the mass values need to match.
73
+
74
+
For example, if your ChIMES parameter file defines elements with masses 12.011 and 15.999, then your LAMMPS data file must have atom types with matching masses, regardless of the order they appear in the files.
75
+
76
+
**ChIMES Parameter File Example:**
77
+
The parameter file defines atom types with specific masses:
78
+
79
+
.. code-block:: text
80
+
81
+
ATOM TYPES: 2
82
+
83
+
# TYPEIDX # # ATM_TYP # # ATMCHRG # # ATMMASS #
84
+
0 C 0 12.011
85
+
1 O 0 15.999
86
+
87
+
**LAMMPS Data File Example:**
88
+
The data file must have atom types with matching masses (order doesn't matter):
89
+
90
+
.. code-block:: text
91
+
92
+
2 atom types
93
+
94
+
Masses
95
+
96
+
1 12.0107 # C (matches ChIMES mass 12.011 within tolerance)
97
+
2 15.9994 # O (matches ChIMES mass 15.999 within tolerance)
98
+
99
+
**Important:** If no mass matches are found between the ChIMES parameter file and LAMMPS data file, the simulation will terminate with an error, as ChIMES cannot be used for any interactions.
100
+
101
+
Hybrid Overlay Usage
102
+
"""""""""""""""""""
103
+
104
+
ChIMES can be used simultaneously with other potentials using LAMMPS' hybrid/overlay pair style. This allows you to combine ChIMES with additional force fields for specific interactions.
In this example, ChIMES is combined with MOMB (Many-body van der Waals) and Lennard-Jones potentials for different atom type interactions.
117
+
118
+
Models with D2 Dispersion Correction
119
+
"""""""""""""""""""""""""""""""""""
120
+
121
+
Using hybrid ChIMES and MOMB is specifically for adding D2 dispersion correction at the time of using LAMMPS. Whether to include MOMB and the parameters used is specific to the ChIMES parameterization and should not be added arbitrarily.
122
+
123
+
**Important:** When using MOMB with ChIMES, you must include the ``make yes-extra-pair`` command in the install.sh script when compiling LAMMPS to enable the MOMB potential support.
124
+
125
+
.. code-block:: text
126
+
127
+
# Compile
128
+
129
+
cd build/${lammps}/src
130
+
make yes-manybody
131
+
make yes-extra-pair
66
132
67
133
.. Warning::
68
134
69
135
1. Implementation assumes outer cutoffs for (n+1)-body interactions are always :math:`\le` those for n-body interactions
70
136
2. This capability is still under testing - please `let us know <https://groups.google.com/g/chimes_software>`_ if you observe strange behavior
71
137
3. Assumes user wants single-atom energies to be added to the system energy. If you don't want to, zero the energy offsets in the parameter file
Copy file name to clipboardExpand all lines: doc/source/getting_started.rst
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,26 +29,30 @@ Please see :ref:`the special Github instructions <page-getting_started-Open-GH>`
29
29
Compiling and running the code
30
30
****************************************
31
31
32
-
As described above, the ``chimes_calculator`` comprises library tools for evaluating ChIMES interactions. However, the repository contains several usage examples (see, e.g. :ref:`ChIMES Calculator <sec-use-examples-api>` and :ref:`ChIMES Calculator Serial Interface <sec-ser-use-examples-api>` examples.). These examples can be compiled by navigating to a given example sub directory (e.g. ``chimes FF/examples/cpp/``) and typing ``make``.
32
+
As described above, the ``chimes_calculator`` comprises library tools for evaluating ChIMES interactions. Further information about the model architecture can be found in :ref:`ChIMES Calculator <page-chimesFF>`. ``chimesFF.h`` and ``chimesFF.cpp`` are the source files that implement the core logic of calculating ChIMES interactions given the cluster of atoms. When the class defined therein is instantiated, it read in a ChIMES parameter file. It then can be used to evaluate individual terms in the many-body cluster expansion that defines the ChIMES potential. Specifically, it contains functions to compute energy, stress tensor, and per-atom forces for an individual 2-, 3- or 4-body cluster of atoms, given their coordinates.
33
33
34
+
For most applications, chimesFF should be integrated into a simulation code that can take a full system configuration, extract all n-body clusters while respecting periodic boundary conditions, and feed them into chimesFF. An example to do this is provided in :ref:`ChIMES Calculator Serial Interface <sec-ser-use-examples-api>`, which demonstrates how to use the ``chimes_calculator`` for an overall system evaluation. We also provide an implementation of chimesFF as a pair_style in lammps in the :ref:`The ChIMES Calculator with LAMMPS <page-etc>` page.
34
35
35
-
Alternatively, the entire software suite can be compiled at once using CMake, via the install script - note that C++, C, *and* Fortran compilers are all required to use the this approach.
36
+
These examples can be compiled by navigating to a given example subdirectory (e.g. ``chimesFF/examples/cpp/``) and typing ``make``.
36
37
38
+
You can compile and install the entire software suite in different computing environments. All require C, C++ and Fortran compilers:
37
39
38
-
If your environment is correctly configured, you can simply execute ``./install.sh``.
40
+
* Standard Installation (Local Machine or Basic Environment)
39
41
40
-
If you are on a HPC using module files, you may need to load them first. Module files are already configured for a handful of HPC - inspect the contents of modfiles to see if
41
-
yours is listed. If it is (e.g., LLNL-LC.mod), execute ``export hosttype=LLNL-LC; ./install.sh`` to install. Otherwise, load the appropriate modules by hand before running the
42
-
install script.
42
+
* If your environment is correctly configured, you can simply execute ``./install.sh`` in the outer most directory.
43
43
44
-
.. Note ::
45
44
46
-
Consider submitting module files and corresponding install.sh changes as a PR, for your HPC!
45
+
* Installation on an HPC cluster
46
+
47
+
* You need to load pre-configured module files first. Module files are already configured for a handful of HPC in ``/modfiles/`` ; verify if yours is listed. If it is (e.g., LLNL-LC.mod), execute ``export hosttype=LLNL-LC; ./install.sh`` to install. Otherwise, load the appropriate modules by hand before running the install script.
47
48
49
+
* CMake-Based Installation
48
50
49
-
, or executing the appropriate CMake commands by simply running ``./install.sh`` from the base ``chimes_calculator`` directory. If the latter option is used, a list of generated executables/library files and their respective install locations can be found in the generated ``build/install_manifest.txt`` file. Note that C++, C, *and* Fortran compilers are all required to use the ``./install.sh`` approach.
51
+
* You can execute the appropriate CMake commands by simply running ``./install.sh`` from the base ``chimes_calculator`` directory. If this option is used, a list of generated executables/library files and their respective install locations can be found in the generated ``build/install_manifest.txt`` file.
50
52
53
+
.. Note ::
51
54
55
+
Consider submitting module files and corresponding install.sh changes as a PR, for your HPC!
52
56
53
57
54
58
Sample ChIMES parameter and input files are provided in the ``serial_interface/tests/force_fields`` and ``serial_interface/tests/configurations`` directories, allowing compiled executables to be tested via, e.g.:
@@ -58,10 +62,16 @@ Sample ChIMES parameter and input files are provided in the ``serial_interface/t
serial_interface/tests/configurations/liqC.2.5gcc_6000K.OUTCAR_#000.xyz | tee my_test.log
65
+
66
+
Compiling the ChIMES Calculator with LAMMPS
67
+
*********************************************
68
+
69
+
We implemented the CHIMES in the `LAMMPS <https://lammps.sandia.gov/>`_ and detailed information regarding Compiling and running can be found in :ref:`The ChIMES Calculator with LAMMPS <page-etc>`.
61
70
62
71
63
-
For additional details on using, integrating, and compiling, and contributing, see:
72
+
For additional details on using, integrating, compiling, and contributing, see:
64
73
65
74
* :ref:`The ChIMES Calculator <page-chimesFF>`
66
75
* :ref:`The ChIMES Calculator Serial Interface <page-serial_interface>`
76
+
* :ref:`The ChIMES Calculator with LAMMPS <page-etc>`
Copy file name to clipboardExpand all lines: doc/source/serial_interface.rst
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,10 @@ The ChIMES Calculator Serial Interface
6
6
Overview
7
7
********
8
8
9
-
The ChIMES calculator serial interface provides an easier means of evaluating ChIMES interactions for a given system. In constrast to the ChIMES calculator (i.e. ``chimesFF``), which takes information on *individual* atom clusters and returns the cluster energy, stress tensor, via ``compute_xB`` functions, the serial interface (i.e. ``serial_chimes_interface``) takes *overall* system information and returns *overall* system energy, stress tensor, and forces. Though far less flexible than direct use of ``chimesFF``, ``serial_chimes_interface`` allows users to leverage ChIMES with much less coding. For further details on ``chimesFF``, see :ref:`The ChIMES Calculator <page-chimesFF>`. For a complete set of ChIMES references, see :ref:`Citing ChIMES <page-citing>`. Note that this functionality is primarily intended for instructive purposes, and is not recommended for large scale simulations.
9
+
The ChIMES calculator serial interface provides an easier means of evaluating ChIMES interactions for a given system. In contrast to the ChIMES calculator (i.e. ``chimesFF``), which takes information on *individual* atom clusters and returns the cluster energy, stress tensor, via ``compute_xB`` functions, the serial interface (i.e. ``serial_chimes_interface``) takes *overall* system information and returns *overall* system energy, stress tensor, and forces. Though far less flexible than direct use of ``chimesFF``, ``serial_chimes_interface`` allows users to leverage ChIMES with much less coding. For examples of how to implement the ChIMES calculator serial interface with different APIs, refer to :ref:`Implementation Examples <sec-ser-use-examples-api>`. For further details on ``chimesFF``, see :ref:`The ChIMES Calculator <page-chimesFF>`. For a complete set of ChIMES references, see :ref:`Citing ChIMES <page-citing>`.
10
+
11
+
.. Note::
12
+
The serial interface is intended to primarily serve as an easy-to-read example of how to use/implement the chimesFF library in various user codes. Hence, the implementation is not optimized for computational efficiency and therefore not recommended for use in long or large scale simulations. For users seeking a computationally efficient out-of-the-box simulation capability, we recommend using our LAMMPS implementation. See the :ref:`ChIMES in LAMMPS <page-etc>` for more details.
10
13
11
14
12
15
The ChIMES Calculator Serial Interface
@@ -24,7 +27,7 @@ The ChIMES calculator serial interface source files are located in ``serial_inte
24
27
25
28
.. Warning::
26
29
27
-
For small simulation cells (e.g., a single atom in a face-centered cubic unit cell), the ChIMES calculator must be instantiated via ``serial_chimes_interface chimes(true)``. This allows for automatic replication in situations where the ChIMES outer cutoff is greater than one half of the smallest supercell length. Please note that use of extra-small simulation cells is ill-advised for aything except crystalline systems and should be used with caution.
30
+
It is recommended to have a supercell length of at least double the outer cutoff. For small simulation cells (e.g., a single atom in a face-centered cubic unit cell), the ChIMES calculator must be instantiated via ``serial_chimes_interface chimes(true)``. This allows for automatic replication in situations where the ChIMES outer cutoff is greater than one half of the smallest supercell length. Please note that use of extra-small simulation cells is ill-advised for aything except crystalline systems and should be used with caution.
28
31
29
32
*Developer note: To recover behavior of the research code, instantiate with:* ``serial_chimes_interface chimes(false)``.
C_double array Vector of x-coordinates for system atoms
179
182
C_double array Vector of y-coordinates for system atoms
180
183
C_double array Vector of z-coordinates for system atoms
181
-
C_char array System cell a lattice vector
184
+
C_char array Vector of atom types for system atoms
185
+
C_double array System cell a lattice vector
182
186
C_double array System cell b lattice vector
183
187
C_double array System cell c lattice vector
184
-
C_double array Vector of atom types for system atoms
185
188
C_double* Overall system energy (updated by function)
186
189
C_double array Vector of forces for system atoms (updated by function); ([atom index][fx, fy, fz])
187
190
C_double array System stress tensor (updated by function); ([s_xx, s_xy, s_xz, s_yx, s_yy, s_yz, s_zx, s_zy, s_zz])
@@ -328,10 +331,10 @@ See description calculate_chimes ======================= =====
328
331
float list Vector of x-coordinates for system atoms
329
332
float list Vector of y-coordinates for system atoms
330
333
float list Vector of z-coordinates for system atoms
331
-
str list System cell a lattice vector
334
+
str list Vector of atom types for system atoms
335
+
float list System cell a lattice vector
332
336
float list System cell b lattice vector
333
337
float list System cell c lattice vector
334
-
float list Vector of atom types for system atoms
335
338
float Overall system energy
336
339
float list Vector of forces for system atoms ([atom index][fx, fy, fz])
337
340
float list System stress tensor ([s_xx, s_xy, s_xz, s_yx, s_yy, s_yz, s_zx, s_zy, s_zz])
@@ -364,15 +367,18 @@ Implementation Examples
364
367
^^^^^^^^^^^^^^^^^^^^^^^
365
368
366
369
The following codes demonstrates how ``serial_chimes_interface.{h,cpp}`` can be used to obtain the overall stress tensor, energy, and per-atom forces for a given system configuration using C, C++ Fortran, and Python. See the ``main.*`` files in each corresponding subdirectory of ``serial_interface/examples`` for further implementation details. Note that sample system configurations (i.e. ``*xyz`` files) and parameter files can be found in ``serial_interface/test/configurations`` and ``serial_interface/test/force_fields``, respectively.
367
-
For user generated tests, note that ``*.xyz`` files must provide lattice vectors in the comment line, e.g. lx 0.0 0.0 0.0 ly 0.0 0.0 0.0 lz. Click :ref:`here <page-units>` for an overview of ChIMES units.
370
+
371
+
.. Note::
372
+
373
+
For user generated tests, note that ``*.xyz`` files must provide lattice vectors in the comment line, e.g. lx 0.0 0.0 0.0 ly 0.0 0.0 0.0 lz. Click :ref:`here <page-units>` for an overview of ChIMES units.
368
374
369
375
.. Note::
370
376
371
377
All implementation examples are intended to be run on Unix-based systems (e.g. Linux, OSX).
372
378
373
379
.. Warning::
374
380
375
-
These codes are for demonstrative purposes only and come with no guarantees.
381
+
These codes are for demonstrative purposes only and come with no guarantees.
376
382
377
383
.. Note::
378
384
@@ -400,21 +406,19 @@ For user generated tests, note that ``*.xyz`` files must provide lattice vectors
400
406
* Navigate to ``serial_interface/examples/fortran``
401
407
* Compile with: ``make all``
402
408
* Test with: ``./chimescalc-test_serial-F <parameter file> <xyz file>``
403
-
* Additional notes:
404
409
405
410
* **Fortran2008 Example:** Similarly, this ``main`` function establishes a pointer to a ``serial_chimes_interface`` object via calls to ``ChimesCalc_init()`` and subroutine calls within the ``ChimesCalc`` class, defined in ``chimescalc_serial_F08.f90.``
406
411
Subroutines called from the Fortran2008 API act as an interface for the wrapper functions establied in the Fortran90 API. Actual linking is achieved at compilation. See the ``Makefile`` for details.
407
412
408
413
* Navigate to ``serial_interface/examples/fortran08``
409
414
* Compile with: ``make all``
410
415
* Test with: ``./chimescalc-test_serial-F08 <parameter file> <xyz file>``
411
-
* Additional notes:
412
416
413
417
* **Python Example:** This example accesses ``serial_chimes_interface`` functions through ``chimescalc_serial_py.py``, a ctypes-based python API for access to the C API functions
414
418
(i.e. through ``chimescalc_serial_C.cpp``). Once ``chimescalc_serial_py.py`` is imported, it is associated with a compiled C API library file, i.e. ``lib-C_wrapper-serial_interface.so`` and can be used to access ``serial_chimes_interface`` member functions.
415
419
416
420
* Navigate to ``serial_interface/examples/python``
0 commit comments