Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / hackblock.h
index cfc1e57cb9c7985f11b47ea1e49df30345ff8b16..9fa36722eb21fde3dbcf4c3b0f8c14400cbf009e 100644 (file)
@@ -57,13 +57,20 @@ struct t_symtab;
  * ebtsBONDS must be the first, new types can be added to the end
  * these *MUST* correspond to the arrays in hackblock.cpp
  */
-enum {
-    ebtsBONDS, ebtsANGLES, ebtsPDIHS, ebtsIDIHS, ebtsEXCLS, ebtsCMAP, ebtsNR
+enum
+{
+    ebtsBONDS,
+    ebtsANGLES,
+    ebtsPDIHS,
+    ebtsIDIHS,
+    ebtsEXCLS,
+    ebtsCMAP,
+    ebtsNR
 };
 //! Names for interaction type entries
-extern const char *btsNames[ebtsNR];
+extern const charbtsNames[ebtsNR];
 //! Numbers for atoms in the interactions.
-extern const int   btsNiatoms[ebtsNR];
+extern const int btsNiatoms[ebtsNR];
 
 /* if changing any of these structs, make sure that all of the
    free/clear/copy/merge_t_* functions stay updated */
@@ -80,19 +87,19 @@ struct BondedInteraction
      * .rtp/.tdb to .top and will be parsed by cpp
      * during grompp.
      */
-    std::string        s;
+    std::string s;
     //! Has the entry been found?
-    bool               match = false;
+    bool match = false;
     //! Get name of first atom in bonded interaction.
-    const std::string &ai() const { return a[0]; }
+    const std::stringai() const { return a[0]; }
     //! Get name of second atom in bonded interaction..
-    const std::string &aj() const { return a[1]; }
+    const std::stringaj() const { return a[1]; }
     //! Get name of third atom in bonded interaction.
-    const std::string &ak() const { return a[2]; }
+    const std::stringak() const { return a[2]; }
     //! Get name of fourth atom in bonded interaction.
-    const std::string &al() const { return a[3]; }
+    const std::stringal() const { return a[3]; }
     //! Get name of fifth atom in bonded interaction.
-    const std::string &am() const { return a[4]; }
+    const std::stringam() const { return a[4]; }
 };
 
 /*! \libinternal \brief
@@ -102,7 +109,7 @@ struct BondedInteraction
 struct BondedInteractionList
 {
     //! The type of bonded interaction.
-    int                            type = -1;
+    int type = -1;
     //! The actual bonded interactions.
     std::vector<BondedInteraction> b;
 };
@@ -113,27 +120,27 @@ struct BondedInteractionList
 struct PreprocessResidue
 {
     //! Name of the residue.
-    std::string                               resname;
+    std::string resname;
     //! The base file name this rtp entry was read from.
-    std::string                               filebase;
+    std::string filebase;
     //! Atom data.
-    std::vector<t_atom>                       atom;
+    std::vector<t_atom> atom;
     //! Atom names.
-    std::vector<char **>                      atomname;
+    std::vector<char**> atomname;
     //! Charge group numbers.
-    std::vector<int>                          cgnr;
+    std::vector<int> cgnr;
     //! Delete autogenerated dihedrals or not.
-    bool                                      bKeepAllGeneratedDihedrals = false;
+    bool bKeepAllGeneratedDihedrals = false;
     //! Number of bonded exclusions.
-    int                                       nrexcl = -1;
+    int nrexcl = -1;
     //! If Hydrogen only 1-4 interactions should be generated.
-    bool                                      bGenerateHH14Interactions = false;
+    bool bGenerateHH14Interactions = false;
     //! Delete dihedrals also defined by impropers.
-    bool                                      bRemoveDihedralIfWithImproper = false;
+    bool bRemoveDihedralIfWithImproper = false;
     //! List of bonded interactions to potentially add.
     std::array<BondedInteractionList, ebtsNR> rb;
     //! Get number of atoms in residue.
-    int                                       natom() const { return atom.size(); }
+    int natom() const { return atom.size(); }
 };
 
 //! Declare different types of hacks for later check.
@@ -153,29 +160,29 @@ enum class MoleculePatchType
 struct MoleculePatch
 {
     //! Number of new are deleted atoms. NOT always equal to atom.size()!
-    int                        nr;
+    int nr;
     //! Old name for entry.
-    std::string                oname;
+    std::string oname;
     //! New name for entry.
-    std::string                nname;
+    std::string nname;
     //! New atom data.
-    std::vector<t_atom>        atom;
+    std::vector<t_atom> atom;
     //! Chargegroup number.
-    int                        cgnr = NOTSET;
+    int cgnr = NOTSET;
     //! Type of attachement.
-    int                        tp = 0;
+    int tp = 0;
     //! Number of control atoms.
-    int                        nctl = 0;
+    int nctl = 0;
     //! Name of control atoms.
     std::array<std::string, 4> a;
     //! Is an atom to be hacked already present?
-    bool                       bAlreadyPresent = false;
+    bool bAlreadyPresent = false;
     //! Are coordinates for a new atom already set?
-    bool                       bXSet = false;
+    bool bXSet = false;
     //! New position for hacked atom.
-    rvec                       newx = {NOTSET};
+    rvec newx = { NOTSET };
     //! New atom index number after additions.
-    int                        newi = -1;
+    int newi = -1;
 
     /*! \brief
      * Get type of hack.
@@ -189,13 +196,13 @@ struct MoleculePatch
     MoleculePatchType type() const;
 
     //! Control atom i name.
-    const std::string &ai() const { return a[0]; }
+    const std::stringai() const { return a[0]; }
     //! Control atom j name.
-    const std::string &aj() const { return a[1]; }
+    const std::stringaj() const { return a[1]; }
     //! Control atom k name.
-    const std::string &ak() const { return a[2]; }
+    const std::stringak() const { return a[2]; }
     //! Control atom l name.
-    const std::string &al() const { return a[3]; }
+    const std::stringal() const { return a[3]; }
 };
 /*! \libinternal \brief
  * A set of modifications to apply to atoms.
@@ -203,15 +210,15 @@ struct MoleculePatch
 struct MoleculePatchDatabase
 {
     //! Name of block
-    std::string                                              name;
+    std::string name;
     //! File that entry was read from.
-    std::string                                              filebase;
+    std::string filebase;
     //! List of changes to atoms.
-    std::vector<MoleculePatch>                               hack;
+    std::vector<MoleculePatch> hack;
     //! List of bonded interactions to potentially add.
-    std::array<BondedInteractionList, ebtsNR>                rb;
+    std::array<BondedInteractionList, ebtsNR> rb;
     //! Number of atoms to modify
-    int                                                      nhack() const { return hack.size(); }
+    int nhack() const { return hack.size(); }
 };
 
 /*!\brief
@@ -220,7 +227,7 @@ struct MoleculePatchDatabase
  * \param[inout] globalPatches Block to reset.
  * \todo Remove once constructor/destructor takes care of all of this.
  */
