Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/api_cc/src/DeepPot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ compute_std_f (std::vector<VALUETYPE> & std,
vdiff[0] = tmp_f[0] - tmp_avg[0];
vdiff[1] = tmp_f[1] - tmp_avg[1];
vdiff[2] = tmp_f[2] - tmp_avg[2];
std[jj] += dot3(vdiff, vdiff);
std[jj] += deepmd::dot3(vdiff, vdiff);
}
}

Expand All @@ -931,7 +931,7 @@ compute_relative_std_f (std::vector<VALUETYPE> &std,
vdiff[0] = tmp_avg[0];
vdiff[1] = tmp_avg[1];
vdiff[2] = tmp_avg[2];
VALUETYPE f_norm = sqrt(dot3(vdiff, vdiff));
VALUETYPE f_norm = sqrt(deepmd::dot3(vdiff, vdiff));
// relative std = std/(abs(f)+eps)
std[ii] /= f_norm + eps;
}
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/tests/test_deepdipole.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ TEST_F(TestInferDeepDipole, cpu_lmp_nlist)
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
std::vector<std::vector<int > > nlist_data;
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
_build_nlist(nlist_data, coord_cpy, atype_cpy, mapping,
coord, atype, box, rc);
int nall = coord_cpy.size() / 3;
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/tests/test_deeppolar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ TEST_F(TestInferDeepPolar, cpu_lmp_nlist)
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
std::vector<std::vector<int > > nlist_data;
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
_build_nlist(nlist_data, coord_cpy, atype_cpy, mapping,
coord, atype, box, rc);
int nall = coord_cpy.size() / 3;
Expand Down
8 changes: 4 additions & 4 deletions source/api_cc/tests/test_deeppot_a.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ TEST_F(TestInferDeepPotA, cpu_lmp_nlist)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

double ener;
Expand Down Expand Up @@ -234,7 +234,7 @@ TEST_F(TestInferDeepPotA, cpu_lmp_nlist_atomic)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

double ener;
Expand Down Expand Up @@ -307,7 +307,7 @@ TEST_F(TestInferDeepPotA, cpu_lmp_nlist_2rc)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

double ener;
Expand Down Expand Up @@ -373,7 +373,7 @@ TEST_F(TestInferDeepPotA, cpu_lmp_nlist_type_sel)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

// dp compute
Expand Down
4 changes: 2 additions & 2 deletions source/api_cc/tests/test_deeppot_model_devi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ TEST_F(TestInferDeepPotModeDevi, cpu_lmp_list)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

int nmodel = 2;
Expand Down Expand Up @@ -170,7 +170,7 @@ TEST_F(TestInferDeepPotModeDevi, cpu_lmp_list_atomic)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

int nmodel = 2;
Expand Down
8 changes: 4 additions & 4 deletions source/api_cc/tests/test_deeppot_r.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ TEST_F(TestInferDeepPotR, cpu_lmp_nlist)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

double ener;
Expand Down Expand Up @@ -234,7 +234,7 @@ TEST_F(TestInferDeepPotR, cpu_lmp_nlist_atomic)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

double ener;
Expand Down Expand Up @@ -307,7 +307,7 @@ TEST_F(TestInferDeepPotR, cpu_lmp_nlist_2rc)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

double ener;
Expand Down Expand Up @@ -373,7 +373,7 @@ TEST_F(TestInferDeepPotR, cpu_lmp_nlist_type_sel)
int nall = coord_cpy.size() / 3;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

// dp compute
Expand Down
6 changes: 3 additions & 3 deletions source/api_cc/tests/test_dipolecharge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ TEST_F(TestDipoleCharge, cpu_lmp_nlist)
int nghost = nall - nloc;
std::vector<int> ilist(nloc), numneigh(nloc);
std::vector<int*> firstneigh(nloc);
InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]);
convert_nlist(inlist, nlist_data);

// evaluate dipole
Expand Down Expand Up @@ -174,9 +174,9 @@ TEST_F(TestDipoleCharge, cpu_lmp_nlist)
// compute the recp part of the ele interaction
double eener;
std::vector<double> eforce, evirial;
Region<double> region;
deepmd::Region<double> region;
init_region_cpu(region, &box[0]);
EwaldParameters<double> eparam;
deepmd::EwaldParameters<double> eparam;
eparam.beta = 0.2;
eparam.spacing = 4;
ewald_recp(eener, eforce, evirial, coord, charge, region, eparam);
Expand Down
4 changes: 2 additions & 2 deletions source/api_cc/tests/test_ewald.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TEST_F(TestInferEwald, cpu_numfv)
class MyModel : public EnergyModelTest<double>
{
const std::vector<double > & charge;
EwaldParameters<double> eparam;
deepmd::EwaldParameters<double> eparam;
public:
MyModel(
const std::vector<double> & charge_
Expand All @@ -48,7 +48,7 @@ TEST_F(TestInferEwald, cpu_numfv)
std::vector<double> & virial,
const std::vector<double> & coord,
const std::vector<double> & box) {
Region<double> region;
deepmd::Region<double> region;
init_region_cpu(region, &box[0]);
ewald_recp(ener, force, virial, coord, charge, region, eparam);
}
Expand Down
4 changes: 2 additions & 2 deletions source/api_cc/tests/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ class EnergyModelTest
VALUETYPE ener;
std::vector<VALUETYPE> force, virial;
compute(ener, force, virial, coord, box);
Region<VALUETYPE> region;
deepmd::Region<VALUETYPE> region;
init_region_cpu(region, &box[0]);
for(int ii = 0; ii < 9; ++ii){
std::vector<VALUETYPE> box0(box), box1(box);
box0[ii] += hh;
box1[ii] -= hh;
Region<VALUETYPE> region0, region1;
deepmd::Region<VALUETYPE> region0, region1;
init_region_cpu(region0, &box0[0]);
init_region_cpu(region1, &box1[0]);
std::vector<VALUETYPE> coord0(coord), coord1(coord);
Expand Down
Loading