Skip to content

Commit c19aab7

Browse files
committed
fixing special_term
1 parent 6824c78 commit c19aab7

7 files changed

Lines changed: 71 additions & 71 deletions

File tree

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
export TORCH_SWITCH=OFF
3+
export TORCH_SWITCH=ON
44

55
export LIBEFP_DIR="/Users/lyuda/LIBEFP/libefp_skp_may2025"
66
export INSTALLATION_DIR="$LIBEFP_DIR"

src/efp.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ compute_two_body_range(struct efp *efp, size_t frag_from, size_t frag_to,
560560
s = (double *) calloc(n_lmo_ij, sizeof(double));
561561
ds = (six_t *) calloc(n_lmo_ij, sizeof(six_t));
562562

563-
if (do_xr(&efp->opts) || special_xr) {
563+
if ((do_xr(&efp->opts) && !if_special_fragment) || special_xr) {
564564
double exr = 0.0, ecp = 0.0;
565565

566566
efp_frag_frag_xr(efp, i, fr_j,
@@ -581,8 +581,8 @@ compute_two_body_range(struct efp *efp, size_t frag_from, size_t frag_to,
581581
}
582582
}
583583
}
584-
if ((do_elec(&efp->opts) || special_elec) && efp->frags[i].n_multipole_pts > 0 &&
585-
efp->frags[fr_j].n_multipole_pts > 0) {
584+
if (((do_elec(&efp->opts) && !if_special_fragment) || special_elec)
585+
&& efp->frags[i].n_multipole_pts > 0 && efp->frags[fr_j].n_multipole_pts > 0) {
586586
e_elec_tmp = efp_frag_frag_elec(efp, i, fr_j);
587587

588588
if (efp->opts.print > 0 && fabs(e_elec_tmp) > 1.0)
@@ -601,8 +601,8 @@ compute_two_body_range(struct efp *efp, size_t frag_from, size_t frag_to,
601601
efp->pair_energies[i].electrostatic = e_elec_tmp;
602602
}
603603
}
604-
if ((do_disp(&efp->opts) || special_disp) && efp->frags[i].n_dynamic_polarizable_pts > 0 &&
605-
efp->frags[fr_j].n_dynamic_polarizable_pts > 0) {
604+
if (((do_disp(&efp->opts) && !if_special_fragment) || special_disp)
605+
&& efp->frags[i].n_dynamic_polarizable_pts > 0 && efp->frags[fr_j].n_dynamic_polarizable_pts > 0) {
606606
e_disp_tmp = efp_frag_frag_disp(efp, i, fr_j, s, ds);
607607
e_disp += e_disp_tmp;
608608
/* */
@@ -614,11 +614,11 @@ compute_two_body_range(struct efp *efp, size_t frag_from, size_t frag_to,
614614
}
615615
}
616616
// LJ terms
617-
if (do_lj(&efp->opts) || special_lj) {
617+
if ((do_lj(&efp->opts) && !if_special_fragment) || special_lj) {
618618
e_lj += efp_frag_frag_lj(efp, i, fr_j);
619619
}
620620
// MM-like charge-charge interactions
621-
if (do_qq(&efp->opts) && special_qq) {
621+
if ((do_qq(&efp->opts) && !if_special_fragment) || special_qq) {
622622
e_qq_tmp = efp_frag_frag_qq(efp, i, fr_j);
623623

624624
// zeroing the energy contribution on the special fragment in torch custom models

tests/CMakeLists.txt

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -45,74 +45,83 @@ macro(add_mpi_test _name _prc)
4545
endmacro()
4646

4747
foreach(test_name
48-
#atom_coord
49-
#constraint_1
50-
#constraint_2
51-
#constraint_3
52-
#disp_1a
53-
#disp_1b
54-
#disp_1c
55-
#disp_2a
56-
#disp_2b
57-
#disp_3a
58-
#disp_3b
59-
#efield
48+
atom_coord
49+
constraint_1
50+
constraint_2
51+
constraint_3
52+
disp_1a
53+
disp_1b
54+
disp_1c
55+
disp_2a
56+
disp_2b
57+
disp_3a
58+
disp_3b
59+
efield
6060
elec_1a
6161
elec_1b
6262
elec_1c
6363
elec_2a
6464
elec_2b
6565
elec_3a
6666
elec_3b
67-
#elpot
68-
#grad_1
69-
#hess_1
70-
#md_1
71-
#md_2
72-
#md_3
73-
#opt_1
74-
#pairwise_0
75-
#pairwise_1
76-
#pairwise_2
77-
#pairwise_x
78-
#pbc_1
79-
#pbc_2
67+
elpot
68+
elpot_frag
69+
grad_1
70+
hess_1
71+
lj_1
72+
lj_2
73+
md_1
74+
md_2
75+
md_3
76+
opt_1
77+
pairwise_0
78+
pairwise_1
79+
pairwise_2
80+
pairwise_x
81+
pbc_1
82+
pbc_2
8083
pol_1a
8184
pol_1b
8285
pol_2a
8386
pol_2b
8487
pol_3a
8588
pol_3b
86-
#print
87-
#qm_1a
88-
#qm_1b
89-
#qm_2a
90-
#qm_2b
91-
#reduced
92-
#sp_1
93-
#symm_1
94-
#symm_2full
95-
#symm_2
96-
#symm_2pw
97-
#symm_2pw_printout
89+
polab_0
90+
polab_1
91+
print
92+
qm_1a
93+
qm_1b
94+
qm_2a
95+
qm_2b
96+
reduced
97+
sp_1
98+
sp_2
99+
spec_frag_1
100+
spec_frag_2
101+
spec_frag_base
102+
symm_1
103+
symm_2full
104+
symm_2
105+
symm_2pw
106+
symm_2pw_printout
98107
total_1a
99108
total_2a
100109
total_3a
101110
total_4a
102111
total_4b
103112
total_4c
104113
total_4d
105-
#total_5a
106-
#total_5b
107-
#total_5c
108-
#total_5d
109-
#total_6a
110-
#total_6b
111-
#total_6c
112-
#total_6d
113-
#xr_1
114-
#xr_2
115-
#xr_3
114+
total_5a
115+
total_5b
116+
total_5c
117+
total_5d
118+
total_6a
119+
total_6b
120+
total_6c
121+
total_6d
122+
xr_1
123+
xr_2
124+
xr_3
116125
# crambin/opt.in not handled (cannot load ff geometry)
117126
)
118127

tests/spec_frag_0.in

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/spec_frag_1.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
run_type sp
1+
run_type etest
2+
ref_energy 0.0000841901
23
coord xyzabc
34
terms elec pol disp xr
45
disp_damp off

tests/spec_frag_2.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
run_type sp
1+
run_type etest
2+
ref_energy -0.0000982356
23
coord xyzabc
34
terms elec pol disp xr
45
disp_damp off

tests/spec_frag_base.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
run_type sp
1+
run_type etest
2+
ref_energy -0.0000850092
23
coord xyzabc
34
terms elec pol disp xr
45
disp_damp off

0 commit comments

Comments
 (0)