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,638 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2011-2023 The plumed team
|
|
3
|
+
(see the PEOPLE file at the root of the distribution for a list of names)
|
|
4
|
+
|
|
5
|
+
See http://www.plumed.org for more information.
|
|
6
|
+
|
|
7
|
+
This file is part of plumed, version 2.
|
|
8
|
+
|
|
9
|
+
plumed is free software: you can redistribute it and/or modify
|
|
10
|
+
it under the terms of the GNU Lesser General Public License as published by
|
|
11
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
(at your option) any later version.
|
|
13
|
+
|
|
14
|
+
plumed is distributed in the hope that it will be useful,
|
|
15
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
GNU Lesser General Public License for more details.
|
|
18
|
+
|
|
19
|
+
You should have received a copy of the GNU Lesser General Public License
|
|
20
|
+
along with plumed. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
|
|
22
|
+
#ifndef __PLUMED_tools_Grid_h
|
|
23
|
+
#define __PLUMED_tools_Grid_h
|
|
24
|
+
|
|
25
|
+
#include <vector>
|
|
26
|
+
#include <array>
|
|
27
|
+
#include <string>
|
|
28
|
+
#include <map>
|
|
29
|
+
#include <cmath>
|
|
30
|
+
#include <memory>
|
|
31
|
+
#include <cstddef>
|
|
32
|
+
|
|
33
|
+
#include "Exception.h"
|
|
34
|
+
|
|
35
|
+
namespace PLMD {
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
// simple function to enable various weighting
|
|
39
|
+
|
|
40
|
+
class WeightBase {
|
|
41
|
+
public:
|
|
42
|
+
virtual double projectInnerLoop(double &input, double &v)=0;
|
|
43
|
+
virtual double projectOuterLoop(double &v)=0;
|
|
44
|
+
virtual ~WeightBase() {}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
class BiasWeight:public WeightBase {
|
|
48
|
+
public:
|
|
49
|
+
double beta,invbeta;
|
|
50
|
+
double shift=0.0;
|
|
51
|
+
explicit BiasWeight(double v) {
|
|
52
|
+
beta=v;
|
|
53
|
+
invbeta=1./beta;
|
|
54
|
+
}
|
|
55
|
+
//double projectInnerLoop(double &input, double &v) override {return input+exp(beta*v);}
|
|
56
|
+
//double projectOuterLoop(double &v) override {return -invbeta*std::log(v);}
|
|
57
|
+
double projectInnerLoop(double &input, double &v) override {
|
|
58
|
+
auto betav=beta*v;
|
|
59
|
+
auto x=betav-shift;
|
|
60
|
+
if(x>0) {
|
|
61
|
+
shift=betav;
|
|
62
|
+
return input*std::exp(-x)+1;
|
|
63
|
+
} else {
|
|
64
|
+
return input+std::exp(x);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
double projectOuterLoop(double &v) override {
|
|
68
|
+
auto res=-invbeta*(std::log(v)+shift);
|
|
69
|
+
shift=0.0;
|
|
70
|
+
return res;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
class ProbWeight:public WeightBase {
|
|
75
|
+
public:
|
|
76
|
+
double beta,invbeta;
|
|
77
|
+
explicit ProbWeight(double v) {
|
|
78
|
+
beta=v;
|
|
79
|
+
invbeta=1./beta;
|
|
80
|
+
}
|
|
81
|
+
double projectInnerLoop(double &input, double &v) override {
|
|
82
|
+
return input+v;
|
|
83
|
+
}
|
|
84
|
+
double projectOuterLoop(double &v) override {
|
|
85
|
+
return -invbeta*std::log(v);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class Value;
|
|
95
|
+
class IFile;
|
|
96
|
+
class OFile;
|
|
97
|
+
class KernelFunctions;
|
|
98
|
+
class Communicator;
|
|
99
|
+
|
|
100
|
+
/// \ingroup TOOLBOX
|
|
101
|
+
class GridBase {
|
|
102
|
+
public:
|
|
103
|
+
// we use a size_t here
|
|
104
|
+
// should be 8 bytes on all 64-bit machines
|
|
105
|
+
// and more portable than "unsigned long long"
|
|
106
|
+
typedef std::size_t index_t;
|
|
107
|
+
// to restore old implementation (unsigned) use the following instead:
|
|
108
|
+
// typedef unsigned index_t;
|
|
109
|
+
/// Maximum dimension (exaggerated value).
|
|
110
|
+
/// Can be used to replace local std::vectors with std::arrays (allocated on stack).
|
|
111
|
+
static constexpr std::size_t maxdim=16;
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
Auxiliary class for accelerating grid calculations.
|
|
116
|
+
|
|
117
|
+
Many functions in the Grid class have loops running over the dimensions.
|
|
118
|
+
These loops are always with a little number of iterations, so would likely
|
|
119
|
+
benefit unrolling. Even better, if the compiler knew the dimension a priori
|
|
120
|
+
it could remove the loops in most common cases (e.g. dimension=1 or 2).
|
|
121
|
+
|
|
122
|
+
To obtain this, I added this AcceleratorBase class. Specifically:
|
|
123
|
+
- Any method in the Grid class that is a bottleneck in performance and
|
|
124
|
+
has a loop can be moved to this auxiliary class.
|
|
125
|
+
- The method should be declared here as a pure virtual function
|
|
126
|
+
of class AcceleratorBase. The implementation instead goes in
|
|
127
|
+
class Accelerator
|
|
128
|
+
- Class Accelerator is derived from AcceleratorBase but depends on
|
|
129
|
+
dimension as a template variable.
|
|
130
|
+
- The function AcceleratorBase::create takes case of constructing
|
|
131
|
+
accelerators for each possible value of dimension.
|
|
132
|
+
|
|
133
|
+
The trick works because we don't expect dimension to ever be very
|
|
134
|
+
high. By restricting it to <=16, we can have a limited number of
|
|
135
|
+
compiled instances. The compiler will choose at runtime which one should
|
|
136
|
+
be used.
|
|
137
|
+
|
|
138
|
+
This class, as well as the derived classes, are expected to be
|
|
139
|
+
empty. In other words, they only contain the pointer to a virtual
|
|
140
|
+
table that the compiler will use to call the proper implementation
|
|
141
|
+
variant, with the correct dimension.
|
|
142
|
+
|
|
143
|
+
\warning
|
|
144
|
+
Interface might change at any time.
|
|
145
|
+
Do not use this outside of class GridBase and children.
|
|
146
|
+
*/
|
|
147
|
+
class AcceleratorBase {
|
|
148
|
+
public:
|
|
149
|
+
/// Creates an accelerator with proper dimension
|
|
150
|
+
static std::unique_ptr<AcceleratorBase> create(unsigned dim);
|
|
151
|
+
virtual ~AcceleratorBase() = default;
|
|
152
|
+
/// Can be used to check which value of dimension was used
|
|
153
|
+
virtual unsigned getDimension() const=0;
|
|
154
|
+
virtual std::vector<GridBase::index_t> getNeighbors(const GridBase& grid, const std::vector<unsigned> & nbin_,const std::vector<bool> & pbc_,const unsigned* indices,std::size_t indices_size, const std::vector<unsigned> &nneigh) const=0;
|
|
155
|
+
virtual GridBase::index_t getIndex(const GridBase& grid, const std::vector<unsigned> & nbin_, const unsigned* indices,std::size_t indices_size) const=0;
|
|
156
|
+
virtual void getPoint(const std::vector<double> & min_,const std::vector<double> & dx_, const unsigned* indices,std::size_t indices_size,double* point,std::size_t point_size) const=0;
|
|
157
|
+
virtual void getIndices(const std::vector<unsigned> & nbin_, GridBase::index_t index, unsigned* indices, std::size_t indices_size) const=0;
|
|
158
|
+
virtual void getIndices(const std::vector<double> & min_,const std::vector<double> & dx_, const std::vector<double> & x, unsigned* rindex_data,std::size_t rindex_size) const=0;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
Auxiliary class for managing AcceleratorBase.
|
|
163
|
+
|
|
164
|
+
class GridBase should contain a std::unique_ptr<AcceleratorBase>, which
|
|
165
|
+
can be used to access the specialized versions. However, this would
|
|
166
|
+
make a GridBase object not copyable. Instead of redefining
|
|
167
|
+
copy constructor and copy assignment for GridBase, which has a lot of
|
|
168
|
+
members, we use this wrapper class that just manages the lifetime
|
|
169
|
+
of the underlying Accelerator object.
|
|
170
|
+
|
|
171
|
+
The underlying object is made accessible through the -> operator,
|
|
172
|
+
so that one can simply call functions as accelerator->function.
|
|
173
|
+
|
|
174
|
+
\warning
|
|
175
|
+
Interface might change at any time.
|
|
176
|
+
Do not use this outside of class GridBase and children.
|
|
177
|
+
*/
|
|
178
|
+
class AcceleratorHandler {
|
|
179
|
+
/// This is the underlying pointer.
|
|
180
|
+
std::unique_ptr<AcceleratorBase> ptr;
|
|
181
|
+
public:
|
|
182
|
+
/// Enable access to methods of AcceleratorBase
|
|
183
|
+
const AcceleratorBase* operator->() const {
|
|
184
|
+
return ptr.get();
|
|
185
|
+
}
|
|
186
|
+
/// Enable access to methods of AcceleratorBase
|
|
187
|
+
AcceleratorBase* operator->() {
|
|
188
|
+
return ptr.get();
|
|
189
|
+
}
|
|
190
|
+
/// Conversion to bool allows to check if the ptr has been set
|
|
191
|
+
explicit operator bool() const noexcept {
|
|
192
|
+
return bool(ptr);
|
|
193
|
+
}
|
|
194
|
+
/// Move constructor
|
|
195
|
+
AcceleratorHandler(const AcceleratorHandler& other):
|
|
196
|
+
ptr((other.ptr?AcceleratorBase::create(other->getDimension()):nullptr))
|
|
197
|
+
{}
|
|
198
|
+
/// Move assignment
|
|
199
|
+
AcceleratorHandler & operator=(const AcceleratorHandler & other) {
|
|
200
|
+
if(this!=&other) {
|
|
201
|
+
ptr.reset();
|
|
202
|
+
if(other.ptr) {
|
|
203
|
+
ptr=AcceleratorBase::create(other->getDimension());
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return *this;
|
|
207
|
+
}
|
|
208
|
+
/// Constructor without arguments result in a non-usable accelerator (dimension is unspecified)
|
|
209
|
+
AcceleratorHandler() = default;
|
|
210
|
+
/// Constructor with an argument creates an accelerator with a fixed dimensionality
|
|
211
|
+
AcceleratorHandler(unsigned dimension):
|
|
212
|
+
ptr(AcceleratorBase::create(dimension))
|
|
213
|
+
{}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
protected:
|
|
217
|
+
AcceleratorHandler accelerator;
|
|
218
|
+
std::string funcname;
|
|
219
|
+
std::vector<std::string> argnames;
|
|
220
|
+
std::vector<std::string> str_min_, str_max_;
|
|
221
|
+
std::vector<double> min_,max_,dx_;
|
|
222
|
+
std::vector<unsigned> nbin_;
|
|
223
|
+
std::vector<bool> pbc_;
|
|
224
|
+
index_t maxsize_;
|
|
225
|
+
unsigned dimension_;
|
|
226
|
+
bool dospline_, usederiv_;
|
|
227
|
+
std::string fmt_; // format for output
|
|
228
|
+
/// get "neighbors" for spline
|
|
229
|
+
unsigned getSplineNeighbors(const unsigned* indices, std::size_t indices_size, index_t* neighbors, std::size_t neighbors_size)const;
|
|
230
|
+
// std::vector<index_t> getSplineNeighbors(const std::vector<unsigned> & indices)const;
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
public:
|
|
234
|
+
/// this constructor here is Value-aware
|
|
235
|
+
GridBase(const std::string& funcl, const std::vector<Value*> & args, const std::vector<std::string> & gmin,
|
|
236
|
+
const std::vector<std::string> & gmax, const std::vector<unsigned> & nbin, bool dospline,
|
|
237
|
+
bool usederiv);
|
|
238
|
+
/// this constructor here is not Value-aware
|
|
239
|
+
GridBase(const std::string& funcl, const std::vector<std::string> &names, const std::vector<std::string> & gmin,
|
|
240
|
+
const std::vector<std::string> & gmax, const std::vector<unsigned> & nbin, bool dospline,
|
|
241
|
+
bool usederiv, const std::vector<bool> &isperiodic, const std::vector<std::string> &pmin,
|
|
242
|
+
const std::vector<std::string> &pmax );
|
|
243
|
+
/// this is the real initializator
|
|
244
|
+
void Init(const std::string & funcl, const std::vector<std::string> &names, const std::vector<std::string> & gmin,
|
|
245
|
+
const std::vector<std::string> & gmax, const std::vector<unsigned> & nbin, bool dospline, bool usederiv,
|
|
246
|
+
const std::vector<bool> &isperiodic, const std::vector<std::string> &pmin, const std::vector<std::string> &pmax);
|
|
247
|
+
/// get lower boundary
|
|
248
|
+
std::vector<std::string> getMin() const;
|
|
249
|
+
/// get upper boundary
|
|
250
|
+
std::vector<std::string> getMax() const;
|
|
251
|
+
/// get bin size
|
|
252
|
+
std::vector<double> getDx() const;
|
|
253
|
+
double getDx(index_t j) const ;
|
|
254
|
+
/// get bin volume
|
|
255
|
+
double getBinVolume() const;
|
|
256
|
+
/// get number of bins
|
|
257
|
+
std::vector<unsigned> getNbin() const;
|
|
258
|
+
/// get if periodic
|
|
259
|
+
std::vector<bool> getIsPeriodic() const;
|
|
260
|
+
/// get grid dimension
|
|
261
|
+
unsigned getDimension() const;
|
|
262
|
+
/// get argument names of this grid
|
|
263
|
+
std::vector<std::string> getArgNames() const;
|
|
264
|
+
/// get if the grid has derivatives
|
|
265
|
+
bool hasDerivatives() const {
|
|
266
|
+
return usederiv_;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/// methods to handle grid indices
|
|
270
|
+
void getIndices(index_t index, std::vector<unsigned>& rindex) const;
|
|
271
|
+
void getIndices(index_t index, unsigned* rindex_data, std::size_t rindex_size) const;
|
|
272
|
+
void getIndices(const std::vector<double> & x, std::vector<unsigned>& rindex) const;
|
|
273
|
+
void getIndices(const std::vector<double> & x, unsigned* rindex_data,std::size_t rindex_size) const;
|
|
274
|
+
std::vector<unsigned> getIndices(index_t index) const;
|
|
275
|
+
std::vector<unsigned> getIndices(const std::vector<double> & x) const;
|
|
276
|
+
index_t getIndex(const unsigned* indices,std::size_t indices_size) const;
|
|
277
|
+
index_t getIndex(const std::vector<unsigned> & indices) const;
|
|
278
|
+
index_t getIndex(const std::vector<double> & x) const;
|
|
279
|
+
std::vector<double> getPoint(index_t index) const;
|
|
280
|
+
std::vector<double> getPoint(const std::vector<unsigned> & indices) const;
|
|
281
|
+
std::vector<double> getPoint(const std::vector<double> & x) const;
|
|
282
|
+
/// faster versions relying on preallocated vectors
|
|
283
|
+
void getPoint(index_t index,std::vector<double> & point) const;
|
|
284
|
+
void getPoint(const std::vector<unsigned> & indices,std::vector<double> & point) const;
|
|
285
|
+
void getPoint(const std::vector<double> & x,std::vector<double> & point) const;
|
|
286
|
+
void getPoint(const unsigned* indices_data,std::size_t indices_size,std::vector<double> & point) const;
|
|
287
|
+
void getPoint(const unsigned* indices_data,std::size_t indices_size,double* point,std::size_t point_size) const;
|
|
288
|
+
|
|
289
|
+
/// get neighbors
|
|
290
|
+
std::vector<index_t> getNeighbors(index_t index,const std::vector<unsigned> & neigh) const;
|
|
291
|
+
std::vector<index_t> getNeighbors(const std::vector<unsigned> & indices,const std::vector<unsigned> & neigh) const;
|
|
292
|
+
std::vector<index_t> getNeighbors(const std::vector<double> & x,const std::vector<unsigned> & neigh) const;
|
|
293
|
+
/// get nearest neighbors (those separated by exactly one lattice unit)
|
|
294
|
+
std::vector<index_t> getNearestNeighbors(const index_t index) const;
|
|
295
|
+
std::vector<index_t> getNearestNeighbors(const std::vector<unsigned> &indices) const;
|
|
296
|
+
|
|
297
|
+
/// write header for grid file
|
|
298
|
+
void writeHeader(OFile& file);
|
|
299
|
+
|
|
300
|
+
/// read grid from file
|
|
301
|
+
static std::unique_ptr<GridBase> create(const std::string&,const std::vector<Value*>&,IFile&,bool,bool,bool);
|
|
302
|
+
/// read grid from file and check boundaries are what is expected from input
|
|
303
|
+
static std::unique_ptr<GridBase> create(const std::string&,const std::vector<Value*>&, IFile&,
|
|
304
|
+
const std::vector<std::string>&,const std::vector<std::string>&,
|
|
305
|
+
const std::vector<unsigned>&,bool,bool,bool);
|
|
306
|
+
/// get grid size
|
|
307
|
+
virtual index_t getSize() const=0;
|
|
308
|
+
/// get grid value
|
|
309
|
+
virtual double getValue(index_t index) const=0;
|
|
310
|
+
double getValue(const std::vector<unsigned> & indices) const;
|
|
311
|
+
double getValue(const std::vector<double> & x) const;
|
|
312
|
+
/// get grid value and derivatives
|
|
313
|
+
virtual double getValueAndDerivatives(index_t index, double* der, std::size_t der_size) const=0;
|
|
314
|
+
double getValueAndDerivatives(index_t index, std::vector<double>& der) const;
|
|
315
|
+
double getValueAndDerivatives(const std::vector<unsigned> & indices, std::vector<double>& der) const;
|
|
316
|
+
double getValueAndDerivatives(const std::vector<double> & x, std::vector<double>& der) const;
|
|
317
|
+
|
|
318
|
+
/// set grid value
|
|
319
|
+
virtual void setValue(index_t index, double value)=0;
|
|
320
|
+
void setValue(const std::vector<unsigned> & indices, double value);
|
|
321
|
+
/// set grid value and derivatives
|
|
322
|
+
virtual void setValueAndDerivatives(index_t index, double value, std::vector<double>& der)=0;
|
|
323
|
+
void setValueAndDerivatives(const std::vector<unsigned> & indices, double value, std::vector<double>& der);
|
|
324
|
+
/// add to grid value
|
|
325
|
+
virtual void addValue(index_t index, double value)=0;
|
|
326
|
+
void addValue(const std::vector<unsigned> & indices, double value);
|
|
327
|
+
/// add to grid value and derivatives
|
|
328
|
+
virtual void addValueAndDerivatives(index_t index, double value, std::vector<double>& der)=0;
|
|
329
|
+
void addValueAndDerivatives(const std::vector<unsigned> & indices, double value, std::vector<double>& der);
|
|
330
|
+
/// add a kernel function to the grid
|
|
331
|
+
void addKernel( const KernelFunctions& kernel );
|
|
332
|
+
|
|
333
|
+
/// get minimum value
|
|
334
|
+
virtual double getMinValue() const = 0;
|
|
335
|
+
/// get maximum value
|
|
336
|
+
virtual double getMaxValue() const = 0;
|
|
337
|
+
|
|
338
|
+
/// dump grid on file
|
|
339
|
+
virtual void writeToFile(OFile&)=0;
|
|
340
|
+
/// dump grid to gaussian cube file
|
|
341
|
+
void writeCubeFile(OFile&, const double& lunit);
|
|
342
|
+
|
|
343
|
+
virtual ~GridBase() = default;
|
|
344
|
+
|
|
345
|
+
/// set output format
|
|
346
|
+
void setOutputFmt(const std::string & ss) {
|
|
347
|
+
fmt_=ss;
|
|
348
|
+
}
|
|
349
|
+
/// reset output format to the default %14.9f format
|
|
350
|
+
void resetToDefaultOutputFmt() {
|
|
351
|
+
fmt_="%14.9f";
|
|
352
|
+
}
|
|
353
|
+
///
|
|
354
|
+
/// Find the maximum over paths of the minimum value of the gridded function along the paths
|
|
355
|
+
/// for all paths of neighboring grid lattice points from a source point to a sink point.
|
|
356
|
+
double findMaximalPathMinimum(const std::vector<double> &source, const std::vector<double> &sink);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
class Grid : public GridBase {
|
|
360
|
+
std::vector<double> grid_;
|
|
361
|
+
std::vector<double> der_;
|
|
362
|
+
double contour_location=0.0;
|
|
363
|
+
public:
|
|
364
|
+
Grid(const std::string& funcl, const std::vector<Value*> & args, const std::vector<std::string> & gmin,
|
|
365
|
+
const std::vector<std::string> & gmax,
|
|
366
|
+
const std::vector<unsigned> & nbin, bool dospline, bool usederiv):
|
|
367
|
+
GridBase(funcl,args,gmin,gmax,nbin,dospline,usederiv) {
|
|
368
|
+
grid_.assign(maxsize_,0.0);
|
|
369
|
+
if(usederiv_) {
|
|
370
|
+
der_.assign(maxsize_*dimension_,0.0);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/// this constructor here is not Value-aware
|
|
374
|
+
Grid(const std::string& funcl, const std::vector<std::string> &names, const std::vector<std::string> & gmin,
|
|
375
|
+
const std::vector<std::string> & gmax, const std::vector<unsigned> & nbin, bool dospline,
|
|
376
|
+
bool usederiv, const std::vector<bool> &isperiodic, const std::vector<std::string> &pmin,
|
|
377
|
+
const std::vector<std::string> &pmax ):
|
|
378
|
+
GridBase(funcl,names,gmin,gmax,nbin,dospline,usederiv,isperiodic,pmin,pmax) {
|
|
379
|
+
grid_.assign(maxsize_,0.0);
|
|
380
|
+
if(usederiv_) {
|
|
381
|
+
der_.assign(maxsize_*dimension_,0.0);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
index_t getSize() const override;
|
|
385
|
+
/// this is to access to Grid:: version of these methods (allowing overloading of virtual methods)
|
|
386
|
+
using GridBase::getValue;
|
|
387
|
+
using GridBase::getValueAndDerivatives;
|
|
388
|
+
using GridBase::setValue;
|
|
389
|
+
using GridBase::setValueAndDerivatives;
|
|
390
|
+
using GridBase::addValue;
|
|
391
|
+
using GridBase::addValueAndDerivatives;
|
|
392
|
+
/// get grid value
|
|
393
|
+
double getValue(index_t index) const override;
|
|
394
|
+
/// get grid value and derivatives
|
|
395
|
+
double getValueAndDerivatives(index_t index, double* der, std::size_t der_size) const override;
|
|
396
|
+
/// set grid value
|
|
397
|
+
void setValue(index_t index, double value) override;
|
|
398
|
+
/// set grid value and derivatives
|
|
399
|
+
void setValueAndDerivatives(index_t index, double value, std::vector<double>& der) override;
|
|
400
|
+
/// add to grid value
|
|
401
|
+
void addValue(index_t index, double value) override;
|
|
402
|
+
/// add to grid value and derivatives
|
|
403
|
+
void addValueAndDerivatives(index_t index, double value, std::vector<double>& der) override;
|
|
404
|
+
|
|
405
|
+
/// get minimum value
|
|
406
|
+
double getMinValue() const override;
|
|
407
|
+
/// get maximum value
|
|
408
|
+
double getMaxValue() const override;
|
|
409
|
+
/// Scale all grid values and derivatives by a constant factor
|
|
410
|
+
void scaleAllValuesAndDerivatives( const double& scalef );
|
|
411
|
+
/// Takes the scalef times the logarithm of all grid values and derivatives
|
|
412
|
+
void logAllValuesAndDerivatives( const double& scalef );
|
|
413
|
+
/// dump grid on file
|
|
414
|
+
void writeToFile(OFile&) override;
|
|
415
|
+
|
|
416
|
+
/// Set the minimum value of the grid to zero and translates accordingly
|
|
417
|
+
void setMinToZero();
|
|
418
|
+
/// apply function: takes pointer to function that accepts a double and apply
|
|
419
|
+
void applyFunctionAllValuesAndDerivatives( double (*func)(double val), double (*funcder)(double valder) );
|
|
420
|
+
/// Get the difference from the contour
|
|
421
|
+
double getDifferenceFromContour(const std::vector<double> & x, std::vector<double>& der) const ;
|
|
422
|
+
/// Find a set of points on a contour in the function
|
|
423
|
+
void findSetOfPointsOnContour(const double& target, const std::vector<bool>& nosearch, unsigned& npoints, std::vector<std::vector<double> >& points );
|
|
424
|
+
/// Since this method returns a concrete Grid, it should be here and not in GridBase - GB
|
|
425
|
+
/// project a high dimensional grid onto a low dimensional one: this should be changed at some time
|
|
426
|
+
/// to enable many types of weighting
|
|
427
|
+
Grid project( const std::vector<std::string> & proj, WeightBase *ptr2obj );
|
|
428
|
+
void projectOnLowDimension(double &val, std::vector<int> &varHigh, WeightBase* ptr2obj );
|
|
429
|
+
void mpiSumValuesAndDerivatives( Communicator& comm );
|
|
430
|
+
/// Integrate the function calculated on the grid
|
|
431
|
+
double integrate( std::vector<unsigned>& npoints );
|
|
432
|
+
void clear();
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
class SparseGrid : public GridBase {
|
|
437
|
+
|
|
438
|
+
std::map<index_t,double> map_;
|
|
439
|
+
std::map< index_t,std::vector<double> > der_;
|
|
440
|
+
|
|
441
|
+
public:
|
|
442
|
+
SparseGrid(const std::string& funcl, const std::vector<Value*> & args, const std::vector<std::string> & gmin,
|
|
443
|
+
const std::vector<std::string> & gmax,
|
|
444
|
+
const std::vector<unsigned> & nbin, bool dospline, bool usederiv):
|
|
445
|
+
GridBase(funcl,args,gmin,gmax,nbin,dospline,usederiv) {}
|
|
446
|
+
|
|
447
|
+
index_t getSize() const override;
|
|
448
|
+
index_t getMaxSize() const;
|
|
449
|
+
|
|
450
|
+
/// this is to access to Grid:: version of these methods (allowing overloading of virtual methods)
|
|
451
|
+
using GridBase::getValue;
|
|
452
|
+
using GridBase::getValueAndDerivatives;
|
|
453
|
+
using GridBase::setValue;
|
|
454
|
+
using GridBase::setValueAndDerivatives;
|
|
455
|
+
using GridBase::addValue;
|
|
456
|
+
using GridBase::addValueAndDerivatives;
|
|
457
|
+
|
|
458
|
+
/// get grid value
|
|
459
|
+
double getValue(index_t index) const override;
|
|
460
|
+
/// get grid value and derivatives
|
|
461
|
+
double getValueAndDerivatives(index_t index, double* der, std::size_t der_size) const override;
|
|
462
|
+
|
|
463
|
+
/// set grid value
|
|
464
|
+
void setValue(index_t index, double value) override;
|
|
465
|
+
/// set grid value and derivatives
|
|
466
|
+
void setValueAndDerivatives(index_t index, double value, std::vector<double>& der) override;
|
|
467
|
+
/// add to grid value
|
|
468
|
+
void addValue(index_t index, double value) override;
|
|
469
|
+
/// add to grid value and derivatives
|
|
470
|
+
void addValueAndDerivatives(index_t index, double value, std::vector<double>& der) override;
|
|
471
|
+
|
|
472
|
+
/// get minimum value
|
|
473
|
+
double getMinValue() const override;
|
|
474
|
+
/// get maximum value
|
|
475
|
+
double getMaxValue() const override;
|
|
476
|
+
/// dump grid on file
|
|
477
|
+
void writeToFile(OFile&) override;
|
|
478
|
+
|
|
479
|
+
virtual ~SparseGrid() = default;
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
inline
|
|
484
|
+
GridBase::index_t GridBase::getIndex(const unsigned* indices,std::size_t indices_size) const {
|
|
485
|
+
plumed_dbg_assert(accelerator);
|
|
486
|
+
return accelerator->getIndex(*this,nbin_,indices,indices_size);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
inline
|
|
490
|
+
GridBase::index_t GridBase::getIndex(const std::vector<unsigned> & indices) const {
|
|
491
|
+
plumed_dbg_assert(indices.size()==dimension_);
|
|
492
|
+
return getIndex(indices.data(),indices.size());
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
inline
|
|
496
|
+
GridBase::index_t GridBase::getIndex(const std::vector<double> & x) const {
|
|
497
|
+
plumed_dbg_assert(x.size()==dimension_);
|
|
498
|
+
std::array<unsigned,maxdim> indices;
|
|
499
|
+
getIndices(x,indices.data(),dimension_);
|
|
500
|
+
return getIndex(indices.data(),dimension_);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
inline
|
|
504
|
+
std::vector<unsigned> GridBase::getIndices(index_t index) const {
|
|
505
|
+
std::vector<unsigned> indices(dimension_);
|
|
506
|
+
getIndices(index,indices.data(),indices.size());
|
|
507
|
+
return indices;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
inline
|
|
511
|
+
void GridBase::getIndices(index_t index, unsigned* indices, std::size_t indices_size) const {
|
|
512
|
+
plumed_assert(indices_size==dimension_);
|
|
513
|
+
plumed_assert(accelerator);
|
|
514
|
+
accelerator->getIndices(nbin_,index,indices,dimension_);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
inline
|
|
518
|
+
void GridBase::getIndices(index_t index, std::vector<unsigned>& indices) const {
|
|
519
|
+
if (indices.size()!=dimension_) {
|
|
520
|
+
indices.resize(dimension_);
|
|
521
|
+
}
|
|
522
|
+
getIndices(index,indices.data(),indices.size());
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
inline
|
|
526
|
+
std::vector<unsigned> GridBase::getIndices(const std::vector<double> & x) const {
|
|
527
|
+
plumed_dbg_assert(x.size()==dimension_);
|
|
528
|
+
std::vector<unsigned> indices(dimension_);
|
|
529
|
+
getIndices(x,indices);
|
|
530
|
+
return indices;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
inline
|
|
534
|
+
void GridBase::getIndices(const std::vector<double> & x, std::vector<unsigned>& indices) const {
|
|
535
|
+
indices.resize(dimension_);
|
|
536
|
+
getIndices(x,indices.data(),indices.size());
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
inline
|
|
540
|
+
void GridBase::getIndices(const std::vector<double> & x, unsigned* rindex_data,std::size_t rindex_size) const {
|
|
541
|
+
plumed_dbg_assert(x.size()==dimension_);
|
|
542
|
+
plumed_dbg_assert(rindex_size==dimension_);
|
|
543
|
+
accelerator->getIndices(min_,dx_,x,rindex_data,rindex_size);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
inline
|
|
547
|
+
void GridBase::getPoint(const unsigned* indices,std::size_t indices_size,double* point,std::size_t point_size) const {
|
|
548
|
+
plumed_dbg_assert(indices_size==dimension_);
|
|
549
|
+
plumed_dbg_assert(point_size==dimension_);
|
|
550
|
+
plumed_dbg_assert(accelerator);
|
|
551
|
+
accelerator->getPoint(min_,dx_,indices,indices_size,point,point_size);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
inline
|
|
555
|
+
std::vector<double> GridBase::getPoint(const std::vector<unsigned> & indices) const {
|
|
556
|
+
plumed_dbg_assert(indices.size()==dimension_);
|
|
557
|
+
std::vector<double> x(dimension_);
|
|
558
|
+
getPoint(indices,x);
|
|
559
|
+
return x;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
inline
|
|
563
|
+
std::vector<double> GridBase::getPoint(index_t index) const {
|
|
564
|
+
plumed_dbg_assert(index<maxsize_);
|
|
565
|
+
std::vector<double> x(dimension_);
|
|
566
|
+
getPoint(index,x);
|
|
567
|
+
return x;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
inline
|
|
571
|
+
std::vector<double> GridBase::getPoint(const std::vector<double> & x) const {
|
|
572
|
+
plumed_dbg_assert(x.size()==dimension_);
|
|
573
|
+
std::vector<double> r(dimension_);
|
|
574
|
+
getPoint(x,r);
|
|
575
|
+
return r;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
inline
|
|
579
|
+
void GridBase::getPoint(index_t index,std::vector<double> & point) const {
|
|
580
|
+
plumed_dbg_assert(index<maxsize_);
|
|
581
|
+
std::array<unsigned,maxdim> indices;
|
|
582
|
+
getIndices(index,indices.data(),dimension_);
|
|
583
|
+
getPoint(indices.data(),dimension_,point);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
inline
|
|
587
|
+
void GridBase::getPoint(const std::vector<unsigned> & indices,std::vector<double> & point) const {
|
|
588
|
+
plumed_dbg_assert(indices.size()==dimension_);
|
|
589
|
+
plumed_dbg_assert(point.size()==dimension_);
|
|
590
|
+
getPoint(indices.data(),indices.size(),point.data(),point.size());
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
inline
|
|
594
|
+
void GridBase::getPoint(const unsigned* indices_data,std::size_t indices_size,std::vector<double> & point) const {
|
|
595
|
+
plumed_dbg_assert(indices_size==dimension_);
|
|
596
|
+
plumed_dbg_assert(point.size()==dimension_);
|
|
597
|
+
getPoint(indices_data,indices_size,point.data(),point.size());
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
inline
|
|
601
|
+
void GridBase::getPoint(const std::vector<double> & x,std::vector<double> & point) const {
|
|
602
|
+
plumed_dbg_assert(x.size()==dimension_);
|
|
603
|
+
std::array<unsigned,maxdim> indices;
|
|
604
|
+
getIndices(x,indices.data(),dimension_);
|
|
605
|
+
getPoint(indices.data(),dimension_,point.data(),point.size());
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
inline
|
|
609
|
+
std::vector<GridBase::index_t> GridBase::getNeighbors(const std::vector<unsigned> &indices,const std::vector<unsigned> &nneigh)const {
|
|
610
|
+
plumed_dbg_assert(accelerator);
|
|
611
|
+
return accelerator->getNeighbors(*this,nbin_,pbc_,indices.data(),indices.size(),nneigh);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
inline
|
|
615
|
+
std::vector<GridBase::index_t> GridBase::getNeighbors(const std::vector<double> & x,const std::vector<unsigned> & nneigh)const {
|
|
616
|
+
plumed_dbg_assert(x.size()==dimension_ && nneigh.size()==dimension_);
|
|
617
|
+
std::array<unsigned,maxdim> indices;
|
|
618
|
+
plumed_dbg_assert(accelerator);
|
|
619
|
+
accelerator->getIndices(min_,dx_,x,indices.data(),dimension_);
|
|
620
|
+
return accelerator->getNeighbors(*this,nbin_,pbc_,indices.data(),dimension_,nneigh);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
inline
|
|
624
|
+
std::vector<GridBase::index_t> GridBase::getNeighbors(index_t index,const std::vector<unsigned> & nneigh)const {
|
|
625
|
+
plumed_dbg_assert(index<maxsize_ && nneigh.size()==dimension_);
|
|
626
|
+
std::array<unsigned,maxdim> indices;
|
|
627
|
+
plumed_dbg_assert(accelerator);
|
|
628
|
+
accelerator->getIndices(nbin_,index,indices.data(),dimension_);
|
|
629
|
+
return accelerator->getNeighbors(*this,nbin_,pbc_,indices.data(),dimension_,nneigh);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
#endif
|