From d052aa0a7d35ff6b09f30aca0270d54206241607 Mon Sep 17 00:00:00 2001
From: Gareth Tribello <gareth.tribello@gmail.com>
Date: Sun, 28 Jul 2019 16:11:24 +0200
Subject: [PATCH] Made it so that example checking script can now deal with
 MOLINFO commands

---
 developer-doc/usingDoxygen.md                 | 20 +++++++++++++++++-
 src/colvar/EEFSolv.cpp                        |  1 +
 src/colvar/ERMSD.cpp                          |  1 +
 src/colvar/Puckering.cpp                      |  1 +
 src/colvar/Torsion.cpp                        |  1 +
 src/generic/DumpAtoms.cpp                     |  1 +
 src/generic/WholeMolecules.cpp                |  1 +
 src/isdb/Jcoupling.cpp                        |  2 +-
 src/multicolvar/AlphaBeta.cpp                 |  1 +
 src/multicolvar/DihedralCorrelation.cpp       |  1 +
 src/multicolvar/Torsions.cpp                  |  1 +
 src/pamm/PAMM.cpp                             |  1 +
 src/secondarystructure/AlphaRMSD.cpp          |  2 ++
 src/secondarystructure/AntibetaRMSD.cpp       |  2 ++
 src/secondarystructure/ParabetaRMSD.cpp       |  2 ++
 src/setup/MolInfo.cpp                         |  3 +++
 user-doc/Miscelaneous.md                      |  2 ++
 user-doc/go-example-check                     | 21 +++++++------------
 user-doc/tutorials/a-trieste-3.txt            |  4 ++++
 user-doc/tutorials/a-trieste-6.txt            |  1 +
 user-doc/tutorials/aa-lugano-2.txt            |  7 ++++++-
 user-doc/tutorials/aa-lugano-6d.txt           |  1 +
 user-doc/tutorials/marvel-1.txt               |  4 ++++
 user-doc/tutorials/munster.txt                |  1 +
 .../tutorials/performance-optimization.txt    |  5 +++++
 25 files changed, 71 insertions(+), 16 deletions(-)

diff --git a/developer-doc/usingDoxygen.md b/developer-doc/usingDoxygen.md
index e0dda8b7d..ea4dd5352 100644
--- a/developer-doc/usingDoxygen.md
+++ b/developer-doc/usingDoxygen.md
@@ -478,7 +478,25 @@ checks the input will complain.
 
 \subsection molfileeg Using MOLFILE in your example input files
 
