hillclimber 0.1.6__cp313-cp313-macosx_15_0_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hillclimber/__init__.py +41 -0
- hillclimber/actions.py +53 -0
- hillclimber/analysis.py +590 -0
- hillclimber/biases.py +293 -0
- hillclimber/calc.py +22 -0
- hillclimber/cvs.py +1070 -0
- hillclimber/interfaces.py +133 -0
- hillclimber/metadynamics.py +416 -0
- hillclimber/nodes.py +6 -0
- hillclimber/opes.py +359 -0
- hillclimber/pycv.py +362 -0
- hillclimber/selectors.py +230 -0
- hillclimber/virtual_atoms.py +341 -0
- hillclimber-0.1.6.dist-info/METADATA +325 -0
- hillclimber-0.1.6.dist-info/RECORD +468 -0
- hillclimber-0.1.6.dist-info/WHEEL +6 -0
- hillclimber-0.1.6.dist-info/entry_points.txt +8 -0
- hillclimber-0.1.6.dist-info/licenses/LICENSE +165 -0
- plumed/__init__.py +104 -0
- plumed/_lib/bin/plumed +0 -0
- plumed/_lib/bin/plumed-config +9 -0
- plumed/_lib/bin/plumed-patch +9 -0
- plumed/_lib/include/plumed/adjmat/AdjacencyMatrixBase.h +659 -0
- plumed/_lib/include/plumed/adjmat/ContactMatrix.h +59 -0
- plumed/_lib/include/plumed/asmjit/arch.h +228 -0
- plumed/_lib/include/plumed/asmjit/arm.h +43 -0
- plumed/_lib/include/plumed/asmjit/asmjit.h +69 -0
- plumed/_lib/include/plumed/asmjit/asmjit_apibegin.h +143 -0
- plumed/_lib/include/plumed/asmjit/asmjit_apiend.h +93 -0
- plumed/_lib/include/plumed/asmjit/asmjit_build.h +971 -0
- plumed/_lib/include/plumed/asmjit/assembler.h +183 -0
- plumed/_lib/include/plumed/asmjit/base.h +56 -0
- plumed/_lib/include/plumed/asmjit/codebuilder.h +944 -0
- plumed/_lib/include/plumed/asmjit/codecompiler.h +767 -0
- plumed/_lib/include/plumed/asmjit/codeemitter.h +528 -0
- plumed/_lib/include/plumed/asmjit/codeholder.h +777 -0
- plumed/_lib/include/plumed/asmjit/constpool.h +286 -0
- plumed/_lib/include/plumed/asmjit/cpuinfo.h +402 -0
- plumed/_lib/include/plumed/asmjit/func.h +1327 -0
- plumed/_lib/include/plumed/asmjit/globals.h +370 -0
- plumed/_lib/include/plumed/asmjit/inst.h +137 -0
- plumed/_lib/include/plumed/asmjit/logging.h +317 -0
- plumed/_lib/include/plumed/asmjit/misc_p.h +103 -0
- plumed/_lib/include/plumed/asmjit/moved_string.h +318 -0
- plumed/_lib/include/plumed/asmjit/operand.h +1599 -0
- plumed/_lib/include/plumed/asmjit/osutils.h +207 -0
- plumed/_lib/include/plumed/asmjit/regalloc_p.h +597 -0
- plumed/_lib/include/plumed/asmjit/runtime.h +227 -0
- plumed/_lib/include/plumed/asmjit/simdtypes.h +1104 -0
- plumed/_lib/include/plumed/asmjit/utils.h +1387 -0
- plumed/_lib/include/plumed/asmjit/vmem.h +183 -0
- plumed/_lib/include/plumed/asmjit/x86.h +45 -0
- plumed/_lib/include/plumed/asmjit/x86assembler.h +125 -0
- plumed/_lib/include/plumed/asmjit/x86builder.h +117 -0
- plumed/_lib/include/plumed/asmjit/x86compiler.h +322 -0
- plumed/_lib/include/plumed/asmjit/x86emitter.h +5149 -0
- plumed/_lib/include/plumed/asmjit/x86globals.h +535 -0
- plumed/_lib/include/plumed/asmjit/x86inst.h +2547 -0
- plumed/_lib/include/plumed/asmjit/x86instimpl_p.h +74 -0
- plumed/_lib/include/plumed/asmjit/x86internal_p.h +108 -0
- plumed/_lib/include/plumed/asmjit/x86logging_p.h +92 -0
- plumed/_lib/include/plumed/asmjit/x86misc.h +417 -0
- plumed/_lib/include/plumed/asmjit/x86operand.h +1133 -0
- plumed/_lib/include/plumed/asmjit/x86regalloc_p.h +734 -0
- plumed/_lib/include/plumed/asmjit/zone.h +1157 -0
- plumed/_lib/include/plumed/bias/Bias.h +82 -0
- plumed/_lib/include/plumed/bias/ReweightBase.h +58 -0
- plumed/_lib/include/plumed/blas/blas.h +253 -0
- plumed/_lib/include/plumed/blas/def_external.h +61 -0
- plumed/_lib/include/plumed/blas/def_internal.h +97 -0
- plumed/_lib/include/plumed/blas/real.h +49 -0
- plumed/_lib/include/plumed/cltools/CLTool.h +32 -0
- plumed/_lib/include/plumed/clusters/ClusteringBase.h +70 -0
- plumed/_lib/include/plumed/colvar/Colvar.h +32 -0
- plumed/_lib/include/plumed/colvar/ColvarInput.h +68 -0
- plumed/_lib/include/plumed/colvar/ColvarShortcut.h +81 -0
- plumed/_lib/include/plumed/colvar/CoordinationBase.h +52 -0
- plumed/_lib/include/plumed/colvar/MultiColvarTemplate.h +333 -0
- plumed/_lib/include/plumed/colvar/PathMSDBase.h +101 -0
- plumed/_lib/include/plumed/colvar/RMSDVector.h +78 -0
- plumed/_lib/include/plumed/config/Config.h +118 -0
- plumed/_lib/include/plumed/config/version.h +9 -0
- plumed/_lib/include/plumed/contour/ContourFindingObject.h +87 -0
- plumed/_lib/include/plumed/contour/DistanceFromContourBase.h +82 -0
- plumed/_lib/include/plumed/contour/FindContour.h +67 -0
- plumed/_lib/include/plumed/core/Action.h +540 -0
- plumed/_lib/include/plumed/core/ActionAnyorder.h +48 -0
- plumed/_lib/include/plumed/core/ActionAtomistic.h +343 -0
- plumed/_lib/include/plumed/core/ActionForInterface.h +99 -0
- plumed/_lib/include/plumed/core/ActionPilot.h +57 -0
- plumed/_lib/include/plumed/core/ActionRegister.h +124 -0
- plumed/_lib/include/plumed/core/ActionSet.h +163 -0
- plumed/_lib/include/plumed/core/ActionSetup.h +48 -0
- plumed/_lib/include/plumed/core/ActionShortcut.h +73 -0
- plumed/_lib/include/plumed/core/ActionToGetData.h +59 -0
- plumed/_lib/include/plumed/core/ActionToPutData.h +101 -0
- plumed/_lib/include/plumed/core/ActionWithArguments.h +140 -0
- plumed/_lib/include/plumed/core/ActionWithMatrix.h +87 -0
- plumed/_lib/include/plumed/core/ActionWithValue.h +258 -0
- plumed/_lib/include/plumed/core/ActionWithVector.h +94 -0
- plumed/_lib/include/plumed/core/ActionWithVirtualAtom.h +123 -0
- plumed/_lib/include/plumed/core/CLTool.h +177 -0
- plumed/_lib/include/plumed/core/CLToolMain.h +102 -0
- plumed/_lib/include/plumed/core/CLToolRegister.h +108 -0
- plumed/_lib/include/plumed/core/Colvar.h +115 -0
- plumed/_lib/include/plumed/core/DataPassingObject.h +94 -0
- plumed/_lib/include/plumed/core/DataPassingTools.h +54 -0
- plumed/_lib/include/plumed/core/DomainDecomposition.h +120 -0
- plumed/_lib/include/plumed/core/ExchangePatterns.h +47 -0
- plumed/_lib/include/plumed/core/FlexibleBin.h +63 -0
- plumed/_lib/include/plumed/core/GREX.h +61 -0
- plumed/_lib/include/plumed/core/GenericMolInfo.h +89 -0
- plumed/_lib/include/plumed/core/Group.h +41 -0
- plumed/_lib/include/plumed/core/ModuleMap.h +30 -0
- plumed/_lib/include/plumed/core/ParallelTaskManager.h +1023 -0
- plumed/_lib/include/plumed/core/PbcAction.h +61 -0
- plumed/_lib/include/plumed/core/PlumedMain.h +632 -0
- plumed/_lib/include/plumed/core/PlumedMainInitializer.h +118 -0
- plumed/_lib/include/plumed/core/RegisterBase.h +340 -0
- plumed/_lib/include/plumed/core/TargetDist.h +48 -0
- plumed/_lib/include/plumed/core/Value.h +547 -0
- plumed/_lib/include/plumed/core/WithCmd.h +93 -0
- plumed/_lib/include/plumed/dimred/SMACOF.h +55 -0
- plumed/_lib/include/plumed/drr/DRR.h +383 -0
- plumed/_lib/include/plumed/drr/colvar_UIestimator.h +777 -0
- plumed/_lib/include/plumed/fisst/legendre_rule_fast.h +44 -0
- plumed/_lib/include/plumed/function/Custom.h +54 -0
- plumed/_lib/include/plumed/function/Function.h +85 -0
- plumed/_lib/include/plumed/function/FunctionOfMatrix.h +368 -0
- plumed/_lib/include/plumed/function/FunctionOfScalar.h +135 -0
- plumed/_lib/include/plumed/function/FunctionOfVector.h +296 -0
- plumed/_lib/include/plumed/function/FunctionSetup.h +180 -0
- plumed/_lib/include/plumed/function/FunctionShortcut.h +130 -0
- plumed/_lib/include/plumed/function/FunctionWithSingleArgument.h +165 -0
- plumed/_lib/include/plumed/gridtools/ActionWithGrid.h +43 -0
- plumed/_lib/include/plumed/gridtools/EvaluateGridFunction.h +99 -0
- plumed/_lib/include/plumed/gridtools/FunctionOfGrid.h +295 -0
- plumed/_lib/include/plumed/gridtools/GridCoordinatesObject.h +179 -0
- plumed/_lib/include/plumed/gridtools/GridSearch.h +135 -0
- plumed/_lib/include/plumed/gridtools/Interpolator.h +45 -0
- plumed/_lib/include/plumed/gridtools/KDE.h +455 -0
- plumed/_lib/include/plumed/gridtools/RDF.h +40 -0
- plumed/_lib/include/plumed/gridtools/SumOfKernels.h +219 -0
- plumed/_lib/include/plumed/isdb/MetainferenceBase.h +398 -0
- plumed/_lib/include/plumed/lapack/def_external.h +207 -0
- plumed/_lib/include/plumed/lapack/def_internal.h +388 -0
- plumed/_lib/include/plumed/lapack/lapack.h +899 -0
- plumed/_lib/include/plumed/lapack/lapack_limits.h +79 -0
- plumed/_lib/include/plumed/lapack/real.h +50 -0
- plumed/_lib/include/plumed/lepton/CompiledExpression.h +164 -0
- plumed/_lib/include/plumed/lepton/CustomFunction.h +143 -0
- plumed/_lib/include/plumed/lepton/Exception.h +93 -0
- plumed/_lib/include/plumed/lepton/ExpressionProgram.h +137 -0
- plumed/_lib/include/plumed/lepton/ExpressionTreeNode.h +145 -0
- plumed/_lib/include/plumed/lepton/Lepton.h +85 -0
- plumed/_lib/include/plumed/lepton/MSVC_erfc.h +123 -0
- plumed/_lib/include/plumed/lepton/Operation.h +1302 -0
- plumed/_lib/include/plumed/lepton/ParsedExpression.h +165 -0
- plumed/_lib/include/plumed/lepton/Parser.h +111 -0
- plumed/_lib/include/plumed/lepton/windowsIncludes.h +73 -0
- plumed/_lib/include/plumed/mapping/Path.h +44 -0
- plumed/_lib/include/plumed/mapping/PathProjectionCalculator.h +57 -0
- plumed/_lib/include/plumed/matrixtools/MatrixOperationBase.h +54 -0
- plumed/_lib/include/plumed/matrixtools/MatrixTimesMatrix.h +309 -0
- plumed/_lib/include/plumed/matrixtools/MatrixTimesVectorBase.h +365 -0
- plumed/_lib/include/plumed/matrixtools/OuterProduct.h +238 -0
- plumed/_lib/include/plumed/maze/Core.h +65 -0
- plumed/_lib/include/plumed/maze/Loss.h +86 -0
- plumed/_lib/include/plumed/maze/Member.h +66 -0
- plumed/_lib/include/plumed/maze/Memetic.h +799 -0
- plumed/_lib/include/plumed/maze/Optimizer.h +357 -0
- plumed/_lib/include/plumed/maze/Random_MT.h +156 -0
- plumed/_lib/include/plumed/maze/Tools.h +183 -0
- plumed/_lib/include/plumed/metatomic/vesin.h +188 -0
- plumed/_lib/include/plumed/molfile/Gromacs.h +2013 -0
- plumed/_lib/include/plumed/molfile/endianswap.h +217 -0
- plumed/_lib/include/plumed/molfile/fastio.h +683 -0
- plumed/_lib/include/plumed/molfile/largefiles.h +78 -0
- plumed/_lib/include/plumed/molfile/libmolfile_plugin.h +77 -0
- plumed/_lib/include/plumed/molfile/molfile_plugin.h +1034 -0
- plumed/_lib/include/plumed/molfile/periodic_table.h +248 -0
- plumed/_lib/include/plumed/molfile/readpdb.h +447 -0
- plumed/_lib/include/plumed/molfile/vmdplugin.h +236 -0
- plumed/_lib/include/plumed/multicolvar/MultiColvarShortcuts.h +45 -0
- plumed/_lib/include/plumed/opes/ExpansionCVs.h +79 -0
- plumed/_lib/include/plumed/sasa/Sasa.h +32 -0
- plumed/_lib/include/plumed/secondarystructure/SecondaryStructureBase.h +372 -0
- plumed/_lib/include/plumed/setup/ActionSetup.h +25 -0
- plumed/_lib/include/plumed/small_vector/small_vector.h +6114 -0
- plumed/_lib/include/plumed/symfunc/CoordinationNumbers.h +41 -0
- plumed/_lib/include/plumed/tools/Angle.h +52 -0
- plumed/_lib/include/plumed/tools/AtomDistribution.h +138 -0
- plumed/_lib/include/plumed/tools/AtomNumber.h +152 -0
- plumed/_lib/include/plumed/tools/BiasRepresentation.h +106 -0
- plumed/_lib/include/plumed/tools/BitmaskEnum.h +167 -0
- plumed/_lib/include/plumed/tools/Brent1DRootSearch.h +159 -0
- plumed/_lib/include/plumed/tools/CheckInRange.h +44 -0
- plumed/_lib/include/plumed/tools/Citations.h +74 -0
- plumed/_lib/include/plumed/tools/ColvarOutput.h +118 -0
- plumed/_lib/include/plumed/tools/Communicator.h +316 -0
- plumed/_lib/include/plumed/tools/ConjugateGradient.h +80 -0
- plumed/_lib/include/plumed/tools/DLLoader.h +79 -0
- plumed/_lib/include/plumed/tools/ERMSD.h +73 -0
- plumed/_lib/include/plumed/tools/Exception.h +406 -0
- plumed/_lib/include/plumed/tools/File.h +28 -0
- plumed/_lib/include/plumed/tools/FileBase.h +153 -0
- plumed/_lib/include/plumed/tools/FileTools.h +37 -0
- plumed/_lib/include/plumed/tools/ForwardDecl.h +54 -0
- plumed/_lib/include/plumed/tools/Grid.h +638 -0
- plumed/_lib/include/plumed/tools/HistogramBead.h +136 -0
- plumed/_lib/include/plumed/tools/IFile.h +117 -0
- plumed/_lib/include/plumed/tools/KernelFunctions.h +113 -0
- plumed/_lib/include/plumed/tools/Keywords.h +380 -0
- plumed/_lib/include/plumed/tools/LatticeReduction.h +66 -0
- plumed/_lib/include/plumed/tools/LeptonCall.h +64 -0
- plumed/_lib/include/plumed/tools/LinkCells.h +126 -0
- plumed/_lib/include/plumed/tools/Log.h +41 -0
- plumed/_lib/include/plumed/tools/LoopUnroller.h +163 -0
- plumed/_lib/include/plumed/tools/Matrix.h +721 -0
- plumed/_lib/include/plumed/tools/MatrixSquareBracketsAccess.h +138 -0
- plumed/_lib/include/plumed/tools/MergeVectorTools.h +153 -0
- plumed/_lib/include/plumed/tools/Minimise1DBrent.h +244 -0
- plumed/_lib/include/plumed/tools/MinimiseBase.h +120 -0
- plumed/_lib/include/plumed/tools/MolDataClass.h +51 -0
- plumed/_lib/include/plumed/tools/NeighborList.h +112 -0
- plumed/_lib/include/plumed/tools/OFile.h +286 -0
- plumed/_lib/include/plumed/tools/OpenACC.h +180 -0
- plumed/_lib/include/plumed/tools/OpenMP.h +75 -0
- plumed/_lib/include/plumed/tools/PDB.h +154 -0
- plumed/_lib/include/plumed/tools/Pbc.h +139 -0
- plumed/_lib/include/plumed/tools/PlumedHandle.h +105 -0
- plumed/_lib/include/plumed/tools/RMSD.h +493 -0
- plumed/_lib/include/plumed/tools/Random.h +80 -0
- plumed/_lib/include/plumed/tools/RootFindingBase.h +79 -0
- plumed/_lib/include/plumed/tools/Stopwatch.h +475 -0
- plumed/_lib/include/plumed/tools/Subprocess.h +142 -0
- plumed/_lib/include/plumed/tools/SwitchingFunction.h +208 -0
- plumed/_lib/include/plumed/tools/Tensor.h +724 -0
- plumed/_lib/include/plumed/tools/TokenizedLine.h +123 -0
- plumed/_lib/include/plumed/tools/Tools.h +638 -0
- plumed/_lib/include/plumed/tools/Torsion.h +55 -0
- plumed/_lib/include/plumed/tools/TrajectoryParser.h +118 -0
- plumed/_lib/include/plumed/tools/Tree.h +61 -0
- plumed/_lib/include/plumed/tools/TypesafePtr.h +463 -0
- plumed/_lib/include/plumed/tools/Units.h +167 -0
- plumed/_lib/include/plumed/tools/Vector.h +433 -0
- plumed/_lib/include/plumed/tools/View.h +296 -0
- plumed/_lib/include/plumed/tools/View2D.h +100 -0
- plumed/_lib/include/plumed/tools/h36.h +39 -0
- plumed/_lib/include/plumed/vatom/ActionWithVirtualAtom.h +32 -0
- plumed/_lib/include/plumed/ves/BasisFunctions.h +380 -0
- plumed/_lib/include/plumed/ves/CoeffsBase.h +310 -0
- plumed/_lib/include/plumed/ves/CoeffsMatrix.h +220 -0
- plumed/_lib/include/plumed/ves/CoeffsVector.h +251 -0
- plumed/_lib/include/plumed/ves/FermiSwitchingFunction.h +74 -0
- plumed/_lib/include/plumed/ves/GridIntegrationWeights.h +50 -0
- plumed/_lib/include/plumed/ves/GridLinearInterpolation.h +81 -0
- plumed/_lib/include/plumed/ves/GridProjWeights.h +61 -0
- plumed/_lib/include/plumed/ves/LinearBasisSetExpansion.h +303 -0
- plumed/_lib/include/plumed/ves/Optimizer.h +444 -0
- plumed/_lib/include/plumed/ves/TargetDistModifer.h +53 -0
- plumed/_lib/include/plumed/ves/TargetDistribution.h +266 -0
- plumed/_lib/include/plumed/ves/VesBias.h +545 -0
- plumed/_lib/include/plumed/ves/VesTools.h +142 -0
- plumed/_lib/include/plumed/ves/WaveletGrid.h +75 -0
- plumed/_lib/include/plumed/volumes/ActionVolume.h +268 -0
- plumed/_lib/include/plumed/volumes/VolumeShortcut.h +147 -0
- plumed/_lib/include/plumed/wrapper/Plumed.h +5025 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile.h +663 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile_trr.h +89 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile_xtc.h +90 -0
- plumed/_lib/lib/PythonCVInterface.dylib +0 -0
- plumed/_lib/lib/libplumed.dylib +0 -0
- plumed/_lib/lib/libplumedKernel.dylib +0 -0
- plumed/_lib/lib/libplumedWrapper.a +0 -0
- plumed/_lib/lib/pkgconfig/plumed.pc +13 -0
- plumed/_lib/lib/pkgconfig/plumedInternals.pc +13 -0
- plumed/_lib/lib/pkgconfig/plumedWrapper.pc +13 -0
- plumed/_lib/lib/plumed/fortran/plumed.f90 +879 -0
- plumed/_lib/lib/plumed/fortran/plumed_f08.f90 +2625 -0
- plumed/_lib/lib/plumed/modulefile +69 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt +543 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt.preplumed +540 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp +1628 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1590 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h +103 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h.preplumed +99 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp +2527 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +408 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +394 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp +2348 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2091 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp +3573 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3495 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1506 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1402 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp +997 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +906 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp +2780 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2738 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt +549 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt.preplumed +546 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h +104 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp +2624 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2610 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +395 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp +2419 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2164 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp +3546 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3468 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp +991 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +900 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp +2895 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2849 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp +886 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +880 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +347 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +345 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt +575 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt.preplumed +572 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h +104 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp +2564 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2550 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h +410 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +396 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp +2435 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp.preplumed +2187 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp +3592 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3514 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp +958 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp.preplumed +929 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp +2987 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp.preplumed +2941 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp +904 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +898 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +353 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +351 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.config +39 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake +82 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake.preplumed +82 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp +162 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp.preplumed +154 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp +107 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp.preplumed +99 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h +120 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h.preplumed +111 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp +215 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp.preplumed +197 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h +87 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h.preplumed +86 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp +2971 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp.preplumed +2970 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h +430 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h.preplumed +429 -0
- plumed/_lib/lib/plumed/patches/namd-2.12.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.12.diff +267 -0
- plumed/_lib/lib/plumed/patches/namd-2.13.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.13.diff +267 -0
- plumed/_lib/lib/plumed/patches/namd-2.14.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.14.diff +268 -0
- plumed/_lib/lib/plumed/patches/patch.sh +500 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.config +25 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90 +368 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90.preplumed +366 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90 +71 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90.preplumed +24 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90 +62 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90 +189 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90.preplumed +185 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.config +26 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90 +422 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90.preplumed +420 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90 +70 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90 +62 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90 +233 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90.preplumed +230 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.config +28 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile +175 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile.preplumed +171 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90 +486 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90.preplumed +484 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90 +74 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90 +64 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90 +532 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90.preplumed +518 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.config +28 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile +249 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile.preplumed +244 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90 +532 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90.preplumed +535 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90 +74 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90 +64 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90 +569 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90.preplumed +560 -0
- plumed/_lib/lib/plumed/plumed-config +9 -0
- plumed/_lib/lib/plumed/plumed-mklib +9 -0
- plumed/_lib/lib/plumed/plumed-newcv +9 -0
- plumed/_lib/lib/plumed/plumed-partial_tempering +9 -0
- plumed/_lib/lib/plumed/plumed-patch +9 -0
- plumed/_lib/lib/plumed/plumed-runtime +0 -0
- plumed/_lib/lib/plumed/plumed-selector +9 -0
- plumed/_lib/lib/plumed/plumed-vim2html +9 -0
- plumed/_lib/lib/plumed/scripts/config.sh +126 -0
- plumed/_lib/lib/plumed/scripts/mklib.sh +175 -0
- plumed/_lib/lib/plumed/scripts/newcv.sh +26 -0
- plumed/_lib/lib/plumed/scripts/partial_tempering.sh +319 -0
- plumed/_lib/lib/plumed/scripts/patch.sh +4 -0
- plumed/_lib/lib/plumed/scripts/selector.sh +234 -0
- plumed/_lib/lib/plumed/scripts/vim2html.sh +190 -0
- plumed/_lib/lib/plumed/src/colvar/Template.cpp +116 -0
- plumed/_lib/lib/plumed/src/config/compile_options.sh +3 -0
- plumed/_lib/lib/plumed/src/config/config.txt +181 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake +6 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.runtime +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.shared +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.static +3 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc +6 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.runtime +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.shared +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.static +3 -0
- plumed/_lib/lib/plumed/vim/scripts.vim +6 -0
- plumed/_plumed_core.cpython-311-darwin.so +0 -0
- plumed/_plumed_core.cpython-312-darwin.so +0 -0
- plumed/_plumed_core.cpython-313-darwin.so +0 -0
- plumedCommunications.cpython-311-darwin.so +0 -0
- plumedCommunications.cpython-312-darwin.so +0 -0
- plumedCommunications.cpython-313-darwin.so +0 -0
- plumedCommunications.pyi +431 -0
|
@@ -0,0 +1,777 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2017 of Haochuan Chen (excluding colvar_UIestimator.h)
|
|
3
|
+
Copyright (c) 2017 of Haohao Fu (colvar_UIestimator.h)
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Lesser General Public License as published
|
|
7
|
+
by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Lesser General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Lesser General Public License
|
|
16
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
|
|
18
|
+
#ifndef __PLUMED_drr_colvar_UIestimator_h
|
|
19
|
+
#define __PLUMED_drr_colvar_UIestimator_h
|
|
20
|
+
// The original code(https://github.com/fhh2626/colvars/blob/master/src/colvar_UIestimator.h) has been modified by Haochuan Chen.
|
|
21
|
+
// Modifications:
|
|
22
|
+
// 1. Disable colvars related code.
|
|
23
|
+
// 2. Change boltzmann constant.
|
|
24
|
+
// 3. Change output precision.
|
|
25
|
+
// I(Haochuan Chen) don't know how to maintain this code and how it runs. If you are interested in it, please contact Haohao Fu.
|
|
26
|
+
|
|
27
|
+
#include <cmath>
|
|
28
|
+
#include <vector>
|
|
29
|
+
#include <fstream>
|
|
30
|
+
#include <string>
|
|
31
|
+
#include <iomanip>
|
|
32
|
+
#include <limits>
|
|
33
|
+
|
|
34
|
+
#include <typeinfo>
|
|
35
|
+
|
|
36
|
+
// only for colvar module!
|
|
37
|
+
// when integrated into other code, just remove this line and "...cvm::backup_file(...)"
|
|
38
|
+
// #include "colvarmodule.h"
|
|
39
|
+
|
|
40
|
+
namespace PLMD {
|
|
41
|
+
namespace drr {
|
|
42
|
+
|
|
43
|
+
namespace UIestimator {
|
|
44
|
+
const int Y_SIZE = 21;
|
|
45
|
+
const int HALF_Y_SIZE = 10;
|
|
46
|
+
const double BOLTZMANN = 0.0083144621;
|
|
47
|
+
const int EXTENDED_X_SIZE = HALF_Y_SIZE;
|
|
48
|
+
|
|
49
|
+
class n_matrix { // spare matrix, stores the distribution matrix of n(x,y)
|
|
50
|
+
public:
|
|
51
|
+
n_matrix() {}
|
|
52
|
+
n_matrix(const std::vector<double> & lowerboundary_p, // lowerboundary of x
|
|
53
|
+
const std::vector<double> & upperboundary_p, // upperboundary of
|
|
54
|
+
const std::vector<double> & width_p, // width of x
|
|
55
|
+
const int y_size) // size of y, for example, ysize=7, then when x=1, the distribution of y in [-2,4] is considered
|
|
56
|
+
: lowerboundary(lowerboundary_p), upperboundary(upperboundary_p), width(width_p) {
|
|
57
|
+
this->dimension = lowerboundary.size();
|
|
58
|
+
this->y_size = y_size; // keep in mind the internal (spare) matrix is stored in diagonal form
|
|
59
|
+
this->y_total_size = int(pow(y_size, dimension) + 0.000001);
|
|
60
|
+
|
|
61
|
+
// the range of the matrix is [lowerboundary, upperboundary]
|
|
62
|
+
x_total_size = 1;
|
|
63
|
+
for (int i = 0; i < dimension; i++) {
|
|
64
|
+
x_size.push_back(int((upperboundary[i] - lowerboundary[i]) / width[i] + 0.000001));
|
|
65
|
+
x_total_size *= x_size[i];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// initialize the internal matrix
|
|
69
|
+
matrix.reserve(x_total_size);
|
|
70
|
+
for (int i = 0; i < x_total_size; i++) {
|
|
71
|
+
matrix.push_back(std::vector<int>(y_total_size, 0));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
temp.resize(dimension);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
int inline get_value(const std::vector<double> & x, const std::vector<double> & y) {
|
|
78
|
+
//if (matrix[convert_x(x)][convert_y(x, y)]!=0)
|
|
79
|
+
//{
|
|
80
|
+
//std::cout<<convert_x(x)<<" "<<convert_y(x, y)<<" "<<x[0]<<" "<<x[1]<<" "<<y[0]<<" "<<y[1]<<" ";
|
|
81
|
+
//std::cout<<matrix[convert_x(x)][convert_y(x, y)]<<"sadasfdasaaaaaaaa"<<std::endl;
|
|
82
|
+
//}
|
|
83
|
+
return matrix[convert_x(x)][convert_y(x, y)];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
void inline set_value(const std::vector<double> & x, const std::vector<double> & y, const int value) {
|
|
87
|
+
matrix[convert_x(x)][convert_y(x,y)] = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
void inline increase_value(const std::vector<double> & x, const std::vector<double> & y, const int value) {
|
|
91
|
+
matrix[convert_x(x)][convert_y(x,y)] += value;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private:
|
|
95
|
+
std::vector<double> lowerboundary;
|
|
96
|
+
std::vector<double> upperboundary;
|
|
97
|
+
std::vector<double> width;
|
|
98
|
+
int dimension;
|
|
99
|
+
std::vector<int> x_size; // the size of x in each dimension
|
|
100
|
+
int x_total_size; // the size of x of the internal matrix
|
|
101
|
+
int y_size; // the size of y in each dimension
|
|
102
|
+
int y_total_size; // the size of y of the internal matrix
|
|
103
|
+
|
|
104
|
+
std::vector<std::vector<int> > matrix; // the internal matrix
|
|
105
|
+
|
|
106
|
+
std::vector<int> temp; // this vector is used in convert_x and convert_y to save computational resource
|
|
107
|
+
|
|
108
|
+
int convert_x(const std::vector<double> & x) { // convert real x value to its interal index
|
|
109
|
+
for (int i = 0; i < dimension; i++) {
|
|
110
|
+
temp[i] = int((x[i] - lowerboundary[i]) / width[i] + 0.000001);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
int index = 0;
|
|
114
|
+
for (int i = 0; i < dimension; i++) {
|
|
115
|
+
if (i + 1 < dimension) {
|
|
116
|
+
int x_temp = 1;
|
|
117
|
+
for (int j = i + 1; j < dimension; j++) {
|
|
118
|
+
x_temp *= x_size[j];
|
|
119
|
+
}
|
|
120
|
+
index += temp[i] * x_temp;
|
|
121
|
+
} else {
|
|
122
|
+
index += temp[i];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return index;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
int convert_y(const std::vector<double> & x, const std::vector<double> & y) { // convert real y value to its interal index
|
|
129
|
+
for (int i = 0; i < dimension; i++) {
|
|
130
|
+
temp[i] = round((round(y[i] / width[i] + 0.000001) - round(x[i] / width[i] + 0.000001)) + (y_size - 1) / 2 + 0.000001);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
int index = 0;
|
|
134
|
+
for (int i = 0; i < dimension; i++) {
|
|
135
|
+
if (i + 1 < dimension) {
|
|
136
|
+
index += temp[i] * int(pow(y_size, dimension - i - 1) + 0.000001);
|
|
137
|
+
} else {
|
|
138
|
+
index += temp[i];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return index;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
double round(double r) {
|
|
145
|
+
return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// vector, store the sum_x, sum_x_square, count_y
|
|
150
|
+
template <typename T>
|
|
151
|
+
class n_vector {
|
|
152
|
+
public:
|
|
153
|
+
n_vector() {}
|
|
154
|
+
n_vector(const std::vector<double> & lowerboundary, // lowerboundary of x
|
|
155
|
+
const std::vector<double> & upperboundary, // upperboundary of
|
|
156
|
+
const std::vector<double> & width_p, // width of x
|
|
157
|
+
const int y_size, // size of y, for example, ysize=7, then when x=1, the distribution of y in [-2,4] is considered
|
|
158
|
+
const T & default_value) // the default value of T
|
|
159
|
+
:width(width_p) {
|
|
160
|
+
this->dimension = lowerboundary.size();
|
|
161
|
+
|
|
162
|
+
x_total_size = 1;
|
|
163
|
+
for (int i = 0; i < dimension; i++) {
|
|
164
|
+
this->lowerboundary.push_back(lowerboundary[i] - (y_size - 1) / 2 * width[i] - 0.000001);
|
|
165
|
+
this->upperboundary.push_back(upperboundary[i] + (y_size - 1) / 2 * width[i] + 0.000001);
|
|
166
|
+
|
|
167
|
+
x_size.push_back(int((this->upperboundary[i] - this->lowerboundary[i]) / this->width[i] + 0.000001));
|
|
168
|
+
x_total_size *= x_size[i];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// initialize the internal vector
|
|
172
|
+
vector.resize(x_total_size, default_value);
|
|
173
|
+
|
|
174
|
+
temp.resize(dimension);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
T inline get_value(const std::vector<double> & x) {
|
|
178
|
+
return vector[convert_x(x)];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
void inline set_value(const std::vector<double> & x, const T & value) {
|
|
182
|
+
vector[convert_x(x)] = value;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
void inline increase_value(const std::vector<double> & x, const T & value) {
|
|
186
|
+
vector[convert_x(x)] += value;
|
|
187
|
+
}
|
|
188
|
+
private:
|
|
189
|
+
std::vector<double> lowerboundary;
|
|
190
|
+
std::vector<double> upperboundary;
|
|
191
|
+
std::vector<double> width;
|
|
192
|
+
int dimension;
|
|
193
|
+
std::vector<int> x_size; // the size of x in each dimension
|
|
194
|
+
int x_total_size; // the size of x of the internal matrix
|
|
195
|
+
|
|
196
|
+
std::vector<T> vector; // the internal vector
|
|
197
|
+
|
|
198
|
+
std::vector<int> temp; // this vector is used in convert_x and convert_y to save computational resource
|
|
199
|
+
|
|
200
|
+
int convert_x(const std::vector<double> & x) { // convert real x value to its interal index
|
|
201
|
+
for (int i = 0; i < dimension; i++) {
|
|
202
|
+
temp[i] = int((x[i] - lowerboundary[i]) / width[i] + 0.000001);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
int index = 0;
|
|
206
|
+
for (int i = 0; i < dimension; i++) {
|
|
207
|
+
if (i + 1 < dimension) {
|
|
208
|
+
int x_temp = 1;
|
|
209
|
+
for (int j = i + 1; j < dimension; j++) {
|
|
210
|
+
x_temp *= x_size[j];
|
|
211
|
+
}
|
|
212
|
+
index += temp[i] * x_temp;
|
|
213
|
+
} else {
|
|
214
|
+
index += temp[i];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return index;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
class UIestimator { // the implemension of UI estimator
|
|
222
|
+
public:
|
|
223
|
+
UIestimator() {}
|
|
224
|
+
|
|
225
|
+
//called when (re)start an eabf simulation
|
|
226
|
+
UIestimator(const std::vector<double>& lowerboundary_p,
|
|
227
|
+
const std::vector<double>& upperboundary_p,
|
|
228
|
+
const std::vector<double>& width_p,
|
|
229
|
+
const std::vector<double>& krestr_p, // force constant in eABF
|
|
230
|
+
const std::string& output_filename_p, // the prefix of output files
|
|
231
|
+
const int output_freq_p,
|
|
232
|
+
const bool restart_p, // whether restart from a .count and a .grad file
|
|
233
|
+
const std::vector<std::string>& input_filename_p, // the prefixes of input files
|
|
234
|
+
const double temperature_p)
|
|
235
|
+
: lowerboundary(lowerboundary_p), upperboundary(upperboundary_p),
|
|
236
|
+
width(width_p), krestr(krestr_p),
|
|
237
|
+
output_filename(output_filename_p), output_freq(output_freq_p),
|
|
238
|
+
restart(restart_p), input_filename(input_filename_p),
|
|
239
|
+
temperature(temperature_p) {
|
|
240
|
+
|
|
241
|
+
dimension = lowerboundary.size();
|
|
242
|
+
|
|
243
|
+
for (int i = 0; i < dimension; i++) {
|
|
244
|
+
sum_x.push_back(n_vector<double>(lowerboundary, upperboundary, width, Y_SIZE, 0.0));
|
|
245
|
+
sum_x_square.push_back(n_vector<double>(lowerboundary, upperboundary, width, Y_SIZE, 0.0));
|
|
246
|
+
|
|
247
|
+
x_av.push_back(n_vector<double>(lowerboundary, upperboundary, width, Y_SIZE, 0.0));
|
|
248
|
+
sigma_square.push_back(n_vector<double>(lowerboundary, upperboundary, width, Y_SIZE, 0.0));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
count_y = n_vector<int>(lowerboundary, upperboundary, width, Y_SIZE, 0);
|
|
252
|
+
distribution_x_y = n_matrix(lowerboundary, upperboundary, width, Y_SIZE);
|
|
253
|
+
|
|
254
|
+
grad = n_vector<std::vector<double> >(lowerboundary, upperboundary, width, 1, std::vector<double>(dimension, 0.0));
|
|
255
|
+
count = n_vector<int>(lowerboundary, upperboundary, width, 1, 0);
|
|
256
|
+
|
|
257
|
+
written = false;
|
|
258
|
+
written_1D = false;
|
|
259
|
+
|
|
260
|
+
if (dimension == 1) {
|
|
261
|
+
std::vector<double> upperboundary_temp = upperboundary;
|
|
262
|
+
upperboundary_temp[0] = upperboundary[0] + width[0];
|
|
263
|
+
oneD_pmf = n_vector<double>(lowerboundary, upperboundary_temp, width, 1, 0.0);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (restart == true) {
|
|
267
|
+
input_grad = n_vector<std::vector<double> >(lowerboundary, upperboundary, width, 1, std::vector<double>(dimension, 0.0));
|
|
268
|
+
input_count = n_vector<int>(lowerboundary, upperboundary, width, 1, 0);
|
|
269
|
+
|
|
270
|
+
// initialize input_Grad and input_count
|
|
271
|
+
std::vector<double> loop_flag(dimension, 0);
|
|
272
|
+
for (int i = 0; i < dimension; i++) {
|
|
273
|
+
loop_flag[i] = lowerboundary[i];
|
|
274
|
+
}
|
|
275
|
+
while (true) {
|
|
276
|
+
for (int i = 0; i < dimension; i++) {
|
|
277
|
+
input_grad.set_value(loop_flag, std::vector<double>(dimension,0));
|
|
278
|
+
}
|
|
279
|
+
input_count.set_value(loop_flag, 0);
|
|
280
|
+
|
|
281
|
+
// iterate over any dimensions
|
|
282
|
+
int i = dimension - 1;
|
|
283
|
+
while (true) {
|
|
284
|
+
loop_flag[i] += width[i];
|
|
285
|
+
if (loop_flag[i] > upperboundary[i] - width[i] + 0.00001) {
|
|
286
|
+
loop_flag[i] = lowerboundary[i];
|
|
287
|
+
i--;
|
|
288
|
+
if (i < 0) {
|
|
289
|
+
goto INITIAL_LOOPEND;
|
|
290
|
+
}
|
|
291
|
+
} else {
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
INITIAL_LOOPEND:
|
|
297
|
+
read_inputfiles(input_filename);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
~UIestimator() {}
|
|
302
|
+
|
|
303
|
+
// called from MD engine every step
|
|
304
|
+
bool update(const int step, const std::vector<double> & x, std::vector<double> y) {
|
|
305
|
+
|
|
306
|
+
//std::cout<<"weeeee: :"<<std::endl;
|
|
307
|
+
//for (int i = 0; i < dimension; i++)
|
|
308
|
+
//{
|
|
309
|
+
// std::cout<<x[i]<<" "<<y[i]<<" ";
|
|
310
|
+
//}
|
|
311
|
+
//std::cout<<std::endl;
|
|
312
|
+
|
|
313
|
+
if (step % output_freq == 0) {
|
|
314
|
+
calc_pmf();
|
|
315
|
+
write_files();
|
|
316
|
+
//write_interal_data();
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
for (int i = 0; i < dimension; i++) {
|
|
320
|
+
// for dihedral RC, it is possible that x = 179 and y = -179, should correct it
|
|
321
|
+
// may have problem, need to fix
|
|
322
|
+
if (x[i] > 150 && y[i] < -150) {
|
|
323
|
+
//std::vector<double> x_temp(x);
|
|
324
|
+
//x_temp[i] -= 360;
|
|
325
|
+
//update(7, x_temp, y);
|
|
326
|
+
y[i] += 360;
|
|
327
|
+
}
|
|
328
|
+
if (x[i] < -150 && y[i] > 150) {
|
|
329
|
+
//std::vector<double> x_temp(x);
|
|
330
|
+
//x_temp[i] += 360;
|
|
331
|
+
//update(7, x_temp, y);
|
|
332
|
+
y[i] -= 360;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (x[i] < lowerboundary[i] - EXTENDED_X_SIZE * width[i] + 0.00001 || x[i] > upperboundary[i] + EXTENDED_X_SIZE * width[i] - 0.00001 \
|
|
336
|
+
|| y[i] - x[i] < -HALF_Y_SIZE * width[i] + 0.00001 || y[i] - x[i] > HALF_Y_SIZE * width[i] - 0.00001 \
|
|
337
|
+
|| y[i] - lowerboundary[i] < -HALF_Y_SIZE * width[i] + 0.00001 || y[i] - upperboundary[i] > HALF_Y_SIZE * width[i] - 0.00001) {
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
//for (int i = 0; i < dimension; i++)
|
|
343
|
+
//{
|
|
344
|
+
// std::cout<<x[i]<<" "<<y[i]<<" ";
|
|
345
|
+
//}
|
|
346
|
+
//std::cout<<std::endl;
|
|
347
|
+
|
|
348
|
+
for (int i = 0; i < dimension; i++) {
|
|
349
|
+
sum_x[i].increase_value(y, x[i]);
|
|
350
|
+
sum_x_square[i].increase_value(y, x[i] * x[i]);
|
|
351
|
+
}
|
|
352
|
+
count_y.increase_value(y, 1);
|
|
353
|
+
|
|
354
|
+
for (int i = 0; i < dimension; i++) {
|
|
355
|
+
//if (x[i] < lowerboundary[i] + 0.000001 || x[i] > upperboundary[i] - 0.000001)
|
|
356
|
+
// adapt colvars precision
|
|
357
|
+
if (x[i] < lowerboundary[i] + 0.00001 || x[i] > upperboundary[i] - 0.00001) {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
distribution_x_y.increase_value(x, y, 1);
|
|
362
|
+
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// update the output_filename
|
|
367
|
+
void update_output_filename(const std::string& filename) {
|
|
368
|
+
output_filename = filename;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
private:
|
|
372
|
+
std::vector<n_vector<double> > sum_x; // the sum of x in each y bin
|
|
373
|
+
std::vector<n_vector<double> > sum_x_square; // the sum of x in each y bin
|
|
374
|
+
n_vector<int> count_y; // the distribution of y
|
|
375
|
+
n_matrix distribution_x_y; // the distribution of <x, y> pair
|
|
376
|
+
|
|
377
|
+
int dimension;
|
|
378
|
+
|
|
379
|
+
std::vector<double> lowerboundary;
|
|
380
|
+
std::vector<double> upperboundary;
|
|
381
|
+
std::vector<double> width;
|
|
382
|
+
std::vector<double> krestr;
|
|
383
|
+
std::string output_filename;
|
|
384
|
+
int output_freq;
|
|
385
|
+
bool restart;
|
|
386
|
+
std::vector<std::string> input_filename;
|
|
387
|
+
double temperature;
|
|
388
|
+
|
|
389
|
+
n_vector<std::vector<double> > grad;
|
|
390
|
+
n_vector<int> count;
|
|
391
|
+
|
|
392
|
+
n_vector<double> oneD_pmf;
|
|
393
|
+
|
|
394
|
+
n_vector<std::vector<double> > input_grad;
|
|
395
|
+
n_vector<int> input_count;
|
|
396
|
+
|
|
397
|
+
// used in double integration
|
|
398
|
+
std::vector<n_vector<double> > x_av;
|
|
399
|
+
std::vector<n_vector<double> > sigma_square;
|
|
400
|
+
|
|
401
|
+
bool written;
|
|
402
|
+
bool written_1D;
|
|
403
|
+
|
|
404
|
+
// calculate gradients from the internal variables
|
|
405
|
+
void calc_pmf() {
|
|
406
|
+
int norm;
|
|
407
|
+
|
|
408
|
+
std::vector<double> loop_flag(dimension, 0);
|
|
409
|
+
for (int i = 0; i < dimension; i++) {
|
|
410
|
+
loop_flag[i] = lowerboundary[i] - HALF_Y_SIZE * width[i];
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
while (true) {
|
|
414
|
+
norm = count_y.get_value(loop_flag) > 0 ? count_y.get_value(loop_flag) : 1;
|
|
415
|
+
for (int i = 0; i < dimension; i++) {
|
|
416
|
+
x_av[i].set_value(loop_flag, sum_x[i].get_value(loop_flag) / norm);
|
|
417
|
+
sigma_square[i].set_value(loop_flag, sum_x_square[i].get_value(loop_flag) / norm - x_av[i].get_value(loop_flag) * x_av[i].get_value(loop_flag));
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// iterate over any dimensions
|
|
421
|
+
int i = dimension - 1;
|
|
422
|
+
while (true) {
|
|
423
|
+
loop_flag[i] += width[i];
|
|
424
|
+
if (loop_flag[i] > upperboundary[i] + HALF_Y_SIZE * width[i] - width[i] + 0.00001) {
|
|
425
|
+
loop_flag[i] = lowerboundary[i] - HALF_Y_SIZE * width[i];
|
|
426
|
+
i--;
|
|
427
|
+
if (i < 0) {
|
|
428
|
+
goto LOOPEND;
|
|
429
|
+
}
|
|
430
|
+
} else {
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
LOOPEND:
|
|
436
|
+
|
|
437
|
+
// double integration
|
|
438
|
+
std::vector<double> av(dimension, 0);
|
|
439
|
+
std::vector<double> diff_av(dimension, 0);
|
|
440
|
+
|
|
441
|
+
std::vector<double> loop_flag_x(dimension, 0);
|
|
442
|
+
std::vector<double> loop_flag_y(dimension, 0);
|
|
443
|
+
for (int i = 0; i < dimension; i++) {
|
|
444
|
+
loop_flag_x[i] = lowerboundary[i];
|
|
445
|
+
loop_flag_y[i] = loop_flag_x[i] - HALF_Y_SIZE * width[i];
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
while (true) {
|
|
449
|
+
norm = 0;
|
|
450
|
+
for (int i = 0; i < dimension; i++) {
|
|
451
|
+
av[i] = 0;
|
|
452
|
+
diff_av[i] = 0;
|
|
453
|
+
loop_flag_y[i] = loop_flag_x[i] - HALF_Y_SIZE * width[i];
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
while (true) {
|
|
457
|
+
//std::cout<<"pppppppppppppppppppppp "<<loop_flag_x[0]<<" "<<loop_flag_x[1]<<" "<<loop_flag_y[0]<<" "<<loop_flag_y[1]<<std::endl;
|
|
458
|
+
norm += distribution_x_y.get_value(loop_flag_x, loop_flag_y);
|
|
459
|
+
for (int i = 0; i < dimension; i++) {
|
|
460
|
+
if (sigma_square[i].get_value(loop_flag_y) > 0.00001 || sigma_square[i].get_value(loop_flag_y) < -0.00001) {
|
|
461
|
+
av[i] += distribution_x_y.get_value(loop_flag_x, loop_flag_y) * ( (loop_flag_x[i] + 0.5 * width[i]) - x_av[i].get_value(loop_flag_y)) / sigma_square[i].get_value(loop_flag_y);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
diff_av[i] += distribution_x_y.get_value(loop_flag_x, loop_flag_y) * (loop_flag_x[i] - loop_flag_y[i]);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// iterate over any dimensions
|
|
468
|
+
int i = dimension - 1;
|
|
469
|
+
while (true) {
|
|
470
|
+
loop_flag_y[i] += width[i];
|
|
471
|
+
if (loop_flag_y[i] > loop_flag_x[i] + HALF_Y_SIZE * width[i] - width[i] + 0.00001) {
|
|
472
|
+
loop_flag_y[i] = loop_flag_x[i] - HALF_Y_SIZE * width[i];
|
|
473
|
+
i--;
|
|
474
|
+
if (i < 0) {
|
|
475
|
+
goto LOOPEND2;
|
|
476
|
+
}
|
|
477
|
+
} else {
|
|
478
|
+
break;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
LOOPEND2:
|
|
483
|
+
|
|
484
|
+
std::vector<double> grad_temp(dimension, 0);
|
|
485
|
+
for (int i = 0; i < dimension; i++) {
|
|
486
|
+
diff_av[i] /= (norm > 0 ? norm : 1);
|
|
487
|
+
av[i] = BOLTZMANN * temperature * av[i] / (norm > 0 ? norm : 1);
|
|
488
|
+
grad_temp[i] = av[i] - krestr[i] * diff_av[i];
|
|
489
|
+
}
|
|
490
|
+
grad.set_value(loop_flag_x, grad_temp);
|
|
491
|
+
count.set_value(loop_flag_x, norm);
|
|
492
|
+
|
|
493
|
+
// iterate over any dimensions
|
|
494
|
+
int i = dimension - 1;
|
|
495
|
+
while (true) {
|
|
496
|
+
loop_flag_x[i] += width[i];
|
|
497
|
+
if (loop_flag_x[i] > upperboundary[i] - width[i] + 0.00001) {
|
|
498
|
+
loop_flag_x[i] = lowerboundary[i];
|
|
499
|
+
i--;
|
|
500
|
+
if (i < 0) {
|
|
501
|
+
goto LOOPEND3;
|
|
502
|
+
}
|
|
503
|
+
} else {
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
LOOPEND3:
|
|
509
|
+
;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
// calculate 1D pmf
|
|
514
|
+
void calc_1D_pmf() {
|
|
515
|
+
std::vector<double> last_position(1, 0);
|
|
516
|
+
std::vector<double> position(1, 0);
|
|
517
|
+
|
|
518
|
+
double min = 0;
|
|
519
|
+
double dG = 0;
|
|
520
|
+
|
|
521
|
+
oneD_pmf.set_value(lowerboundary, 0);
|
|
522
|
+
last_position = lowerboundary;
|
|
523
|
+
for (double i = lowerboundary[0] + width[0]; i < upperboundary[0] + 0.000001; i += width[0]) {
|
|
524
|
+
position[0] = i + 0.000001;
|
|
525
|
+
if (restart == false || input_count.get_value(last_position) == 0) {
|
|
526
|
+
dG = oneD_pmf.get_value(last_position) + grad.get_value(last_position)[0] * width[0];
|
|
527
|
+
} else {
|
|
528
|
+
dG = oneD_pmf.get_value(last_position) + ((grad.get_value(last_position)[0] * count.get_value(last_position) + input_grad.get_value(last_position)[0] * input_count.get_value(last_position)) / (count.get_value(last_position) + input_count.get_value(last_position))) * width[0];
|
|
529
|
+
}
|
|
530
|
+
if (dG < min) {
|
|
531
|
+
min = dG;
|
|
532
|
+
}
|
|
533
|
+
oneD_pmf.set_value(position, dG);
|
|
534
|
+
last_position[0] = i + 0.000001;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
for (double i = lowerboundary[0]; i < upperboundary[0] + 0.000001; i += width[0]) {
|
|
538
|
+
position[0] = i + 0.000001;
|
|
539
|
+
oneD_pmf.set_value(position, oneD_pmf.get_value(position) - min);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// write 1D pmf
|
|
544
|
+
void write_1D_pmf() {
|
|
545
|
+
std::string pmf_filename = output_filename + ".UI.pmf";
|
|
546
|
+
|
|
547
|
+
// only for colvars module!
|
|
548
|
+
// if (written_1D) cvm::backup_file(pmf_filename.c_str());
|
|
549
|
+
|
|
550
|
+
std::ofstream ofile_pmf(pmf_filename.c_str());
|
|
551
|
+
|
|
552
|
+
std::vector<double> position(1, 0);
|
|
553
|
+
for (double i = lowerboundary[0]; i < upperboundary[0] + 0.000001; i += width[0]) {
|
|
554
|
+
ofile_pmf << i << " ";
|
|
555
|
+
position[0] = i + 0.000001;
|
|
556
|
+
ofile_pmf << oneD_pmf.get_value(position) << std::endl;
|
|
557
|
+
}
|
|
558
|
+
ofile_pmf.close();
|
|
559
|
+
|
|
560
|
+
written_1D = true;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// write heads of the output files
|
|
564
|
+
void writehead(std::ofstream& os) const {
|
|
565
|
+
os << "# " << dimension << std::endl;
|
|
566
|
+
for (int i = 0; i < dimension; i++) {
|
|
567
|
+
os.precision(std::numeric_limits<double>::max_digits10);
|
|
568
|
+
os << "# " << std::fixed << lowerboundary[i] << " " << width[i] << " " << int((upperboundary[i] - lowerboundary[i]) / width[i] + 0.000001) << " " << 0 << std::endl;
|
|
569
|
+
}
|
|
570
|
+
os << std::endl;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// write interal data, used for testing
|
|
574
|
+
// void write_interal_data()
|
|
575
|
+
// {
|
|
576
|
+
// std::string internal_filaname = output_filename + ".UI.internal";
|
|
577
|
+
//
|
|
578
|
+
// std::ofstream ofile_internal(internal_filaname.c_str());
|
|
579
|
+
//
|
|
580
|
+
// std::vector<double> loop_flag(dimension, 0);
|
|
581
|
+
// for (int i = 0; i < dimension; i++)
|
|
582
|
+
// {
|
|
583
|
+
// loop_flag[i] = lowerboundary[i];
|
|
584
|
+
// }
|
|
585
|
+
// while (true)
|
|
586
|
+
// {
|
|
587
|
+
// for (int i = 0; i < dimension; i++)
|
|
588
|
+
// {
|
|
589
|
+
// ofile_internal << loop_flag[i] + 0.5 * width[i] << " ";
|
|
590
|
+
// }
|
|
591
|
+
//
|
|
592
|
+
// for (int i = 0; i < dimension; i++)
|
|
593
|
+
// {
|
|
594
|
+
// ofile_internal << grad.get_value(loop_flag)[i] << " ";
|
|
595
|
+
// }
|
|
596
|
+
//
|
|
597
|
+
// std::vector<double> ii(dimension,0);
|
|
598
|
+
// for (double i = loop_flag[0] - 10; i < loop_flag[0] + 10 + 0.00001; i+= width[0])
|
|
599
|
+
// {
|
|
600
|
+
// for (double j = loop_flag[1] - 10; j< loop_flag[1] + 10 +0.00001; j+=width[1])
|
|
601
|
+
// {
|
|
602
|
+
// ii[0] = i;
|
|
603
|
+
// ii[1] = j;
|
|
604
|
+
// ofile_internal << i <<" "<<j<<" "<< distribution_x_y.get_value(loop_flag,ii)<< " ";
|
|
605
|
+
// }
|
|
606
|
+
// }
|
|
607
|
+
// ofile_internal << std::endl;
|
|
608
|
+
//
|
|
609
|
+
// // iterate over any dimensions
|
|
610
|
+
// int i = dimension - 1;
|
|
611
|
+
// while (true)
|
|
612
|
+
// {
|
|
613
|
+
// loop_flag[i] += width[i];
|
|
614
|
+
// if (loop_flag[i] > upperboundary[i] - width[i] + 0.00001)
|
|
615
|
+
// {
|
|
616
|
+
// loop_flag[i] = lowerboundary[i];
|
|
617
|
+
// i--;
|
|
618
|
+
// if (i < 0)
|
|
619
|
+
// goto LOOPEND5;
|
|
620
|
+
// }
|
|
621
|
+
// else
|
|
622
|
+
// break;
|
|
623
|
+
// }
|
|
624
|
+
// }
|
|
625
|
+
// LOOPEND5:
|
|
626
|
+
// ofile_internal.close();
|
|
627
|
+
// }
|
|
628
|
+
|
|
629
|
+
// write output files
|
|
630
|
+
void write_files() {
|
|
631
|
+
std::string grad_filename = output_filename + ".UI.grad";
|
|
632
|
+
std::string hist_filename = output_filename + ".UI.hist.grad";
|
|
633
|
+
std::string count_filename = output_filename + ".UI.count";
|
|
634
|
+
|
|
635
|
+
// only for colvars module!
|
|
636
|
+
// if (written) cvm::backup_file(grad_filename.c_str());
|
|
637
|
+
//if (written) cvm::backup_file(hist_filename.c_str());
|
|
638
|
+
// if (written) cvm::backup_file(count_filename.c_str());
|
|
639
|
+
|
|
640
|
+
std::ofstream ofile(grad_filename.c_str());
|
|
641
|
+
std::ofstream ofile_hist(hist_filename.c_str(), std::ios::app);
|
|
642
|
+
std::ofstream ofile_count(count_filename.c_str());
|
|
643
|
+
|
|
644
|
+
writehead(ofile);
|
|
645
|
+
writehead(ofile_hist);
|
|
646
|
+
writehead(ofile_count);
|
|
647
|
+
|
|
648
|
+
if (dimension == 1) {
|
|
649
|
+
calc_1D_pmf();
|
|
650
|
+
write_1D_pmf();
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
std::vector<double> loop_flag(dimension, 0);
|
|
654
|
+
for (int i = 0; i < dimension; i++) {
|
|
655
|
+
loop_flag[i] = lowerboundary[i];
|
|
656
|
+
}
|
|
657
|
+
while (true) {
|
|
658
|
+
for (int i = 0; i < dimension; i++) {
|
|
659
|
+
ofile << std::fixed << std::setprecision(6) << loop_flag[i] + 0.5 * width[i] << " ";
|
|
660
|
+
ofile_hist << std::fixed << std::setprecision(6) << loop_flag[i] + 0.5 * width[i] << " ";
|
|
661
|
+
ofile_count << std::fixed << std::setprecision(6) << loop_flag[i] + 0.5 * width[i] << " ";
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (restart == false) {
|
|
665
|
+
for (int i = 0; i < dimension; i++) {
|
|
666
|
+
ofile << std::fixed << std::setprecision(6) << grad.get_value(loop_flag)[i] << " ";
|
|
667
|
+
ofile_hist << std::fixed << std::setprecision(6) << grad.get_value(loop_flag)[i] << " ";
|
|
668
|
+
}
|
|
669
|
+
ofile << std::endl;
|
|
670
|
+
ofile_hist << std::endl;
|
|
671
|
+
ofile_count << count.get_value(loop_flag) << " " <<std::endl;
|
|
672
|
+
} else {
|
|
673
|
+
double final_grad = 0;
|
|
674
|
+
for (int i = 0; i < dimension; i++) {
|
|
675
|
+
int total_count_temp = (count.get_value(loop_flag) + input_count.get_value(loop_flag));
|
|
676
|
+
if (input_count.get_value(loop_flag) == 0) {
|
|
677
|
+
final_grad = grad.get_value(loop_flag)[i];
|
|
678
|
+
} else {
|
|
679
|
+
final_grad = ((grad.get_value(loop_flag)[i] * count.get_value(loop_flag) + input_grad.get_value(loop_flag)[i] * input_count.get_value(loop_flag)) / total_count_temp);
|
|
680
|
+
}
|
|
681
|
+
ofile << std::fixed << std::setprecision(6) << final_grad << " ";
|
|
682
|
+
ofile_hist << std::fixed << std::setprecision(6) << final_grad << " ";
|
|
683
|
+
}
|
|
684
|
+
ofile << std::endl;
|
|
685
|
+
ofile_hist << std::endl;
|
|
686
|
+
ofile_count << (count.get_value(loop_flag) + input_count.get_value(loop_flag)) << " " <<std::endl;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// iterate over any dimensions
|
|
690
|
+
int i = dimension - 1;
|
|
691
|
+
while (true) {
|
|
692
|
+
loop_flag[i] += width[i];
|
|
693
|
+
if (loop_flag[i] > upperboundary[i] - width[i] + 0.00001) {
|
|
694
|
+
loop_flag[i] = lowerboundary[i];
|
|
695
|
+
i--;
|
|
696
|
+
ofile << std::endl;
|
|
697
|
+
ofile_hist << std::endl;
|
|
698
|
+
ofile_count << std::endl;
|
|
699
|
+
if (i < 0) {
|
|
700
|
+
goto LOOPEND4;
|
|
701
|
+
}
|
|
702
|
+
} else {
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
LOOPEND4:
|
|
708
|
+
ofile.close();
|
|
709
|
+
ofile_count.close();
|
|
710
|
+
ofile_hist.close();
|
|
711
|
+
|
|
712
|
+
written = true;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// read input files
|
|
716
|
+
void read_inputfiles(const std::vector<std::string>& input_filename) {
|
|
717
|
+
char sharp;
|
|
718
|
+
double nothing;
|
|
719
|
+
int dimension_temp;
|
|
720
|
+
|
|
721
|
+
std::vector<double> loop_bin_size(dimension, 0);
|
|
722
|
+
std::vector<double> position_temp(dimension, 0);
|
|
723
|
+
std::vector<double> grad_temp(dimension, 0);
|
|
724
|
+
int count_temp = 0;
|
|
725
|
+
for (unsigned int i = 0; i < input_filename.size(); i++) {
|
|
726
|
+
int size = 1, size_temp = 0;
|
|
727
|
+
|
|
728
|
+
std::string count_filename = input_filename[i] + ".UI.count";
|
|
729
|
+
std::string grad_filename = input_filename[i] + ".UI.grad";
|
|
730
|
+
|
|
731
|
+
std::ifstream count_file(count_filename.c_str(), std::ios::in);
|
|
732
|
+
std::ifstream grad_file(grad_filename.c_str(), std::ios::in);
|
|
733
|
+
|
|
734
|
+
count_file >> sharp >> dimension_temp;
|
|
735
|
+
grad_file >> sharp >> dimension_temp;
|
|
736
|
+
|
|
737
|
+
for (int j = 0; j < dimension; j++) {
|
|
738
|
+
count_file >> sharp >> nothing >> nothing >> size_temp >> nothing;
|
|
739
|
+
grad_file >> sharp >> nothing >> nothing >> nothing >> nothing;
|
|
740
|
+
size *= size_temp;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
for (int j = 0; j < size; j++) {
|
|
744
|
+
do {
|
|
745
|
+
for (int k = 0; k < dimension; k++) {
|
|
746
|
+
count_file >> position_temp[k];
|
|
747
|
+
grad_file >> nothing;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
for (int l = 0; l < dimension; l++) {
|
|
751
|
+
grad_file >> grad_temp[l];
|
|
752
|
+
}
|
|
753
|
+
count_file >> count_temp;
|
|
754
|
+
} while (position_temp[i] < lowerboundary[i] - 0.000001 || position_temp[i] > upperboundary[i] + 0.000001);
|
|
755
|
+
|
|
756
|
+
if (count_temp == 0) {
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
for (int m = 0; m < dimension; m++) {
|
|
761
|
+
grad_temp[m] = (grad_temp[m] * count_temp + input_grad.get_value(position_temp)[m] * input_count.get_value(position_temp)) / (count_temp + input_count.get_value(position_temp));
|
|
762
|
+
}
|
|
763
|
+
input_grad.set_value(position_temp, grad_temp);
|
|
764
|
+
input_count.increase_value(position_temp, count_temp);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
count_file.close();
|
|
768
|
+
grad_file.close();
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
#endif
|