Skip to content

Commit

Permalink
Merge pull request brucefan1983#761 from BBBuZHIDAO/ilp_tmd_sw
Browse files Browse the repository at this point in the history
Add a Hybrid Potential "ILP_TMD_SW"
  • Loading branch information
brucefan1983 authored Oct 21, 2024
2 parents 4e99a79 + dc865c9 commit df1f16a
Show file tree
Hide file tree
Showing 8 changed files with 2,072 additions and 0 deletions.
5 changes: 5 additions & 0 deletions potentials/ilp/ilp_tmd_sw_ILP_MoS2_oywg_2018.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ilp_tmd_sw 2 Mo S
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.62715212 19.97137510 7.58503123 76.10193100 3.31749559 45.72032846 0.94747037 4.41042503 150597.85771629 1.0 4.0 16.0
3.62715212 19.97137510 7.58503123 76.10193100 3.31749559 45.72032846 0.94747037 4.41042503 150597.85771629 1.0 4.0 16.0
3.16140219 8.09326275 1.95314020 4.58676418 118.06546646 58.80941584 0.21536658 4.29960013 148811.24340892 1.0 4.0 16.0
11 changes: 11 additions & 0 deletions potentials/ilp/ilp_tmd_sw_SW_MoS2_jjw_2018.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
0.000 1.000 1.000 1.000 1.000
6.918 7.223 2.523 1.252 1.000
0.000 1.000 1.000 1.000 1.000
0.000 0.143
0.000 0.143
0.000 0.143
67.883 0.143
62.449 0.143
0.000 0.143
0.000 0.143
0.000 0.143
24 changes: 24 additions & 0 deletions src/force/force.cu
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The driver class calculating force and related quantities.
#include "tersoff1988.cuh"
#include "tersoff1989.cuh"
#include "tersoff_mini.cuh"
#include "ilp_tmd_sw.cuh"
#include "utilities/common.cuh"
#include "utilities/error.cuh"
#include "utilities/read_file.cuh"
Expand Down Expand Up @@ -131,6 +132,13 @@ void Force::parse_potential(
check_types(param[1]);
} else if (strcmp(potential_name, "lj") == 0) {
potential.reset(new LJ(fid_potential, num_types, number_of_atoms));
} else if (strcmp(potential_name, "ilp_tmd_sw") == 0) {
if (num_param != 3) {
PRINT_INPUT_ERROR("potential should contain ILP potential file and SW potential file.\n");
}
FILE* fid_sw = my_fopen(param[2], "r");
potential.reset(new ILP_TMD_SW(fid_potential, fid_sw, num_types, number_of_atoms));
fclose(fid_sw);
} else {
PRINT_INPUT_ERROR("illegal potential model.\n");
}
Expand Down Expand Up @@ -477,6 +485,10 @@ void Force::compute(
potential_per_atom,
force_per_atom,
virial_per_atom);
} else if (1 == potentials[0]->ilp_flag) {
// compute the potential with ILP
potentials[0]->compute_ilp(
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom, group);
} else {
potentials[0]->compute(
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom);
Expand All @@ -494,6 +506,10 @@ void Force::compute(
potential_per_atom,
force_per_atom,
virial_per_atom);
} else if (1 == potentials[i]->ilp_flag) {
// compute the potential with ILP
potentials[i]->compute_ilp(
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom, group);
} else {
potentials[i]->compute(
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom);
Expand Down Expand Up @@ -764,6 +780,10 @@ void Force::compute(
potential_per_atom,
force_per_atom,
virial_per_atom);
} else if (1 == potentials[0]->ilp_flag) {
// compute the potential with ILP
potentials[0]->compute_ilp(
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom, group);
} else {
potentials[0]->compute(
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom);
Expand All @@ -781,6 +801,10 @@ void Force::compute(
potential_per_atom,
force_per_atom,
virial_per_atom);
} else if (1 == potentials[i]->ilp_flag) {
// compute the potential with ILP
potentials[i]->compute_ilp(
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom, group);
} else {
potentials[i]->compute(
box, type, position_per_atom, potential_per_atom, force_per_atom, virial_per_atom);
Expand Down
Loading

0 comments on commit df1f16a

Please sign in to comment.