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/developers.md
+33-2Lines changed: 33 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,38 @@ Raising issues on GitHub is a convernient way to notify the develper team about
19
19
20
20
## Modularization and module tests
21
21
22
-
The ABACUS code is reconstructed to form several self-contained modules. A description of modules can be found in the [installation guide](install.md#structure-of-source-code). We also provide module tests for the modules.
22
+
The ABACUS code is refactored to several self-contained modules. A description of modules can be found in the [installation guide](install.md#structure-of-source-code). We also provide module unit tests.
23
+
24
+
### Add a unit test
25
+
26
+
If there are currently no unit tests provided for the module, do as follows. `module_base` provides a simple demonstration.
27
+
28
+
- Add a folder named `test` under the module.
29
+
- Append the content below to `CMakeLists.txt` of the module:
30
+
31
+
```cmake
32
+
IF (BUILD_TESTING)
33
+
add_subdirectory(test)
34
+
endif()
35
+
```
36
+
37
+
- Add a blank `CMakeLists.txt` under `module*/test`.
38
+
39
+
To add a unit test:
40
+
41
+
- Write your test under `GoogleTest` framework.
42
+
- Add your testing source code with suffix `*_test.cpp` in `test` directory.
43
+
- Append the content below to `CMakeLists.txt` of the module:
44
+
45
+
```cmake
46
+
AddTest(
47
+
TARGET <module_name>_<test_name> # this is the executable file name of the test
48
+
SOURCES <test_name>.cpp
49
+
)
50
+
```
51
+
52
+
- Build with `-D BUILD_TESTING=1` flag. You can find built testing programs under `build/source/<module_name>/test`.
53
+
- Follow the installing procedure of CMake. The tests will move to `build/test`.
23
54
24
55
[back to top](#for-developers)
25
56
@@ -91,7 +122,7 @@ For comments that need to be shown in documents, these formats should be used --
91
122
92
123
A helpful VS Code extension -- Doxygen Documentation Generator, can help you formating comments.
93
124
94
-
An practical example is class [LCAO_Descriptor](https://github.com/deepmodeling/abacus-develop/blob/deepks/source/src_lcao/LCAO_descriptor.h), the effects can be seen on [readthedocs page](https://abacus-deepks.readthedocs.io/en/latest/DeePKS_API/classLCAO__Descriptor.html#exhale-class-classLCAO-Descriptor)
125
+
An practical example is class [LCAO_Deepks](https://github.com/deepmodeling/abacus-develop/blob/deepks/source/module_deepks/LCAO_deepks.h), the effects can be seen on [readthedocs page](https://abacus-deepks.readthedocs.io/en/latest/DeePKS_API/classLCAO__Descriptor.html#exhale-class-classLCAO-Descriptor)
Copy file name to clipboardExpand all lines: doc/examples/md.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ md_dt 1 //time step
38
38
md_tfirst 700 //the first target temperature
39
39
md_rstmd 0 //whether restart md
40
40
md_qmass 1 //mass of themostat
41
-
md_dumpmdfred 10 //The period to dump MD information for monitoring and restarting MD
41
+
md_dumpfred 10 //The period to dump MD information for monitoring and restarting MD
42
42
```
43
43
44
44
These MD parameters means that ABACUS will use NVT ensemble with Nosé-hoover themostat; the time step is 1fs, and target temperature is 700K; start renew without restart file, set the mass of themostat as 1g/mol, and calculate the MSD and diffusion coefficent from first step.
@@ -50,7 +50,7 @@ Note: *Please turn off symmetry when do MD simulation.*
50
50
- md_tfirst : target temperature in md simulation(K), you should set parameter md_tlast and md_fixtemperature when you want to change temperature during md simulation.
51
51
- md_rstmd : 0, no need of restart ; 1, restart with restart file, you must repalce STRU file with STRU_MD before you run the restart task.
52
52
- md_qmass : mass of thermostat, set by experience, if you don’t know how to set, set it to 0 will have a number autosetted by ABACUS
53
-
-md_dumpmdfred : frequency for output consequence of md simulation
53
+
-md_dumpfred : frequency for output consequence of md simulation
@@ -1157,45 +1157,26 @@ This part of variables are used to control the molecular dynamics calculations.
1157
1157
- *Default*: No default
1158
1158
1159
1159
[back to top](#input-file)
1160
-
- md_dumpmdfred<a id="md-dumpmdfred"></a>
1160
+
- md_dumpfred<a id="md-dumpfred"></a>
1161
1161
- *Type*: Integer
1162
-
- *Description*:This is the steps to control the frequence to output md information
1162
+
- *Description*:This is the frequence to dump md information.
1163
1163
- *Default*: 1
1164
1164
1165
1165
[back to top](#input-file)
1166
1166
1167
-
- md_tfreq<a id="md-tfreq"></a>
1168
-
- *Type*: Real
1169
-
- *Description*:
1170
-
- Oscillation frequency, used to determine Qmass of NHC;
1171
-
- 1/(md_tfreq*md_dt) is collision probability in Anderson method.
1172
-
- *Default*: 1.0
1173
-
1174
-
[back to top](#input-file)
1175
-
1176
-
- md_fixtemperature<a id="md-fixtemperature"></a>
1177
-
- *Type*: Integer
1178
-
- *Description*:
1179
-
- n:when set to n (n > 1), ABACUS will read the file "ChangeTemp.dat" and change system’s temperature every n steps
1180
-
- 0,1:When set to 0 or 1, ABACUS won’t change the temperature during running MD.
1181
-
- *Default*: 1
1182
-
1183
-
[back to top](#input-file)
1184
-
1185
-
- NVT_control<a id="nvt-control"></a>
1167
+
- md_rstfred<a id="md-rstfred"></a>
1186
1168
- *Type*: Integer
1187
-
- *Description*: Specifies which type of thermostat is used.
1188
-
- 1: Nose-Hoover-chains
1189
-
- 2: Langevin
1190
-
- 3: Andersen
1169
+
- *Description*:This is the frequence to output restart information.
1191
1170
- *Default*: 1
1192
1171
1193
1172
[back to top](#input-file)
1194
1173
1195
-
- NVT_tau<a id="nvt-tau"></a>
1174
+
- md_tfreq<a id="md-tfreq"></a>
1196
1175
- *Type*: Real
1197
-
- *Description*: Parameter for adjust effect of thermostat corresponding to the time scale of collision, in fs. If te input value is less than 1d-10, then it is automatically set in ABACUS.
1198
-
- *Default*: 0
1176
+
- *Description*:
1177
+
- Oscillation frequency, used to determine Qmass of NHC;
1178
+
- 1/(md_tfreq*md_dt) is collision probability in Anderson method.
1179
+
- *Default*: 1.0
1199
1180
1200
1181
[back to top](#input-file)
1201
1182
@@ -1206,20 +1187,6 @@ This part of variables are used to control the molecular dynamics calculations.
1206
1187
1207
1188
[back to top](#input-file)
1208
1189
1209
-
- md_ediff<a id="md-ediff"></a>
1210
-
- *Type*: Real
1211
-
- *Description*: Parameter for constraining total energy change.
1212
-
- *Default*: 0.0001
1213
-
1214
-
[back to top](#input-file)
1215
-
1216
-
- md_ediffg<a id="md-ediffg"></a>
1217
-
- *Type*: Real
1218
-
- *Description*: Parameter for constraining max force change
1219
-
- *Default*: 0.001
1220
-
1221
-
[back to top](#input-file)
1222
-
1223
1190
- rcut_lj<a id="rcut_lj"></a>
1224
1191
- *Type*: Real
1225
1192
- *Description*: Cut-off radius for Leonard Jones potential (angstrom).
0 commit comments