Skip to content

Commit df1f16a

Browse files
authored
Merge pull request brucefan1983#761 from BBBuZHIDAO/ilp_tmd_sw
Add a Hybrid Potential "ILP_TMD_SW"
2 parents 4e99a79 + dc865c9 commit df1f16a

File tree

8 files changed

+2072
-0
lines changed

8 files changed

+2072
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ilp_tmd_sw 2 Mo S
2+
5.57945037 9.37766246 2.02722246 144.15177543 97.97857017 89.43759676 2.05903055 5.12205490 491850.31619468 1.0 4.0 16.0
3+
3.62715212 19.97137510 7.58503123 76.10193100 3.31749559 45.72032846 0.94747037 4.41042503 150597.85771629 1.0 4.0 16.0
4+
3.62715212 19.97137510 7.58503123 76.10193100 3.31749559 45.72032846 0.94747037 4.41042503 150597.85771629 1.0 4.0 16.0
5+
3.16140219 8.09326275 1.95314020 4.58676418 118.06546646 58.80941584 0.21536658 4.29960013 148811.24340892 1.0 4.0 16.0
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
0.000 1.000 1.000 1.000 1.000
2+
6.918 7.223 2.523 1.252 1.000
3+
0.000 1.000 1.000 1.000 1.000
4+
0.000 0.143
5+
0.000 0.143
6+
0.000 0.143
7+
67.883 0.143
8+
62.449 0.143
9+
0.000 0.143
10+
0.000 0.143
11+
0.000 0.143

src/force/force.cu

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The driver class calculating force and related quantities.
2525
#include "tersoff1988.cuh"
2626
#include "tersoff1989.cuh"
2727
#include "tersoff_mini.cuh"
28+
#include "ilp_tmd_sw.cuh"
2829
#include "utilities/common.cuh"
2930
#include "utilities/error.cuh"
3031
#include "utilities/read_file.cuh"
@@ -131,6 +132,13 @@ void Force::parse_potential(
131132
check_types(param[1]);
132133
} else if (strcmp(potential_name, "lj") == 0) {
133134
potential.reset(new LJ(fid_potential, num_types, number_of_atoms));
135+
} else if (strcmp(potential_name, "ilp_tmd_sw") == 0) {
136+
if (num_param != 3) {
137+
PRINT_INPUT_ERROR("potential should contain ILP potential file and SW potential file.\n");
138+
}
139+
FILE* fid_sw = my_fopen(param[2], "r");
140+
potential.reset(new ILP_TMD_SW(fid_potential, fid_sw, num_types, number_of_atoms));
141+
fclose(fid_sw);
134142
} else {
135143
PRINT_INPUT_ERROR("illegal potential model.\n");
136144
}
@@ -477,6 +485,10 @@ void Force::compute(
477485
potential_per_atom,
478486
force_per_atom,
479487
virial_per_atom);
488+
} else if (1 == potentials[0]->ilp_flag) {
489+
// compute the potential with ILP
490+
potentials[0]->compute_ilp(
491+
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom, group);
480492
} else {
481493
potentials[0]->compute(
482494
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom);
@@ -494,6 +506,10 @@ void Force::compute(
494506
potential_per_atom,
495507
force_per_atom,
496508
virial_per_atom);
509+
} else if (1 == potentials[i]->ilp_flag) {
510+
// compute the potential with ILP
511+
potentials[i]->compute_ilp(
512+
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom, group);
497513
} else {
498514
potentials[i]->compute(
499515
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom);
@@ -764,6 +780,10 @@ void Force::compute(
764780
potential_per_atom,
765781
force_per_atom,
766782
virial_per_atom);
783+
} else if (1 == potentials[0]->ilp_flag) {
784+
// compute the potential with ILP
785+
potentials[0]->compute_ilp(
786+
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom, group);
767787
} else {
768788
potentials[0]->compute(
769789
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom);
@@ -781,6 +801,10 @@ void Force::compute(
781801
potential_per_atom,
782802
force_per_atom,
783803
virial_per_atom);
804+
} else if (1 == potentials[i]->ilp_flag) {
805+
// compute the potential with ILP
806+
potentials[i]->compute_ilp(
807+
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom, group);
784808
} else {
785809
potentials[i]->compute(
786810
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom);

0 commit comments

Comments
 (0)