Skip to content

Commit

Permalink
fix pt
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Sep 28, 2024
1 parent be59313 commit ec7c16b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions source/api_cc/src/DeepPotPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ template void DeepPotPT::compute<double, std::vector<ENERGYTYPE>>(
std::vector<double>& atom_energy,
std::vector<double>& atom_virial,
const std::vector<double>& coord,
const std::vector<double>& spin,
const std::vector<int>& atype,
const std::vector<double>& box,
const int nghost,
Expand All @@ -523,6 +524,7 @@ template void DeepPotPT::compute<float, std::vector<ENERGYTYPE>>(
std::vector<float>& atom_energy,
std::vector<float>& atom_virial,
const std::vector<float>& coord,
const std::vector<float>& spin,
const std::vector<int>& atype,
const std::vector<float>& box,
const int nghost,
Expand Down Expand Up @@ -636,7 +638,6 @@ template void DeepPotPT::compute<double, std::vector<ENERGYTYPE>>(
std::vector<double>& atom_energy,
std::vector<double>& atom_virial,
const std::vector<double>& coord,
const std::vector<double>& spin,
const std::vector<int>& atype,
const std::vector<double>& box,
const std::vector<double>& fparam,
Expand All @@ -649,7 +650,6 @@ template void DeepPotPT::compute<float, std::vector<ENERGYTYPE>>(
std::vector<float>& atom_energy,
std::vector<float>& atom_virial,
const std::vector<float>& coord,
const std::vector<float>& spin,
const std::vector<int>& atype,
const std::vector<float>& box,
const std::vector<float>& fparam,
Expand Down
11 changes: 7 additions & 4 deletions source/lmp/pair_deepmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,11 @@ void PairDeepMD::compute(int eflag, int vflag) {
}
} else {
try {
deep_pot.compute(dener, dforce, dforce_mag, dvirial, dcoord, dspin,
dtype, dbox, nghost, lmp_list, ago, fparam,
daparam);
const vector<double> &dcoord_const = dcoord;
const vector<double> &dspin_const = dspin;
deep_pot.compute(dener, dforce, dforce_mag, dvirial, dcoord_const,
dspin_const, dtype, dbox, nghost, lmp_list, ago,
fparam, daparam);
} catch (deepmd_compat::deepmd_exception &e) {
error->one(FLERR, e.what());
}
Expand All @@ -601,6 +603,7 @@ void PairDeepMD::compute(int eflag, int vflag) {
}
} else {
try {
std::cout << "calculate atomic energy" << std::endl;
deep_pot.compute(dener, dforce, dforce_mag, dvirial, deatom, dvatom,
dcoord, dspin, dtype, dbox, nghost, lmp_list, ago,
fparam, daparam);
Expand Down Expand Up @@ -675,7 +678,7 @@ void PairDeepMD::compute(int eflag, int vflag) {
if (!(eflag_atom || cvflag_atom)) {
try {
deep_pot_model_devi.compute(all_energy, all_force, all_force_mag,
all_virial, dcoord, dspin, dtype, dbox,
all_virial, dcoord, dspin, dtype, dbox,
nghost, lmp_list, ago, fparam, daparam);
} catch (deepmd_compat::deepmd_exception &e) {
error->one(FLERR, e.what());
Expand Down

0 comments on commit ec7c16b

Please sign in to comment.