diff --git a/src/USER-COLVARS/colvarproxy_lammps.cpp b/src/USER-COLVARS/colvarproxy_lammps.cpp index 685c698ab6..2c43a3fb26 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.cpp +++ b/src/USER-COLVARS/colvarproxy_lammps.cpp @@ -10,30 +10,19 @@ #include "colvarproxy_lammps.h" #include -#include #include -#include - #include -#include #include - #include -#include +#include #include #include "lammps.h" -#include "atom.h" #include "error.h" #include "output.h" #include "random_park.h" -#include "fix_colvars.h" - #include "colvarmodule.h" -#include "colvar.h" -#include "colvarbias.h" -#include "colvaratoms.h" #include "colvarproxy.h" #define HASH_FAIL -1 diff --git a/src/USER-COLVARS/colvarproxy_lammps.h b/src/USER-COLVARS/colvarproxy_lammps.h index 3243a14fbd..8ed03309a3 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.h +++ b/src/USER-COLVARS/colvarproxy_lammps.h @@ -10,39 +10,22 @@ #ifndef COLVARPROXY_LAMMPS_H #define COLVARPROXY_LAMMPS_H -#include "colvarproxy_lammps_version.h" +#include "colvarproxy_lammps_version.h" // IWYU pragma: export + +#include +#include +#include +#include #include "colvarmodule.h" #include "colvarproxy.h" -#include "colvarvalue.h" +#include "colvartypes.h" -#include "lammps.h" -#include "domain.h" -#include "force.h" -#include "update.h" - -#include -#include -#include - -/* struct for packed data communication of coordinates and forces. */ -struct commdata { - int tag,type; - double x,y,z,m,q; -}; - -inline std::ostream & operator<< (std::ostream &out, const commdata &cd) -{ - out << " (" << cd.tag << "/" << cd.type << ": " - << cd.x << ", " << cd.y << ", " << cd.z << ") "; - return out; -} - -// forward declarations -namespace LAMMPS_NS { - class LAMMPS; - class RanPark; -} +#include "random_park.h" +#include "lammps.h" // IWYU pragma: keep +#include "domain.h" // IWYU pragma: keep +#include "force.h" // IWYU pragma: keep +#include "update.h" // IWYU pragma: keep /// \brief Communication between colvars and LAMMPS /// (implementation of \link colvarproxy \endlink) diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index 9331fe7abb..4a57e59fbd 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -25,26 +25,28 @@ ------------------------------------------------------------------------- */ #include "fix_colvars.h" -#include -#include +#include #include #include -#include +#include +#include +#include +#include #include "atom.h" #include "comm.h" #include "domain.h" #include "error.h" -#include "group.h" +#include "force.h" #include "memory.h" #include "modify.h" -#include "random_park.h" #include "respa.h" #include "universe.h" #include "update.h" #include "citeme.h" #include "colvarproxy_lammps.h" +#include "colvarmodule.h" static const char colvars_pub[] = "fix colvars command:\n\n" @@ -57,6 +59,19 @@ static const char colvars_pub[] = " note = {doi: 10.1080/00268976.2013.813594}\n" "}\n\n"; +/* struct for packed data communication of coordinates and forces. */ +struct LAMMPS_NS::commdata { + int tag,type; + double x,y,z,m,q; +}; + +inline std::ostream & operator<< (std::ostream &out, const LAMMPS_NS::commdata &cd) +{ + out << " (" << cd.tag << "/" << cd.type << ": " + << cd.x << ", " << cd.y << ", " << cd.z << ") "; + return out; +} + /* re-usable integer hash table code with static linkage. */ /** hash table top level data structure */ diff --git a/src/USER-COLVARS/fix_colvars.h b/src/USER-COLVARS/fix_colvars.h index a0c197fca4..985457e746 100644 --- a/src/USER-COLVARS/fix_colvars.h +++ b/src/USER-COLVARS/fix_colvars.h @@ -34,10 +34,9 @@ FixStyle(colvars,FixColvars) #define LMP_FIX_COLVARS_H #include "fix.h" +#include -// forward declaration class colvarproxy_lammps; -struct commdata; namespace LAMMPS_NS { @@ -64,7 +63,7 @@ class FixColvars : public Fix { virtual void restart(char *); protected: - class colvarproxy_lammps *proxy; // pointer to the colvars proxy class + colvarproxy_lammps *proxy; // pointer to the colvars proxy class char *conf_file; // name of colvars config file char *inp_name; // name/prefix of colvars restart file char *out_name; // prefix string for all output files diff --git a/src/USER-COLVARS/group_ndx.cpp b/src/USER-COLVARS/group_ndx.cpp index 7350712c40..1e37e2de9c 100644 --- a/src/USER-COLVARS/group_ndx.cpp +++ b/src/USER-COLVARS/group_ndx.cpp @@ -17,12 +17,11 @@ ------------------------------------------------------------------------- */ #include "group_ndx.h" -#include +#include #include #include "atom.h" #include "comm.h" #include "group.h" -#include "memory.h" #include "error.h" using namespace LAMMPS_NS; diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index 5436ba7b6b..a1369df2fb 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -17,14 +17,12 @@ ------------------------------------------------------------------------- */ #include "ndx_group.h" -#include +#include #include #include #include "atom.h" #include "comm.h" #include "group.h" -#include "memory.h" -#include "force.h" #include "error.h" using namespace LAMMPS_NS;