-To be written
+If you use have used a \ref MOLINFO command in the example input that you specified as has been done here:
+
+<pre class="fragment">
+<a href="./_m_o_l_i_n_f_o.html" style="color:green">MOLINFO</a> STRUCTURE=helix.pdb
+<a href="./_w_h_o_l_e_m_o_l_e_c_u_l_e_s.html" style="color:green">WHOLEMOLECULES</a> ENTITY0=1-100
+alpha: <a href="./_a_l_p_h_a_r_m_s_d.html" style="color:green">ALPHARMSD</a> RESIDUES=all TYPE=OPTIMAL R_0=0.1
+</pre> 
+
+Then you must provide information on the location from whence PLUMED can the reference input so that the example checking script can copy the input
+for the MOLINFO.   The above input would thus be included in the manual as shown below:
+
+\verbatim
+\plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
+MOLINFO STRUCTURE=helix.pdb
+WHOLEMOLECULES ENTITY0=1-100
+alpha: ALPHARMSD RESIDUES=all TYPE=OPTIMAL R_0=0.1
+\ endplumedfile    /*** But with no space between the \ and the endplumedfile
+\endverbatim
 
 \section tutorials Writing how-to instructions
 
diff --git a/src/colvar/EEFSolv.cpp b/src/colvar/EEFSolv.cpp
index c5fd6dbc7..58d2ca69a 100644
--- a/src/colvar/EEFSolv.cpp
+++ b/src/colvar/EEFSolv.cpp
@@ -59,6 +59,7 @@ The output from this collective variable, the free energy of solvation, can be u
 \par Examples
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO MOLTYPE=protein STRUCTURE=peptide.pdb
 WHOLEMOLECULES ENTITY0=1-111
 
diff --git a/src/colvar/ERMSD.cpp b/src/colvar/ERMSD.cpp
index 42f03a402..ad0e175d6 100644
--- a/src/colvar/ERMSD.cpp
+++ b/src/colvar/ERMSD.cpp
@@ -94,6 +94,7 @@ Calculate the eRMSD from reference structure reference.pdb using the default cut
 considering residues 1,2,3,4,5,6.
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt-ermsd/ref.pdb 
 MOLINFO STRUCTURE=reference.pdb
 eRMSD1: ERMSD REFERENCE=reference.pdb ATOMS=@lcs-1,@lcs-2,@lcs-3,@lcs-4,@lcs-5,@lcs-6
 \endplumedfile
diff --git a/src/colvar/Puckering.cpp b/src/colvar/Puckering.cpp
index 62b315835..a68bd2525 100644
--- a/src/colvar/Puckering.cpp
+++ b/src/colvar/Puckering.cpp
@@ -65,6 +65,7 @@ namespace colvar {
 
  This input tells plumed to print the puckering phase angle of the 3rd nucleotide of a RNA molecule on file COLVAR.
  \plumedfile
+ #SETTINGS MOLFILE=regtest/basic/rt65/AA.pdb
  MOLINFO STRUCTURE=rna.pdb MOLTYPE=rna
  PUCKERING ATOMS=@sugar-3 LABEL=puck
  PRINT ARG=puck.phs FILE=COLVAR
diff --git a/src/colvar/Torsion.cpp b/src/colvar/Torsion.cpp
index 9c0c0ddbe..7d0954e43 100644
--- a/src/colvar/Torsion.cpp
+++ b/src/colvar/Torsion.cpp
@@ -55,6 +55,7 @@ by using TORSION in combination with the \ref MOLINFO command.  This can be done
 syntax.
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO MOLTYPE=protein STRUCTURE=myprotein.pdb
 t1: TORSION ATOMS=@phi-3
 t2: TORSION ATOMS=@psi-4
diff --git a/src/generic/DumpAtoms.cpp b/src/generic/DumpAtoms.cpp
index 0a08259ca..6bad49b33 100644
--- a/src/generic/DumpAtoms.cpp
+++ b/src/generic/DumpAtoms.cpp
@@ -88,6 +88,7 @@ action. However, this latter choice will affect all your input and output.
 The following input is very similar but dumps a .gro (gromacs) file,
 which also contains atom and residue names.
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 # this is required to have proper atom names:
 MOLINFO STRUCTURE=reference.pdb
 # if omitted, atoms will have "X" name...
diff --git a/src/generic/WholeMolecules.cpp b/src/generic/WholeMolecules.cpp
index 1ead3d791..33843bd73 100644
--- a/src/generic/WholeMolecules.cpp
+++ b/src/generic/WholeMolecules.cpp
@@ -91,6 +91,7 @@ This command instructs plumed to reconstruct the chain of backbone atoms in a
 protein
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=helix.pdb
 WHOLEMOLECULES RESIDUES=all MOLTYPE=protein
 \endplumedfile
diff --git a/src/isdb/Jcoupling.cpp b/src/isdb/Jcoupling.cpp
index 46a02f155..48e3f8d98 100644
--- a/src/isdb/Jcoupling.cpp
+++ b/src/isdb/Jcoupling.cpp
@@ -64,7 +64,7 @@ dihedral \f$\psi\f$ angles in the peptide backbone. We also add the experimental
 the correlation and other measures and finally print the results.
 
 \plumedfile
-
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO MOLTYPE=protein STRUCTURE=peptide.pdb
 WHOLEMOLECULES ENTITY0=1-111
 
diff --git a/src/multicolvar/AlphaBeta.cpp b/src/multicolvar/AlphaBeta.cpp
index 75006b4f8..c8056eebf 100644
--- a/src/multicolvar/AlphaBeta.cpp
+++ b/src/multicolvar/AlphaBeta.cpp
@@ -76,6 +76,7 @@ can avoid this by using the \ref MOLINFO command.  PLUMED uses the pdb file that
 about the topology of the protein molecule.  This means that you can specify torsion angles using the following syntax:
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO MOLTYPE=protein STRUCTURE=myprotein.pdb
 ALPHABETA ...
 ATOMS1=@phi-3 REFERENCE=3.14
diff --git a/src/multicolvar/DihedralCorrelation.cpp b/src/multicolvar/DihedralCorrelation.cpp
index 4460d2491..e4d48273b 100644
--- a/src/multicolvar/DihedralCorrelation.cpp
+++ b/src/multicolvar/DihedralCorrelation.cpp
@@ -66,6 +66,7 @@ can avoid this by using the \ref MOLINFO command.  PLUMED uses the pdb file that
 about the topology of the protein molecule.  This means that you can specify torsion angles using the following syntax:
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO MOLTYPE=protein STRUCTURE=myprotein.pdb
 dih: DIHCOR ...
 ATOMS1=@phi-3,@psi-3
diff --git a/src/multicolvar/Torsions.cpp b/src/multicolvar/Torsions.cpp
index 13889c1a1..14f377543 100644
--- a/src/multicolvar/Torsions.cpp
+++ b/src/multicolvar/Torsions.cpp
@@ -56,6 +56,7 @@ can avoid this by using the \ref MOLINFO command.  PLUMED uses the pdb file that
 about the topology of the protein molecule.  This means that you can specify torsion angles using the following syntax:
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO MOLTYPE=protein STRUCTURE=myprotein.pdb
 TORSIONS ...
 ATOMS1=@phi-3
diff --git a/src/pamm/PAMM.cpp b/src/pamm/PAMM.cpp
index 7e847bc5f..259f5d543 100644
--- a/src/pamm/PAMM.cpp
+++ b/src/pamm/PAMM.cpp
@@ -60,6 +60,7 @@ looking through the example given below.
 In this example I will explain in detail what the following input is computing:
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO MOLTYPE=protein STRUCTURE=M1d.pdb
 psi: TORSIONS ATOMS1=@psi-2 ATOMS2=@psi-3 ATOMS3=@psi-4
 phi: TORSIONS ATOMS1=@phi-2 ATOMS2=@phi-3 ATOMS3=@phi-4
diff --git a/src/secondarystructure/AlphaRMSD.cpp b/src/secondarystructure/AlphaRMSD.cpp
index af672a28d..b0c2e2b2b 100644
--- a/src/secondarystructure/AlphaRMSD.cpp
+++ b/src/secondarystructure/AlphaRMSD.cpp
@@ -68,6 +68,7 @@ The following input calculates the number of six residue segments of
 protein that are in an alpha helical configuration.
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=helix.pdb
 alpha: ALPHARMSD RESIDUES=all
 \endplumedfile
@@ -75,6 +76,7 @@ alpha: ALPHARMSD RESIDUES=all
 Here the same is done use RMSD instead of DRMSD
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=helix.pdb
 WHOLEMOLECULES ENTITY0=1-100
 alpha: ALPHARMSD RESIDUES=all TYPE=OPTIMAL R_0=0.1
diff --git a/src/secondarystructure/AntibetaRMSD.cpp b/src/secondarystructure/AntibetaRMSD.cpp
index 814ca6a98..0bd676124 100644
--- a/src/secondarystructure/AntibetaRMSD.cpp
+++ b/src/secondarystructure/AntibetaRMSD.cpp
@@ -70,6 +70,7 @@ The following input calculates the number of six residue segments of
 protein that are in an antiparallel beta sheet configuration.
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=beta.pdb
 ab: ANTIBETARMSD RESIDUES=all STRANDS_CUTOFF=1
 \endplumedfile
@@ -77,6 +78,7 @@ ab: ANTIBETARMSD RESIDUES=all STRANDS_CUTOFF=1
 Here the same is done use RMSD instead of DRMSD
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=helix.pdb
 WHOLEMOLECULES ENTITY0=1-100
 hh: ANTIBETARMSD RESIDUES=all TYPE=OPTIMAL R_0=0.1  STRANDS_CUTOFF=1
diff --git a/src/secondarystructure/ParabetaRMSD.cpp b/src/secondarystructure/ParabetaRMSD.cpp
index a781278e9..c93237eb7 100644
--- a/src/secondarystructure/ParabetaRMSD.cpp
+++ b/src/secondarystructure/ParabetaRMSD.cpp
@@ -70,6 +70,7 @@ The following input calculates the number of six residue segments of
 protein that are in an parallel beta sheet configuration.
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=beta.pdb
 pb: PARABETARMSD RESIDUES=all STRANDS_CUTOFF=1
 \endplumedfile
@@ -77,6 +78,7 @@ pb: PARABETARMSD RESIDUES=all STRANDS_CUTOFF=1
 Here the same is done use RMSD instead of DRMSD
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=helix.pdb
 WHOLEMOLECULES ENTITY0=1-100
 hh: PARABETARMSD RESIDUES=all TYPE=OPTIMAL R_0=0.1  STRANDS_CUTOFF=1
diff --git a/src/setup/MolInfo.cpp b/src/setup/MolInfo.cpp
index 1ad655d1e..8189a9d45 100644
--- a/src/setup/MolInfo.cpp
+++ b/src/setup/MolInfo.cpp
@@ -160,6 +160,7 @@ In the following example the MOLINFO command is used to provide the information
 are in the backbone of a protein to the ALPHARMSD CV.
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=reference.pdb
 ALPHARMSD RESIDUES=all TYPE=DRMSD LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12} LABEL=a
 \endplumedfile
@@ -168,6 +169,7 @@ The following example prints the distance corresponding to the hydrogen bonds
 in a GC Watson-Crick pair.
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt-ermsd/ref.pdb
 MOLINFO STRUCTURE=reference.pdb MOLTYPE=dna
 hb1: DISTANCE ATOMS=@N2-2,@O2-15
 hb2: DISTANCE ATOMS=@N1-2,@N3-15
@@ -178,6 +180,7 @@ PRINT ARG=hb1,hb2,hb3
 This example use MOLINFO to calculate torsion angles
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO MOLTYPE=protein STRUCTURE=myprotein.pdb
 t1: TORSION ATOMS=@phi-3
 t2: TORSION ATOMS=@psi-4
diff --git a/user-doc/Miscelaneous.md b/user-doc/Miscelaneous.md
index 01e9712f2..a743ae6a7 100644
--- a/user-doc/Miscelaneous.md
+++ b/user-doc/Miscelaneous.md
@@ -643,6 +643,7 @@ You might have noticed that from time to time constants are specified using stri
 An example is the following
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt65/AA.pdb
 MOLINFO STRUCTURE=AA.pdb  MOLTYPE=rna
 e1: TORSION ATOMS=@epsilon-1
 t: METAD ARG=e1 SIGMA=0.15 PACE=10 HEIGHT=2 GRID_MIN=-pi GRID_MAX=pi GRID_BIN=200
@@ -654,6 +655,7 @@ as `0.5pi` and `-pi`. However, as of version 2.4, we use the Lepton library in o
 that we read. This means that you can also employ more complicated expressions such as `1+2` or `exp(10)`:
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt65/AA.pdb
 MOLINFO STRUCTURE=AA.pdb  MOLTYPE=rna
 e1: TORSION ATOMS=@epsilon-1
 RESTRAINT ARG=e1 AT=1+0.5
diff --git a/user-doc/go-example-check b/user-doc/go-example-check
index 846bedfdf..462cb8501 100755
--- a/user-doc/go-example-check
+++ b/user-doc/go-example-check
@@ -5,7 +5,7 @@ mkdir example-check
 
 # This generates plumed.dat files for each of the documentation pages in the manual
 for file in *PP.md automatic/*.txt ../CHANGES/*.md tutorials/*.txt tutorials/*.site tutorials/others/*.txt ; do
-    #echo Generating examples to check for file $file
+    # echo Generating examples to check for file $file
     # Single replica examples
     splits=`echo $file | sed -e 's/\// /g'`
     nf=`echo $splits | awk '{print NF}'`
@@ -97,19 +97,14 @@ for dir in * ; do
         molfile=`grep "MOLINFO" $file | wc -l | awk '{print $1}'`
         nfill=`grep "__FILL__" $file | wc -l | awk '{print $1}'`
         if [ $molfile -gt 0 ] && [ $nfill -eq 0 ] ; then
-             hasermds=`grep "ERMSD" $file | wc -l | awk '{print $1}'`
-             isdna=`grep "MOLTYPE=dna" $file | wc -l | awk '{print $1}'`
-             isrna=`grep "MOLTYPE=rna" $file | wc -l | awk '{print $1}'`
-             inpf=`grep "STRUCTURE=" $file | awk '{for(i=1;i<=NF;++i){ if($i ~ /STRUCTURE=/){ print $i; }}}' | sed -e 's/STRUCTURE=//'`
-             if [ $hasermds -gt 0 ] ; then
-                cp ../../../regtest/basic/rt-ermsd/ref.pdb $inpf
-             elif [ $isdna -gt 0 ] ; then
-                cp ../../../regtest/basic/rt-ermsd/ref.pdb $inpf
-             elif [ $isrna -gt 0 ] ; then
-                cp ../../../regtest/basic/rt65/AA.pdb $inpf
-             else 
-                cp ../../../regtest/basic/rt32/helix.pdb $inpf
+             hasmol=`grep "#SETTINGS" $file | grep "MOLFILE=" | wc -l | awk '{print $1}'`
+             if [ $hasmol -eq 0 ] ; then
+                  echo For example $file in $dir you need to include a MOLFILE= keyword in the SETTINGS line
+                  exit 1 
              fi
+             molname=`grep "#SETTINGS" $file | awk '{for(i=1;i<=NF;++i){if(match($i,"MOLFILE=")){print $i}}}' | sed -e 's/MOLFILE=//'`
+             inpf=`grep "STRUCTURE=" $file | awk '{for(i=1;i<=NF;++i){ if($i ~ /STRUCTURE=/){ print $i; }}}' | sed -e 's/STRUCTURE=//'`
+             cp ../../../$molname $inpf
         fi
 
         # Now running test with PLUMED
diff --git a/user-doc/tutorials/a-trieste-3.txt b/user-doc/tutorials/a-trieste-3.txt
index dac69051b..816db7a03 100644
--- a/user-doc/tutorials/a-trieste-3.txt
+++ b/user-doc/tutorials/a-trieste-3.txt
@@ -384,6 +384,7 @@ gnuplot and add a bias using an analytical function of a collective variable wit
 As a first test lets run an MD and generate on-the-fly the free energy as a function of the phi and psi collective variables separately.
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/trieste-3/aladip/aladip.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=aladip.pdb
 phi: TORSION ATOMS=@phi-2
@@ -417,6 +418,7 @@ The function and the resulting parameters can be used to run a new biased simula
 \section trieste-3-ex-7 Exercise 7: First biased run with Alanine dipeptide
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/trieste-3/aladip/aladip.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=aladip.pdb
 
@@ -448,6 +450,7 @@ We can now run a third simulation where both regions are biased.
 \section trieste-3-ex-8 Exercise 8: Second biased run with Alanine dipeptide
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/trieste-3/aladip/aladip.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=aladip.pdb
 
@@ -473,6 +476,7 @@ With this third simulation it should be possible to visit both regions as a func
 and obtain a better free energy estimate along phi.
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/trieste-3/aladip/aladip.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=aladip.pdb
 
diff --git a/user-doc/tutorials/a-trieste-6.txt b/user-doc/tutorials/a-trieste-6.txt
index 2ef9d4dd7..513b25a51 100644
--- a/user-doc/tutorials/a-trieste-6.txt
+++ b/user-doc/tutorials/a-trieste-6.txt
@@ -195,6 +195,7 @@ The users should select two of them for the \ref METAD simulation. Once you are
 to evaluate the free-energy difference between folded and unfolded state as a function of multiple collective variables. 
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 #this allows you to use short-cut for dihedral angles
 MOLINFO STRUCTURE=GB1_native.pdb
 
diff --git a/user-doc/tutorials/aa-lugano-2.txt b/user-doc/tutorials/aa-lugano-2.txt
index 4c92988a1..28438c3b5 100644
--- a/user-doc/tutorials/aa-lugano-2.txt
+++ b/user-doc/tutorials/aa-lugano-2.txt
@@ -121,6 +121,7 @@ As a first test lets run an MD and generate on-the-fly the free energy as a func
 This is an example input file to calculate the phi and psi angles on the fly and accumulate two 1D histograms from which calculating the free energy.
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/lugano-2/diala.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=diala.pdb
 phi: TORSION ATOMS=@phi-2
@@ -178,6 +179,7 @@ The function and the resulting parameters can be used to run a new biased simula
 To the above file we add a few lines to define using \ref CUSTOM a function of the angle phi.
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/lugano-2/diala.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=diala.pdb
 phi: TORSION ATOMS=@phi-2
@@ -217,6 +219,7 @@ We can now run a third simulation where both regions are biased.
 \section lugano-2-ex-3 Exercise 3: Second biased run with alanine dipeptide
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/lugano-2/diala.pdb
 MOLINFO STRUCTURE=diala.pdb
 phi: TORSION ATOMS=@phi-2
 psi: TORSION ATOMS=@psi-2
@@ -244,6 +247,7 @@ is flatter than the former even if not flat everywhere. Now it is possible to re
 and obtain a better free energy estimate along phi.
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/lugano-2/diala.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=diala.pdb
 
@@ -328,6 +332,7 @@ gmx trjcat -f traj*.xtc -cat -o concatenated.xtc
 2) calculate the values for all employed biases applied on each frame
 for this we can write a plumed-wham.dat file including all the biases used in the former simulations:
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/lugano-2/diala.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=diala.pdb
 phi: TORSION ATOMS=@phi-2
@@ -391,7 +396,7 @@ is presented in the following but the exercise is possible only if plumed is com
 Here we use the "replica" syntax of plumed to write a single plumed input file for all the windows:
 
 \plumedfile
-#SETTINGS FILENAME=plumed.dat
+#SETTINGS FILENAME=plumed.dat MOLFILE=user-doc/tutorials/lugano-2/diala.pdb
 # this is plumed.dat
 # vim:ft=plumed
 MOLINFO STRUCTURE=diala.pdb
diff --git a/user-doc/tutorials/aa-lugano-6d.txt b/user-doc/tutorials/aa-lugano-6d.txt
index d56f45581..b517d10c0 100644
--- a/user-doc/tutorials/aa-lugano-6d.txt
+++ b/user-doc/tutorials/aa-lugano-6d.txt
@@ -61,6 +61,7 @@ Once you are satisfied by the convergence of your simulation, you can use one of
 to evaluate the free-energy difference between folded and unfolded state as a function of multiple collective variables. 
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/lugano-6d/GB1_native.pdb
 #this allows you to use short-cut for dihedral angles
 MOLINFO STRUCTURE=GB1_native.pdb
 
diff --git a/user-doc/tutorials/marvel-1.txt b/user-doc/tutorials/marvel-1.txt
index b960a3a0a..68673abbd 100644
--- a/user-doc/tutorials/marvel-1.txt
+++ b/user-doc/tutorials/marvel-1.txt
@@ -277,6 +277,7 @@ angles).  The \ref MOLINFO command makes it particularly easy to do this.  For i
 in the sixth residue of the protein and the \f$\psi\f$ angle in the eighth residue of the protein.  You can do so using the following input:
 
 \verbatim
+#SETTINGS MOLFILE=user-doc/tutorials/marvel-1/template.pdb
 MOLINFO STRUCTURE=template.pdb
 phi6: TORSION ATOMS=@phi-6
 psi8: TORSION ATOMS=@psi-8
@@ -360,6 +361,7 @@ below to calculate the degree of anti-beta secondary structure in each of the tr
 and by exploiting the commands to run driver that were described in section \ref marvel-1-introinput. 
 
 \verbatim
+#SETTINGS MOLFILE=user-doc/tutorials/marvel-1/template.pdb
 MOLINFO STRUCTURE=template.pdb
 abeta: ANTIBETARMSD RESIDUES=all TYPE=DRMSD LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12} STRANDS_CUTOFF=1
 
@@ -564,6 +566,7 @@ We are going to calculate the \ref HISTOGRAM from our protein trajectory as a fu
 calculate perform this analysis is shown below:
 
 \verbatim
+#SETTINGS MOLFILE=user-doc/tutorials/marvel-1/template.pdb
 # Read in protein structure template
 MOLINFO STRUCTURE=template.pdb
 # Calculate collective variables
@@ -599,6 +602,7 @@ F(s) = -k_B T \ln H(s)
 If you want to use PLUMED to output the free energy rather than the histogram you need to use the \ref CONVERT_TO_FES command as shown below:
 
 \verbatim
+#SETTINGS MOLFILE=user-doc/tutorials/marvel-1/template.pdb
 # Read in protein structure template
 MOLINFO STRUCTURE=template.pdb
 # Calculate collective variables
diff --git a/user-doc/tutorials/munster.txt b/user-doc/tutorials/munster.txt
index bef53426e..7f7f5f09a 100644
--- a/user-doc/tutorials/munster.txt
+++ b/user-doc/tutorials/munster.txt
@@ -248,6 +248,7 @@ the atomic positions. This is a very good way to understand what \ref WHOLEMOLEC
 is actually doing. Try the following input
 
 \plumedfile
+#SETTINGS MOLFILE=user-doc/tutorials/munster/TOPO/reference.pdb
 MOLINFO STRUCTURE=reference.pdb
 DUMPATOMS FILE=test1.gro ATOMS=1-22
 WHOLEMOLECULES ENTITY0=1-22
diff --git a/user-doc/tutorials/performance-optimization.txt b/user-doc/tutorials/performance-optimization.txt
index 804f9b021..b2e94cd79 100644
--- a/user-doc/tutorials/performance-optimization.txt
+++ b/user-doc/tutorials/performance-optimization.txt
@@ -51,6 +51,7 @@ Scaling is approximately linear.
 Now you can run GROMACS with PLUMED using the following input file
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=conf.pdb
 # @water and @hydrogens are special groups introduce in PLUMED 2.5!
 wat: GROUP ATOMS=@water
@@ -130,6 +131,7 @@ The recommended procedure is to first perform a simulation where you compute you
 For instance:
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=conf.pdb
 wat: GROUP ATOMS=@water
 ow:  GROUP ATOMS=@water REMOVE=@hydrogens
@@ -218,6 +220,7 @@ the distance between the magnesium ion and the phosphate. Parameters are similar
 although we use here a shorter deposition pace in order to artificially increase the computational cost.
 
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=conf.pdb
 wat: GROUP ATOMS=@water
 ow:  GROUP ATOMS=@water REMOVE=@hydrogens
@@ -249,6 +252,7 @@ for((i=0;i<=10000;i++)) ; do echo "$var" ; done | awk '{if($1!="#!") print $1,$2
 
 Now modify your `plumed.dat` file so that it will read the `HILLS_long` file:
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 MOLINFO STRUCTURE=conf.pdb
 wat: GROUP ATOMS=@water
 ow:  GROUP ATOMS=@water REMOVE=@hydrogens
@@ -289,6 +293,7 @@ Let's see what happens using the GPU. In this case the first couple of thousands
 GROMACS tries to optimize the GPU load, so we should run a longer simulation to estimate the simulation speed.
 For simplicity, use the following `plumed.dat` file:
 \plumedfile
+#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
 # vim:ft=plumed
 MOLINFO STRUCTURE=conf.pdb
 DEBUG DETAILED_TIMERS
-- 
GitLab