@@ -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
0 commit comments