Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ When splitting a function into a new `.cpp`, if its callers span LCAO and PW, pu
- Extract a base-class nested-vector member in three steps (hold + forward,
switch writers, delete legacy) so no commit mixes old-storage writes with
new-storage reads.
- Keep MD geometry output separate from restart checkpoints. A restart STRU
must retain atomic velocities and a step marker matching Restart_md.txt;
ordinary MD STRU files carry per-atom forces and velocities for analysis.
- Sort distributed trajectory output by stable atom identity, not MPI rank or
local storage order; check for duplicate and missing atom indices before
writing each frame.

## Local Commands

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/input_files/stru.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ For general usage requirements, the APNSv1.0 pseudopotential and orbital set is
Several other parameters could be defined after the atom position using key words :

- `m` or NO key word: three numbers, which take value in 0 or 1, control how the atom move in geometry relaxation calculations. In example below, the numbers `0 0 0` following the coordinates of the first atom means this atom are *not allowed* to move in all three directions, and the numbers `1 1 1` following the coordinates of the second atom means this atom *can* move in all three directions.
- `v` or `vel` or `velocity`: set the three components of initial velocity of atoms, used only for restarting MD calculations (e.g., `v 1.0 1.0 1.0`).
- `v` or `vel` or `velocity`: set the three components of atomic velocity in atomic units (1 a.u. is about 21.877 Angstrom/fs). MD structure and restart output include this field so the velocities can be read back (e.g., `v 1.0 1.0 1.0`).
- `mag` or `magmom` : set the start magnetization for each atom. In colinear case only one number should be given. In non-colinear case one have two choice:either set one number for the norm of magnetization here and specify two polar angle later(e. g. see below), or set three number for the xyz commponent of magnetization here (e. g. `mag 0.0 0.0 1.0`). Note that if this parameter is set, the initial magnetic moment setting in the second line will be overrided.
- `angle1`: in non-colinear case, specify the angle between z-axis and real spin, in angle measure instead of radian measure
- `angle2`: in non-colinear case, specify angle between x-axis and real spin in projection in xy-plane , in angle measure instead of radian measure
Expand Down Expand Up @@ -326,7 +326,7 @@ For general usage requirements, the APNSv1.0 pseudopotential and orbital set is

- `sc`: set the spin constraint target magnetization for each atom. Can specify one value (z-component) or three values for x, y, z components (e.g., `sc 1.0` or `sc 0.5 0.5 1.0`). Used with spin-constrained DFT (enable with `sc_mag_switch` in INPUT file).

