@@ -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