From dd76a1c2470dc5fabdc3d2082935cafcfd01e497 Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Fri, 25 May 2018 03:07:41 +0200 Subject: [PATCH] Clean up force.h and its use Reduced use of transitive inclusion of headers, along with unnecessary inclusion of force.h, and broke it up into its parts. Change-Id: Ic75795e98e010bd2d36093cdce28d101343a5645 --- src/gromacs/domdec/domdec.cpp | 2 +- src/gromacs/domdec/domdec_topology.cpp | 1 - src/gromacs/mdlib/calcvir.cpp | 7 +- src/gromacs/mdlib/calcvir.h | 51 ++++++++++ src/gromacs/mdlib/expanded.cpp | 1 + src/gromacs/mdlib/force.cpp | 3 + src/gromacs/mdlib/force.h | 103 ++------------------- src/gromacs/mdlib/forcerec.cpp | 2 + src/gromacs/mdlib/forcerec.h | 29 ++++++ .../mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.cpp | 2 +- .../mdlib/nbnxn_kernels/nbnxn_kernel_ref.cpp | 4 +- src/gromacs/mdlib/ns.cpp | 1 - src/gromacs/mdlib/qm_gamess.cpp | 3 +- src/gromacs/mdlib/qm_mopac.cpp | 3 +- src/gromacs/mdlib/qm_orca.cpp | 4 +- src/gromacs/mdlib/qmmm.cpp | 2 +- src/gromacs/mdlib/rf_util.cpp | 4 +- src/gromacs/mdlib/rf_util.h | 79 ++++++++++++++++ src/gromacs/mdlib/shellfc.cpp | 1 + src/gromacs/mdlib/sim_util.cpp | 1 + src/gromacs/mdlib/stat.cpp | 1 - src/gromacs/mdlib/update.cpp | 1 - src/gromacs/mdlib/wall.cpp | 3 +- src/gromacs/mdlib/wall.h | 64 +++++++++++++ src/gromacs/mdlib/wnblist.cpp | 2 +- src/gromacs/mdrun/runner.cpp | 2 +- src/gromacs/mdrun/tpi.cpp | 1 + 27 files changed, 262 insertions(+), 115 deletions(-) create mode 100644 src/gromacs/mdlib/calcvir.h create mode 100644 src/gromacs/mdlib/rf_util.h create mode 100644 src/gromacs/mdlib/wall.h diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index a294879ebd..f4a1e633fb 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -50,6 +50,7 @@ #include #include "gromacs/domdec/collect.h" +#include "gromacs/domdec/dlbtiming.h" #include "gromacs/domdec/domdec_network.h" #include "gromacs/domdec/ga2la.h" #include "gromacs/ewald/pme.h" @@ -67,7 +68,6 @@ #include "gromacs/math/vectypes.h" #include "gromacs/mdlib/constr.h" #include "gromacs/mdlib/constraintrange.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/forcerec.h" #include "gromacs/mdlib/gmx_omp_nthreads.h" #include "gromacs/mdlib/lincs.h" diff --git a/src/gromacs/domdec/domdec_topology.cpp b/src/gromacs/domdec/domdec_topology.cpp index e8880dc950..e6fe90fc8c 100644 --- a/src/gromacs/domdec/domdec_topology.cpp +++ b/src/gromacs/domdec/domdec_topology.cpp @@ -60,7 +60,6 @@ #include "gromacs/gmxlib/chargegroup.h" #include "gromacs/gmxlib/network.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/forcerec.h" #include "gromacs/mdlib/gmx_omp_nthreads.h" #include "gromacs/mdlib/vsite.h" diff --git a/src/gromacs/mdlib/calcvir.cpp b/src/gromacs/mdlib/calcvir.cpp index 380ebfb8b7..641b116682 100644 --- a/src/gromacs/mdlib/calcvir.cpp +++ b/src/gromacs/mdlib/calcvir.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -37,13 +37,14 @@ /* This file is completely threadsafe - keep it that way! */ #include "gmxpre.h" +#include "calcvir.h" + #include "config.h" /* for GMX_MAX_OPENMP_THREADS */ #include #include "gromacs/math/vec.h" #include "gromacs/math/vectypes.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/gmx_omp_nthreads.h" #include "gromacs/pbcutil/ishift.h" #include "gromacs/pbcutil/mshift.h" @@ -102,7 +103,7 @@ static void calc_x_times_f(int nxf, const rvec x[], const rvec f[], } void calc_vir(int nxf, rvec x[], rvec f[], tensor vir, - gmx_bool bScrewPBC, matrix box) + bool bScrewPBC, matrix box) { matrix x_times_f; diff --git a/src/gromacs/mdlib/calcvir.h b/src/gromacs/mdlib/calcvir.h new file mode 100644 index 0000000000..896b1347fb --- /dev/null +++ b/src/gromacs/mdlib/calcvir.h @@ -0,0 +1,51 @@ +/* + * This file is part of the GROMACS molecular simulation package. + * + * Copyright (c) 2018, by the GROMACS development team, led by + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, + * and including many others, as listed in the AUTHORS file in the + * top-level source directory and at http://www.gromacs.org. + * + * GROMACS is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * GROMACS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GROMACS; if not, see + * http://www.gnu.org/licenses, or write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * If you want to redistribute modifications to GROMACS, please + * consider that scientific software is very special. Version + * control is crucial - bugs must be traceable. We will be happy to + * consider code for inclusion in the official distribution, but + * derived work must not be called official GROMACS. Details are found + * in the README & COPYING files - if they are missing, get the + * official version at http://www.gromacs.org. + * + * To help us fund GROMACS development, we humbly ask that you cite + * the research papers on the package. Check out http://www.gromacs.org. + */ +#ifndef GMX_MDLIB_CALCVIR_H +#define GMX_MDLIB_CALCVIR_H + +#include "gromacs/math/vectypes.h" + +struct t_graph; +struct t_pbc; + +void calc_vir(int nxf, rvec x[], rvec f[], tensor vir, + bool bScrewPBC, matrix box); +/* Calculate virial for nxf atoms, and add it to vir */ + +void f_calc_vir(int i0, int i1, rvec x[], rvec f[], tensor vir, + t_graph *g, rvec shift_vec[]); +/* Calculate virial taking periodicity into account */ + +#endif diff --git a/src/gromacs/mdlib/expanded.cpp b/src/gromacs/mdlib/expanded.cpp index e4330ed5ba..22a76aadff 100644 --- a/src/gromacs/mdlib/expanded.cpp +++ b/src/gromacs/mdlib/expanded.cpp @@ -58,6 +58,7 @@ #include "gromacs/mdlib/constr.h" #include "gromacs/mdlib/force.h" #include "gromacs/mdlib/update.h" +#include "gromacs/mdtypes/forcerec.h" #include "gromacs/mdtypes/inputrec.h" #include "gromacs/mdtypes/md_enums.h" #include "gromacs/mdtypes/mdatom.h" diff --git a/src/gromacs/mdlib/force.cpp b/src/gromacs/mdlib/force.cpp index 205b065f53..3e07b81f13 100644 --- a/src/gromacs/mdlib/force.cpp +++ b/src/gromacs/mdlib/force.cpp @@ -56,10 +56,13 @@ #include "gromacs/listed-forces/listed-forces.h" #include "gromacs/math/vec.h" #include "gromacs/math/vecdump.h" +#include "gromacs/mdlib/force_flags.h" #include "gromacs/mdlib/forcerec-threading.h" #include "gromacs/mdlib/mdrun.h" #include "gromacs/mdlib/ns.h" #include "gromacs/mdlib/qmmm.h" +#include "gromacs/mdlib/rf_util.h" +#include "gromacs/mdlib/wall.h" #include "gromacs/mdtypes/commrec.h" #include "gromacs/mdtypes/forceoutput.h" #include "gromacs/mdtypes/inputrec.h" diff --git a/src/gromacs/mdlib/force.h b/src/gromacs/mdlib/force.h index 793eab2b85..60c26a6365 100644 --- a/src/gromacs/mdlib/force.h +++ b/src/gromacs/mdlib/force.h @@ -38,112 +38,36 @@ #define GMX_MDLIB_FORCE_H #include "gromacs/domdec/dlbtiming.h" -#include "gromacs/mdlib/force_flags.h" -#include "gromacs/mdlib/vsite.h" -#include "gromacs/mdtypes/fcdata.h" -#include "gromacs/mdtypes/forcerec.h" -#include "gromacs/timing/wallcycle.h" +#include "gromacs/math/paddedvector.h" +#include "gromacs/math/vectypes.h" #include "gromacs/utility/arrayref.h" -struct gmx_device_info_t; struct gmx_edsam; -struct gmx_gpu_info_t; +struct gmx_enerdata_t; struct gmx_groups_t; +struct gmx_grppairener_t; +struct gmx_localtop_t; struct gmx_multisim_t; struct gmx_vsite_t; +struct gmx_wallcycle; class history_t; -struct nonbonded_verlet_t; struct t_blocka; struct t_commrec; struct t_fcdata; +struct t_forcerec; struct t_graph; -struct t_grpopts; +struct t_idef; struct t_inputrec; struct t_lambda; struct t_mdatoms; struct t_nrnb; -struct t_pbc; namespace gmx { class ForceWithVirial; class MDLogger; -class PhysicalNodeCommunicator; } -void calc_vir(int nxf, rvec x[], rvec f[], tensor vir, - gmx_bool bScrewPBC, matrix box); -/* Calculate virial for nxf atoms, and add it to vir */ - -void f_calc_vir(int i0, int i1, rvec x[], rvec f[], tensor vir, - t_graph *g, rvec shift_vec[]); -/* Calculate virial taking periodicity into account */ - -real RF_excl_correction(const t_forcerec *fr, - const t_graph *g, - const t_mdatoms *mdatoms, - const t_blocka *excl, - bool usingDomainDecomposition, - rvec x[], - rvec f[], - rvec *fshift, - const t_pbc *pbc, - real lambda, - real *dvdlambda); -/* Calculate the reaction-field energy correction for this node: - * epsfac q_i q_j (k_rf r_ij^2 - c_rf) - * and force correction for all excluded pairs, including self pairs. - */ - -void calc_rffac(FILE *fplog, int eel, real eps_r, real eps_rf, - real Rc, real Temp, - real zsq, matrix box, - real *krf, real *crf); -/* Determine the reaction-field constants */ - -void init_generalized_rf(FILE *fplog, - const gmx_mtop_t *mtop, const t_inputrec *ir, - t_forcerec *fr); -/* Initialize the generalized reaction field parameters */ - - -/* In wall.c */ -void make_wall_tables(FILE *fplog, - const t_inputrec *ir, const char *tabfn, - const gmx_groups_t *groups, - t_forcerec *fr); - -real do_walls(const t_inputrec *ir, - t_forcerec *fr, - matrix box, - const t_mdatoms *md, - const rvec x[], - rvec f[], - real lambda, - real Vlj[], - t_nrnb *nrnb); - -gmx_bool can_use_allvsall(const t_inputrec *ir, - gmx_bool bPrintNote, const t_commrec *cr, FILE *fp); -/* Returns if we can use all-vs-all loops. - * If bPrintNote==TRUE, prints a note, if necessary, to stderr - * and fp (if !=NULL) on the master node. - */ - -gmx_bool nbnxn_simd_supported(const gmx::MDLogger &mdlog, - const t_inputrec *ir); -/* Return if CPU SIMD support exists for the given inputrec - * If the return value is FALSE and fplog/cr != NULL, prints a fallback - * message to fplog/stderr. - */ - -gmx_bool uses_simple_tables(int cutoff_scheme, - nonbonded_verlet_t *nbv, - int group); -/* Returns whether simple tables (i.e. not for use with GPUs) are used - * with the type of kernel indicated. - */ - void init_enerdata(int ngener, int n_lambda, gmx_enerdata_t *enerd); /* Intializes the energy storage struct */ @@ -162,17 +86,13 @@ void sum_epot(gmx_grppairener_t *grpp, real *epot); void sum_dhdl(gmx_enerdata_t *enerd, gmx::ArrayRef lambda, t_lambda *fepvals); /* Sum the free energy contributions */ -/* Compute the average C6 and C12 params for LJ corrections */ -void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, - const gmx_mtop_t *mtop); - void do_force(FILE *log, const t_commrec *cr, const gmx_multisim_t *ms, const t_inputrec *inputrec, gmx_int64_t step, t_nrnb *nrnb, - gmx_wallcycle_t wcycle, + gmx_wallcycle *wcycle, // TODO top can be const when the group scheme no longer // builds exclusions during neighbor searching within // do_force_cutsGROUP. @@ -223,7 +143,7 @@ void do_force_lowlevel(t_forcerec *fr, const t_commrec *cr, const gmx_multisim_t *ms, t_nrnb *nrnb, - gmx_wallcycle_t wcycle, + gmx_wallcycle *wcycle, const t_mdatoms *md, rvec x[], history_t *hist, @@ -241,7 +161,4 @@ void do_force_lowlevel(t_forcerec *fr, float *cycles_pme); /* Call all the force routines */ -void free_gpu_resources(const t_forcerec *fr, - const gmx::PhysicalNodeCommunicator &physicalNodeCommunicator); - #endif diff --git a/src/gromacs/mdlib/forcerec.cpp b/src/gromacs/mdlib/forcerec.cpp index e6a4c8e73a..569ff867f7 100644 --- a/src/gromacs/mdlib/forcerec.cpp +++ b/src/gromacs/mdlib/forcerec.cpp @@ -79,7 +79,9 @@ #include "gromacs/mdlib/nbnxn_util.h" #include "gromacs/mdlib/ns.h" #include "gromacs/mdlib/qmmm.h" +#include "gromacs/mdlib/rf_util.h" #include "gromacs/mdlib/sim_util.h" +#include "gromacs/mdlib/wall.h" #include "gromacs/mdtypes/commrec.h" #include "gromacs/mdtypes/fcdata.h" #include "gromacs/mdtypes/group.h" diff --git a/src/gromacs/mdlib/forcerec.h b/src/gromacs/mdlib/forcerec.h index c9b9308d5c..4d36ba7395 100644 --- a/src/gromacs/mdlib/forcerec.h +++ b/src/gromacs/mdlib/forcerec.h @@ -54,6 +54,7 @@ struct t_inputrec; namespace gmx { class MDLogger; +class PhysicalNodeCommunicator; } /*! \brief Create a new forcerec structure */ @@ -150,4 +151,32 @@ void forcerec_set_excl_load(t_forcerec *fr, */ void update_forcerec(t_forcerec *fr, matrix box); +gmx_bool uses_simple_tables(int cutoff_scheme, + nonbonded_verlet_t *nbv, + int group); +/* Returns whether simple tables (i.e. not for use with GPUs) are used + * with the type of kernel indicated. + */ + +gmx_bool can_use_allvsall(const t_inputrec *ir, + gmx_bool bPrintNote, const t_commrec *cr, FILE *fp); +/* Returns if we can use all-vs-all loops. + * If bPrintNote==TRUE, prints a note, if necessary, to stderr + * and fp (if !=NULL) on the master node. + */ + +gmx_bool nbnxn_simd_supported(const gmx::MDLogger &mdlog, + const t_inputrec *ir); +/* Return if CPU SIMD support exists for the given inputrec + * If the return value is FALSE and fplog/cr != NULL, prints a fallback + * message to fplog/stderr. + */ + +/* Compute the average C6 and C12 params for LJ corrections */ +void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, + const gmx_mtop_t *mtop); + +void free_gpu_resources(const t_forcerec *fr, + const gmx::PhysicalNodeCommunicator &physicalNodeCommunicator); + #endif diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.cpp b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.cpp index 9ccd46a4eb..5e1973482d 100644 --- a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.cpp +++ b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.cpp @@ -45,7 +45,7 @@ #include "gromacs/math/functions.h" #include "gromacs/math/utilities.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" +#include "gromacs/mdlib/force_flags.h" #include "gromacs/mdlib/nb_verlet.h" #include "gromacs/mdlib/nbnxn_consts.h" #include "gromacs/mdtypes/md_enums.h" diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.cpp b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.cpp index cc13cbc67a..66584a2300 100644 --- a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.cpp +++ b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,10 +46,10 @@ #include "gromacs/math/functions.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/gmx_omp_nthreads.h" #include "gromacs/mdlib/nb_verlet.h" #include "gromacs/mdlib/nbnxn_consts.h" +#include "gromacs/mdtypes/interaction_const.h" #include "gromacs/mdtypes/md_enums.h" #include "gromacs/pbcutil/ishift.h" #include "gromacs/utility/fatalerror.h" diff --git a/src/gromacs/mdlib/ns.cpp b/src/gromacs/mdlib/ns.cpp index ad8f04fec2..fd9c8b99b9 100644 --- a/src/gromacs/mdlib/ns.cpp +++ b/src/gromacs/mdlib/ns.cpp @@ -54,7 +54,6 @@ #include "gromacs/math/utilities.h" #include "gromacs/math/vec.h" #include "gromacs/math/vecdump.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/nsgrid.h" #include "gromacs/mdlib/qmmm.h" #include "gromacs/mdtypes/commrec.h" diff --git a/src/gromacs/mdlib/qm_gamess.cpp b/src/gromacs/mdlib/qm_gamess.cpp index 4ceb4646ca..a2b069dc6a 100644 --- a/src/gromacs/mdlib/qm_gamess.cpp +++ b/src/gromacs/mdlib/qm_gamess.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -51,7 +51,6 @@ #include "gromacs/gmxlib/nrnb.h" #include "gromacs/math/units.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/ns.h" #include "gromacs/mdlib/qmmm.h" #include "gromacs/mdtypes/commrec.h" diff --git a/src/gromacs/mdlib/qm_mopac.cpp b/src/gromacs/mdlib/qm_mopac.cpp index 204332af4b..ed585cdaaa 100644 --- a/src/gromacs/mdlib/qm_mopac.cpp +++ b/src/gromacs/mdlib/qm_mopac.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -51,7 +51,6 @@ #include "gromacs/gmxlib/nrnb.h" #include "gromacs/math/units.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/ns.h" #include "gromacs/mdlib/qmmm.h" #include "gromacs/mdtypes/md_enums.h" diff --git a/src/gromacs/mdlib/qm_orca.cpp b/src/gromacs/mdlib/qm_orca.cpp index 1f23624de8..287c97b64a 100644 --- a/src/gromacs/mdlib/qm_orca.cpp +++ b/src/gromacs/mdlib/qm_orca.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2008, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -49,9 +49,9 @@ #include "gromacs/gmxlib/nrnb.h" #include "gromacs/math/units.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/ns.h" #include "gromacs/mdlib/qmmm.h" +#include "gromacs/mdtypes/forcerec.h" #include "gromacs/mdtypes/md_enums.h" #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" diff --git a/src/gromacs/mdlib/qmmm.cpp b/src/gromacs/mdlib/qmmm.cpp index 062c1ebf02..1cf2fc63a0 100644 --- a/src/gromacs/mdlib/qmmm.cpp +++ b/src/gromacs/mdlib/qmmm.cpp @@ -55,9 +55,9 @@ #include "gromacs/math/functions.h" #include "gromacs/math/units.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/ns.h" #include "gromacs/mdtypes/commrec.h" +#include "gromacs/mdtypes/forcerec.h" #include "gromacs/mdtypes/inputrec.h" #include "gromacs/mdtypes/md_enums.h" #include "gromacs/mdtypes/mdatom.h" diff --git a/src/gromacs/mdlib/rf_util.cpp b/src/gromacs/mdlib/rf_util.cpp index dd99949e6b..705a6bcbb5 100644 --- a/src/gromacs/mdlib/rf_util.cpp +++ b/src/gromacs/mdlib/rf_util.cpp @@ -36,12 +36,14 @@ */ #include "gmxpre.h" +#include "rf_util.h" + #include #include "gromacs/math/functions.h" #include "gromacs/math/units.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" +#include "gromacs/mdtypes/forcerec.h" #include "gromacs/mdtypes/inputrec.h" #include "gromacs/mdtypes/md_enums.h" #include "gromacs/mdtypes/mdatom.h" diff --git a/src/gromacs/mdlib/rf_util.h b/src/gromacs/mdlib/rf_util.h new file mode 100644 index 0000000000..336163a1c2 --- /dev/null +++ b/src/gromacs/mdlib/rf_util.h @@ -0,0 +1,79 @@ +/* + * This file is part of the GROMACS molecular simulation package. + * + * Copyright (c) 2018, by the GROMACS development team, led by + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, + * and including many others, as listed in the AUTHORS file in the + * top-level source directory and at http://www.gromacs.org. + * + * GROMACS is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * GROMACS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GROMACS; if not, see + * http://www.gnu.org/licenses, or write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * If you want to redistribute modifications to GROMACS, please + * consider that scientific software is very special. Version + * control is crucial - bugs must be traceable. We will be happy to + * consider code for inclusion in the official distribution, but + * derived work must not be called official GROMACS. Details are found + * in the README & COPYING files - if they are missing, get the + * official version at http://www.gromacs.org. + * + * To help us fund GROMACS development, we humbly ask that you cite + * the research papers on the package. Check out http://www.gromacs.org. + */ +#ifndef GMX_MDLIB_RF_UTIL_H +#define GMX_MDLIB_RF_UTIL_H + +#include + +#include "gromacs/math/vectypes.h" +#include "gromacs/utility/real.h" + +struct gmx_mtop_t; +struct t_blocka; +struct t_forcerec; +struct t_graph; +struct t_inputrec; +struct t_mdatoms; +struct t_pbc; + +real RF_excl_correction(const t_forcerec *fr, + const t_graph *g, + const t_mdatoms *mdatoms, + const t_blocka *excl, + bool usingDomainDecomposition, + rvec x[], + rvec f[], + rvec *fshift, + const t_pbc *pbc, + real lambda, + real *dvdlambda); +/* Calculate the reaction-field energy correction for this node: + * epsfac q_i q_j (k_rf r_ij^2 - c_rf) + * and force correction for all excluded pairs, including self pairs. + */ + +void calc_rffac(FILE *fplog, int eel, real eps_r, real eps_rf, + real Rc, real Temp, + real zsq, matrix box, + real *krf, real *crf); +/* Determine the reaction-field constants */ + +void init_generalized_rf(FILE *fplog, + const gmx_mtop_t *mtop, const t_inputrec *ir, + t_forcerec *fr); +/* Initialize the generalized reaction field parameters */ + + +#endif diff --git a/src/gromacs/mdlib/shellfc.cpp b/src/gromacs/mdlib/shellfc.cpp index 58f6f50bf9..3958321029 100644 --- a/src/gromacs/mdlib/shellfc.cpp +++ b/src/gromacs/mdlib/shellfc.cpp @@ -57,6 +57,7 @@ #include "gromacs/math/vecdump.h" #include "gromacs/mdlib/constr.h" #include "gromacs/mdlib/force.h" +#include "gromacs/mdlib/force_flags.h" #include "gromacs/mdlib/mdrun.h" #include "gromacs/mdlib/sim_util.h" #include "gromacs/mdlib/vsite.h" diff --git a/src/gromacs/mdlib/sim_util.cpp b/src/gromacs/mdlib/sim_util.cpp index e3cff86584..a6e94301e1 100644 --- a/src/gromacs/mdlib/sim_util.cpp +++ b/src/gromacs/mdlib/sim_util.cpp @@ -70,6 +70,7 @@ #include "gromacs/math/vec.h" #include "gromacs/math/vecdump.h" #include "gromacs/mdlib/calcmu.h" +#include "gromacs/mdlib/calcvir.h" #include "gromacs/mdlib/constr.h" #include "gromacs/mdlib/force.h" #include "gromacs/mdlib/forcerec.h" diff --git a/src/gromacs/mdlib/stat.cpp b/src/gromacs/mdlib/stat.cpp index f1e7bd7f20..8f2941f74f 100644 --- a/src/gromacs/mdlib/stat.cpp +++ b/src/gromacs/mdlib/stat.cpp @@ -47,7 +47,6 @@ #include "gromacs/math/utilities.h" #include "gromacs/math/vec.h" #include "gromacs/mdlib/constr.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/md_support.h" #include "gromacs/mdlib/mdrun.h" #include "gromacs/mdlib/rbin.h" diff --git a/src/gromacs/mdlib/update.cpp b/src/gromacs/mdlib/update.cpp index 5313e8fd57..0cb0063dca 100644 --- a/src/gromacs/mdlib/update.cpp +++ b/src/gromacs/mdlib/update.cpp @@ -57,7 +57,6 @@ #include "gromacs/math/vec.h" #include "gromacs/math/vecdump.h" #include "gromacs/mdlib/constr.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/gmx_omp_nthreads.h" #include "gromacs/mdlib/mdrun.h" #include "gromacs/mdlib/sim_util.h" diff --git a/src/gromacs/mdlib/wall.cpp b/src/gromacs/mdlib/wall.cpp index 4be749be23..c99a879175 100644 --- a/src/gromacs/mdlib/wall.cpp +++ b/src/gromacs/mdlib/wall.cpp @@ -37,6 +37,8 @@ #include "gmxpre.h" +#include "wall.h" + #include #include @@ -45,7 +47,6 @@ #include "gromacs/gmxlib/nrnb.h" #include "gromacs/math/utilities.h" #include "gromacs/math/vec.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdtypes/inputrec.h" #include "gromacs/mdtypes/md_enums.h" #include "gromacs/mdtypes/mdatom.h" diff --git a/src/gromacs/mdlib/wall.h b/src/gromacs/mdlib/wall.h new file mode 100644 index 0000000000..2120d64921 --- /dev/null +++ b/src/gromacs/mdlib/wall.h @@ -0,0 +1,64 @@ +/* + * This file is part of the GROMACS molecular simulation package. + * + * Copyright (c) 2018, by the GROMACS development team, led by + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, + * and including many others, as listed in the AUTHORS file in the + * top-level source directory and at http://www.gromacs.org. + * + * GROMACS is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * GROMACS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GROMACS; if not, see + * http://www.gnu.org/licenses, or write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * If you want to redistribute modifications to GROMACS, please + * consider that scientific software is very special. Version + * control is crucial - bugs must be traceable. We will be happy to + * consider code for inclusion in the official distribution, but + * derived work must not be called official GROMACS. Details are found + * in the README & COPYING files - if they are missing, get the + * official version at http://www.gromacs.org. + * + * To help us fund GROMACS development, we humbly ask that you cite + * the research papers on the package. Check out http://www.gromacs.org. + */ +#ifndef GMX_MDLIB_WALLS_H +#define GMX_MDLIB_WALLS_H + +#include + +#include "gromacs/math/vectypes.h" + +struct gmx_groups_t; +struct t_forcerec; +struct t_idef; +struct t_inputrec; +struct t_mdatoms; +struct t_nrnb; + +void make_wall_tables(FILE *fplog, + const t_inputrec *ir, const char *tabfn, + const gmx_groups_t *groups, + t_forcerec *fr); + +real do_walls(const t_inputrec *ir, + t_forcerec *fr, + matrix box, + const t_mdatoms *md, + const rvec x[], + rvec f[], + real lambda, + real Vlj[], + t_nrnb *nrnb); + +#endif diff --git a/src/gromacs/mdlib/wnblist.cpp b/src/gromacs/mdlib/wnblist.cpp index 37c1ae4af5..2ef86fbc16 100644 --- a/src/gromacs/mdlib/wnblist.cpp +++ b/src/gromacs/mdlib/wnblist.cpp @@ -46,9 +46,9 @@ #include "gromacs/domdec/domdec_struct.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/gmxlib/nrnb.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/ns.h" #include "gromacs/mdtypes/commrec.h" +#include "gromacs/mdtypes/forcerec.h" #include "gromacs/mdtypes/md_enums.h" #include "gromacs/mdtypes/nblist.h" #include "gromacs/utility/fatalerror.h" diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 96a179990e..b08c74bc1e 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -76,7 +76,6 @@ #include "gromacs/mdlib/calc_verletbuf.h" #include "gromacs/mdlib/constr.h" #include "gromacs/mdlib/deform.h" -#include "gromacs/mdlib/force.h" #include "gromacs/mdlib/forcerec.h" #include "gromacs/mdlib/gmx_omp_nthreads.h" #include "gromacs/mdlib/main.h" @@ -95,6 +94,7 @@ #include "gromacs/mdrunutility/mdmodules.h" #include "gromacs/mdrunutility/threadaffinity.h" #include "gromacs/mdtypes/commrec.h" +#include "gromacs/mdtypes/fcdata.h" #include "gromacs/mdtypes/inputrec.h" #include "gromacs/mdtypes/md_enums.h" #include "gromacs/mdtypes/observableshistory.h" diff --git a/src/gromacs/mdrun/tpi.cpp b/src/gromacs/mdrun/tpi.cpp index dd4fd7d329..5c8e3aff07 100644 --- a/src/gromacs/mdrun/tpi.cpp +++ b/src/gromacs/mdrun/tpi.cpp @@ -64,6 +64,7 @@ #include "gromacs/math/vec.h" #include "gromacs/mdlib/constr.h" #include "gromacs/mdlib/force.h" +#include "gromacs/mdlib/force_flags.h" #include "gromacs/mdlib/mdatoms.h" #include "gromacs/mdlib/mdebin.h" #include "gromacs/mdlib/mdrun.h" -- 2.11.4.GIT