- `f` or `force` or `forces`: three numbers giving the per-atom force (fx, fy, fz) in **eV/Angstrom**. This field is *output-only*: it is written into structure files (STRU{istep}, STRU_NOW, STRU_FINAL) when [`out_stru`](input-main.md#out_stru) is enabled, [`cal_force`](input-main.md#cal_force) is true, and the geometry has been evaluated. When such a file is read back as an input STRU, the `f` values are consumed but ignored -- they are informational only and do not affect the calculation.
- `f` or `force` or `forces`: three numbers giving the per-atom force (fx, fy, fz) in **eV/Angstrom**. This field is *output-only*: it is written into evaluated structure files when [`out_stru`](input-main.md#out_stru) is enabled; MD ordinary frames include it, but `STRU_restart` omits it. When such a file is read back as an input STRU, the `f` values are consumed but ignored -- they are informational only and do not affect the calculation.

### Important Notes for ATOMIC_POSITIONS

Expand Down
6 changes: 3 additions & 3 deletions docs/advanced/interface/candela.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ For Detailed usage of CANDELA, please refer to the [official document](https://c
There are two things which need special attention in using CANDELA with ABACUS.
First, the input file of CANDELA only takes the name of `INPUT`, the same as ABACUS input file, so you should not run CANDELA in the same folder where you run ABACUS.
Second, to use CANDELA to postprocess ABACUS MD trajectory, the following parameters have to be specified in the `INPUT` file of CANDELA in addition to other required parameters:
1. `geo_in_type` has to be set to `ABACUS`;
1. For current ABACUS MD output, convert the STRU trajectory to a CANDELA-supported format and set `geo_in_type` to that format, such as `LAMMPS`. The older `ABACUS` setting applies only to legacy MD dump files;
2. `msd_dt` has to be specified in unit of picosecond, especially in the case of `calculation` = `msd`;
3. `geo_directory` has to be set to the path to the `MD_dump` file in the `OUT.xxx` folder.
3. `geo_directory` has to point to the converted trajectory. CANDELA's older `geo_in_type ABACUS` reader does not read current STRU trajectories directly.
As a result, a CANDELA `INPUT` file for calculating PDF from ABACUS should be something like this:
```
calculation pdf # Pair Distribution Function.
Expand All @@ -36,4 +36,4 @@ struf_dgx 0.05
struf_ng 200
```

More examples of CANDELA `INPUT` with ABACUS can be found in the [test](https://github.com/MCresearch/Candela/tree/main/test) directory.
More examples of CANDELA `INPUT` with ABACUS can be found in the [test](https://github.com/MCresearch/Candela/tree/main/test) directory.
10 changes: 7 additions & 3 deletions docs/advanced/md.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ When [md_type](./input_files/input-main.md#md_type) is set to npt, [md_pmode](./

Furthermore, ABACUS also provides a [list of keywords](./input_files/input-main.md#molecular-dynamics) to control relevant parmeters used in MD simulations.

The MD output information will be written into the file `MD_dump`, in which the atomic forces, atomic velocities, and lattice virial are controlled by keyword [dump_force](./input_files/input-main.md#dump_force), [dump_vel](./input_files/input-main.md#dump_vel), and [dump_virial](./input_files/input-main.md#dump_virial), respectively.
MD structure output is controlled by [`out_stru`](./input_files/input-main.md#out_stru), [`out_freq_ion`](./input_files/input-main.md#out_freq_ion), and [`out_app_flag`](./input_files/input-main.md#out_app_flag). Set `out_stru 1`, `out_freq_ion 1`, and `out_app_flag 1` to keep every MD step in the appended `STRU` trajectory. With `out_freq_ion 0`, only `STRU_FINAL` is written. Mode 0 overwrites the periodic `STRU`; mode 2 writes numbered files and `STRU_FINAL` under `STRUC/`.

Use `md_thermo_freq` to set the output interval for MD step, energy, temperature, and pressure information in `running_md.log` and on screen. The default is 1; set it to 0 to disable this thermodynamic output. The interval counts MD steps from 0, so a value of 10 selects steps 0, 10, 20, and so on, including after a restart.
Use `out_thermo_freq` to set the output interval for MD step, energy, temperature, and pressure information in `running_md.log` and on screen. The default is 1; set it to 0 to disable this thermodynamic output. The interval counts MD steps from 0, so a value of 10 selects steps 0, 10, 20, and so on, including after a restart.

The `md_out_force` INPUT keyword has been removed. An INPUT file that still contains it will fail to parse. For MDCell simulations, per-atom forces are no longer printed in `running_md.log`; use `dump_force 1` to include them in `MD_dump`, and use `md_dumpfreq` to set the trajectory output interval.
For MDCell simulations, per-atom forces are in ordinary STRU frames rather than `running_md.log`. The `md_out_force`, `md_dumpfreq`, `dump_force`, `dump_vel`, and `dump_virial` INPUT keywords have been removed; an INPUT file using them will fail to parse.

MDCell structure output (`STRU`, `STRU_FINAL`, and `STRU_restart`) lists atoms by element and then by their original index within that element. This order remains stable when atoms migrate between MPI processes. In an appended `STRU` trajectory, the same row within each element therefore refers to the same atom in every frame.

Ordinary MD structure frames include per-atom `f` forces in eV/Angstrom and `v` velocities in atomic units; `STRU_restart` retains `v` for restarting and omits `f`. When `cal_stress=1`, the thermodynamic block in `running_md.log` includes the complete 3-by-3 virial and total stress tensors in kbar at the `out_thermo_freq` cadence. This frequency affects MD only; SCF and relaxation output are unchanged.

[Examples](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/18_md/01_LCAO_NVE_Si8) of MD simulations are also provided.
There are eight INPUT files corresponding to eight different MD evolution methods in the directory.
Expand Down
2 changes: 1 addition & 1 deletion examples/18_md/01_LCAO_NVE_Si8/README
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Furthermore, ABACUS also provides a [list of keywords](./input_files/input-main.
To employ CMD calculations, `esolver_type` should be set to be `lj` or `dp`.
If DP model is selected, the filename of DP model is specified by keyword `pot_file`.

The MD output information will be written into the file `MD_dump`, in which the atomic forces, atomic velocities, and lattice virial are controlled by keyword `dump_force`, `dump_vel`, and `dump_virial`, respectively.
MD trajectories are written to STRU files when `out_stru=1` and `out_freq_ion>0`. Each ordinary frame contains positions, forces, and velocities. The full virial tensor is written to `running_md.log` when stress is calculated.

Note:
1) When doing md calculations, turn off `symmetry`.
Expand Down
4 changes: 3 additions & 1 deletion examples/35_tdofdft/01_Al_proton_ESP/02_td/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ md_restart 0
md_type nve
md_nstep 4500
md_dt 0.0005
md_dumpfreq 1
out_stru 1
out_freq_ion 1
out_app_flag 1

# Total charge: 256 Al * 3 valence electrons = 768
# (proton contributes +1 charge, no valence electrons)
Expand Down
2 changes: 1 addition & 1 deletion examples/35_tdofdft/README
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ computational cost of KS-DFT becomes prohibitive.
2. Copy `chg.cube` from `01_gs/OUT.autotest/` to `02_td/`
3. Run `02_td/` for the time-dependent proton dynamics
4. Use `get_kinetic.py` from `tools/02_postprocessing/tdofdft-tools/` to extract the
proton kinetic energy curve from `OUT.autotest/MD_dump`
proton kinetic energy curve from the appended `OUT.autotest/STRU` trajectory

## Input Files

Expand Down
4 changes: 2 additions & 2 deletions interfaces/ASE_interface/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This directory contains the input/output (I/O) functions for extracting informat
|lattice constant|'lattice constant \(Angstrom\)\s*=\s*(-?\d+(\.\d+)?)'|`lattice constant (Angstrom) = 0.529177`||
|lattice vectors|'^Lattice vectors: \(Cartesian coordinate: in unit of a_0\)$'|` Lattice vectors: (Cartesian coordinate: in unit of a_0)`||
|coordinate system|'^(DIRECT\|CARTESIAN) COORDINATES'|`DIRECT COORDINATES`||
|atomic positions|'atom\s+x\s+y\s+z\s+mag‘|` atom x y z mag`|"tauc/taud" suffix has been removed, therefore the way to read the coordinates changes to find the head of the table, then read the following `number of atoms` lines. On the other hand, if the `calculation` is set to `md`, ABACUS will not dump the atomic positions to running log anymore, instead, will read from the MD_dump file|
|atomic positions|'atom\s+x\s+y\s+z\s+mag‘|` atom x y z mag`|"tauc/taud" suffix has been removed, therefore the way to read the coordinates changes to find the head of the table, then read the following `number of atoms` lines. For `calculation=md`, the reader uses periodic STRU frames or STRU_FINAL; legacy runs may still be read from MD_dump.|
|eigenvalues|'spin=(\d)\s+k-point=(\d+)/(\d+)\s+Cartesian=\s*(-?\d(\.\d+)?(e-\d+)?)\s+(-?\d(\.\d+)?(e-\d+)?)\s+(-?\d(\.\d\|+)?(e-\d+)?)\s+\(\d+\s+plane wave\)'| spin=1 k-point=1/1 Cartesian=0.0000000 0.0000000 0.0000000 (1837 plane wave)|eigenvalues information has been removed from the running log, the file istate.info is renamed as eig_occ.txt, where the eigenvalues are read|
|atomic forces|'#\s\*TOTAL\-FORCE\s*\(eV\s*/Angstrom\)\s\*#'|` #TOTAL-FORCE (eV/Angstrom)#`||
|total stress|'#\s\*TOTAL\-STRESS\s*\(kbar\)\s\*#'|` #TOTAL-STRESS (kbar)# `||
Expand Down Expand Up @@ -87,4 +87,4 @@ This module contains the wrapper of k-point sampling functions and helper functi

## xtest.sh

This script can run all the unittests that programmed in all Python source files.
This script can run all the unittests that programmed in all Python source files.
Loading
Loading