1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
11 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
12 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
13 * Copyright (c) 2001-2004, The GROMACS development team,
14 * check out http://www.gromacs.org for more information.
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * For more info, check our website at http://www.gromacs.org
34 * GROwing Monsters And Cloning Shrimps
50 #include "nonbonded.h"
65 #include "gmx_omp_nthreads.h"
80 gmx_grppairener_t *grppener,
82 gmx_bool bDoLongRange,
90 if (!fr->ns.nblist_initialized)
92 init_neighbor_list(fp, fr, md->homenr);
98 nsearch = search_neighbours(fp,fr,x,box,top,groups,cr,nrnb,md,
99 lambda,dvdlambda,grppener,
100 bFillGrid,bDoLongRange,
103 fprintf(debug,"nsearch = %d\n",nsearch);
105 /* Check whether we have to do dynamic load balancing */
106 /*if ((nsb->nstDlb > 0) && (mod(step,nsb->nstDlb) == 0))
107 count_nb(cr,nsb,&(top->blocks[ebCGS]),nns,fr->nlr,
108 &(top->idef),opts->ngener);
110 if (fr->ns.dump_nl > 0)
111 dump_nblist(fp,cr,fr,fr->ns.dump_nl);
114 static void reduce_thread_forces(int n,rvec *f,
117 int efpt_ind,real *dvdl,
118 int nthreads,f_thread_t *f_t)
122 /* This reduction can run over any number of threads */
123 #pragma omp parallel for num_threads(gmx_omp_nthreads_get(emntBonded)) private(t) schedule(static)
126 for(t=1; t<nthreads; t++)
128 rvec_inc(f[i],f_t[t].f[i]);
131 for(t=1; t<nthreads; t++)
133 *Vcorr += f_t[t].Vcorr;
134 *dvdl += f_t[t].dvdl[efpt_ind];
135 m_add(vir,f_t[t].vir,vir);
139 void do_force_lowlevel(FILE *fplog, gmx_large_int_t step,
140 t_forcerec *fr, t_inputrec *ir,
141 t_idef *idef, t_commrec *cr,
142 t_nrnb *nrnb, gmx_wallcycle_t wcycle,
145 rvec x[], history_t *hist,
147 gmx_enerdata_t *enerd,
165 gmx_bool bDoEpot,bSepDVDL,bSB;
169 real Vsr,Vlr,Vcorr=0;
173 gmx_enerdata_t ed_lam;
174 double clam_i,vlam_i;
175 real dvdl_dum[efptNR], dvdl, dvdl_nb[efptNR], lam_i[efptNR];
179 double t0=0.0,t1,t2,t3; /* time measurement for coarse load balancing */
182 #define PRINT_SEPDVDL(s,v,dvdlambda) if (bSepDVDL) fprintf(fplog,sepdvdlformat,s,v,dvdlambda);
185 set_pbc(&pbc,fr->ePBC,box);
187 /* reset free energy components */
188 for (i=0;i<efptNR;i++)
195 for(i=0; (i<DIM); i++)
197 box_size[i]=box[i][i];
200 bSepDVDL=(fr->bSepDVDL && do_per_step(step,ir->nstlog));
203 /* do QMMM first if requested */
206 enerd->term[F_EQM] = calculate_QMMM(cr,x,f,fr,md);
211 fprintf(fplog,"Step %s: non-bonded V and dVdl for node %d:\n",
212 gmx_step_str(step,buf),cr->nodeid);
215 /* Call the short range functions all in one go. */
218 /*#define TAKETIME ((cr->npmenodes) && (fr->timesteps < 12))*/
219 #define TAKETIME FALSE
222 MPI_Barrier(cr->mpi_comm_mygroup);
229 /* foreign lambda component for walls */
230 dvdl = do_walls(ir,fr,box,md,x,f,lambda[efptVDW],
231 enerd->grpp.ener[egLJSR],nrnb);
232 PRINT_SEPDVDL("Walls",0.0,dvdl);
233 enerd->dvdl_lin[efptVDW] += dvdl;
236 /* If doing GB, reset dvda and calculate the Born radii */
237 if (ir->implicit_solvent)
239 wallcycle_sub_start(wcycle, ewcsNONBONDED);
241 for(i=0;i<born->nr;i++)
248 calc_gb_rad(cr,fr,ir,top,atype,x,&(fr->gblist),born,md,nrnb);
251 wallcycle_sub_stop(wcycle, ewcsNONBONDED);
255 if (flags & GMX_FORCE_NONBONDED)
258 if (flags & GMX_FORCE_FORCES)
260 donb_flags |= GMX_DONB_FORCES;
263 wallcycle_sub_start(wcycle, ewcsNONBONDED);
264 do_nonbonded(cr,fr,x,f,md,excl,
266 enerd->grpp.ener[egBHAMSR] :
267 enerd->grpp.ener[egLJSR],
268 enerd->grpp.ener[egCOULSR],
269 enerd->grpp.ener[egGB],box_size,nrnb,
270 lambda,dvdl_nb,-1,-1,donb_flags);
271 wallcycle_sub_stop(wcycle, ewcsNONBONDED);
274 /* If we do foreign lambda and we have soft-core interactions
275 * we have to recalculate the (non-linear) energies contributions.
277 if (fepvals->n_lambda > 0 && (flags & GMX_FORCE_DHDL) && fepvals->sc_alpha != 0)
279 wallcycle_sub_start(wcycle, ewcsNONBONDED);
280 init_enerdata(mtop->groups.grps[egcENER].nr,fepvals->n_lambda,&ed_lam);
282 for(i=0; i<enerd->n_lambda; i++)
284 for (j=0;j<efptNR;j++)
286 lam_i[j] = (i==0 ? lambda[j] : fepvals->all_lambda[j][i-1]);
288 reset_enerdata(&ir->opts,fr,TRUE,&ed_lam,FALSE);
289 do_nonbonded(cr,fr,x,f,md,excl,
291 ed_lam.grpp.ener[egBHAMSR] :
292 ed_lam.grpp.ener[egLJSR],
293 ed_lam.grpp.ener[egCOULSR],
294 enerd->grpp.ener[egGB], box_size,nrnb,
295 lam_i,dvdl_dum,-1,-1,
296 GMX_DONB_FOREIGNLAMBDA);
297 sum_epot(&ir->opts,&ed_lam);
298 enerd->enerpart_lambda[i] += ed_lam.term[F_EPOT];
300 destroy_enerdata(&ed_lam);
301 wallcycle_sub_stop(wcycle, ewcsNONBONDED);
305 /* If we are doing GB, calculate bonded forces and apply corrections
306 * to the solvation forces */
307 /* MRS: Eventually, many need to include free energy contribution here! */
308 if (ir->implicit_solvent)
310 calc_gb_forces(cr,md,born,top,atype,x,f,fr,idef,
311 ir->gb_algorithm,ir->sa_algorithm,nrnb,bBornRadii,&pbc,graph,enerd);
312 wallcycle_sub_stop(wcycle, ewcsBONDED);
323 if (fepvals->sc_alpha!=0)
325 enerd->dvdl_nonlin[efptVDW] += dvdl_nb[efptVDW];
329 enerd->dvdl_lin[efptVDW] += dvdl_nb[efptVDW];
332 if (fepvals->sc_alpha!=0)
334 /* even though coulomb part is linear, we already added it, beacuse we
335 need to go through the vdw calculation anyway */
337 enerd->dvdl_nonlin[efptCOUL] += dvdl_nb[efptCOUL];
341 enerd->dvdl_lin[efptCOUL] += dvdl_nb[efptCOUL];
347 for(i=0; i<enerd->grpp.nener; i++)
351 enerd->grpp.ener[egBHAMSR][i] :
352 enerd->grpp.ener[egLJSR][i])
353 + enerd->grpp.ener[egCOULSR][i] + enerd->grpp.ener[egGB][i];
355 dvdlsum = dvdl_nb[efptVDW] + dvdl_nb[efptCOUL];
356 PRINT_SEPDVDL("VdW and Coulomb SR particle-p.",Vsr,dvdlsum);
363 pr_rvecs(debug,0,"fshift after SR",fr->fshift,SHIFTS);
366 /* Shift the coordinates. Must be done before bonded forces and PPPM,
367 * but is also necessary for SHAKE and update, therefore it can NOT
368 * go when no bonded forces have to be evaluated.
371 /* Here sometimes we would not need to shift with NBFonly,
372 * but we do so anyhow for consistency of the returned coordinates.
376 shift_self(graph,box,x);
379 inc_nrnb(nrnb,eNR_SHIFTX,2*graph->nnodes);
383 inc_nrnb(nrnb,eNR_SHIFTX,graph->nnodes);
386 /* Check whether we need to do bondeds or correct for exclusions */
388 ((flags & GMX_FORCE_BONDED)
389 || EEL_RF(fr->eeltype) || EEL_FULL(fr->eeltype)))
391 /* Since all atoms are in the rectangular or triclinic unit-cell,
392 * only single box vector shifts (2 in x) are required.
394 set_pbc_dd(&pbc,fr->ePBC,cr->dd,TRUE,box);
398 if (flags & GMX_FORCE_BONDED)
400 wallcycle_sub_start(wcycle, ewcsBONDED);
401 calc_bonds(fplog,cr->ms,
402 idef,x,hist,f,fr,&pbc,graph,enerd,nrnb,lambda,md,fcd,
403 DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL, atype, born,
405 fr->bSepDVDL && do_per_step(step,ir->nstlog),step);
407 /* Check if we have to determine energy differences
408 * at foreign lambda's.
410 if (fepvals->n_lambda > 0 && (flags & GMX_FORCE_DHDL) &&
411 idef->ilsort != ilsortNO_FE)
413 if (idef->ilsort != ilsortFE_SORTED)
415 gmx_incons("The bonded interactions are not sorted for free energy");
417 init_enerdata(mtop->groups.grps[egcENER].nr,fepvals->n_lambda,&ed_lam);
419 for(i=0; i<enerd->n_lambda; i++)
421 reset_enerdata(&ir->opts,fr,TRUE,&ed_lam,FALSE);
422 for (j=0;j<efptNR;j++)
424 lam_i[j] = (i==0 ? lambda[j] : fepvals->all_lambda[j][i-1]);
426 calc_bonds_lambda(fplog,idef,x,fr,&pbc,graph,&ed_lam,nrnb,lam_i,md,
427 fcd,DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
428 sum_epot(&ir->opts,&ed_lam);
429 enerd->enerpart_lambda[i] += ed_lam.term[F_EPOT];
431 destroy_enerdata(&ed_lam);
435 wallcycle_sub_stop(wcycle, ewcsBONDED);
441 if (EEL_FULL(fr->eeltype))
443 bSB = (ir->nwall == 2);
447 svmul(ir->wall_ewald_zfac,boxs[ZZ],boxs[ZZ]);
448 box_size[ZZ] *= ir->wall_ewald_zfac;
451 clear_mat(fr->vir_el_recip);
458 /* With the Verlet scheme exclusion forces are calculated
459 * in the non-bonded kernel.
461 /* The TPI molecule does not have exclusions with the rest
462 * of the system and no intra-molecular PME grid contributions
463 * will be calculated in gmx_pme_calc_energy.
465 if ((ir->cutoff_scheme == ecutsGROUP && fr->n_tpi == 0) ||
466 ir->ewald_geometry != eewg3D ||
467 ir->epsilon_surface != 0)
471 wallcycle_sub_start(wcycle, ewcsEWALD_CORRECTION);
475 gmx_fatal(FARGS,"TPI with PME currently only works in a 3D geometry with tin-foil boundary conditions");
478 nthreads = gmx_omp_nthreads_get(emntBonded);
479 #pragma omp parallel for num_threads(nthreads) schedule(static)
480 for(t=0; t<nthreads; t++)
488 fnv = fr->f_novirsum;
489 vir = &fr->vir_el_recip;
496 vir = &fr->f_t[t].vir;
497 Vcorrt = &fr->f_t[t].Vcorr;
498 dvdlt = &fr->f_t[t].dvdl[efptCOUL];
499 for(i=0; i<fr->natoms_force; i++)
507 ewald_LRcorrection(fplog,
508 fr->excl_load[t],fr->excl_load[t+1],
511 md->nChargePerturbed ? md->chargeB : NULL,
512 ir->cutoff_scheme != ecutsVERLET,
513 excl,x,bSB ? boxs : box,mu_tot,
517 lambda[efptCOUL],dvdlt);
521 reduce_thread_forces(fr->natoms_force,fr->f_novirsum,
523 &Vcorr,efptCOUL,&dvdl,
527 wallcycle_sub_stop(wcycle, ewcsEWALD_CORRECTION);
532 Vcorr += ewald_charge_correction(cr,fr,lambda[efptCOUL],box,
533 &dvdl,fr->vir_el_recip);
536 PRINT_SEPDVDL("Ewald excl./charge/dip. corr.",Vcorr,dvdl);
537 enerd->dvdl_lin[efptCOUL] += dvdl;
548 case eelPMEUSERSWITCH:
550 if (cr->duty & DUTY_PME)
552 assert(fr->n_tpi >= 0);
553 if (fr->n_tpi == 0 || (flags & GMX_FORCE_STATECHANGED))
555 pme_flags = GMX_PME_SPREAD_Q | GMX_PME_SOLVE;
556 if (flags & GMX_FORCE_FORCES)
558 pme_flags |= GMX_PME_CALC_F;
560 if (flags & (GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY))
562 pme_flags |= GMX_PME_CALC_ENER_VIR;
566 /* We don't calculate f, but we do want the potential */
567 pme_flags |= GMX_PME_CALC_POT;
569 wallcycle_start(wcycle,ewcPMEMESH);
570 status = gmx_pme_do(fr->pmedata,
571 md->start,md->homenr - fr->n_tpi,
573 md->chargeA,md->chargeB,
575 DOMAINDECOMP(cr) ? dd_pme_maxshift_x(cr->dd) : 0,
576 DOMAINDECOMP(cr) ? dd_pme_maxshift_y(cr->dd) : 0,
578 fr->vir_el_recip,fr->ewaldcoeff,
579 &Vlr,lambda[efptCOUL],&dvdl,
581 *cycles_pme = wallcycle_stop(wcycle,ewcPMEMESH);
583 /* We should try to do as little computation after
584 * this as possible, because parallel PME synchronizes
585 * the nodes, so we want all load imbalance of the rest
586 * of the force calculation to be before the PME call.
587 * DD load balancing is done on the whole time of
588 * the force call (without PME).
593 /* Determine the PME grid energy of the test molecule
594 * with the PME grid potential of the other charges.
596 gmx_pme_calc_energy(fr->pmedata,fr->n_tpi,
597 x + md->homenr - fr->n_tpi,
598 md->chargeA + md->homenr - fr->n_tpi,
601 PRINT_SEPDVDL("PME mesh",Vlr,dvdl);
605 Vlr = do_ewald(fplog,FALSE,ir,x,fr->f_novirsum,
606 md->chargeA,md->chargeB,
607 box_size,cr,md->homenr,
608 fr->vir_el_recip,fr->ewaldcoeff,
609 lambda[efptCOUL],&dvdl,fr->ewald_table);
610 PRINT_SEPDVDL("Ewald long-range",Vlr,dvdl);
613 gmx_fatal(FARGS,"No such electrostatics method implemented %s",
614 eel_names[fr->eeltype]);
618 gmx_fatal(FARGS,"Error %d in long range electrostatics routine %s",
619 status,EELTYPE(fr->eeltype));
621 /* Note that with separate PME nodes we get the real energies later */
622 enerd->dvdl_lin[efptCOUL] += dvdl;
623 enerd->term[F_COUL_RECIP] = Vlr + Vcorr;
626 fprintf(debug,"Vlr = %g, Vcorr = %g, Vlr_corr = %g\n",
627 Vlr,Vcorr,enerd->term[F_COUL_RECIP]);
628 pr_rvecs(debug,0,"vir_el_recip after corr",fr->vir_el_recip,DIM);
629 pr_rvecs(debug,0,"fshift after LR Corrections",fr->fshift,SHIFTS);
634 if (EEL_RF(fr->eeltype))
636 /* With the Verlet scheme exclusion forces are calculated
637 * in the non-bonded kernel.
639 if (ir->cutoff_scheme != ecutsVERLET && fr->eeltype != eelRF_NEC)
642 enerd->term[F_RF_EXCL] =
643 RF_excl_correction(fplog,fr,graph,md,excl,x,f,
644 fr->fshift,&pbc,lambda[efptCOUL],&dvdl);
647 enerd->dvdl_lin[efptCOUL] += dvdl;
648 PRINT_SEPDVDL("RF exclusion correction",
649 enerd->term[F_RF_EXCL],dvdl);
657 print_nrnb(debug,nrnb);
665 MPI_Barrier(cr->mpi_comm_mygroup);
668 if (fr->timesteps == 11)
670 fprintf(stderr,"* PP load balancing info: node %d, step %s, rel wait time=%3.0f%% , load string value: %7.2f\n",
671 cr->nodeid, gmx_step_str(fr->timesteps,buf),
672 100*fr->t_wait/(fr->t_wait+fr->t_fnbf),
673 (fr->t_fnbf+fr->t_wait)/fr->t_fnbf);
681 pr_rvecs(debug,0,"fshift after bondeds",fr->fshift,SHIFTS);
686 void init_enerdata(int ngener,int n_lambda,gmx_enerdata_t *enerd)
690 for(i=0; i<F_NRE; i++)
696 for(i=0; i<efptNR; i++) {
697 enerd->dvdl_lin[i] = 0;
698 enerd->dvdl_nonlin[i] = 0;
704 fprintf(debug,"Creating %d sized group matrix for energies\n",n2);
706 enerd->grpp.nener = n2;
707 for(i=0; (i<egNR); i++)
709 snew(enerd->grpp.ener[i],n2);
714 enerd->n_lambda = 1 + n_lambda;
715 snew(enerd->enerpart_lambda,enerd->n_lambda);
723 void destroy_enerdata(gmx_enerdata_t *enerd)
727 for(i=0; (i<egNR); i++)
729 sfree(enerd->grpp.ener[i]);
734 sfree(enerd->enerpart_lambda);
738 static real sum_v(int n,real v[])
750 void sum_epot(t_grpopts *opts,gmx_enerdata_t *enerd)
752 gmx_grppairener_t *grpp;
759 /* Accumulate energies */
760 epot[F_COUL_SR] = sum_v(grpp->nener,grpp->ener[egCOULSR]);
761 epot[F_LJ] = sum_v(grpp->nener,grpp->ener[egLJSR]);
762 epot[F_LJ14] = sum_v(grpp->nener,grpp->ener[egLJ14]);
763 epot[F_COUL14] = sum_v(grpp->nener,grpp->ener[egCOUL14]);
764 epot[F_COUL_LR] = sum_v(grpp->nener,grpp->ener[egCOULLR]);
765 epot[F_LJ_LR] = sum_v(grpp->nener,grpp->ener[egLJLR]);
766 /* We have already added 1-2,1-3, and 1-4 terms to F_GBPOL */
767 epot[F_GBPOL] += sum_v(grpp->nener,grpp->ener[egGB]);
769 /* lattice part of LR doesnt belong to any group
770 * and has been added earlier
772 epot[F_BHAM] = sum_v(grpp->nener,grpp->ener[egBHAMSR]);
773 epot[F_BHAM_LR] = sum_v(grpp->nener,grpp->ener[egBHAMLR]);
776 for(i=0; (i<F_EPOT); i++)
778 if (i != F_DISRESVIOL && i != F_ORIRESDEV)
780 epot[F_EPOT] += epot[i];
785 void sum_dhdl(gmx_enerdata_t *enerd, real *lambda, t_lambda *fepvals)
790 enerd->dvdl_lin[efptVDW] += enerd->term[F_DVDL_VDW]; /* include dispersion correction */
791 enerd->term[F_DVDL] = 0.0;
792 for (i=0;i<efptNR;i++)
794 if (fepvals->separate_dvdl[i])
796 /* could this be done more readably/compactly? */
805 index = F_DVDL_BONDED;
807 case (efptRESTRAINT):
808 index = F_DVDL_RESTRAINT;
817 enerd->term[index] = enerd->dvdl_lin[i] + enerd->dvdl_nonlin[i];
820 fprintf(debug,"dvdl-%s[%2d]: %f: non-linear %f + linear %f\n",
821 efpt_names[i],i,enerd->term[index],enerd->dvdl_nonlin[i],enerd->dvdl_lin[i]);
826 enerd->term[F_DVDL] += enerd->dvdl_lin[i] + enerd->dvdl_nonlin[i];
829 fprintf(debug,"dvd-%sl[%2d]: %f: non-linear %f + linear %f\n",
830 efpt_names[0],i,enerd->term[F_DVDL],enerd->dvdl_nonlin[i],enerd->dvdl_lin[i]);
835 /* Notes on the foreign lambda free energy difference evaluation:
836 * Adding the potential and ekin terms that depend linearly on lambda
837 * as delta lam * dvdl to the energy differences is exact.
838 * For the constraints this is not exact, but we have no other option
839 * without literally changing the lengths and reevaluating the energies at each step.
840 * (try to remedy this post 4.6 - MRS)
841 * For the non-bonded LR term we assume that the soft-core (if present)
842 * no longer affects the energy beyond the short-range cut-off,
843 * which is a very good approximation (except for exotic settings).
844 * (investigate how to overcome this post 4.6 - MRS)
847 for(i=0; i<fepvals->n_lambda; i++)
848 { /* note we are iterating over fepvals here!
849 For the current lam, dlam = 0 automatically,
850 so we don't need to add anything to the
851 enerd->enerpart_lambda[0] */
853 /* we don't need to worry about dvdl contributions to the current lambda, because
854 it's automatically zero */
856 /* first kinetic energy term */
857 dlam = (fepvals->all_lambda[efptMASS][i] - lambda[efptMASS]);
859 enerd->enerpart_lambda[i+1] += enerd->term[F_DKDL]*dlam;
861 for (j=0;j<efptNR;j++)
863 if (j==efptMASS) {continue;} /* no other mass term to worry about */
865 dlam = (fepvals->all_lambda[j][i]-lambda[j]);
866 enerd->enerpart_lambda[i+1] += dlam*enerd->dvdl_lin[j];
869 fprintf(debug,"enerdiff lam %g: (%15s), non-linear %f linear %f*%f\n",
870 fepvals->all_lambda[j][i],efpt_names[j],
871 (enerd->enerpart_lambda[i+1] - enerd->enerpart_lambda[0]),
872 dlam,enerd->dvdl_lin[j]);
878 void reset_enerdata(t_grpopts *opts,
879 t_forcerec *fr,gmx_bool bNS,
880 gmx_enerdata_t *enerd,
886 /* First reset all energy components, except for the long range terms
887 * on the master at non neighbor search steps, since the long range
888 * terms have already been summed at the last neighbor search step.
890 bKeepLR = (fr->bTwinRange && !bNS);
891 for(i=0; (i<egNR); i++) {
892 if (!(bKeepLR && bMaster && (i == egCOULLR || i == egLJLR))) {
893 for(j=0; (j<enerd->grpp.nener); j++)
894 enerd->grpp.ener[i][j] = 0.0;
897 for (i=0;i<efptNR;i++)
899 enerd->dvdl_lin[i] = 0.0;
900 enerd->dvdl_nonlin[i] = 0.0;
903 /* Normal potential energy components */
904 for(i=0; (i<=F_EPOT); i++) {
905 enerd->term[i] = 0.0;
907 /* Initialize the dVdlambda term with the long range contribution */
908 /* Initialize the dvdl term with the long range contribution */
909 enerd->term[F_DVDL] = 0.0;
910 enerd->term[F_DVDL_COUL] = 0.0;
911 enerd->term[F_DVDL_VDW] = 0.0;
912 enerd->term[F_DVDL_BONDED] = 0.0;
913 enerd->term[F_DVDL_RESTRAINT] = 0.0;
914 enerd->term[F_DKDL] = 0.0;
915 if (enerd->n_lambda > 0)
917 for(i=0; i<enerd->n_lambda; i++)
919 enerd->enerpart_lambda[i] = 0.0;