-void clearModificationBlock(MoleculePatchDatabase *globalPatches);
+void clearModificationBlock(MoleculePatchDatabaseglobalPatches);
 
 /*!\brief
  * Copy residue information.
@@ -230,7 +237,7 @@ void clearModificationBlock(MoleculePatchDatabase *globalPatches);
  * \param[inout] symtab Symbol table for names.
  * \todo Remove once copy can be done directly.
  */
-void copyPreprocessResidues(const PreprocessResidue &s, PreprocessResidue *d, t_symtab *symtab);
+void copyPreprocessResidues(const PreprocessResidue& s, PreprocessResidue* d, t_symtab* symtab);
 
 /*! \brief
  * Add bond information in \p s to \p d.
@@ -242,8 +249,9 @@ void copyPreprocessResidues(const PreprocessResidue &s, PreprocessResidue *d, t_
  * \returns if bonds were removed at the termini.
  */
 bool mergeBondedInteractionList(gmx::ArrayRef<const BondedInteractionList> s,
-                                gmx::ArrayRef<BondedInteractionList> d,
-                                bool bMin, bool bPlus);
+                                gmx::ArrayRef<BondedInteractionList>       d,
+                                bool                                       bMin,
+                                bool                                       bPlus);
 
 /*! \brief
  * Copy all information from datastructure.
@@ -251,7 +259,7 @@ bool mergeBondedInteractionList(gmx::ArrayRef<const BondedInteractionList> s,
  * \param[in] s Source information.
  * \param[inout] d Destination to copy to.
  */
-void copyModificationBlocks(const MoleculePatchDatabase &s, MoleculePatchDatabase *d);
+void copyModificationBlocks(const MoleculePatchDatabase& s, MoleculePatchDatabase* d);
 
 /*!\brief
  * Add the individual modifications in \p s to \p d.
@@ -259,9 +267,9 @@ void copyModificationBlocks(const MoleculePatchDatabase &s, MoleculePatchDatabas
  * \param[in] s Source information.
  * \param[inout] d Destination to copy to.
  */
-void mergeAtomModifications(const MoleculePatchDatabase &s, MoleculePatchDatabase *d);
+void mergeAtomModifications(const MoleculePatchDatabase& s, MoleculePatchDatabase* d);
 
 //! \copydoc mergeAtomModifications
-void mergeAtomAndBondModifications(const MoleculePatchDatabase &s, MoleculePatchDatabase *d);
+void mergeAtomAndBondModifications(const MoleculePatchDatabase& s, MoleculePatchDatabase* d);
 
 #endif