diff --git a/examples/features/committee_models/weighted_baseline/input.xml b/examples/features/committee_models/weighted_baseline/input.xml index db690f6cf..2687bdf06 100644 --- a/examples/features/committee_models/weighted_baseline/input.xml +++ b/examples/features/committee_models/weighted_baseline/input.xml @@ -43,8 +43,8 @@ - - [committee_pot, committee_force, committee_virial, baseline_pot, baseline_force, baseline_virial, wb_mixing] + + [committee_pot, committee_force, committee_virial, baseline_pot, baseline_force, baseline_virial, wb_mixing] diff --git a/examples/features/committee_models/weighted_baseline_extra/input.xml b/examples/features/committee_models/weighted_baseline_extra/input.xml index 77d12b014..ffa642f56 100644 --- a/examples/features/committee_models/weighted_baseline_extra/input.xml +++ b/examples/features/committee_models/weighted_baseline_extra/input.xml @@ -40,8 +40,8 @@ - - [committee_pot, committee_force, committee_virial, baseline_pot, baseline_force, baseline_virial, wb_mixing] + + [committee_pot, committee_force, committee_virial, baseline_pot, baseline_force, baseline_virial, wb_mixing] diff --git a/examples/features/metadynamics/README.md b/examples/features/metadynamics/README.md index a4e4f5454..3c6ee970e 100644 --- a/examples/features/metadynamics/README.md +++ b/examples/features/metadynamics/README.md @@ -15,3 +15,7 @@ i-pi--driver -u -h zundel -m zundel ``` However, they require having PLUMED libraries and Python bindings in the appropriate system paths. + +Note also that the example in `pimd_metadynamics` provides a demonstration of how to retrieve quantities +computed PLUMED-side (such as CV values) back into i-PI as `extras` that can be associated with +individual structures and printed out alongside the other i-PI outputs. diff --git a/examples/features/metadynamics/pimd_metadynamics_zundel/input.xml b/examples/features/metadynamics/pimd_metadynamics_zundel/input.xml index dda30f68e..b94e5747d 100644 --- a/examples/features/metadynamics/pimd_metadynamics_zundel/input.xml +++ b/examples/features/metadynamics/pimd_metadynamics_zundel/input.xml @@ -9,11 +9,13 @@ ./h5o2+.xyz plumed/plumed.dat + [doo, co1.lessthan, co2.lessthan, mtd.bias ] 400 positions{angstrom} x_centroid{angstrom} + extras_bias [ step, time, conserved, temperature{kelvin}, kinetic_cv, potential, kinetic_cv(H), kinetic_cv(O), ensemble_bias ] @@ -33,7 +35,9 @@ 300.0 - + + [ doo, mtd.bias ] + diff --git a/examples/temp/pes/pswater/combine-extras/h2o_3.xyz b/examples/features/outputs/combine-extras/h2o_3.xyz similarity index 100% rename from examples/temp/pes/pswater/combine-extras/h2o_3.xyz rename to examples/features/outputs/combine-extras/h2o_3.xyz diff --git a/examples/temp/pes/pswater/combine-extras/input.xml b/examples/features/outputs/combine-extras/input.xml similarity index 91% rename from examples/temp/pes/pswater/combine-extras/input.xml rename to examples/features/outputs/combine-extras/input.xml index 6c485fabe..3ff5dab21 100644 --- a/examples/temp/pes/pswater/combine-extras/input.xml +++ b/examples/features/outputs/combine-extras/input.xml @@ -7,8 +7,8 @@ kinetic_cv extras extras - extras_component(0) - extras_component(1) + extras_component_raw(0) + extras_component_raw(1) @@ -39,10 +39,10 @@ - ['dipole'] + ['dipole'] - ['dipole'] + ['dipole'] diff --git a/examples/temp/pes/pswater/combine-extras/test_settings.dat b/examples/features/outputs/combine-extras/test_settings.dat similarity index 100% rename from examples/temp/pes/pswater/combine-extras/test_settings.dat rename to examples/features/outputs/combine-extras/test_settings.dat diff --git a/examples/temp/pes/pswater/committee-extras/h2o_3.xyz b/examples/features/outputs/committee-extras/h2o_3.xyz similarity index 100% rename from examples/temp/pes/pswater/committee-extras/h2o_3.xyz rename to examples/features/outputs/committee-extras/h2o_3.xyz diff --git a/examples/temp/pes/pswater/committee-extras/input.xml b/examples/features/outputs/committee-extras/input.xml similarity index 100% rename from examples/temp/pes/pswater/committee-extras/input.xml rename to examples/features/outputs/committee-extras/input.xml diff --git a/examples/temp/pes/pswater/committee-extras/test_settings.dat b/examples/features/outputs/committee-extras/test_settings.dat similarity index 100% rename from examples/temp/pes/pswater/committee-extras/test_settings.dat rename to examples/features/outputs/committee-extras/test_settings.dat diff --git a/examples/temp/pes/pswater/contract-extras/h2o_3.xyz b/examples/features/outputs/contract-extras/h2o_3.xyz similarity index 100% rename from examples/temp/pes/pswater/contract-extras/h2o_3.xyz rename to examples/features/outputs/contract-extras/h2o_3.xyz diff --git a/examples/temp/pes/pswater/contract-extras/input.xml b/examples/features/outputs/contract-extras/input.xml similarity index 90% rename from examples/temp/pes/pswater/contract-extras/input.xml rename to examples/features/outputs/contract-extras/input.xml index 16b460fd7..cab284f25 100644 --- a/examples/temp/pes/pswater/contract-extras/input.xml +++ b/examples/features/outputs/contract-extras/input.xml @@ -6,6 +6,8 @@ forces kinetic_cv extras + + extras_component_raw(0) @@ -31,7 +33,7 @@ - ['dipole'] + [dipole] diff --git a/examples/temp/pes/pswater/contract-extras/test_settings.dat b/examples/features/outputs/contract-extras/test_settings.dat similarity index 100% rename from examples/temp/pes/pswater/contract-extras/test_settings.dat rename to examples/features/outputs/contract-extras/test_settings.dat diff --git a/examples/features/path_integral_molecular_dynamics/README.md b/examples/features/path_integral_molecular_dynamics/README.md index 77781001b..38f2f5d07 100644 --- a/examples/features/path_integral_molecular_dynamics/README.md +++ b/examples/features/path_integral_molecular_dynamics/README.md @@ -2,9 +2,9 @@ Path integral molecular dynamics. ================================================= `standard_pimd`: path integral molecular dynamics using the PILE thermostat and MTS for propagating the ring polymer modes. `cayley_pimd`: path integral molecular dynamics using the PILE thermostat and Cayley integrator for propagating the ring polymer modes. -`constrained_centroid`: constant-temperature PIMD, with the centroid held fixed in the initial position. useful to compute the centroid potential of mean force. +`constrained_centroid`: constant-temperature PIMD, with the centroid held fixed in the initial position. Useful to compute the centroid potential of mean force. `piglet`: path integral molecular dynamics using the PIGLET thermostat -`pimd+mts`: path integral molecular dynamics with MTS algorithm to integrate short and long ranged forces with different timesteps. +`pimd+mts`: path integral molecular dynamics with MTS algorithm to integrate short and long ranged forces with different timesteps. Includes option to print out the slow and/or fast force components. `rpc`: path integral molecular dynamics with RPC algorithm to use different number of replicas for short and long ranged forces. scpimd: path integral molecular dynamics with the Suzuki-Chin splitting. `water_remd`: path integral molecular dynamics with replica-exchange spanning different temperatures and pressures. diff --git a/examples/features/path_integral_molecular_dynamics/pimd+mts_liquid_water/input.xml b/examples/features/path_integral_molecular_dynamics/pimd+mts_liquid_water/input.xml index c93dd94ea..51eebb8bc 100644 --- a/examples/features/path_integral_molecular_dynamics/pimd+mts_liquid_water/input.xml +++ b/examples/features/path_integral_molecular_dynamics/pimd+mts_liquid_water/input.xml @@ -1,7 +1,11 @@ - [ step, time{picosecond}, conserved, temperature{kelvin}, kinetic_cv, potential, pressure_cv{megapascal} ] - positions + [ step, time{picosecond}, conserved, temperature{kelvin}, kinetic_cv, potential, pressure_cv{megapascal}, pot_component_raw(0), pot_component_raw(1) ] + [ pot_component(1;0), pot_component(1;1), pot_component(1;2), pot_component(1;3) ] + [ pot_component_raw(1;0), pot_component_raw(1;1) ] + positions + forces_component_raw(0) + forces_component_raw(0;0) 100 @@ -21,14 +25,16 @@ [0,1] - + [1,0] diff --git a/examples/temp/pes/pswater/nvt/input.xml b/examples/temp/pes/pswater/nvt/input.xml index 4af020049..6ec1f52c2 100644 --- a/examples/temp/pes/pswater/nvt/input.xml +++ b/examples/temp/pes/pswater/nvt/input.xml @@ -7,7 +7,7 @@ kinetic_cv extras extras - extras_component(0) + extras_component_raw(0) diff --git a/ipi/engine/forcefields.py b/ipi/engine/forcefields.py index 88691aeb3..c7efddc67 100644 --- a/ipi/engine/forcefields.py +++ b/ipi/engine/forcefields.py @@ -671,6 +671,7 @@ def __init__( init_file="", plumeddat="", plumedstep=0, + plumedextras=[], ): """Initialises FFPlumed. @@ -689,6 +690,7 @@ def __init__( self.plumed = plumed.Plumed() self.plumeddat = plumeddat self.plumedstep = plumedstep + self.plumedextras = plumedextras self.init_file = init_file if self.init_file.mode == "xyz": @@ -718,6 +720,20 @@ def __init__( self.plumedrestart = True self.plumed.cmd("setRestart", 1) self.plumed.cmd("init") + + self.plumed_data = {} + for x in plumedextras: + rank = np.zeros(1, dtype=np.int_) + self.plumed.cmd(f"getDataRank {x}", rank) + if rank[0] > 1: + raise ValueError("Cannot retrieve varibles with rank > 1") + shape = np.zeros(rank[0], dtype=np.int_) + if shape[0] > 1: + raise ValueError("Cannot retrieve varibles with size > 1") + self.plumed.cmd(f"getDataShape {x}", shape) + self.plumed_data[x] = np.zeros(shape, dtype=np.double) + self.plumed.cmd(f"setMemoryForData {x}", self.plumed_data[x]) + self.charges = dstrip(myatoms.q) * 0.0 self.masses = dstrip(myatoms.m) self.lastq = np.zeros(3 * self.natoms) @@ -771,8 +787,12 @@ def evaluate(self, r): f[:] -= dstrip(self.system_force.f).flatten() vir[:] -= -dstrip(self.system_force.vir) + extras = {"raw": ""} + for x in self.plumed_data: + extras[str(x)] = self.plumed_data[x].copy() + # nb: the virial is a symmetric tensor, so we don't need to transpose - r["result"] = [v, f, vir, {"raw": ""}] + r["result"] = [v, f, vir, extras] r["status"] = "Done" def mtd_update(self, pos, cell): diff --git a/ipi/engine/forces.py b/ipi/engine/forces.py index c7eb811d8..a09d84547 100644 --- a/ipi/engine/forces.py +++ b/ipi/engine/forces.py @@ -301,7 +301,7 @@ def __init__( weight=1.0, name="", mts_weights=None, - force_extras=None, + interpolate_extras=None, epsilon=-0.001, ): """Initializes ForceComponent @@ -316,7 +316,7 @@ def __init__( will be weighted by this factor. The combination is a weighted sum. name: The name of the forcefield. mts_weights: Weight of forcefield at each mts level. - force_extras: A list of properties that should be treated as physical quantities, + interpolate_extras: A list of properties that should be treated as physical quantities, converted to numpy arrays and treated with ring polymer contraction. If different force components have this field, they will also be summed with the respective weight like a forces object. @@ -330,10 +330,10 @@ def __init__( self.mts_weights = np.asarray([]) else: self.mts_weights = np.asarray(mts_weights) - if force_extras is None: - self.force_extras = [] + if interpolate_extras is None: + self.interpolate_extras = [] else: - self.force_extras = force_extras + self.interpolate_extras = interpolate_extras self.epsilon = epsilon def bind(self, beads, cell, fflist, output_maker): @@ -400,7 +400,7 @@ def bind(self, beads, cell, fflist, output_maker): ) self._extras = depend_value( name="extras", - value=np.zeros(self.nbeads, float), + value={}, func=self.extra_gather, dependencies=[self._forces[b]._extra for b in range(self.nbeads)], ) @@ -464,21 +464,21 @@ def extra_gather(self): ) fc_extra[e].append(b.extra[e]) - # force_extras should be numerical, thus can be converted to numpy arrays. + # interpolate_extras should be numerical, thus can be converted to numpy arrays. # we enforce the type and numpy will raise an error if not. - for e in self.force_extras: + for e in self.interpolate_extras: try: fc_extra[e] = np.asarray(fc_extra[e], dtype=float) except KeyError: raise KeyError( - "force_extras required " + "interpolate_extras required " + e + " to promote, but was not found among extras " + str(list(fc_extra.keys())) ) except: raise Exception( - "force_extras has to be numerical to be treated as a physical quantity. It is not -- check the quantity that is being passed." + "interpolate_extras has to be numerical to be treated as a physical quantity. It is not -- check the quantity that is being passed." ) return fc_extra @@ -530,6 +530,7 @@ class ScaledForceComponent: def __init__(self, baseforce, scaling=1): self.bf = baseforce self.name = baseforce.name + self.nbeads = baseforce.nbeads self.ffield = baseforce.ffield self._scaling = depend_value(name="scaling", value=scaling) self._f = depend_array( @@ -554,10 +555,10 @@ def __init__(self, baseforce, scaling=1): value=np.zeros((self.bf.nbeads, 3, 3)), dependencies=[self.bf._virs, self._scaling], ) - self._extras = depend_array( + self._extras = depend_value( name="extras", func=lambda: self.bf.extras, - value=np.zeros(self.bf.nbeads), + value={}, dependencies=[self.bf._extras], ) @@ -576,7 +577,7 @@ def __init__(self, baseforce, scaling=1): self._weight = depend_value(name="weight", value=0) dpipe(self.bf._weight, self._weight) self.mts_weights = self.bf.mts_weights - self.force_extras = self.bf.force_extras + self.interpolate_extras = self.bf.interpolate_extras def get_pots(self): return ( @@ -812,7 +813,7 @@ def make_rpc(rpc, beads): nbeads=newb, weight=fc.weight, mts_weights=fc.mts_weights, - force_extras=fc.force_extras, + interpolate_extras=fc.interpolate_extras, epsilon=fc.epsilon, ) newbeads = Beads(beads.natoms, newb) @@ -1160,41 +1161,44 @@ def get_vir(self): vir += v return vir - def pots_component(self, index, weighted=True): + def pots_component(self, index, weighted=True, interpolate=True): """Fetches the index^th component of the total potential.""" - if weighted: - if self.mforces[index].weight != 0: - return self.mforces[index].weight * self.mrpc[index].b2tob1( - self.mforces[index].pots - ) + + if weighted and self.mforces[index].weight == 0: + if interpolate: + return np.zeros(self.mrpc[index].nbeads1) else: - return 0 + return np.zeros(self.mrpc[index].nbeads2) else: - return self.mrpc[index].b2tob1(self.mforces[index].pots) - - def forces_component(self, index, weighted=True): + pots = dstrip(self.mforces[index].pots).copy() + if weighted: + pots *= self.mforces[index].weight + if interpolate: + pots = self.mrpc[index].b2tob1(pots) + return pots + + def forces_component(self, index, weighted=True, interpolate=True): """Fetches the index^th component of the total force.""" - if weighted: - if self.mforces[index].weight != 0: - return self.mforces[index].weight * self.mrpc[index].b2tob1( - dstrip(self.mforces[index].f) - ) + + if weighted and self.mforces[index].weight == 0: + if interpolate: + return np.zeros((self.mrpc[index].nbeads1, 3 * self.natoms)) else: - return np.zeros((self.nbeads, self.natoms * 3), float) + return np.zeros((self.mrpc[index].nbeads2, 3 * self.natoms)) else: - return self.mrpc[index].b2tob1(dstrip(self.mforces[index].f)) + forces = dstrip(self.mforces[index].f).copy() + if weighted: + forces *= self.mforces[index].weight + if interpolate: + forces = self.mrpc[index].b2tob1(forces) + return forces def extras_component(self, index): - """Fetches extras that are computed for one specific force component.""" + """Fetches extras that are computed for one specific force component. + + Does not attempt to apply weights or interpolate, always returns raw stuff. + """ - if self.nbeads != self.mforces[index].nbeads: - raise ValueError( - "Cannot fetch extras for a component when using ring polymer contraction" - ) - if self.mforces[index].weight == 0: - raise ValueError( - "Cannot fetch extras for a component that has not been computed because of zero weight" - ) return self.mforces[index].extras def forcesvirs_4th_order(self, index): @@ -1449,8 +1453,8 @@ def extra_combine(self): for k in range(self.nforces): # combines the extras from the different force components for e, v in self.mforces[k].extras.items(): - if e in self.mforces[k].force_extras: - # extras that are tagged as force_extras are treated exactly as if they were an energy/force/stress + if e in self.mforces[k].interpolate_extras: + # extras that are tagged as interpolate_extras are treated exactly as if they were an energy/force/stress v = ( self.mforces[k].weight * self.mforces[k].mts_weights.sum() diff --git a/ipi/engine/outputs.py b/ipi/engine/outputs.py index 9031f9c22..8b60a8ba6 100644 --- a/ipi/engine/outputs.py +++ b/ipi/engine/outputs.py @@ -345,14 +345,15 @@ def open_stream(self, mode): "velocities", "forces", "extras", - "extras_component", + # "extras_component_raw", write out a single file as we don't know how to do contraction here + "extras_bias", "forces_sc", "momenta", ]: # must write out trajectories for each bead, so must create b streams # prepare format string for file name - if getkey(self.what) == "extras" or getkey(self.what) == "extras_component": + if getkey(self.what)[:6] == "extras": fmt_fn = self.filename + "_" + fmt_bead else: fmt_fn = self.filename + "_" + fmt_bead + "." + self.format @@ -367,7 +368,10 @@ def open_stream(self, mode): self.out.append(None) else: # open one file - filename = self.filename + "." + self.format + filename = self.filename + # prepare format string for file name + if getkey(self.what)[:6] != "extras": + filename += "." + self.format self.out = open_backup(filename, mode) def close_stream(self): @@ -477,14 +481,27 @@ def write_traj( """ key = getkey(what) - if key in ["extras", "extras_component"]: - stream.write( - " #%s(%s)# Step: %10d Bead: %5d \n" - % (key.upper(), self.extra_type, self.system.simul.step + 1, b) - ) + if key in ["extras", "extras_component_raw", "extras_bias"]: + if key == "extras_component_raw": + stream.write( + " #%s(%s)# Step: %10d Bead: %5d \n" + % (key.upper(), self.extra_type, self.system.simul.step + 1, b) + ) + else: + stream.write( + " #%s(%s)# Step: %10d \n" + % (key.upper(), self.extra_type, self.system.simul.step + 1) + ) if self.extra_type in data: try: - floatarray = np.asarray(data[self.extra_type][b], dtype=float) + if key == "extras_component_raw": + # don't partition into beads as there might be a different number when contracting + floatarray = np.asarray( + data[self.extra_type], dtype=float + ).squeeze() + else: + # picks up the desired bead + floatarray = np.asarray(data[self.extra_type][b], dtype=float) if floatarray.ndim == 2: stream.write( "\n".join( diff --git a/ipi/engine/properties.py b/ipi/engine/properties.py index 89a1b3d4e..eadf1eb98 100644 --- a/ipi/engine/properties.py +++ b/ipi/engine/properties.py @@ -361,7 +361,8 @@ def __init__(self): "longhelp": """The contribution to the system potential from one of the force components. Takes one mandatory argument index (zero-based) that indicates which component of the potential must be returned. The optional argument 'bead' will print the potential associated - with the specified bead. If the potential is weighed, the weight will be applied. """, + with the specified bead (interpolated to the full ring polymer). + If the potential is weighed, the weight will be applied. """, "func": ( lambda index, bead="-1": ( self.forces.pots_component(int(index)).sum() / self.beads.nbeads @@ -376,14 +377,16 @@ def __init__(self): "longhelp": """The contribution to the system potential from one of the force components. Takes one mandatory argument index (zero-based) that indicates which component of the potential must be returned. The optional argument 'bead' - will print the potential associated with the specified bead. Potential weights - will not be applied. """, + will print the potential associated with the specified bead, at the level of + discretization of the given component. Potential weights will not be applied. """, "func": ( lambda index, bead="-1": ( - self.forces.pots_component(int(index), False).sum() + self.forces.pots_component(int(index), False, False).sum() / self.beads.nbeads if int(bead) < 0 - else self.forces.pots_component(int(index), False)[int(bead)] + else self.forces.pots_component(int(index), False, False)[ + int(bead) + ] ) ), }, @@ -1122,21 +1125,6 @@ def get_kincv(self, atom=""): acv = np.dot(q.flatten(), f.flatten()) acv *= -0.5 / self.beads.nbeads acv += ncount * 1.5 * Constants.kb * self.ensemble.temp - # ~ acv = 0.0 - # ~ ncount = 0 - # ~ - # ~ for i in range(self.beads.natoms): - # ~ if (atom != "" and iatom != i and latom != self.beads.names[i]): - # ~ continue - # ~ - # ~ kcv = 0.0 - # ~ k = 3*i - # ~ for b in range(self.beads.nbeads): - # ~ kcv += q[b,k]* f[b,k] + q[b,k+1]* f[b,k+1] + q[b,k+2]* f[b,k+2] - # ~ kcv *= -0.5/self.beads.nbeads - # ~ kcv += 1.5*Constants.kb*self.ensemble.temp - # ~ acv += kcv - # ~ ncount += 1 if ncount == 0: # TODO: don't warn if bosons are matched @@ -2848,10 +2836,50 @@ def __init__(self): is printed verbatim. Will print out one file per bead, unless the bead attribute is set by the user.""", "func": (lambda: self.system.forces.extras), }, - "extras_component": { - "help": """The additional data returned by the client code, printed verbatim or expanded as a dictionary. See "extras". - Fetches the extras from a specific force component, indicated in parentheses [extras_component(idx)]. """, - "func": (lambda idx: self.system.forces.extras_component(int(idx))), + "forces_component": { + "dimension": "force", + "help": """The contribution to the system forces from one of the force components. + Takes one mandatory argument index (zero-based) that indicates which component of the + potential must be returned. The optional argument 'bead' will print the potential associated + with the specified bead (interpolated to the full ring polymer), otherwise the centoid force is computed. + If the potential is weighed, the weight will be applied. """, + "func": lambda index, bead="-1": ( + self.system.forces.forces_component(int(index)).sum(axis=0) + / self.system.beads.nbeads + if int(bead) < 0 + else self.system.forces.forces_component(int(index))[int(bead)] + ), + }, + "forces_component_raw": { + "dimension": "force", + "help": """The contribution to the system forces from one of the force components. + Takes one mandatory argument index (zero-based) that indicates which component of the + potential must be returned. The optional argument 'bead' will print the potential associated + with the specified bead (with the level of discretization of the component), otherwise the + centoid force is computed. The weight of the potential is not applied. """, + "func": lambda index, bead="-1": ( + self.system.forces.forces_component(int(index), False, False).sum( + axis=0 + ) + / self.system.beads.nbeads + if int(bead) < 0 + else self.system.forces.forces_component(int(index), False, False)[ + int(bead) + ] + ), + }, + "extras_component_raw": { + "help": """The additional data returned by the client code, printed verbatim or expanded + as a dictionary. See "extras". + Fetches the extras from a specific force component, indicated in parentheses + and a specific bead [extras_component_raw(idx; bead=0)]. + Never applies weighting or contraction, and does not automatically sum + over beads as we don't know if the extras are numeric""", + "func": (lambda idx: (self.system.forces.extras_component(int(idx)))), + }, + "extras_bias": { + "help": """The additional data returned by the bias forcefield, printed verbatim or expanded as a dictionary. See "extras". """, + "func": (lambda: self.system.ensemble.bias.extras), }, "isotope_zetatd": { "dimension": "undefined", diff --git a/ipi/inputs/forcefields.py b/ipi/inputs/forcefields.py index 4498264a7..d11d46b97 100644 --- a/ipi/inputs/forcefields.py +++ b/ipi/inputs/forcefields.py @@ -521,6 +521,14 @@ class InputFFPlumed(InputForceField): "help": "The current step counter for PLUMED calls", }, ), + "plumedextras": ( + InputArray, + { + "dtype": str, + "default": input_default(factory=np.zeros, args=(0, str)), + "help": "List of variables defined in the PLUMED input, that should be transferred to i-PI as `extras` fields.", + }, + ), } attribs = {} @@ -528,7 +536,12 @@ class InputFFPlumed(InputForceField): attribs.update(InputForceField.attribs) fields.update(InputForceField.fields) - default_help = """ Direct PLUMED interface """ + default_help = """ +Direct PLUMED interface. Can be used to implement metadynamics in i-PI in combination with +the SMotion class. NB: if you use PLUMED for constant biasing (e.g. for umbrella sampling) +the bias will be computed but there will be no output as specified in the `plumed.dat` file +unless you include a tag, that triggers the log update. """ + default_label = "FFPLUMED" def store(self, ff): @@ -539,6 +552,7 @@ def store(self, ff): # self.plumedstep.store(pstep) self.plumedstep.store(ff.plumedstep) self.file.store(ff.init_file) + self.plumedextras.store(np.array(ff.plumed_data.keys())) def fetch(self): super(InputFFPlumed, self).fetch() @@ -551,6 +565,7 @@ def fetch(self): threaded=self.threaded.fetch(), plumeddat=self.plumeddat.fetch(), plumedstep=self.plumedstep.fetch(), + plumedextras=self.plumedextras.fetch(), init_file=self.file.fetch(), ) diff --git a/ipi/inputs/forces.py b/ipi/inputs/forces.py index 5f3dd093c..7789aab64 100644 --- a/ipi/inputs/forces.py +++ b/ipi/inputs/forces.py @@ -79,7 +79,7 @@ class InputForceComponent(Input): "dimension": "force", }, ), - "force_extras": ( + "interpolate_extras": ( InputArray, { "dtype": str, @@ -107,7 +107,7 @@ def store(self, forceb): self.nbeads.store(forceb.nbeads) self.weight.store(forceb.weight) self.mts_weights.store(forceb.mts_weights) - self.force_extras.store(forceb.force_extras) + self.interpolate_extras.store(forceb.interpolate_extras) self.fd_epsilon.store(forceb.epsilon) self.name.store(forceb.name) self.forcefield.store(forceb.ffield) @@ -126,7 +126,7 @@ def fetch(self): weight=self.weight.fetch(), name=self.name.fetch(), mts_weights=self.mts_weights.fetch(), - force_extras=self.force_extras.fetch(), + interpolate_extras=self.interpolate_extras.fetch(), epsilon=self.fd_epsilon.fetch(), ) diff --git a/ipi/utils/nmtransform.py b/ipi/utils/nmtransform.py index 3405969fa..76b562fd9 100644 --- a/ipi/utils/nmtransform.py +++ b/ipi/utils/nmtransform.py @@ -247,6 +247,9 @@ def __init__(self, nbeads1, nbeads2, open_paths=None): nbeads2: The rescaled number of beads. """ + self.nbeads1 = nbeads1 + self.nbeads2 = nbeads2 + if open_paths is None: open_paths = [] self._open = open_paths diff --git a/ipi_tests/regression_tests/README b/ipi_tests/regression_tests/README index 4a072e877..94db4a9fb 100644 --- a/ipi_tests/regression_tests/README +++ b/ipi_tests/regression_tests/README @@ -62,6 +62,11 @@ To add a new regression test please provide: reference file: ref_simulation.out output to be genererated from i-pi: simulation.out + + - Folder names terminating with '.NOAUTO' (e.g. 'PLUMED.NOAUTO') are ignored + when run without specifying the folder name explicitly. This is useful when the + test requires an external program (e.g. PLUMED) that may not be available on + the testing platform Important: diff --git a/ipi_tests/regression_tests/test_run.py b/ipi_tests/regression_tests/test_run.py index aea4daac7..acc95bfdf 100644 --- a/ipi_tests/regression_tests/test_run.py +++ b/ipi_tests/regression_tests/test_run.py @@ -66,14 +66,14 @@ def test_regtest(regtest): try: path = str(regtests_folder / args.folder) - reg_tests = get_test_list(path) + reg_tests = get_test_list(path, skip_noauto=False) print("We will run only:") for i in reg_tests: print(i) print("") except: print("We will run all available regression tests") - reg_tests = get_test_list(regtests_folder) + reg_tests = get_test_list(regtests_folder, skip_noauto=True) print("We have found {} reg_tests".format(len(reg_tests))) for test_info in reg_tests: diff --git a/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/files_to_check.txt b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/files_to_check.txt new file mode 100644 index 000000000..7cd6ce2a1 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/files_to_check.txt @@ -0,0 +1,6 @@ + filename format +---------------------------------------------------------- +ref_simulation.frc_c.xyz xyz +ref_simulation.pos_c.xyz xyz +ref_simulation.out numpy +ref_simulation.cv_0 numpy diff --git a/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/init.xyz b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/init.xyz new file mode 100644 index 000000000..f83ff8622 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/init.xyz @@ -0,0 +1,5 @@ +3 +# + O 0.54044984 -0.97485007 -0.21657970 + H 0.18385954 -1.25804198 -1.07875142 + H 0.04233158 -0.19485993 0.09228101 diff --git a/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/input.xml b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/input.xml new file mode 100644 index 000000000..37d944682 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/input.xml @@ -0,0 +1,41 @@ + + + [ step, potential{electronvolt}, ensemble_bias{electronvolt}] + x_centroid + f_centroid + extras_bias + extras_bias + + 100 + +
localhost
+
+ + ./init.xyz + plumed.dat + [dhh, rest.bias] + + + + init.xyz + [ 25.29166, 0, 0, 0, 25.29166, 0, 0, 0, 25.29166 ] + + + + + + 300.0 + + + + + + + 0.5 + + 5 + + + + +
diff --git a/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/plumed.dat b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/plumed.dat new file mode 100644 index 000000000..dfb2f7e55 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/plumed.dat @@ -0,0 +1,7 @@ +# default units are LENGTH=nm ENERGY=kJ/mol TIME=ps +dhh: DISTANCE ATOMS=2,3 +RESTRAINT ARG=dhh AT=0.25 KAPPA=1e5 LABEL=rest + +PRINT ARG=dhh,rest.* STRIDE=4 FILE=COLVAR +FLUSH STRIDE=1 + diff --git a/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.frc_c.xyz b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.frc_c.xyz new file mode 100644 index 000000000..0d3c58819 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.frc_c.xyz @@ -0,0 +1,30 @@ +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 0 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O -7.34145e-03 4.55046e-03 -4.38801e-03 + H 1.78151e-03 1.10616e-02 1.67248e-02 + H 5.55994e-03 -1.56120e-02 -1.23368e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 20 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O 3.00660e-02 -6.51393e-02 -2.11490e-02 + H -1.36193e-02 5.76692e-02 5.16106e-02 + H -1.64467e-02 7.47005e-03 -3.04616e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 40 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O -8.54149e-03 6.99613e-03 -1.05965e-02 + H -8.06995e-03 5.15873e-02 7.46366e-02 + H 1.66114e-02 -5.85834e-02 -6.40401e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 60 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O 2.25533e-03 1.23581e-02 3.15938e-02 + H -1.72452e-02 5.30545e-02 6.25606e-02 + H 1.49899e-02 -6.54126e-02 -9.41544e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 80 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O 5.90243e-03 -1.75604e-03 1.37665e-03 + H -1.36026e-02 5.64416e-02 8.00102e-02 + H 7.70016e-03 -5.46855e-02 -8.13869e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 100 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O -3.77567e-03 -2.01726e-03 -2.78397e-03 + H -2.26877e-03 5.64479e-02 8.41792e-02 + H 6.04444e-03 -5.44307e-02 -8.13952e-02 diff --git a/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.out b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.out new file mode 100644 index 000000000..4e0ee8956 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.out @@ -0,0 +1,14 @@ +# column 1 --> step : The current simulation time step. +# column 2 --> potential{electronvolt} : The physical system potential energy. +# column 3 --> ensemble_bias{electronvolt} : The bias applied to the current ensemble + 0.00000000e+00 3.25615492e-02 4.31033085e+00 + 1.00000000e+01 2.98085379e+00 2.30964185e-01 + 2.00000000e+01 8.25580153e-01 2.10170212e+00 + 3.00000000e+01 2.28081628e+00 5.14931223e-01 + 4.00000000e+01 9.69291798e-01 1.63948920e+00 + 5.00000000e+01 1.74743959e+00 9.00071457e-01 + 6.00000000e+01 1.62576266e+00 9.73399614e-01 + 7.00000000e+01 1.39149390e+00 1.15067255e+00 + 8.00000000e+01 1.44091236e+00 1.10196105e+00 + 9.00000000e+01 1.14348946e+00 1.41818509e+00 + 1.00000000e+02 1.37586058e+00 1.16128765e+00 diff --git a/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.pos_c.xyz b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.pos_c.xyz new file mode 100644 index 000000000..73f8cb4b9 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/ref_simulation.pos_c.xyz @@ -0,0 +1,30 @@ +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 0 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 1.02130e+00 -1.84220e+00 -4.09276e-01 + H 3.47444e-01 -2.37735e+00 -2.03854e+00 + H 7.99951e-02 -3.68232e-01 1.74386e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 20 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 9.69225e-01 -1.82197e+00 -4.19100e-01 + H 8.30712e-01 -2.73182e+00 -2.12743e+00 + H 4.23365e-01 -3.34913e-01 4.19203e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 40 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 9.86598e-01 -1.84319e+00 -4.13643e-01 + H 7.48846e-01 -2.49957e+00 -2.31041e+00 + H 2.29459e-01 -2.30219e-01 5.15560e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 60 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 9.76284e-01 -1.83587e+00 -4.39929e-01 + H 8.20561e-01 -2.52441e+00 -2.28179e+00 + H 3.21472e-01 -3.21702e-01 9.04183e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 80 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 9.99042e-01 -1.80673e+00 -4.46798e-01 + H 6.00194e-01 -2.74082e+00 -2.21121e+00 + H 1.80588e-01 -5.67817e-01 9.42645e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 100 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 1.01297e+00 -1.78473e+00 -4.65187e-01 + H 3.71459e-01 -2.89285e+00 -2.07779e+00 + H 1.88253e-01 -7.64974e-01 1.10112e+00 diff --git a/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/test_settings.dat b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/test_settings.dat new file mode 100644 index 000000000..be0a0f064 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/BIAS.NOAUTO/test_settings.dat @@ -0,0 +1,4 @@ +driver_model pswater +address localhost +port 32342 +socket_mode unix diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/files_to_check.txt b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/files_to_check.txt new file mode 100644 index 000000000..6d1c71158 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/files_to_check.txt @@ -0,0 +1,8 @@ + filename format +---------------------------------------------------------- +ref_simulation.frc_c.xyz xyz +ref_simulation.pos_c.xyz xyz +ref_simulation.dhh_0 numpy +ref_simulation.out numpy +ref_COLVAR numpy +ref_HILLS numpy diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/init.xyz b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/init.xyz new file mode 100644 index 000000000..f83ff8622 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/init.xyz @@ -0,0 +1,5 @@ +3 +# + O 0.54044984 -0.97485007 -0.21657970 + H 0.18385954 -1.25804198 -1.07875142 + H 0.04233158 -0.19485993 0.09228101 diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/input.xml b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/input.xml new file mode 100644 index 000000000..1f2237eda --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/input.xml @@ -0,0 +1,43 @@ + + + [ step, potential{electronvolt}, ensemble_bias{electronvolt}] + x_centroid + f_centroid + extras_bias + + 100 + +
localhost
+
+ + ./init.xyz + plumed.dat + [dhh, metad.bias] + + + + init.xyz + [ 25.29166, 0, 0, 0, 25.29166, 0, 0, 0, 25.29166 ] + + + + + + 300.0 + + + + + + + 0.5 + + 5 + + + + + + [ plumed ] + +
diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/plumed.dat b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/plumed.dat new file mode 100644 index 000000000..11a76a906 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/plumed.dat @@ -0,0 +1,7 @@ +# default units are LENGTH=nm ENERGY=kJ/mol TIME=ps +dhh: DISTANCE ATOMS=2,3 +METAD ARG=dhh PACE=10 SIGMA=0.01 HEIGHT=20 FILE=HILLS BIASFACTOR=10 TEMP=300 LABEL=metad + +PRINT ARG=dhh,metad.* STRIDE=5 FILE=COLVAR +FLUSH STRIDE=1 + diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_COLVAR b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_COLVAR new file mode 100644 index 000000000..d3ed6fe9c --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_COLVAR @@ -0,0 +1,21 @@ +#! FIELDS time dhh metad.bias + 5.000000 0.155967 0.000000 + 10.000000 0.154921 0.000000 + 15.000000 0.151864 19.084936 + 20.000000 0.139466 6.031047 + 25.000000 0.142372 23.734149 + 30.000000 0.145451 25.534972 + 35.000000 0.148893 32.506443 + 40.000000 0.147492 32.517662 + 45.000000 0.148125 37.242794 + 50.000000 0.159635 24.447986 + 55.000000 0.174320 5.508267 + 60.000000 0.174171 5.659232 + 65.000000 0.164223 31.413049 + 70.000000 0.168911 26.431936 + 75.000000 0.164387 36.790132 + 80.000000 0.158287 41.449045 + 85.000000 0.158746 44.314595 + 90.000000 0.155239 45.920543 + 95.000000 0.153812 48.671895 + 100.000000 0.146912 44.468779 diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_HILLS b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_HILLS new file mode 100644 index 000000000..b299df481 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_HILLS @@ -0,0 +1,13 @@ +#! FIELDS time dhh sigma_dhh height biasf +#! SET multivariate false +#! SET kerneltype stretched-gaussian + 10 0.1549211771444685 0.01 22.22222222222222 10 + 20 0.1394657546721228 0.01 16.98682245697788 10 + 30 0.1454511453378886 0.01 7.125139405924957 10 + 40 0.1474917194020225 0.01 5.220447499489441 10 + 50 0.1596346790688307 0.01 7.47862865628175 10 + 60 0.1741707468887148 0.01 17.27051083233874 10 + 70 0.1689106642077213 0.01 6.846063239044688 10 + 80 0.1582870349379482 0.01 3.506897910172468 10 + 90 0.1552386764037809 0.01 2.873548060189675 10 + 100 0.1469124424133807 0.01 3.065518757280203 10 diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.frc_c.xyz b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.frc_c.xyz new file mode 100644 index 000000000..67b8244e1 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.frc_c.xyz @@ -0,0 +1,30 @@ +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 0 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O -7.34145e-03 4.55046e-03 -4.38801e-03 + H 1.78151e-03 1.10616e-02 1.67248e-02 + H 5.55994e-03 -1.56120e-02 -1.23368e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 20 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O 2.04865e-02 1.00551e-02 5.68341e-02 + H -1.43933e-02 -2.82911e-02 -7.13938e-02 + H -6.09325e-03 1.82360e-02 1.45598e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 40 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O -1.09557e-02 2.67334e-02 2.84741e-02 + H -4.25606e-03 -9.31289e-03 -2.86912e-02 + H 1.52117e-02 -1.74205e-02 2.17115e-04 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 60 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O 1.12574e-02 -3.23849e-03 2.05735e-02 + H -1.33301e-02 2.38665e-02 2.02790e-02 + H 2.07268e-03 -2.06280e-02 -4.08526e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 80 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O 2.84007e-02 -2.16826e-02 -9.32255e-03 + H -7.58183e-03 8.33039e-03 7.00661e-03 + H -2.08188e-02 1.33522e-02 2.31594e-03 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 100 Bead: 0 f_centroid{atomic_unit} cell{atomic_unit} + O 2.62025e-02 5.94171e-03 2.12597e-02 + H -1.98991e-02 -1.35334e-02 -3.10173e-02 + H -6.30340e-03 7.59173e-03 9.75759e-03 diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.out b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.out new file mode 100644 index 000000000..490a34f39 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.out @@ -0,0 +1,104 @@ +# column 1 --> step : The current simulation time step. +# column 2 --> potential{electronvolt} : The physical system potential energy. +# column 3 --> ensemble_bias{electronvolt} : The bias applied to the current ensemble + 0.00000000e+00 3.25615492e-02 0.00000000e+00 + 1.00000000e+00 3.05942306e-02 0.00000000e+00 + 2.00000000e+00 1.90266342e-02 0.00000000e+00 + 3.00000000e+00 1.60349367e-02 0.00000000e+00 + 4.00000000e+00 1.52102454e-02 0.00000000e+00 + 5.00000000e+00 1.16190191e-02 0.00000000e+00 + 6.00000000e+00 8.99753647e-03 0.00000000e+00 + 7.00000000e+00 9.92540584e-03 0.00000000e+00 + 8.00000000e+00 1.09996699e-02 0.00000000e+00 + 9.00000000e+00 1.37685499e-02 0.00000000e+00 + 1.00000000e+01 2.03824115e-02 2.07285375e-01 + 1.10000000e+01 2.19904857e-02 2.07266680e-01 + 1.20000000e+01 3.13668080e-02 2.06375471e-01 + 1.30000000e+01 3.56232697e-02 2.05076485e-01 + 1.40000000e+01 4.07015682e-02 2.02929240e-01 + 1.50000000e+01 3.87624398e-02 1.97801404e-01 + 1.60000000e+01 3.39657627e-02 1.82092515e-01 + 1.70000000e+01 3.12618976e-02 1.54304539e-01 + 1.80000000e+01 5.31161653e-02 1.15956203e-01 + 1.90000000e+01 9.30897356e-02 8.40262697e-02 + 2.00000000e+01 1.48443319e-01 2.20957781e-01 + 2.10000000e+01 1.82447607e-01 2.16175975e-01 + 2.20000000e+01 1.99778411e-01 2.11286853e-01 + 2.30000000e+01 1.53434717e-01 2.19375243e-01 + 2.40000000e+01 1.11334565e-01 2.35251066e-01 + 2.50000000e+01 9.44743014e-02 2.45987099e-01 + 2.60000000e+01 8.63339633e-02 2.55524355e-01 + 2.70000000e+01 9.89848969e-02 2.59964899e-01 + 2.80000000e+01 1.15389799e-01 2.61186263e-01 + 2.90000000e+01 1.33264521e-01 2.62631477e-01 + 3.00000000e+01 1.53550763e-01 3.31113488e-01 + 3.10000000e+01 1.58555449e-01 3.34675163e-01 + 3.20000000e+01 1.45407875e-01 3.36838214e-01 + 3.30000000e+01 1.11832557e-01 3.37213466e-01 + 3.40000000e+01 6.96386353e-02 3.37330505e-01 + 3.50000000e+01 4.98040694e-02 3.36905506e-01 + 3.60000000e+01 4.46158799e-02 3.37002037e-01 + 3.70000000e+01 4.14674186e-02 3.37384228e-01 + 3.80000000e+01 5.13758622e-02 3.37393342e-01 + 3.90000000e+01 5.02454311e-02 3.37365172e-01 + 4.00000000e+01 4.42007214e-02 3.85717301e-01 + 4.10000000e+01 3.03349953e-02 3.85384387e-01 + 4.20000000e+01 2.22119743e-02 3.83922950e-01 + 4.30000000e+01 1.96984157e-02 3.83305455e-01 + 4.40000000e+01 1.53411228e-02 3.84717216e-01 + 4.50000000e+01 6.76754736e-03 3.85994329e-01 + 4.60000000e+01 2.05692781e-03 3.82289172e-01 + 4.70000000e+01 9.49065538e-03 3.69167884e-01 + 4.80000000e+01 2.57424651e-02 3.46505247e-01 + 4.90000000e+01 4.63702011e-02 3.11261537e-01 + 5.00000000e+01 8.56131263e-02 3.23144963e-01 + 5.10000000e+01 1.33869652e-01 2.54327843e-01 + 5.20000000e+01 1.73296390e-01 1.83233560e-01 + 5.30000000e+01 2.16419862e-01 1.26396065e-01 + 5.40000000e+01 2.66309619e-01 8.50265031e-02 + 5.50000000e+01 3.12196361e-01 5.70891616e-02 + 5.60000000e+01 3.56906979e-01 3.95512941e-02 + 5.70000000e+01 3.73472078e-01 3.31046757e-02 + 5.80000000e+01 3.74903373e-01 3.18612257e-02 + 5.90000000e+01 3.45201037e-01 3.90357461e-02 + 6.00000000e+01 3.01063563e-01 2.19750400e-01 + 6.10000000e+01 2.62155829e-01 2.50239008e-01 + 6.20000000e+01 2.52925857e-01 2.81882959e-01 + 6.30000000e+01 2.62247359e-01 3.16418518e-01 + 6.40000000e+01 2.72768890e-01 3.33757052e-01 + 6.50000000e+01 2.43283647e-01 3.25573283e-01 + 6.60000000e+01 2.03077954e-01 3.08949660e-01 + 6.70000000e+01 1.73664217e-01 2.91185751e-01 + 6.80000000e+01 1.60316301e-01 2.83584955e-01 + 6.90000000e+01 1.74235312e-01 2.73784286e-01 + 7.00000000e+01 1.81924340e-01 3.37806678e-01 + 7.10000000e+01 1.88066099e-01 3.37749898e-01 + 7.20000000e+01 1.77388023e-01 3.43575701e-01 + 7.30000000e+01 1.61295958e-01 3.51650021e-01 + 7.40000000e+01 1.23943021e-01 3.66936894e-01 + 7.50000000e+01 9.52850083e-02 3.81302819e-01 + 7.60000000e+01 7.26735367e-02 3.94747471e-01 + 7.70000000e+01 5.56024676e-02 4.10547494e-01 + 7.80000000e+01 5.61907770e-02 4.19470865e-01 + 7.90000000e+01 6.29617648e-02 4.25108282e-01 + 8.00000000e+01 6.10287178e-02 4.62300825e-01 + 8.10000000e+01 4.77398529e-02 4.61117096e-01 + 8.20000000e+01 4.18901067e-02 4.57344538e-01 + 8.30000000e+01 3.88649041e-02 4.56812502e-01 + 8.40000000e+01 3.53958012e-02 4.58954123e-01 + 8.50000000e+01 3.27962946e-02 4.59288375e-01 + 8.60000000e+01 2.61455439e-02 4.64762551e-01 + 8.70000000e+01 1.87766372e-02 4.69216885e-01 + 8.80000000e+01 1.63194487e-02 4.70540267e-01 + 8.90000000e+01 1.59238243e-02 4.74575363e-01 + 9.00000000e+01 1.75766792e-02 5.02736852e-01 + 9.10000000e+01 1.53648955e-02 5.04156985e-01 + 9.20000000e+01 1.18353549e-02 5.04220043e-01 + 9.30000000e+01 1.11498261e-02 5.04295731e-01 + 9.40000000e+01 9.14632639e-03 5.04297756e-01 + 9.50000000e+01 7.65257671e-03 5.04448597e-01 + 9.60000000e+01 3.14646759e-03 5.03795265e-01 + 9.70000000e+01 7.82098849e-05 5.00264378e-01 + 9.80000000e+01 6.72651225e-03 4.90547417e-01 + 9.90000000e+01 2.59993981e-02 4.73272023e-01 + 1.00000000e+02 3.79665209e-02 4.89481054e-01 diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.pos_c.xyz b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.pos_c.xyz new file mode 100644 index 000000000..cdd8e154f --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/ref_simulation.pos_c.xyz @@ -0,0 +1,30 @@ +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 0 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 1.02130e+00 -1.84220e+00 -4.09276e-01 + H 3.47444e-01 -2.37735e+00 -2.03854e+00 + H 7.99951e-02 -3.68232e-01 1.74386e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 20 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 1.01254e+00 -1.85116e+00 -3.91895e-01 + H 5.16678e-01 -2.23293e+00 -1.97266e+00 + H 4.98084e-02 -3.70389e-01 -1.67402e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 40 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 1.01837e+00 -1.85650e+00 -3.99305e-01 + H 5.23818e-01 -2.11575e+00 -2.07253e+00 + H -4.98662e-02 -4.02909e-01 5.00906e-02 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 60 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 9.96930e-01 -1.84402e+00 -4.25966e-01 + H 6.26121e-01 -2.22185e+00 -2.18335e+00 + H 1.88189e-01 -4.94871e-01 5.84100e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 80 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 1.02806e+00 -1.82535e+00 -4.31273e-01 + H 2.98306e-01 -2.29676e+00 -2.01974e+00 + H 2.18604e-02 -7.16337e-01 5.04750e-01 +3 +# CELL(abcABC): 25.29166 25.29166 25.29166 90.00000 90.00000 90.00000 Step: 100 Bead: 0 x_centroid{atomic_unit} cell{atomic_unit} + O 1.05015e+00 -1.81115e+00 -4.51024e-01 + H 5.14127e-02 -2.35120e+00 -1.77831e+00 + H -8.18111e-02 -8.87253e-01 5.76822e-01 diff --git a/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/test_settings.dat b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/test_settings.dat new file mode 100644 index 000000000..be0a0f064 --- /dev/null +++ b/ipi_tests/regression_tests/tests/PLUMED/METAD.NOAUTO/test_settings.dat @@ -0,0 +1,4 @@ +driver_model pswater +address localhost +port 32342 +socket_mode unix diff --git a/ipi_tests/test_tools.py b/ipi_tests/test_tools.py index 0dc980276..b4f4dff35 100644 --- a/ipi_tests/test_tools.py +++ b/ipi_tests/test_tools.py @@ -44,12 +44,14 @@ ] -def get_test_list(parent): +def get_test_list(parent, skip_noauto=True): """This function recursively searches for test""" folders = [x[0] for x in os.walk(parent)] reg_tests = list() for ff in folders: + if skip_noauto and ff[-7:].lower() == ".noauto": + continue if os.path.isfile(Path(ff) / "input.xml"): reg_tests.append(ff)