hillclimber 0.1.5__cp313-cp313-musllinux_1_2_aarch64.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 +39 -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 +325 -0
- hillclimber/nodes.py +6 -0
- hillclimber/opes.py +359 -0
- hillclimber/selectors.py +230 -0
- hillclimber/virtual_atoms.py +341 -0
- hillclimber-0.1.5.dist-info/METADATA +210 -0
- hillclimber-0.1.5.dist-info/RECORD +472 -0
- hillclimber-0.1.5.dist-info/WHEEL +5 -0
- hillclimber-0.1.5.dist-info/entry_points.txt +8 -0
- hillclimber-0.1.5.dist-info/licenses/LICENSE +165 -0
- hillclimber-0.1.5.dist-info/sboms/auditwheel.cdx.json +1 -0
- hillclimber.libs/libgcc_s-2d945d6c.so.1 +0 -0
- hillclimber.libs/libgomp-1ede7ee7.so.1.0.0 +0 -0
- hillclimber.libs/libstdc++-85f2cd6d.so.6.0.33 +0 -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.so +0 -0
- plumed/_lib/lib/libplumed.a +0 -0
- plumed/_lib/lib/libplumed.so +0 -0
- plumed/_lib/lib/libplumedKernel.so +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 +179 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake +8 -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 +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc +8 -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 +5 -0
- plumed/_lib/lib/plumed/vim/scripts.vim +6 -0
- plumed/_plumed_core.cpython-311-aarch64-linux-musl.so +0 -0
- plumed/_plumed_core.cpython-312-aarch64-linux-musl.so +0 -0
- plumed/_plumed_core.cpython-313-aarch64-linux-musl.so +0 -0
- plumedCommunications.cpython-311-aarch64-linux-musl.so +0 -0
- plumedCommunications.cpython-312-aarch64-linux-musl.so +0 -0
- plumedCommunications.cpython-313-aarch64-linux-musl.so +0 -0
- plumedCommunications.pyi +431 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2025 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
|
+
|
|
23
|
+
#ifndef __PLUMED_tools_TrajectoryParser_h
|
|
24
|
+
#define __PLUMED_tools_TrajectoryParser_h
|
|
25
|
+
#include "Keywords.h"
|
|
26
|
+
#include "Tools.h"
|
|
27
|
+
|
|
28
|
+
#include <memory>
|
|
29
|
+
#include <optional>
|
|
30
|
+
#include <string_view>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
namespace PLMD {
|
|
35
|
+
class fileParser;
|
|
36
|
+
|
|
37
|
+
class TrajectoryParser {
|
|
38
|
+
public:
|
|
39
|
+
enum class trajfmt {
|
|
40
|
+
molfile,
|
|
41
|
+
xdr_xtc,
|
|
42
|
+
xdr_trr,
|
|
43
|
+
xyz,
|
|
44
|
+
gro,
|
|
45
|
+
dlp4,
|
|
46
|
+
error
|
|
47
|
+
};
|
|
48
|
+
static trajfmt FMTfromString(std::string_view fmt);
|
|
49
|
+
static std::string toString(trajfmt fmt);
|
|
50
|
+
private:
|
|
51
|
+
std::unique_ptr<fileParser> parser;
|
|
52
|
+
public:
|
|
53
|
+
TrajectoryParser();
|
|
54
|
+
~TrajectoryParser();
|
|
55
|
+
static void registerKeywords(Keywords& keys);
|
|
56
|
+
static std::vector<std::string> trajectoryOptions();
|
|
57
|
+
static std::vector<std::string> getMolfilePluginsnames();
|
|
58
|
+
|
|
59
|
+
std::optional<std::string> init(std::string_view fmt,
|
|
60
|
+
std::string_view fname,
|
|
61
|
+
bool useMolfile=false,
|
|
62
|
+
int command_line_natoms=-1);
|
|
63
|
+
//Driver with filename ="-"
|
|
64
|
+
std::optional<std::string> init(std::string_view fmt,FILE* fileHandle);
|
|
65
|
+
|
|
66
|
+
std::optional<std::string> readHeader(long long int &step,
|
|
67
|
+
double &timeStep);
|
|
68
|
+
std::optional<std::string> readHeader(long long int &step,
|
|
69
|
+
float &timeStep);
|
|
70
|
+
std::optional<std::string> readAtoms(int stride,
|
|
71
|
+
bool dont_read_pbc,
|
|
72
|
+
bool debug_pd,
|
|
73
|
+
int pd_start,
|
|
74
|
+
int pd_nlocal,
|
|
75
|
+
long long int &step,
|
|
76
|
+
double* masses,
|
|
77
|
+
double* charges,
|
|
78
|
+
double* coordinates,
|
|
79
|
+
double* cell );
|
|
80
|
+
std::optional<std::string> readAtoms(int stride,
|
|
81
|
+
bool dont_read_pbc,
|
|
82
|
+
bool debug_pd,
|
|
83
|
+
int pd_start,
|
|
84
|
+
int pd_nlocal,
|
|
85
|
+
long long int &step,
|
|
86
|
+
float* masses,
|
|
87
|
+
float* charges,
|
|
88
|
+
float* coordinates,
|
|
89
|
+
float* cell );
|
|
90
|
+
std::optional<std::string> readFrame(int stride,
|
|
91
|
+
bool dont_read_pbc,
|
|
92
|
+
bool debug_pd,
|
|
93
|
+
int pd_start,
|
|
94
|
+
int pd_nlocal,
|
|
95
|
+
long long int &step,
|
|
96
|
+
double&timeStep,
|
|
97
|
+
double* masses,
|
|
98
|
+
double* charges,
|
|
99
|
+
double* coordinates,
|
|
100
|
+
double* cell );
|
|
101
|
+
std::optional<std::string> readFrame(int stride,
|
|
102
|
+
bool dont_read_pbc,
|
|
103
|
+
bool debug_pd,
|
|
104
|
+
int pd_start,
|
|
105
|
+
int pd_nlocal,
|
|
106
|
+
long long int &step,
|
|
107
|
+
float&timeStep,
|
|
108
|
+
float* masses,
|
|
109
|
+
float* charges,
|
|
110
|
+
float* coordinates,
|
|
111
|
+
float* cell );
|
|
112
|
+
/// Return the number of atoms
|
|
113
|
+
int nOfAtoms() const;
|
|
114
|
+
/// Return the file pointer to the initial position (use at your own risk)
|
|
115
|
+
std::optional<std::string> rewind();
|
|
116
|
+
};
|
|
117
|
+
} //namespace PLMD
|
|
118
|
+
#endif //__PLUMED_tools_TrajectoryParser_h
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2021-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_Tree_h
|
|
23
|
+
#define __PLUMED_tools_Tree_h
|
|
24
|
+
|
|
25
|
+
#include <vector>
|
|
26
|
+
#include "Vector.h"
|
|
27
|
+
#include "../core/GenericMolInfo.h"
|
|
28
|
+
#include "AtomNumber.h"
|
|
29
|
+
|
|
30
|
+
namespace PLMD {
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/// \ingroup TOOLBOX
|
|
34
|
+
class Tree {
|
|
35
|
+
|
|
36
|
+
private:
|
|
37
|
+
GenericMolInfo* moldat_;
|
|
38
|
+
std::vector<AtomNumber> root_;
|
|
39
|
+
std::vector<AtomNumber> tree_;
|
|
40
|
+
|
|
41
|
+
std::vector<unsigned> root_indexes_;
|
|
42
|
+
std::vector<unsigned> tree_indexes_;
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/// constructor
|
|
46
|
+
explicit Tree(GenericMolInfo* moldat);
|
|
47
|
+
/// build a tree
|
|
48
|
+
void buildTree(const std::vector<AtomNumber> & atoms);
|
|
49
|
+
const std::vector<AtomNumber> & getTree(const std::vector<AtomNumber> & atoms);
|
|
50
|
+
|
|
51
|
+
const std::vector<AtomNumber> & getTree() const noexcept;
|
|
52
|
+
/// get root
|
|
53
|
+
const std::vector<AtomNumber> & getRoot() const noexcept;
|
|
54
|
+
|
|
55
|
+
const std::vector<unsigned> & getTreeIndexes() const noexcept;
|
|
56
|
+
const std::vector<unsigned> & getRootIndexes() const noexcept;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#endif
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2018-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_TypesafePtr_h
|
|
23
|
+
#define __PLUMED_tools_TypesafePtr_h
|
|
24
|
+
|
|
25
|
+
#include "Exception.h"
|
|
26
|
+
|
|
27
|
+
#include <memory>
|
|
28
|
+
#include <iosfwd>
|
|
29
|
+
#include <map>
|
|
30
|
+
#include <utility>
|
|
31
|
+
#include <mutex>
|
|
32
|
+
#include <cstdio>
|
|
33
|
+
#include <array>
|
|
34
|
+
#include <cstring>
|
|
35
|
+
#include <type_traits>
|
|
36
|
+
#include <climits>
|
|
37
|
+
#include <limits>
|
|
38
|
+
#include <initializer_list>
|
|
39
|
+
#include <algorithm>
|
|
40
|
+
|
|
41
|
+
namespace PLMD {
|
|
42
|
+
|
|
43
|
+
static inline bool typesafePtrSkipCheck() {
|
|
44
|
+
static const bool ret=std::getenv("PLUMED_TYPESAFE_IGNORE");
|
|
45
|
+
return ret;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
template<class T>
|
|
49
|
+
std::size_t typesafePtrSizeof() {
|
|
50
|
+
return sizeof(T);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
template<>
|
|
54
|
+
inline
|
|
55
|
+
std::size_t typesafePtrSizeof<void>() {
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
template<>
|
|
60
|
+
inline
|
|
61
|
+
std::size_t typesafePtrSizeof<const void>() {
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
\ingroup TOOLBOX
|
|
67
|
+
Class to deal with propoagation of typesafe pointers.
|
|
68
|
+
|
|
69
|
+
*/
|
|
70
|
+
class TypesafePtr {
|
|
71
|
+
/// Small structure used to pass elements of a shape initializer_list
|
|
72
|
+
struct SizeLike {
|
|
73
|
+
std::size_t size;
|
|
74
|
+
SizeLike(short unsigned dim): size(dim) {}
|
|
75
|
+
SizeLike(unsigned dim): size(dim) {}
|
|
76
|
+
SizeLike(long unsigned dim): size(dim) {}
|
|
77
|
+
SizeLike(long long unsigned dim): size(dim) {}
|
|
78
|
+
SizeLike(short dim): size(std::size_t(dim)) {}
|
|
79
|
+
SizeLike(int dim): size(std::size_t(dim)) {}
|
|
80
|
+
SizeLike(long int dim): size(std::size_t(dim)) {}
|
|
81
|
+
SizeLike(long long int dim): size(std::size_t(dim)) {}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
inline void init_shape(const std::size_t* shape) {
|
|
85
|
+
myshape[0]=0;
|
|
86
|
+
if(shape && *shape>0) {
|
|
87
|
+
std::size_t nelem_=1;
|
|
88
|
+
unsigned i=0;
|
|
89
|
+
for(i=0; i<myshape.size(); i++) {
|
|
90
|
+
myshape[i]=*shape;
|
|
91
|
+
if(*shape==0) {
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
nelem_*=*shape;
|
|
95
|
+
shape++;
|
|
96
|
+
}
|
|
97
|
+
plumed_assert(i<myshape.size()); // check that last element is actually zero
|
|
98
|
+
if(mynelem==0) {
|
|
99
|
+
mynelem=nelem_;
|
|
100
|
+
}
|
|
101
|
+
plumed_assert(mynelem==nelem_) << "Inconsistent shape/nelem";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static std::string extra_msg();
|
|
106
|
+
|
|
107
|
+
public:
|
|
108
|
+
|
|
109
|
+
TypesafePtr(void* ptr, std::size_t nelem, const std::size_t* shape, std::size_t flags):
|
|
110
|
+
myptr(ptr),
|
|
111
|
+
mynelem(nelem),
|
|
112
|
+
myflags(flags) {
|
|
113
|
+
buffer[0]='\0';
|
|
114
|
+
init_shape(shape);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static constexpr unsigned maxrank=4;
|
|
118
|
+
static TypesafePtr fromSafePtr(void* safe);
|
|
119
|
+
static TypesafePtr setNelemAndShape(const TypesafePtr &other, std::size_t nelem, const std::size_t* shape) {
|
|
120
|
+
return TypesafePtr(other.myptr,nelem,shape,other.myflags);
|
|
121
|
+
}
|
|
122
|
+
static TypesafePtr unchecked(const void* ptr) {
|
|
123
|
+
return TypesafePtr(const_cast<void*>(ptr),0,nullptr,0);
|
|
124
|
+
}
|
|
125
|
+
static constexpr unsigned short is_integral=3;
|
|
126
|
+
static constexpr unsigned short is_floating_point=4;
|
|
127
|
+
static constexpr unsigned short is_file=5;
|
|
128
|
+
|
|
129
|
+
TypesafePtr() {
|
|
130
|
+
myshape[0]=0;
|
|
131
|
+
buffer[0]='\0';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
TypesafePtr(std::nullptr_t) {
|
|
135
|
+
myshape[0]=0;
|
|
136
|
+
buffer[0]='\0';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/// Macro that generate a constructor with given type and flags
|
|
140
|
+
#define __PLUMED_WRAPPER_TYPESAFEPTR_INNER(type,type_,flags_) \
|
|
141
|
+
TypesafePtr(type_*ptr, std::size_t nelem=0, const std::size_t* shape=nullptr) : \
|
|
142
|
+
myptr((void*)const_cast<type*>(ptr)), \
|
|
143
|
+
mynelem(nelem), \
|
|
144
|
+
myflags(flags_) \
|
|
145
|
+
{ \
|
|
146
|
+
init_shape(shape); \
|
|
147
|
+
buffer[0]='\0'; \
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/// Macro that uses __PLUMED_WRAPPER_TYPESAFEPTR_INNER to generate constructors with
|
|
151
|
+
/// all possible pointer-const combinations
|
|
152
|
+
#define __PLUMED_WRAPPER_TYPESAFEPTR(type, code,size) \
|
|
153
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_INNER(type, type, size | (0x10000*(code)) | (0x2000000*2)) \
|
|
154
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_INNER(type, type const, size | (0x10000*(code)) | (0x2000000*3)) \
|
|
155
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_INNER(type*,type*, size | (0x10000*(code)) | (0x2000000*4)) \
|
|
156
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_INNER(type*,type*const, size | (0x10000*(code)) | (0x2000000*5)) \
|
|
157
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_INNER(type*,type const*, size | (0x10000*(code)) | (0x2000000*6)) \
|
|
158
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_INNER(type*,type const*const, size | (0x10000*(code)) | (0x2000000*7))
|
|
159
|
+
|
|
160
|
+
/// Macro that generates the constructors from empy types (those of which sizeof cannot be computed)
|
|
161
|
+
#define __PLUMED_WRAPPER_TYPESAFEPTR_EMPTY(type,code) __PLUMED_WRAPPER_TYPESAFEPTR(type,code,0)
|
|
162
|
+
|
|
163
|
+
/// Macro that generates the constructors from sized types (those of which sizeof can be computed).
|
|
164
|
+
/// In addition to generating constructors with all pointer types, it generates a constructor to
|
|
165
|
+
/// allow pass-by-value
|
|
166
|
+
#define __PLUMED_WRAPPER_TYPESAFEPTR_SIZED(type,code) \
|
|
167
|
+
__PLUMED_WRAPPER_TYPESAFEPTR(type,code,sizeof(type)) \
|
|
168
|
+
TypesafePtr(type val, std::size_t nelem=0, const std::size_t* shape=nullptr): \
|
|
169
|
+
mynelem(1), \
|
|
170
|
+
myflags(sizeof(type) | (0x10000*(code)) | (0x2000000*1)) \
|
|
171
|
+
{ \
|
|
172
|
+
plumed_assert(sizeof(type)<=32); \
|
|
173
|
+
myptr=&buffer[0]; \
|
|
174
|
+
myflags=sizeof(type) | (0x10000*(code)) | (0x2000000*1); \
|
|
175
|
+
std::memcpy(&buffer[0],&val,sizeof(type)); \
|
|
176
|
+
init_shape(shape); \
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/// Here we create all the required instances
|
|
180
|
+
/// 1: void
|
|
181
|
+
/// 3: integral
|
|
182
|
+
/// 4: floating
|
|
183
|
+
/// 5: FILE
|
|
184
|
+
/// 0x100: unsigned
|
|
185
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_EMPTY(void,1)
|
|
186
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(char,(CHAR_MIN==0)*0x100+3)
|
|
187
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(signed char,3)
|
|
188
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(unsigned char,0x100+3)
|
|
189
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(short,3)
|
|
190
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(unsigned short,0x100+3)
|
|
191
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(int,3)
|
|
192
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(unsigned int,0x100+3)
|
|
193
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(long,3)
|
|
194
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(unsigned long,0x100+3)
|
|
195
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(long long,3)
|
|
196
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(unsigned long long,0x100+3)
|
|
197
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(float,4)
|
|
198
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(double,4)
|
|
199
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_SIZED(long double,4)
|
|
200
|
+
__PLUMED_WRAPPER_TYPESAFEPTR_EMPTY(FILE,5)
|
|
201
|
+
|
|
202
|
+
~TypesafePtr() {
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
TypesafePtr(const TypesafePtr&other) = delete;
|
|
207
|
+
|
|
208
|
+
TypesafePtr & operator=(const TypesafePtr & other) = delete;
|
|
209
|
+
|
|
210
|
+
TypesafePtr(TypesafePtr&&other):
|
|
211
|
+
buffer(other.buffer),
|
|
212
|
+
myptr(other.myptr==&other.buffer[0] ? &buffer[0] : other.myptr),
|
|
213
|
+
mynelem(other.mynelem),
|
|
214
|
+
myshape(other.myshape),
|
|
215
|
+
myflags(other.myflags) {
|
|
216
|
+
other.myptr=nullptr;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
TypesafePtr copy() const;
|
|
220
|
+
|
|
221
|
+
TypesafePtr & operator=(TypesafePtr && other) {
|
|
222
|
+
myptr=(other.myptr==&other.buffer[0] ? &buffer[0] : other.myptr);
|
|
223
|
+
myflags=other.myflags;
|
|
224
|
+
mynelem=other.mynelem;
|
|
225
|
+
myshape=other.myshape;
|
|
226
|
+
buffer=other.buffer;
|
|
227
|
+
other.myptr=nullptr;
|
|
228
|
+
return *this;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
std::string type_str() const {
|
|
232
|
+
auto type=(myflags>>16)&0xff;
|
|
233
|
+
if(type==0) {
|
|
234
|
+
return "wildcard";
|
|
235
|
+
}
|
|
236
|
+
if(type==1) {
|
|
237
|
+
return "void";
|
|
238
|
+
}
|
|
239
|
+
if(type==2) {
|
|
240
|
+
return "integral";
|
|
241
|
+
}
|
|
242
|
+
if(type==3) {
|
|
243
|
+
return "integral";
|
|
244
|
+
}
|
|
245
|
+
if(type==4) {
|
|
246
|
+
return "floating point";
|
|
247
|
+
}
|
|
248
|
+
if(type==5) {
|
|
249
|
+
return "FILE";
|
|
250
|
+
}
|
|
251
|
+
return "unknown";
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
private:
|
|
255
|
+
|
|
256
|
+
template<typename T>
|
|
257
|
+
T* get_priv(std::size_t nelem, const std::size_t* shape, bool byvalue) const {
|
|
258
|
+
|
|
259
|
+
if(typesafePtrSkipCheck()) {
|
|
260
|
+
return (T*) myptr;
|
|
261
|
+
}
|
|
262
|
+
typedef typename std::remove_pointer<T>::type T_noptr;
|
|
263
|
+
if(myflags==0) {
|
|
264
|
+
return (T*) myptr; // no check
|
|
265
|
+
}
|
|
266
|
+
auto size=myflags&0xffff;
|
|
267
|
+
auto type=(myflags>>16)&0xff;
|
|
268
|
+
// auto unsi=(flags>>24)&0x1; // ignored
|
|
269
|
+
auto cons=(myflags>>25)&0x7;
|
|
270
|
+
|
|
271
|
+
// type=0: ignore check
|
|
272
|
+
// type>5: undefined yet
|
|
273
|
+
if(type!=0 && type<=5) {
|
|
274
|
+
if(std::is_integral<T_noptr>::value && (type!=is_integral)) {
|
|
275
|
+
throw ExceptionTypeError() <<"This command expects an integer type. Received a " << type_str() << " instead"<<extra_msg();
|
|
276
|
+
}
|
|
277
|
+
if(std::is_floating_point<T_noptr>::value && (type!=is_floating_point)) {
|
|
278
|
+
throw ExceptionTypeError() <<"This command expects a floating point type. Received a " << type_str() << " instead"<<extra_msg();
|
|
279
|
+
}
|
|
280
|
+
if(std::is_same<FILE,typename std::remove_const<T_noptr>::type>::value && (type!=is_file)) {
|
|
281
|
+
throw ExceptionTypeError() <<"This command expects a FILE. Received a " << type_str() << " instead"<<extra_msg();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if(size>0 && typesafePtrSizeof<T_noptr>() >0 && typesafePtrSizeof<T_noptr>()!=size) {
|
|
286
|
+
throw ExceptionTypeError() << "This command expects a type with size " << typesafePtrSizeof<T_noptr>() << ". Received type has size " << size << " instead"<<extra_msg();
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if(!byvalue)
|
|
290
|
+
if(cons==1) {
|
|
291
|
+
throw ExceptionTypeError() << "This command is trying to take the address of an argument that was passed by value"<<extra_msg();
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// cons==1 (by value) is here treated as cons==3 (const type*)
|
|
295
|
+
if(cons>0) {
|
|
296
|
+
if(!std::is_pointer<T>::value) {
|
|
297
|
+
if(std::is_void<T>::value) {
|
|
298
|
+
if(cons==1) {
|
|
299
|
+
throw ExceptionTypeError() << "This command expects a void pointer. It received a value instead"<<extra_msg();
|
|
300
|
+
}
|
|
301
|
+
} else {
|
|
302
|
+
if(cons!=1 && cons!=2 && cons!=3) {
|
|
303
|
+
throw ExceptionTypeError() << "This command expects a pointer or a value. It received a pointer-to-pointer instead"<<extra_msg();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if(!std::is_const<T>::value) {
|
|
307
|
+
if(cons==3) {
|
|
308
|
+
throw ExceptionTypeError() << "This command expects a modifiable pointer (T*). It received a non modifiable pointer instead (const T*)"<<extra_msg();
|
|
309
|
+
} else if(cons==1) {
|
|
310
|
+
throw ExceptionTypeError() << "This command expects a modifiable pointer (T*). It received a value instead (T)"<<extra_msg();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
if(!std::is_const<T>::value) {
|
|
315
|
+
if(cons==1) {
|
|
316
|
+
throw ExceptionTypeError() << "This command expects a pointer-to-pointer. It received a value intead"<<extra_msg();
|
|
317
|
+
}
|
|
318
|
+
if(cons==2 || cons==3) {
|
|
319
|
+
throw ExceptionTypeError() << "This command expects a pointer-to-pointer. It received a pointer intead"<<extra_msg();
|
|
320
|
+
}
|
|
321
|
+
if(!std::is_const<T_noptr>::value) {
|
|
322
|
+
if(cons!=4) {
|
|
323
|
+
throw ExceptionTypeError() << "This command expects a modifiable pointer-to-pointer (T**)"<<extra_msg();
|
|
324
|
+
}
|
|
325
|
+
} else {
|
|
326
|
+
if(cons!=6) {
|
|
327
|
+
throw ExceptionTypeError() << "This command expects a modifiable pointer to unmodifiable pointer (const T**)"<<extra_msg();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
} else {
|
|
331
|
+
if(!std::is_const<T_noptr>::value) {
|
|
332
|
+
if(cons!=4 && cons!=5) {
|
|
333
|
+
throw ExceptionTypeError() << "This command expects T*const* pointer, and can only receive T** or T*const* pointers"<<extra_msg();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
// check full shape, if possible
|
|
340
|
+
if(shape && shape[0] && myshape[0]) {
|
|
341
|
+
for(unsigned i=0; i<myshape.size(); i++) {
|
|
342
|
+
if(shape[i]==0 && myshape[i]!=0) {
|
|
343
|
+
throw ExceptionTypeError() << "Incorrect number of axis (passed greater than requested)"<<extra_msg();
|
|
344
|
+
}
|
|
345
|
+
if(shape[i]!=0 && myshape[i]==0) {
|
|
346
|
+
throw ExceptionTypeError() << "Incorrect number of axis (requested greater than passed)"<<extra_msg();
|
|
347
|
+
}
|
|
348
|
+
if(shape[i]==0) {
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
if((shape[i]>myshape[i])) {
|
|
352
|
+
throw ExceptionTypeError() << "This command wants " << shape[i] << " elements on axis " << i <<" of this pointer, but " << myshape[i] << " have been passed"<<extra_msg();
|
|
353
|
+
}
|
|
354
|
+
if(i>0 && (shape[i]<myshape[i])) {
|
|
355
|
+
throw ExceptionTypeError() << "This command wants " << shape[i] << " elements on axis " << i <<" of this pointer, but " << myshape[i] << " have been passed"<<extra_msg();
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if(nelem==0 && shape && shape[0]>0) {
|
|
360
|
+
nelem=1;
|
|
361
|
+
for(unsigned i=0; i<myshape.size(); i++) {
|
|
362
|
+
if(shape[i]==0) {
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
nelem*=shape[i];
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
// check number of elements
|
|
369
|
+
if(nelem>0 && mynelem>0)
|
|
370
|
+
if(!(nelem<=mynelem)) {
|
|
371
|
+
throw ExceptionTypeError() << "This command wants to access " << nelem << " from this pointer, but only " << mynelem << " have been passed"<<extra_msg();
|
|
372
|
+
}
|
|
373
|
+
return (T*) myptr;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
public:
|
|
377
|
+
|
|
378
|
+
template<typename T>
|
|
379
|
+
void set(T val) const {
|
|
380
|
+
*get_priv<T>(0,nullptr,false)=val;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
template<typename T>
|
|
384
|
+
typename std::enable_if<std::is_pointer<T>::value,T>::type get() const {
|
|
385
|
+
typedef typename std::remove_pointer<T>::type T_noptr;
|
|
386
|
+
return get_priv<T_noptr>(0,nullptr,false);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
template<typename T>
|
|
390
|
+
typename std::enable_if<!std::is_pointer<T>::value,T>::type get() const {
|
|
391
|
+
return *get_priv<const T>(1,nullptr,true);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// this will make sure that a null character is present
|
|
395
|
+
const char* getCString() const {
|
|
396
|
+
const char* ptr=get_priv<const char>(0,nullptr,false);
|
|
397
|
+
if(!typesafePtrSkipCheck() && mynelem>0 && mynelem<std::numeric_limits<std::size_t>::max()) {
|
|
398
|
+
std::size_t i=0;
|
|
399
|
+
for(; i<mynelem; i++)
|
|
400
|
+
if(ptr[i]==0) {
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
if(i==mynelem) {
|
|
404
|
+
throw ExceptionTypeError() << "PLUMED is expecting a null terminated string, but no null character was found";
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return ptr;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
template<typename T,typename I>
|
|
411
|
+
typename std::enable_if<std::is_integral<I>::value, T>::type get(I nelem) const {
|
|
412
|
+
static_assert(std::is_pointer<T>::value,"only pointer types allowed here");
|
|
413
|
+
typedef typename std::remove_pointer<T>::type T_noptr;
|
|
414
|
+
return get_priv<T_noptr>(std::size_t(nelem),nullptr,false);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
template<typename T>
|
|
418
|
+
T get(std::initializer_list<SizeLike> shape) const {
|
|
419
|
+
static_assert(std::is_pointer<T>::value,"only pointer types allowed here");
|
|
420
|
+
plumed_assert(shape.size()<=maxrank);
|
|
421
|
+
std::array<std::size_t,maxrank+1> shape_;
|
|
422
|
+
typedef typename std::remove_pointer<T>::type T_noptr;
|
|
423
|
+
unsigned j=0;
|
|
424
|
+
for(auto i : shape) {
|
|
425
|
+
shape_[j]=i.size;
|
|
426
|
+
j++;
|
|
427
|
+
}
|
|
428
|
+
shape_[j]=0;
|
|
429
|
+
return get_priv<T_noptr>(0,&shape_[0],false);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
operator bool() const noexcept {
|
|
433
|
+
return myptr;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
void* getRaw() const noexcept {
|
|
437
|
+
return myptr;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
std::size_t getNelem() const noexcept {
|
|
441
|
+
return mynelem;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const std::size_t* getShape() const noexcept {
|
|
445
|
+
return myshape.data();
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
std::size_t getFlags() const noexcept {
|
|
449
|
+
return myflags;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
private:
|
|
453
|
+
std::array<char,32> buffer;
|
|
454
|
+
void* myptr=nullptr;
|
|
455
|
+
std::size_t mynelem=0;
|
|
456
|
+
std::array<std::size_t,maxrank+1> myshape; // make sure to initialize this!
|
|
457
|
+
std::size_t myflags=0;
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
#endif
|