├── ext ├── source ├── interface │ ├── version.txt │ ├── cpp │ │ └── tinker │ │ │ ├── modcpp.cpp │ │ │ ├── detail │ │ │ ├── kchrge.hh │ │ │ ├── inter.hh │ │ │ ├── kanang.hh │ │ │ ├── hescut.hh │ │ │ ├── ctrpot.hh │ │ │ ├── gkstuf.hh │ │ │ ├── sizes.hh │ │ │ ├── iounit.hh │ │ │ ├── tortor.hh │ │ │ ├── bitor.hh │ │ │ ├── openmp.hh │ │ │ ├── chrono.hh │ │ │ ├── kcpen.hh │ │ │ ├── kctrn.hh │ │ │ ├── kdsp.hh │ │ │ ├── scales.hh │ │ │ ├── titles.hh │ │ │ ├── extfld.hh │ │ │ ├── virial.hh │ │ │ ├── fields.hh │ │ │ ├── solpot.hh │ │ │ ├── keys.hh │ │ │ ├── params.hh │ │ │ ├── usage.hh │ │ │ ├── align.hh │ │ │ ├── moldyn.hh │ │ │ ├── angang.hh │ │ │ ├── rotbnd.hh │ │ │ ├── strbnd.hh │ │ │ ├── strtor.hh │ │ │ ├── vibs.hh │ │ │ ├── angtor.hh │ │ │ ├── ksolut.hh │ │ │ ├── chgtrn.hh │ │ │ ├── opbend.hh │ │ │ ├── opdist.hh │ │ │ ├── pitors.hh │ │ │ ├── atmlst.hh │ │ │ ├── fracs.hh │ │ │ ├── hessn.hh │ │ │ ├── kpitor.hh │ │ │ ├── krepl.hh │ │ │ ├── kstbnd.hh │ │ │ ├── orbits.hh │ │ │ ├── kantor.hh │ │ │ ├── ksttor.hh │ │ │ ├── tarray.hh │ │ │ ├── urypot.hh │ │ │ ├── kopbnd.hh │ │ │ ├── kopdst.hh │ │ │ ├── rxnpot.hh │ │ │ ├── stodyn.hh │ │ │ ├── rxnfld.hh │ │ │ ├── tree.hh │ │ │ ├── math.hh │ │ │ ├── urey.hh │ │ │ ├── argue.hh │ │ │ ├── bndstr.hh │ │ │ ├── kpolr.hh │ │ │ ├── omega.hh │ │ │ ├── dipole.hh │ │ │ ├── kexpl.hh │ │ │ ├── kiprop.hh │ │ │ ├── kurybr.hh │ │ │ ├── improp.hh │ │ │ ├── khbond.hh │ │ │ ├── bndpot.hh │ │ │ ├── kpolpr.hh │ │ │ ├── kvdwpr.hh │ │ │ ├── minima.hh │ │ │ ├── kmulti.hh │ │ │ ├── reppot.hh │ │ │ ├── zclose.hh │ │ │ ├── disp.hh │ │ │ ├── cflux.hh │ │ │ ├── angbnd.hh │ │ │ ├── rigid.hh │ │ │ ├── kitors.hh │ │ │ ├── kvdws.hh │ │ │ ├── chgpen.hh │ │ │ ├── syntrn.hh │ │ │ ├── files.hh │ │ │ ├── polpcg.hh │ │ │ ├── imptor.hh │ │ │ ├── pistuf.hh │ │ │ ├── zcoord.hh │ │ │ ├── ewald.hh │ │ │ ├── ptable.hh │ │ │ ├── bound.hh │ │ │ ├── dsppot.hh │ │ │ ├── units.hh │ │ │ ├── atoms.hh │ │ │ ├── charge.hh │ │ │ ├── molcul.hh │ │ │ ├── fft.hh │ │ │ ├── linmin.hh │ │ │ ├── katoms.hh │ │ │ ├── mplpot.hh │ │ │ ├── ascii.hh │ │ │ ├── mdstuf.hh │ │ │ ├── socket.hh │ │ │ ├── expol.hh │ │ │ ├── kcflux.hh │ │ │ ├── disgeo.hh │ │ │ ├── nucleo.hh │ │ │ ├── phipsi.hh │ │ │ ├── cell.hh │ │ │ ├── torpot.hh │ │ │ ├── qmstuf.hh │ │ │ ├── tors.hh │ │ │ ├── poltcg.hh │ │ │ ├── repel.hh │ │ │ ├── paths.hh │ │ │ ├── couple.hh │ │ │ ├── dma.hh │ │ │ ├── polgrp.hh │ │ │ ├── valfit.hh │ │ │ ├── sequen.hh │ │ │ ├── rgddyn.hh │ │ │ ├── atomid.hh │ │ │ ├── freeze.hh │ │ │ ├── group.hh │ │ │ ├── hpmf.hh │ │ │ ├── ring.hh │ │ │ └── xtals.hh │ │ │ └── routines.cpp │ └── include │ │ └── tinker │ │ ├── ifort │ │ └── macro.hh │ │ └── gfortran │ │ └── macro.hh └── ext │ ├── y3 │ └── genall.sh │ └── y31 │ └── mdPos_cu1.yaml ├── include ├── syntax │ ├── cu │ │ ├── realndef.h │ │ └── seqdef.h │ └── acc │ │ └── seqdef.h ├── seq │ ├── add.h │ ├── seq.h │ ├── triangle.h │ ├── pair_vlambda.h │ ├── torque.h │ ├── copysign.h │ ├── pair_chgtrn.h │ └── pairchgtrnaplus.h ├── ff │ ├── hippo │ │ ├── expolscr.h │ │ ├── chgpen.h │ │ ├── expol.h │ │ ├── cflux.h │ │ ├── echgtrn.h │ │ ├── empole.h │ │ ├── epolar.h │ │ └── induce.h │ ├── pmestream.h │ ├── amoeba │ │ ├── empole.h │ │ ├── epolar.h │ │ ├── emplar.h │ │ └── mpole.h │ ├── switch.h │ ├── rwcrd.h │ ├── cumodamoeba.h │ └── echglj.h ├── tool │ ├── exec.h │ ├── compilers.h │ ├── argkey.h │ ├── tinkersuppl.h │ ├── ptrtrait.h │ ├── platform.h │ ├── thrustcache.h │ ├── dvector.h │ └── iotext.h ├── _clang-format ├── math │ ├── const.h │ ├── lu.h │ ├── parallelcu.h │ ├── parallelacc.h │ ├── maxmin.h │ ├── ou.h │ └── switch.h └── test.h ├── doc └── manual │ ├── genindex.rst │ ├── m │ ├── intro.rst │ ├── fig │ │ ├── end.tex │ │ ├── cg.pdf │ │ ├── cg.png │ │ ├── anglep.pdf │ │ ├── anglep.png │ │ ├── qiframe.pdf │ │ ├── qiframe.png │ │ ├── begin.tex │ │ ├── qiframe.tex │ │ ├── cg.tex │ │ └── anglep.tex │ ├── tutorial │ │ ├── analyze.rst │ │ ├── dynamic.rst │ │ ├── minimize.rst │ │ └── index.rst │ ├── feat │ │ ├── potent-vdw.rst │ │ └── index.rst │ ├── elec │ │ └── index.rst │ ├── install │ │ ├── index.rst │ │ └── tinker.rst │ ├── key │ │ ├── hippo.rst │ │ ├── fep.rst │ │ ├── math.rst │ │ ├── dynamic.rst │ │ └── parallel.rst │ ├── zrefs.rst │ └── replace.rst │ ├── index.rst │ ├── Makefile │ ├── requirements.txt │ └── make.bat ├── test ├── file │ ├── water10 │ │ └── h2o10.key │ ├── trpcage │ │ ├── trp_charmm.key │ │ └── trpcage.key │ ├── local_frame │ │ ├── local_frame.key │ │ └── local_frame2.xyz │ ├── anglef │ │ ├── anglef.key │ │ └── anglef.xyz │ ├── nuc │ │ └── a4.key │ ├── nacl │ │ ├── nacl1.xyz │ │ ├── nacl2.xyz │ │ ├── nacl3.xyz │ │ ├── nacl4.xyz │ │ ├── nacl.key │ │ └── nacl4.key │ ├── expol │ │ ├── NaCl.xyz │ │ ├── Nawater.xyz │ │ ├── Clwater.xyz │ │ ├── crys.xyz │ │ └── expol.key │ ├── ala │ │ └── ala.key │ ├── arbox │ │ └── arbox.key │ ├── polpair │ │ ├── nacl.key │ │ └── nacl.xyz │ ├── trunc8 │ │ └── arbox.key │ ├── hippo │ │ ├── repuls │ │ │ ├── repwater.key │ │ │ └── rep.key │ │ ├── chgtrn │ │ │ └── chgtrn.key │ │ ├── mpole │ │ │ ├── newald.key │ │ │ └── ewald.key │ │ └── polar │ │ │ ├── newald.key │ │ │ └── ewald.key │ ├── kwater │ │ ├── kwater.key │ │ └── kwater.xyz │ ├── disp │ │ ├── dewald.key │ │ └── ndewald.key │ ├── aplus2022 │ │ ├── gas.key │ │ ├── liquid.key │ │ └── EtOH-Wat-OH_0.70.xyz │ └── rattle │ │ └── dhfr.key ├── info.cpp ├── main.cpp ├── text.cpp ├── ref │ ├── polpair.1.txt │ ├── polpair.2.txt │ ├── expol.1.txt │ ├── expol.2.txt │ ├── expol.3.txt │ ├── expol.6.txt │ ├── expol.5.txt │ └── angle.2.txt ├── cmakesrc.txt └── kinetic.cpp ├── src ├── objc │ ├── cmakesrc.txt │ └── CMakeLists.txt ├── cu │ ├── cumod.cu │ ├── compilers.cu │ ├── mdPos_cu1.cc │ ├── cmakesrc.txt │ ├── cudalib.cu │ └── amoeba │ │ └── rotpole.cu ├── f │ ├── tinkersupplement.F │ ├── CMakeLists.txt │ └── tinkersupplement.h ├── mechanic2.cpp ├── promo.cc ├── evalence.cpp ├── host │ ├── pmestream.cpp │ ├── gpucard.cpp │ └── darray.cpp ├── acc │ ├── compilers.cpp │ ├── box.cpp │ ├── minimize.cpp │ ├── amoeba │ │ └── rotpole.cpp │ ├── cudalib.cpp │ ├── cmakesrc.txt │ └── CMakeLists.txt ├── exec.cpp ├── amoeba │ └── emplar.cpp ├── cudart │ ├── error.cpp │ ├── pmestream.cpp │ └── thrustcache.cpp ├── mod.cpp ├── mathlu.cpp ├── compilers.cpp └── errprint.cpp ├── .gitmodules ├── cmake ├── os.cmake └── host.cmake ├── example ├── butanex.key ├── ar94.key ├── iceXIII.key ├── dhfr.key ├── dhfr2.key ├── dhfr.seq └── dhfr-dyn.key ├── .clang-tidy ├── .gitignore └── .github └── workflows └── doxygen_gh_pages.yaml /ext/source: -------------------------------------------------------------------------------- 1 | ../tinker/source -------------------------------------------------------------------------------- /ext/interface/version.txt: -------------------------------------------------------------------------------- 1 | 49 2 | -------------------------------------------------------------------------------- /include/syntax/cu/realndef.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /doc/manual/genindex.rst: -------------------------------------------------------------------------------- 1 | Index Page 2 | ========== 3 | -------------------------------------------------------------------------------- /test/file/water10/h2o10.key: -------------------------------------------------------------------------------- 1 | parameters water03 2 | -------------------------------------------------------------------------------- /doc/manual/m/intro.rst: -------------------------------------------------------------------------------- 1 | Introduction 2 | ============ 3 | -------------------------------------------------------------------------------- /include/seq/add.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "adddef.h" 3 | -------------------------------------------------------------------------------- /include/seq/seq.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "seqdef.h" 3 | -------------------------------------------------------------------------------- /test/file/trpcage/trp_charmm.key: -------------------------------------------------------------------------------- 1 | parameters charmm19 2 | -------------------------------------------------------------------------------- /test/file/trpcage/trpcage.key: -------------------------------------------------------------------------------- 1 | parameters amoebapro13 2 | -------------------------------------------------------------------------------- /test/file/local_frame/local_frame.key: -------------------------------------------------------------------------------- 1 | parameters amoeba09 2 | -------------------------------------------------------------------------------- /doc/manual/m/fig/end.tex: -------------------------------------------------------------------------------- 1 | \end{tikzpicture} 2 | \end{document} 3 | -------------------------------------------------------------------------------- /src/objc/cmakesrc.txt: -------------------------------------------------------------------------------- 1 | set (__T9_OBJC_SRC 2 | gpuutil.m 3 | ) 4 | -------------------------------------------------------------------------------- /doc/manual/m/tutorial/analyze.rst: -------------------------------------------------------------------------------- 1 | Program: analyze 2 | ================ 3 | -------------------------------------------------------------------------------- /doc/manual/m/tutorial/dynamic.rst: -------------------------------------------------------------------------------- 1 | Program: dynamic 2 | ================ 3 | -------------------------------------------------------------------------------- /doc/manual/m/tutorial/minimize.rst: -------------------------------------------------------------------------------- 1 | Program: minimize 2 | ================= 3 | -------------------------------------------------------------------------------- /test/file/anglef/anglef.key: -------------------------------------------------------------------------------- 1 | parameters amoeba09 2 | angleterm only 3 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/modcpp.cpp: -------------------------------------------------------------------------------- 1 | #define TINKER_FORTRAN_MODULE_CPP 2 | #include "modcpp.h" 3 | -------------------------------------------------------------------------------- /src/cu/cumod.cu: -------------------------------------------------------------------------------- 1 | #define TINKER_EXTERN_DEFINITION_FILE 1 2 | 3 | #include "ff/cumodamoeba.h" 4 | -------------------------------------------------------------------------------- /doc/manual/m/fig/cg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerTools/tinker9/HEAD/doc/manual/m/fig/cg.pdf -------------------------------------------------------------------------------- /doc/manual/m/fig/cg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerTools/tinker9/HEAD/doc/manual/m/fig/cg.png -------------------------------------------------------------------------------- /doc/manual/m/feat/potent-vdw.rst: -------------------------------------------------------------------------------- 1 | Van der Waals Potential Functions 2 | ================================= 3 | -------------------------------------------------------------------------------- /src/f/tinkersupplement.F: -------------------------------------------------------------------------------- 1 | #define TINKER_SUPPL_IMPL 2 | #include "suppl.f" 3 | #undef TINKER_SUPPL_IMPL 4 | -------------------------------------------------------------------------------- /doc/manual/m/fig/anglep.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerTools/tinker9/HEAD/doc/manual/m/fig/anglep.pdf -------------------------------------------------------------------------------- /doc/manual/m/fig/anglep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerTools/tinker9/HEAD/doc/manual/m/fig/anglep.png -------------------------------------------------------------------------------- /doc/manual/m/fig/qiframe.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerTools/tinker9/HEAD/doc/manual/m/fig/qiframe.pdf -------------------------------------------------------------------------------- /doc/manual/m/fig/qiframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinkerTools/tinker9/HEAD/doc/manual/m/fig/qiframe.png -------------------------------------------------------------------------------- /doc/manual/m/elec/index.rst: -------------------------------------------------------------------------------- 1 | Electrostatics 2 | ============== 3 | 4 | .. toctree:: 5 | 6 | mpole 7 | polar 8 | qi 9 | -------------------------------------------------------------------------------- /src/f/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.18) 2 | 3 | 4 | add_library (tinker9_f OBJECT tinkersupplement.F) 5 | -------------------------------------------------------------------------------- /test/file/nuc/a4.key: -------------------------------------------------------------------------------- 1 | parameters amoebanuc17.prm 2 | 3 | #strtorunit 10.0 4 | #strtorterm only 5 | #angtorterm only 6 | -------------------------------------------------------------------------------- /src/mechanic2.cpp: -------------------------------------------------------------------------------- 1 | #include "md/osrw.h" 2 | 3 | namespace tinker { 4 | void mechanic2() 5 | { 6 | osrw_mech(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /doc/manual/m/install/index.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | .. toctree:: 5 | 6 | preq 7 | tinker 8 | buildwithcmake 9 | -------------------------------------------------------------------------------- /ext/interface/include/tinker/ifort/macro.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define TINKER_IFORT 4 | #define TINKER_MOD(mod, var) mod##_mp_##var##_ 5 | -------------------------------------------------------------------------------- /doc/manual/m/feat/index.rst: -------------------------------------------------------------------------------- 1 | Features & Methods 2 | ================== 3 | 4 | .. toctree:: 5 | 6 | potent 7 | potent-vdw 8 | integrators 9 | -------------------------------------------------------------------------------- /ext/interface/include/tinker/gfortran/macro.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define TINKER_GFORTRAN 4 | #define TINKER_MOD(mod, var) __##mod##_MOD_##var 5 | -------------------------------------------------------------------------------- /doc/manual/m/key/hippo.rst: -------------------------------------------------------------------------------- 1 | HIPPO Force Field 2 | ================= 3 | 4 | **CHGTRN [integer & 2 reals]** 5 | 6 | **DISPERSION [integer & 2 reals]** 7 | -------------------------------------------------------------------------------- /test/file/nacl/nacl1.xyz: -------------------------------------------------------------------------------- 1 | 2 NaCl 2 | 1 Na+ 0.000000 0.000000 0.000000 7 3 | 2 Cl- 2.200000 0.000000 0.000000 15 4 | -------------------------------------------------------------------------------- /test/file/nacl/nacl2.xyz: -------------------------------------------------------------------------------- 1 | 2 NaCl 2 | 1 Na+ 0.000000 0.000000 0.000000 7 3 | 2 Cl- 2.380000 0.000000 0.000000 15 4 | -------------------------------------------------------------------------------- /test/file/nacl/nacl3.xyz: -------------------------------------------------------------------------------- 1 | 2 NaCl 2 | 1 Na+ 0.000000 0.000000 0.000000 7 3 | 2 Cl- 2.500000 0.000000 0.000000 15 4 | -------------------------------------------------------------------------------- /doc/manual/m/zrefs.rst: -------------------------------------------------------------------------------- 1 | .. only:: html 2 | 3 | References 4 | ========== 5 | 6 | .. bibliography:: refs.bib 7 | :cited: 8 | :style: unsrt-modified 9 | -------------------------------------------------------------------------------- /test/file/expol/NaCl.xyz: -------------------------------------------------------------------------------- 1 | 2 Na+_Cl- 2 | 1 Na+ 0.000000 0.000000 0.000000 7 3 | 2 Cl- 0.000000 0.000000 2.370000 15 4 | -------------------------------------------------------------------------------- /include/ff/hippo/expolscr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace tinker { 4 | enum class ExpolScr 5 | { 6 | NONE, 7 | S2U, 8 | S2, 9 | G, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /test/file/nacl/nacl4.xyz: -------------------------------------------------------------------------------- 1 | 2 NaCl 2 | 1 Na+ 0.123000 0.134000 0.145000 7 2 3 | 2 Cl- 1.123000 1.234000 1.347000 15 1 4 | -------------------------------------------------------------------------------- /test/file/ala/ala.key: -------------------------------------------------------------------------------- 1 | parameters amber99sb 2 | verbose 3 | neighbor-list 4 | a-axis 30.0 5 | vdw-cutoff 9.0 6 | ewald 7 | ewald-cutoff 9.0 8 | 9 | -------------------------------------------------------------------------------- /test/file/arbox/arbox.key: -------------------------------------------------------------------------------- 1 | parameters amoeba09 2 | archive 3 | 4 | neighbor-list 5 | list-buffer 1.0 6 | cutoff 9.0 7 | 8 | vdwterm only 9 | 10 | -------------------------------------------------------------------------------- /test/file/polpair/nacl.key: -------------------------------------------------------------------------------- 1 | parameters amoeba09 2 | neighbor-list 3 | a-axis 20.0 4 | cutoff 7.0 5 | vdwterm none 6 | polpair 7 15 0.05 7 | -------------------------------------------------------------------------------- /test/info.cpp: -------------------------------------------------------------------------------- 1 | #include "test.h" 2 | #include "tinker9.h" 3 | 4 | using namespace tinker; 5 | 6 | TEST_CASE("Info", "[noassert]") 7 | { 8 | xInfo(0, nullptr); 9 | } 10 | -------------------------------------------------------------------------------- /test/file/trunc8/arbox.key: -------------------------------------------------------------------------------- 1 | parameters amoeba09 2 | 3 | neighbor-list 4 | list-buffer 0.5 5 | cutoff 7.0 6 | 7 | vdwterm only 8 | octahedron 9 | 10 | -------------------------------------------------------------------------------- /test/file/hippo/repuls/repwater.key: -------------------------------------------------------------------------------- 1 | parameters water19.prm 2 | neighbor-list 3 | 4 | 5 | repulsionterm only 6 | a-axis 25.0 7 | repuls-cutoff 7.0 8 | -------------------------------------------------------------------------------- /include/ff/hippo/chgpen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace tinker { 4 | enum class Chgpen 5 | { 6 | NONE, 7 | GORDON1, ///< HIPPO 8 | GORDON2 ///< AMOEBA Plus 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /src/promo.cc: -------------------------------------------------------------------------------- 1 | #include "tool/ioprint.h" 2 | 3 | #include "tinker9.h" 4 | 5 | namespace tinker { 6 | void promo() 7 | { 8 | print(stdout, "%s\n", TINKER9_PROMO_STRING); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/main.cpp: -------------------------------------------------------------------------------- 1 | #if __cplusplus < 201402L 2 | #ifdef __PGIC__ 3 | #warning This file may take a couple of minutes to compile. 4 | #endif 5 | #define CATCH_CONFIG_MAIN 6 | #include "test.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /ext/ext/y3/genall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run a python script for all YAML files in this directory to generate their cuda kernals 4 | 5 | for f in *.yaml; do 6 | python3 ../ck3.py -c $f | bash 7 | done 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tinker"] 2 | path = tinker 3 | url = https://github.com/TinkerTools/Tinker 4 | [submodule "ext/ext/catch2v3"] 5 | path = ext/ext/catch2v3 6 | url = https://github.com/catchorg/Catch2 7 | -------------------------------------------------------------------------------- /test/file/kwater/kwater.key: -------------------------------------------------------------------------------- 1 | parameters amoeba09 2 | a-axis 18.643 3 | vdw-cutoff 8.0 4 | ewald 5 | ewald-cutoff 7.0 6 | neighbor-list 7 | list-buffer 1.0 8 | ligand 1 9 | -------------------------------------------------------------------------------- /cmake/os.cmake: -------------------------------------------------------------------------------- 1 | if (${CMAKE_SYSTEM_NAME} STREQUAL Linux) 2 | set (__T9_LD_START_GROUP "-Wl,--start-group") 3 | set (__T9_LD_END_GROUP "-Wl,--end-group") 4 | # elseif (${CMAKE_SYSTEM_NAME} STREQUAL Darwin) 5 | endif () 6 | -------------------------------------------------------------------------------- /src/evalence.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/externfunc.h" 2 | 3 | namespace tinker { 4 | TINKER_FVOID2(acc0, cu1, evalence, int); 5 | void evalence(int vers) 6 | { 7 | TINKER_FCALL2(acc0, cu1, evalence, vers); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/host/pmestream.cpp: -------------------------------------------------------------------------------- 1 | namespace tinker { 2 | void pmeStreamStartRecord(bool) {} 3 | 4 | void pmeStreamStartWait(bool) {} 5 | 6 | void pmeStreamFinishRecord(bool) {} 7 | 8 | void pmeStreamFinishWait(bool) {} 9 | } 10 | -------------------------------------------------------------------------------- /test/file/polpair/nacl.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | 20.000000 20.000000 20.000000 90.000000 90.000000 90.000000 3 | 1 Na+ 0.000000 0.000000 0.000000 7 4 | 2 Cl- 1.000000 2.000000 1.500000 15 5 | -------------------------------------------------------------------------------- /include/tool/exec.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace tinker { 5 | /// \ingroup platform 6 | /// \brief Executes a command in shell and returns the output in a string. 7 | std::string exec(const std::string& cmd); 8 | } 9 | -------------------------------------------------------------------------------- /test/file/hippo/chgtrn/chgtrn.key: -------------------------------------------------------------------------------- 1 | parameters hippo19.prm 2 | neighbor-list 3 | a-axis 25.0 4 | b-axis 25.0 5 | c-axis 30.0 6 | 7 | chgtrnterm only 8 | chgtrn-cutoff 7.0 9 | -------------------------------------------------------------------------------- /test/file/hippo/mpole/newald.key: -------------------------------------------------------------------------------- 1 | parameters hippo19.prm 2 | neighbor-list 3 | a-axis 35.0 4 | b-axis 30.0 5 | c-axis 25.0 6 | 7 | multipoleterm only 8 | mpole-cutoff 9.0 9 | -------------------------------------------------------------------------------- /test/file/hippo/polar/newald.key: -------------------------------------------------------------------------------- 1 | parameters hippo19.prm 2 | neighbor-list 3 | a-axis 25.0 4 | b-axis 25.0 5 | c-axis 30.0 6 | 7 | polarizeterm only 8 | mpole-cutoff 9.0 9 | -------------------------------------------------------------------------------- /test/file/hippo/repuls/rep.key: -------------------------------------------------------------------------------- 1 | parameters hippo19.prm 2 | neighbor-list 3 | a-axis 35.0 4 | b-axis 30.0 5 | c-axis 25.0 6 | 7 | repulsionterm only 8 | repuls-cutoff 7.0 9 | -------------------------------------------------------------------------------- /test/file/hippo/mpole/ewald.key: -------------------------------------------------------------------------------- 1 | parameters hippo19.prm 2 | neighbor-list 3 | a-axis 35.0 4 | b-axis 30.0 5 | c-axis 25.0 6 | 7 | multipoleterm only 8 | ewald-cutoff 7.0 9 | ewald 10 | -------------------------------------------------------------------------------- /test/file/hippo/polar/ewald.key: -------------------------------------------------------------------------------- 1 | parameters hippo19.prm 2 | neighbor-list 3 | a-axis 25.0 4 | b-axis 25.0 5 | c-axis 30.0 6 | 7 | polarizeterm only 8 | ewald-cutoff 7.0 9 | ewald 10 | -------------------------------------------------------------------------------- /include/ff/hippo/expol.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/energybuffer.h" 3 | #include "tool/rcman.h" 4 | 5 | namespace tinker { 6 | void expolData(RcOp); 7 | 8 | void alterpol(real (*polscale)[3][3], real (*polinv)[3][3]); 9 | void dexpol(int vers); 10 | } 11 | -------------------------------------------------------------------------------- /src/cu/compilers.cu: -------------------------------------------------------------------------------- 1 | #include "tool/compilers.h" 2 | #include "tool/ioprint.h" 3 | 4 | namespace tinker { 5 | std::string cudaCompilerName() 6 | { 7 | return format("nvcc %d.%d.%d", __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, __CUDACC_VER_BUILD__); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /include/_clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: InheritParentConfig 2 | 3 | ColumnLimit: 160 4 | 5 | AlignAfterOpenBracket: Align 6 | AllowAllArgumentsOnNextLine: false 7 | BinPackParameters: false 8 | -------------------------------------------------------------------------------- /src/f/tinkersupplement.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "tool/macro.h" 3 | #include 4 | 5 | #define TINKER_SUPPL_DECL 6 | 7 | #ifdef __cplusplus 8 | extern "C" 9 | { 10 | #endif 11 | 12 | #include "suppl.f" 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /test/file/disp/dewald.key: -------------------------------------------------------------------------------- 1 | parameters hippo19.prm 2 | neighbor-list 3 | a-axis 35.0 4 | b-axis 30.0 5 | c-axis 25.0 6 | 7 | dispersionterm only 8 | disp-cutoff 5.0 9 | dewald-cutoff 5.0 10 | dewald 11 | -------------------------------------------------------------------------------- /src/objc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # printf "set (__T9_OBJC_SRC\n%s\n)\n" "$(LC_COLLATE=C ls -1a *.m)" > cmakesrc.txt 2 | cmake_minimum_required (VERSION 3.18) 3 | 4 | 5 | enable_language (C) 6 | 7 | 8 | include (cmakesrc.txt) 9 | add_library (tinker9_objc STATIC "${__T9_OBJC_SRC}") 10 | -------------------------------------------------------------------------------- /test/file/disp/ndewald.key: -------------------------------------------------------------------------------- 1 | parameters hippo19.prm 2 | neighbor-list 3 | a-axis 35.0 4 | b-axis 30.0 5 | c-axis 25.0 6 | 7 | dispersionterm only 8 | disp-cutoff 5.0 9 | dewald-cutoff 5.0 10 | #dewald 11 | -------------------------------------------------------------------------------- /test/file/expol/Nawater.xyz: -------------------------------------------------------------------------------- 1 | 4 Na+_water 2 | 1 O 0.000000 0.000000 0.000000 1 2 3 3 | 2 H -0.588762 0.759148 0.000000 2 1 4 | 3 H -0.588762 -0.759148 0.000000 2 1 5 | 4 Na+ 2.219895 0.000000 0.000000 7 6 | -------------------------------------------------------------------------------- /test/file/kwater/kwater.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | 1 K+ -1.614715 -6.918699 7.771255 8 3 | 2 O -0.258625 -8.948555 6.940646 36 3 4 4 | 3 H -0.064465 -9.185704 6.026976 37 2 5 | 4 H 0.160753 -9.629380 7.478526 37 2 6 | -------------------------------------------------------------------------------- /test/file/expol/Clwater.xyz: -------------------------------------------------------------------------------- 1 | 4 Cl-_water 2 | 1 O 0.000000 0.000000 0.000000 1 2 3 3 | 2 H -0.050521 0.955410 0.000000 2 1 4 | 3 H 0.977803 -0.134349 0.000000 2 1 5 | 4 Cl- 3.084358 0.000000 0.000000 15 6 | -------------------------------------------------------------------------------- /doc/manual/m/key/fep.rst: -------------------------------------------------------------------------------- 1 | Free Energy 2 | =========== 3 | 4 | **OSRW-ELE []** 5 | 6 | **OSRW-LAMBDA [real]** 7 | Sets the internal logical flag for OSRW to *true* and provides 8 | the initial value of lambda. 9 | 10 | **OSRW-TORS []** 11 | 12 | **OSRW-VDW []** 13 | 14 | **ROTATABLE-BOND [integer list]** 15 | -------------------------------------------------------------------------------- /include/ff/pmestream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace tinker { 4 | /// \ingroup pme 5 | /// \{ 6 | void pmeStreamStartRecord(bool usePmeStream); 7 | void pmeStreamStartWait(bool usePmeStream); 8 | void pmeStreamFinishRecord(bool usePmeStream); 9 | void pmeStreamFinishWait(bool usePmeStream); 10 | /// \} 11 | } 12 | -------------------------------------------------------------------------------- /doc/manual/m/fig/begin.tex: -------------------------------------------------------------------------------- 1 | \documentclass{standalone} 2 | %\usepackage{charter} 3 | %\usepackage{fouriernc} 4 | \usepackage[notextcomp]{kpfonts} 5 | \usepackage[defaultsans]{lato} 6 | \usepackage{inconsolata} 7 | \usepackage{tikz} 8 | \usetikzlibrary{angles,quotes} 9 | 10 | \begin{document} 11 | \begin{tikzpicture} 12 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kchrge.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kchrge { 6 | extern double*& chg; 7 | 8 | #ifdef TINKER_FORTRAN_MODULE_CPP 9 | extern "C" double* TINKER_MOD(kchrge, chg); 10 | 11 | double*& chg = TINKER_MOD(kchrge, chg); 12 | #endif 13 | } } 14 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/inter.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace inter { 6 | extern double& einter; 7 | 8 | #ifdef TINKER_FORTRAN_MODULE_CPP 9 | extern "C" double TINKER_MOD(inter, einter); 10 | 11 | double& einter = TINKER_MOD(inter, einter); 12 | #endif 13 | } } 14 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kanang.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kanang { 6 | extern double*& anan; 7 | 8 | #ifdef TINKER_FORTRAN_MODULE_CPP 9 | extern "C" double* TINKER_MOD(kanang, anan); 10 | 11 | double*& anan = TINKER_MOD(kanang, anan); 12 | #endif 13 | } } 14 | -------------------------------------------------------------------------------- /test/file/aplus2022/gas.key: -------------------------------------------------------------------------------- 1 | parameters AMOEBAplus_Org.prm 2 | polar-eps 0.00001 3 | 4 | bondterm none 5 | angleterm none 6 | strbndterm none 7 | ureybradterm none 8 | torsionterm none 9 | 10 | #chgtrnterm none 11 | #multipoleterm none 12 | #polarizeterm none 13 | #vdwterm none 14 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/hescut.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace hescut { 6 | extern double& hesscut; 7 | 8 | #ifdef TINKER_FORTRAN_MODULE_CPP 9 | extern "C" double TINKER_MOD(hescut, hesscut); 10 | 11 | double& hesscut = TINKER_MOD(hescut, hesscut); 12 | #endif 13 | } } 14 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/ctrpot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace ctrpot { 6 | extern char (&ctrntyp)[8]; 7 | 8 | #ifdef TINKER_FORTRAN_MODULE_CPP 9 | extern "C" char TINKER_MOD(ctrpot, ctrntyp)[8]; 10 | 11 | char (&ctrntyp)[8] = TINKER_MOD(ctrpot, ctrntyp); 12 | #endif 13 | } } 14 | -------------------------------------------------------------------------------- /example/butanex.key: -------------------------------------------------------------------------------- 1 | # http://scripts.iucr.org/cgi-bin/paper?S010876818609804X 2 | # stable phase III at 5 K 3 | # (a,b,c) = (4.110, 7.621, 8.097); P21/c beta = 118.603 4 | 5 | parameters ~/tinker/params/oplsua 6 | 7 | cutoff 9.0 8 | neighbor-list 9 | 10 | spacegroup P21/c 11 | beta 118.603 12 | 13 | -------------------------------------------------------------------------------- /include/ff/hippo/cflux.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/energybuffer.h" 3 | #include "tool/rcman.h" 4 | 5 | namespace tinker { 6 | /// \ingroup cflux 7 | /// \{ 8 | void cfluxData(RcOp); 9 | 10 | void alterchg(); 11 | void cfluxZeroPot(); 12 | void dcflux(int vers, grad_prec* gx, grad_prec* gy, grad_prec* gz, VirialBuffer vir); 13 | /// \} 14 | } 15 | -------------------------------------------------------------------------------- /test/file/expol/crys.xyz: -------------------------------------------------------------------------------- 1 | 4 Na+_Cl-_Na+_Cl- 2 | 100.000000 100.000000 100.000000 90.000000 90.000000 90.000000 3 | 1 Na+ 0.000000 0.000000 0.000000 7 4 | 2 Cl- 0.000000 1.000000 2.270000 15 5 | 3 Na+ 1.500000 -1.500000 1.500000 7 6 | 4 Cl- 2.270000 0.000000 1.000000 15 7 | -------------------------------------------------------------------------------- /example/ar94.key: -------------------------------------------------------------------------------- 1 | parameters ../params/amoeba09.prm 2 | randomseed 123456 3 | a-axis 118.666 4 | vdw-cutoff 12.0 5 | list-buffer 1.2 6 | neighbor-list 7 | vdwterm only 8 | 9 | integrator verlet 10 | thermostat bussi 11 | -------------------------------------------------------------------------------- /test/file/nacl/nacl.key: -------------------------------------------------------------------------------- 1 | parameters amoeba09 2 | 3 | a-axis 18.643 4 | integrator RESPA 5 | thermostat BUSSI 6 | barostat MONTECARLO 7 | 8 | neighbor-list 9 | list-buffer 0.1 10 | vdw-cutoff 2.6 11 | mpole-cutoff 5.0 12 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/gkstuf.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace gkstuf { 7 | using namespace sizes; 8 | 9 | extern double& gkc; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" double TINKER_MOD(gkstuf, gkc); 13 | 14 | double& gkc = TINKER_MOD(gkstuf, gkc); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /include/ff/amoeba/empole.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/precision.h" 3 | #include "tool/rcman.h" 4 | 5 | namespace tinker { 6 | /// \ingroup mpole 7 | /// \{ 8 | void empoleData(RcOp); 9 | void empole(int vers); 10 | void empoleEwaldRecip(int vers); 11 | void torque(int vers, grad_prec* dx, grad_prec* dy, grad_prec* dz); 12 | void mpoleInit(int vers); 13 | /// \} 14 | } 15 | -------------------------------------------------------------------------------- /include/ff/hippo/echgtrn.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/evdw.h" 3 | #include "tool/rcman.h" 4 | 5 | namespace tinker { 6 | /// \ingroup chgtrn 7 | enum class Chgtrn 8 | { 9 | NONE, 10 | SEPARATE, // hippo 11 | COMBINED // amoeba+ 12 | }; 13 | 14 | /// \ingroup chgtrn 15 | void echgtrnData(RcOp); 16 | /// \ingroup chgtrn 17 | void echgtrn(int vers); 18 | } 19 | -------------------------------------------------------------------------------- /include/syntax/cu/seqdef.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /// \def SEQ_ROUTINE 4 | /// \ingroup cuda_syntax 5 | /// Expands to \c __device__ in CUDA source files. 6 | #define SEQ_ROUTINE __device__ 7 | 8 | /// \def SEQ_CUDA 9 | /// \ingroup cuda_syntax 10 | /// Expands to \c __device__ in CUDA source files. 11 | /// Used in CUDA kernel templates. 12 | #define SEQ_CUDA __device__ 13 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/sizes.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace sizes { 6 | const int maxatm = 1000000; 7 | const int maxtyp = 5000; 8 | const int maxclass = 1000; 9 | const int maxval = 8; 10 | const int maxref = 30; 11 | const int maxgrp = 1000; 12 | const int maxres = 10000; 13 | const int maxbio = 10000; 14 | } } 15 | -------------------------------------------------------------------------------- /include/tool/compilers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace tinker { 5 | /// \addtogroup platform 6 | /// \{ 7 | std::string cxxCompilerName(); ///< Returns the name of the C++ compiler. 8 | std::string accCompilerName(); ///< Returns the name of the OpenACC compiler. 9 | std::string cudaCompilerName(); ///< Returns the name of the CUDA compiler. 10 | /// \} 11 | } 12 | -------------------------------------------------------------------------------- /example/iceXIII.key: -------------------------------------------------------------------------------- 1 | parameters ../params/water21 2 | verbose 3 | 4 | neighbor-list 5 | vdw-correction 6 | ewald 7 | dewald 8 | 9 | spacegroup P21/a 10 | a-axis 27.7251 11 | b-axis 22.4172 12 | c-axis 30.8910 13 | alpha 90.00 14 | beta 109.6873 15 | gamma 90.00 16 | -------------------------------------------------------------------------------- /include/ff/amoeba/epolar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/precision.h" 3 | #include "tool/rcman.h" 4 | 5 | namespace tinker { 6 | /// \ingroup polar 7 | /// \{ 8 | void epolarData(RcOp); 9 | void epolar(int vers); 10 | void epolarEwaldRecipSelf(int vers); 11 | // see also subroutine epolar0e in epolar.f 12 | void epolar0DotProd(const real (*uind)[3], const real (*udirp)[3]); 13 | /// \} 14 | } 15 | -------------------------------------------------------------------------------- /include/syntax/acc/seqdef.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /// \def SEQ_ROUTINE 4 | /// \ingroup acc_syntax 5 | /// Expands to \c _Pragma("acc routine seq") in OpenACC source files. 6 | /// `#pragma acc` cannot be used in macro. 7 | #define SEQ_ROUTINE _Pragma("acc routine seq") 8 | 9 | /// \def SEQ_CUDA 10 | /// \ingroup acc_syntax 11 | /// An empty macro in the OpenACC source code. 12 | #define SEQ_CUDA 13 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/iounit.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace iounit { 6 | extern int& input; 7 | extern int& iout; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" int TINKER_MOD(iounit, input); 11 | extern "C" int TINKER_MOD(iounit, iout); 12 | 13 | int& input = TINKER_MOD(iounit, input); 14 | int& iout = TINKER_MOD(iounit, iout); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /src/acc/compilers.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/compilers.h" 2 | #include "tool/ioprint.h" 3 | 4 | namespace tinker { 5 | #if TINKER_GPULANG_OPENACC 6 | std::string accCompilerName() 7 | { 8 | if (__PGIC__ <= 19) 9 | return format("pgc++ %d.%d.%d", __PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__); 10 | else 11 | return format("nvc++ %d.%d.%d", __PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__); 12 | } 13 | #endif 14 | } 15 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/tortor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace tortor { 6 | extern int& ntortor; 7 | extern int*& itt; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" int TINKER_MOD(tortor, ntortor); 11 | extern "C" int* TINKER_MOD(tortor, itt); 12 | 13 | int& ntortor = TINKER_MOD(tortor, ntortor); 14 | int*& itt = TINKER_MOD(tortor, itt); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/bitor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace bitor_ { 6 | extern int& nbitor; 7 | extern int*& ibitor; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" int TINKER_MOD(bitor, nbitor); 11 | extern "C" int* TINKER_MOD(bitor, ibitor); 12 | 13 | int& nbitor = TINKER_MOD(bitor, nbitor); 14 | int*& ibitor = TINKER_MOD(bitor, ibitor); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/openmp.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace openmp { 6 | extern int& nproc; 7 | extern int& nthread; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" int TINKER_MOD(openmp, nproc); 11 | extern "C" int TINKER_MOD(openmp, nthread); 12 | 13 | int& nproc = TINKER_MOD(openmp, nproc); 14 | int& nthread = TINKER_MOD(openmp, nthread); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /src/host/gpucard.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/gpucard.h" 2 | 3 | namespace tinker { 4 | void gpuData(RcOp op) 5 | { 6 | if (op & RcOp::DEALLOC) { 7 | ndevice = 0; 8 | idevice = -1; 9 | } 10 | 11 | if (op & RcOp::INIT) { 12 | ndevice = 1; 13 | idevice = 0; 14 | } 15 | } 16 | 17 | int gpuGridSize(int) 18 | { 19 | return 1; 20 | } 21 | 22 | int gpuMaxNParallel(int) 23 | { 24 | return 1; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/chrono.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace chrono { 6 | extern double& twall; 7 | extern double& tcpu; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" double TINKER_MOD(chrono, twall); 11 | extern "C" double TINKER_MOD(chrono, tcpu); 12 | 13 | double& twall = TINKER_MOD(chrono, twall); 14 | double& tcpu = TINKER_MOD(chrono, tcpu); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /include/ff/hippo/empole.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "tool/rcman.h" 3 | 4 | namespace tinker { 5 | /// \ingroup hippompole 6 | void empoleChgpenData(RcOp); 7 | /// \ingroup hippompole 8 | void empoleChgpen(int vers); 9 | /// \ingroup hippompole 10 | void empoleChgpenEwaldRecip(int vers, int useCF); 11 | } 12 | 13 | namespace tinker { 14 | void empoleAplusEwald(int vers, int useCF); 15 | void empoleAplusNonEwald(int vers, int useCF); 16 | } 17 | -------------------------------------------------------------------------------- /src/cu/mdPos_cu1.cc: -------------------------------------------------------------------------------- 1 | // ck.py Version 3.1.0 2 | __global__ 3 | static void mdPos_cu1(int n, time_prec dt, pos_prec* restrict qx, pos_prec* restrict qy, pos_prec* restrict qz, 4 | const vel_prec* restrict vlx, const vel_prec* restrict vly, const vel_prec* restrict vlz) 5 | { 6 | for (int i = ITHREAD; i < n; i += STRIDE) { 7 | qx[i] += dt * vlx[i]; 8 | qy[i] += dt * vly[i]; 9 | qz[i] += dt * vlz[i]; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kcpen.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kcpen { 6 | extern double*& cpele; 7 | extern double*& cpalp; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" double* TINKER_MOD(kcpen, cpele); 11 | extern "C" double* TINKER_MOD(kcpen, cpalp); 12 | 13 | double*& cpele = TINKER_MOD(kcpen, cpele); 14 | double*& cpalp = TINKER_MOD(kcpen, cpalp); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kctrn.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kctrn { 6 | extern double*& ctchg; 7 | extern double*& ctdmp; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" double* TINKER_MOD(kctrn, ctchg); 11 | extern "C" double* TINKER_MOD(kctrn, ctdmp); 12 | 13 | double*& ctchg = TINKER_MOD(kctrn, ctchg); 14 | double*& ctdmp = TINKER_MOD(kctrn, ctdmp); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kdsp.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kdsp { 6 | extern double*& dspsix; 7 | extern double*& dspdmp; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" double* TINKER_MOD(kdsp, dspsix); 11 | extern "C" double* TINKER_MOD(kdsp, dspdmp); 12 | 13 | double*& dspsix = TINKER_MOD(kdsp, dspsix); 14 | double*& dspdmp = TINKER_MOD(kdsp, dspdmp); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /include/ff/hippo/epolar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "tool/rcman.h" 3 | 4 | namespace tinker { 5 | /// \ingroup hippopolar 6 | void epolarChgpenData(RcOp); 7 | /// \ingroup hippopolar 8 | void epolarChgpen(int vers); 9 | /// \ingroup hippopolar 10 | void epolarChgpenEwaldRecipSelf(int vers, int use_cf); 11 | } 12 | 13 | namespace tinker { 14 | void epolarAplusEwald(int vers, int useCF); 15 | void epolarAplusNonEwald(int vers, int useCF); 16 | } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/scales.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace scales { 6 | extern double*& scale; 7 | extern int& set_scale; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" double* TINKER_MOD(scales, scale); 11 | extern "C" int TINKER_MOD(scales, set_scale); 12 | 13 | double*& scale = TINKER_MOD(scales, scale); 14 | int& set_scale = TINKER_MOD(scales, set_scale); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/titles.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace titles { 6 | extern int& ltitle; 7 | extern char (&title)[240]; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" int TINKER_MOD(titles, ltitle); 11 | extern "C" char TINKER_MOD(titles, title)[240]; 12 | 13 | int& ltitle = TINKER_MOD(titles, ltitle); 14 | char (&title)[240] = TINKER_MOD(titles, title); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /include/seq/triangle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace tinker { 4 | __device__ 5 | inline int xy_to_tri(int x, int y) 6 | { 7 | long long lx = x; 8 | int base = (lx + 1) * lx / 2; 9 | return base + y; 10 | } 11 | 12 | __device__ 13 | inline void tri_to_xy(int f, int& x, int& y) 14 | { 15 | long long lf = 8ll * f + 1; 16 | double ff = lf; 17 | double fa = (sqrt(ff) - 1) / 2; 18 | x = fa; 19 | y = f - xy_to_tri(x, 0); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/extfld.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace extfld { 6 | extern double (&exfld)[3]; 7 | extern int& use_exfld; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" double TINKER_MOD(extfld, exfld)[3]; 11 | extern "C" int TINKER_MOD(extfld, use_exfld); 12 | 13 | double (&exfld)[3] = TINKER_MOD(extfld, exfld); 14 | int& use_exfld = TINKER_MOD(extfld, use_exfld); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/virial.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace virial { 6 | extern double (&vir)[3][3]; 7 | extern int& use_virial; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" double TINKER_MOD(virial, vir)[3][3]; 11 | extern "C" int TINKER_MOD(virial, use_virial); 12 | 13 | double (&vir)[3][3] = TINKER_MOD(virial, vir); 14 | int& use_virial = TINKER_MOD(virial, use_virial); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/fields.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace fields { 6 | extern int*& biotyp; 7 | extern char (&forcefield)[20]; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" int* TINKER_MOD(fields, biotyp); 11 | extern "C" char TINKER_MOD(fields, forcefield)[20]; 12 | 13 | int*& biotyp = TINKER_MOD(fields, biotyp); 14 | char (&forcefield)[20] = TINKER_MOD(fields, forcefield); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/solpot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace solpot { 6 | extern char (&solvtyp)[8]; 7 | extern char (&borntyp)[8]; 8 | 9 | #ifdef TINKER_FORTRAN_MODULE_CPP 10 | extern "C" char TINKER_MOD(solpot, solvtyp)[8]; 11 | extern "C" char TINKER_MOD(solpot, borntyp)[8]; 12 | 13 | char (&solvtyp)[8] = TINKER_MOD(solpot, solvtyp); 14 | char (&borntyp)[8] = TINKER_MOD(solpot, borntyp); 15 | #endif 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/keys.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace keys { 6 | const int maxkey = 25000; 7 | extern int& nkey; 8 | extern char (&keyline)[maxkey][240]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(keys, nkey); 12 | extern "C" char TINKER_MOD(keys, keyline)[maxkey][240]; 13 | 14 | int& nkey = TINKER_MOD(keys, nkey); 15 | char (&keyline)[maxkey][240] = TINKER_MOD(keys, keyline); 16 | #endif 17 | } } 18 | -------------------------------------------------------------------------------- /include/tool/argkey.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace tinker { 7 | void nextarg(size_t len, char* str, bool& exist); 8 | 9 | template 10 | void nextarg(char (&str)[Len], bool& exist) 11 | { 12 | nextarg(Len, str, exist); 13 | } 14 | 15 | template 16 | void getKV(std::string k, T1& v, T2 vIfKNotFound); 17 | 18 | template 19 | void getKV(std::string k, std::vector& v); 20 | } 21 | -------------------------------------------------------------------------------- /src/acc/box.cpp: -------------------------------------------------------------------------------- 1 | #include "ff/box.h" 2 | 3 | namespace tinker { 4 | void boxDataP1_acc(RcOp op) 5 | { 6 | if (op & RcOp::DEALLOC) { 7 | #pragma acc exit data async delete(lvec1,lvec2,lvec3,recipa,recipb,recipc) 8 | } 9 | 10 | if (op & RcOp::ALLOC) { 11 | #pragma acc enter data async create(lvec1,lvec2,lvec3,recipa,recipb,recipc) 12 | } 13 | } 14 | 15 | void boxCopyin_acc() 16 | { 17 | #pragma acc update async device(lvec1,lvec2,lvec3,recipa,recipb,recipc) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /include/seq/pair_vlambda.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/evdw.h" 3 | #include "seq/seq.h" 4 | 5 | namespace tinker { 6 | /** 7 | * \ingroup vdw 8 | */ 9 | SEQ_ROUTINE 10 | inline real pair_vlambda(real vlam, Vdw vcouple, int imut, int kmut) 11 | { 12 | real vlambda = 1; 13 | if (vcouple == Vdw::DECOUPLE) { 14 | vlambda = (imut == kmut ? 1 : vlam); 15 | } else if (vcouple == Vdw::ANNIHILATE) { 16 | vlambda = (imut || kmut ? vlam : 1); 17 | } 18 | return vlambda; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/params.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace params { 6 | const int maxprm = 25000; 7 | extern int& nprm; 8 | extern char (&prmline)[maxprm][240]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(params, nprm); 12 | extern "C" char TINKER_MOD(params, prmline)[maxprm][240]; 13 | 14 | int& nprm = TINKER_MOD(params, nprm); 15 | char (&prmline)[maxprm][240] = TINKER_MOD(params, prmline); 16 | #endif 17 | } } 18 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/usage.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace usage { 6 | extern int& nuse; 7 | extern int*& iuse; 8 | extern int*& use; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(usage, nuse); 12 | extern "C" int* TINKER_MOD(usage, iuse); 13 | extern "C" int* TINKER_MOD(usage, use); 14 | 15 | int& nuse = TINKER_MOD(usage, nuse); 16 | int*& iuse = TINKER_MOD(usage, iuse); 17 | int*& use = TINKER_MOD(usage, use); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /include/math/const.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/precision.h" 3 | #include 4 | 5 | namespace tinker { 6 | /// \ingroup math 7 | /// \brief \f$ \pi \f$ 8 | constexpr real pi = M_PI; 9 | /// \ingroup math 10 | /// \brief \f$ \sqrt{\pi} \f$ 11 | constexpr real sqrtpi = 1.77245385090551602730; 12 | /// \ingroup math 13 | /// \brief \f$ 180/\pi \f$ 14 | constexpr real radian = 57.2957795130823208768; 15 | /// \ingroup math 16 | /// \brief \f$ \pi/180 \f$ 17 | constexpr real _1radian = 0.01745329251994329576924; 18 | } 19 | -------------------------------------------------------------------------------- /test/file/aplus2022/liquid.key: -------------------------------------------------------------------------------- 1 | parameters AMOEBAplus_Org.prm 2 | polar-eps 0.00001 3 | 4 | bondterm none 5 | angleterm none 6 | strbndterm none 7 | ureybradterm none 8 | torsionterm none 9 | 10 | #chgtrnterm none 11 | #multipoleterm none 12 | #polarizeterm none 13 | #vdwterm none 14 | 15 | neighbor-list 16 | a-axis 20 17 | 18 | chgtrn-cutoff 6.0 19 | mpole-cutoff 7.0 20 | #ewald 21 | ewald-cutoff 7.0 22 | vdw-cutoff 8.0 23 | vdw-correction 24 | -------------------------------------------------------------------------------- /test/file/anglef/anglef.xyz: -------------------------------------------------------------------------------- 1 | 7 Hexafluorophosphate PF6(-) 2 | 1 P -1.306880 3.378018 -3.498924 22 2 3 4 5 6 7 3 | 2 F -1.679942 1.999194 -2.630786 23 1 4 | 3 F -2.107799 2.889512 -4.777447 23 1 5 | 4 F -1.017740 4.724599 -4.296764 23 1 6 | 5 F 0.099120 2.661738 -4.015559 23 1 7 | 6 F -0.616509 3.975867 -2.135322 23 1 8 | 7 F -2.581908 4.159284 -3.008014 23 1 9 | -------------------------------------------------------------------------------- /.clang-tidy: -------------------------------------------------------------------------------- 1 | # for f in $(find src test -type f -name '*.cpp'); do clang-tidy --quiet --config-file=.clang-tidy -p BUILD_DIR $f; done 2 | 3 | --- 4 | Checks: '-*,readability-implicit-bool-conversion' 5 | WarningsAsErrors: '' 6 | HeaderFilterRegex: '' 7 | FormatStyle: none 8 | CheckOptions: 9 | - key: readability-implicit-bool-conversion.AllowIntegerConditions 10 | value: true 11 | - key: readability-implicit-bool-conversion.AllowPointerConditions 12 | value: true 13 | ... 14 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/align.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace align { 6 | extern int& nfit; 7 | extern int*& ifit; 8 | extern double*& wfit; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(align, nfit); 12 | extern "C" int* TINKER_MOD(align, ifit); 13 | extern "C" double* TINKER_MOD(align, wfit); 14 | 15 | int& nfit = TINKER_MOD(align, nfit); 16 | int*& ifit = TINKER_MOD(align, ifit); 17 | double*& wfit = TINKER_MOD(align, wfit); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/moldyn.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace moldyn { 6 | extern double*& v; 7 | extern double*& a; 8 | extern double*& aalt; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double* TINKER_MOD(moldyn, v); 12 | extern "C" double* TINKER_MOD(moldyn, a); 13 | extern "C" double* TINKER_MOD(moldyn, aalt); 14 | 15 | double*& v = TINKER_MOD(moldyn, v); 16 | double*& a = TINKER_MOD(moldyn, a); 17 | double*& aalt = TINKER_MOD(moldyn, aalt); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /test/text.cpp: -------------------------------------------------------------------------------- 1 | #include "test.h" 2 | #include "tool/iotext.h" 3 | 4 | using namespace tinker; 5 | 6 | TEST_CASE("Text", "[util][text]") 7 | { 8 | SECTION("Replace") 9 | { 10 | char c = ' '; 11 | std::string s, r, ans; 12 | auto f = Text::replace; 13 | 14 | s = ""; 15 | r = "x"; 16 | ans = ""; 17 | f(s, r, c); 18 | REQUIRE(s == ans); 19 | 20 | s = "1234567890"; 21 | r = "42"; 22 | ans = "1 3 567890"; 23 | f(s, r, c); 24 | REQUIRE(s == ans); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/angang.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace angang { 6 | extern int& nangang; 7 | extern int*& iaa; 8 | extern double*& kaa; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(angang, nangang); 12 | extern "C" int* TINKER_MOD(angang, iaa); 13 | extern "C" double* TINKER_MOD(angang, kaa); 14 | 15 | int& nangang = TINKER_MOD(angang, nangang); 16 | int*& iaa = TINKER_MOD(angang, iaa); 17 | double*& kaa = TINKER_MOD(angang, kaa); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/rotbnd.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace rotbnd { 6 | extern int& nrot; 7 | extern int*& rot; 8 | extern int& use_short; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(rotbnd, nrot); 12 | extern "C" int* TINKER_MOD(rotbnd, rot); 13 | extern "C" int TINKER_MOD(rotbnd, use_short); 14 | 15 | int& nrot = TINKER_MOD(rotbnd, nrot); 16 | int*& rot = TINKER_MOD(rotbnd, rot); 17 | int& use_short = TINKER_MOD(rotbnd, use_short); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/strbnd.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace strbnd { 6 | extern int& nstrbnd; 7 | extern int*& isb; 8 | extern double*& sbk; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(strbnd, nstrbnd); 12 | extern "C" int* TINKER_MOD(strbnd, isb); 13 | extern "C" double* TINKER_MOD(strbnd, sbk); 14 | 15 | int& nstrbnd = TINKER_MOD(strbnd, nstrbnd); 16 | int*& isb = TINKER_MOD(strbnd, isb); 17 | double*& sbk = TINKER_MOD(strbnd, sbk); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/strtor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace strtor { 6 | extern int& nstrtor; 7 | extern int*& ist; 8 | extern double*& kst; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(strtor, nstrtor); 12 | extern "C" int* TINKER_MOD(strtor, ist); 13 | extern "C" double* TINKER_MOD(strtor, kst); 14 | 15 | int& nstrtor = TINKER_MOD(strtor, nstrtor); 16 | int*& ist = TINKER_MOD(strtor, ist); 17 | double*& kst = TINKER_MOD(strtor, kst); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/vibs.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace vibs { 6 | extern double*& rho; 7 | extern double*& rhok; 8 | extern double*& rwork; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double* TINKER_MOD(vibs, rho); 12 | extern "C" double* TINKER_MOD(vibs, rhok); 13 | extern "C" double* TINKER_MOD(vibs, rwork); 14 | 15 | double*& rho = TINKER_MOD(vibs, rho); 16 | double*& rhok = TINKER_MOD(vibs, rhok); 17 | double*& rwork = TINKER_MOD(vibs, rwork); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/angtor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace angtor { 6 | extern int& nangtor; 7 | extern int*& iat; 8 | extern double*& kant; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(angtor, nangtor); 12 | extern "C" int* TINKER_MOD(angtor, iat); 13 | extern "C" double* TINKER_MOD(angtor, kant); 14 | 15 | int& nangtor = TINKER_MOD(angtor, nangtor); 16 | int*& iat = TINKER_MOD(angtor, iat); 17 | double*& kant = TINKER_MOD(angtor, kant); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/ksolut.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace ksolut { 6 | extern double*& pbr; 7 | extern double*& csr; 8 | extern double*& gkr; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double* TINKER_MOD(ksolut, pbr); 12 | extern "C" double* TINKER_MOD(ksolut, csr); 13 | extern "C" double* TINKER_MOD(ksolut, gkr); 14 | 15 | double*& pbr = TINKER_MOD(ksolut, pbr); 16 | double*& csr = TINKER_MOD(ksolut, csr); 17 | double*& gkr = TINKER_MOD(ksolut, gkr); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/ext/y31/mdPos_cu1.yaml: -------------------------------------------------------------------------------- 1 | KERNEL_VERSION_NUMBER: 11 2 | KERNEL_IS_STATIC: True 3 | 4 | OUTPUT_DIR: src/cu 5 | KERNEL_NAME: mdPos_cu1 6 | SINGLE_LOOP_LIMIT: int n 7 | SINGLE_LOOP_ITER: int i 8 | SINGLE_LOOP_CODE: | 9 | qx[@i@] += dt * vlx[@i@]; 10 | qy[@i@] += dt * vly[@i@]; 11 | qz[@i@] += dt * vlz[@i@]; 12 | EXTRA_PARAMS: | 13 | , time_prec dt 14 | , pos_prec* restrict qx 15 | , pos_prec* restrict qy 16 | , pos_prec* restrict qz 17 | , const vel_prec* restrict vlx 18 | , const vel_prec* restrict vly 19 | , const vel_prec* restrict vlz 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/chgtrn.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace chgtrn { 6 | extern int& nct; 7 | extern double*& chgct; 8 | extern double*& dmpct; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(chgtrn, nct); 12 | extern "C" double* TINKER_MOD(chgtrn, chgct); 13 | extern "C" double* TINKER_MOD(chgtrn, dmpct); 14 | 15 | int& nct = TINKER_MOD(chgtrn, nct); 16 | double*& chgct = TINKER_MOD(chgtrn, chgct); 17 | double*& dmpct = TINKER_MOD(chgtrn, dmpct); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/opbend.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace opbend { 6 | extern int& nopbend; 7 | extern int*& iopb; 8 | extern double*& opbk; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(opbend, nopbend); 12 | extern "C" int* TINKER_MOD(opbend, iopb); 13 | extern "C" double* TINKER_MOD(opbend, opbk); 14 | 15 | int& nopbend = TINKER_MOD(opbend, nopbend); 16 | int*& iopb = TINKER_MOD(opbend, iopb); 17 | double*& opbk = TINKER_MOD(opbend, opbk); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/opdist.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace opdist { 6 | extern int& nopdist; 7 | extern int*& iopd; 8 | extern double*& opdk; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(opdist, nopdist); 12 | extern "C" int* TINKER_MOD(opdist, iopd); 13 | extern "C" double* TINKER_MOD(opdist, opdk); 14 | 15 | int& nopdist = TINKER_MOD(opdist, nopdist); 16 | int*& iopd = TINKER_MOD(opdist, iopd); 17 | double*& opdk = TINKER_MOD(opdist, opdk); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/pitors.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace pitors { 6 | extern int& npitors; 7 | extern int*& ipit; 8 | extern double*& kpit; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(pitors, npitors); 12 | extern "C" int* TINKER_MOD(pitors, ipit); 13 | extern "C" double* TINKER_MOD(pitors, kpit); 14 | 15 | int& npitors = TINKER_MOD(pitors, npitors); 16 | int*& ipit = TINKER_MOD(pitors, ipit); 17 | double*& kpit = TINKER_MOD(pitors, kpit); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /cmake/host.cmake: -------------------------------------------------------------------------------- 1 | add_executable (tinker9) 2 | target_link_libraries (tinker9 3 | __t9_main_o 4 | ${__T9_LD_START_GROUP} 5 | tinker9_acc 6 | tinker9_cpp 7 | ${__T9_LD_END_GROUP} 8 | tinker9_version 9 | tinker9_f 10 | tinkerFToCpp 11 | pthread 12 | ) 13 | 14 | 15 | add_executable (all.tests) 16 | target_link_libraries (all.tests 17 | __t9_all_tests_o 18 | ${__T9_LD_START_GROUP} 19 | tinker9_acc 20 | tinker9_cpp 21 | ${__T9_LD_END_GROUP} 22 | tinker9_version 23 | tinker9_f 24 | tinkerFToCpp 25 | pthread 26 | ) 27 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/atmlst.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace atmlst { 6 | extern int*& bndlist; 7 | extern int*& anglist; 8 | extern int*& balist; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int* TINKER_MOD(atmlst, bndlist); 12 | extern "C" int* TINKER_MOD(atmlst, anglist); 13 | extern "C" int* TINKER_MOD(atmlst, balist); 14 | 15 | int*& bndlist = TINKER_MOD(atmlst, bndlist); 16 | int*& anglist = TINKER_MOD(atmlst, anglist); 17 | int*& balist = TINKER_MOD(atmlst, balist); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/fracs.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace fracs { 6 | extern double*& xfrac; 7 | extern double*& yfrac; 8 | extern double*& zfrac; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double* TINKER_MOD(fracs, xfrac); 12 | extern "C" double* TINKER_MOD(fracs, yfrac); 13 | extern "C" double* TINKER_MOD(fracs, zfrac); 14 | 15 | double*& xfrac = TINKER_MOD(fracs, xfrac); 16 | double*& yfrac = TINKER_MOD(fracs, yfrac); 17 | double*& zfrac = TINKER_MOD(fracs, zfrac); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/hessn.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace hessn { 6 | extern double*& hessx; 7 | extern double*& hessy; 8 | extern double*& hessz; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double* TINKER_MOD(hessn, hessx); 12 | extern "C" double* TINKER_MOD(hessn, hessy); 13 | extern "C" double* TINKER_MOD(hessn, hessz); 14 | 15 | double*& hessx = TINKER_MOD(hessn, hessx); 16 | double*& hessy = TINKER_MOD(hessn, hessy); 17 | double*& hessz = TINKER_MOD(hessn, hessz); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kpitor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kpitor { 6 | extern int& maxnpt; 7 | extern double*& ptcon; 8 | extern char (*&kpt)[8]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(kpitor, maxnpt); 12 | extern "C" double* TINKER_MOD(kpitor, ptcon); 13 | extern "C" char (*TINKER_MOD(kpitor, kpt))[8]; 14 | 15 | int& maxnpt = TINKER_MOD(kpitor, maxnpt); 16 | double*& ptcon = TINKER_MOD(kpitor, ptcon); 17 | char (*&kpt)[8] = TINKER_MOD(kpitor, kpt); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/krepl.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace krepl { 6 | extern double*& prsiz; 7 | extern double*& prdmp; 8 | extern double*& prele; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double* TINKER_MOD(krepl, prsiz); 12 | extern "C" double* TINKER_MOD(krepl, prdmp); 13 | extern "C" double* TINKER_MOD(krepl, prele); 14 | 15 | double*& prsiz = TINKER_MOD(krepl, prsiz); 16 | double*& prdmp = TINKER_MOD(krepl, prdmp); 17 | double*& prele = TINKER_MOD(krepl, prele); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kstbnd.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kstbnd { 6 | extern int& maxnsb; 7 | extern double*& stbn; 8 | extern char (*&ksb)[12]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(kstbnd, maxnsb); 12 | extern "C" double* TINKER_MOD(kstbnd, stbn); 13 | extern "C" char (*TINKER_MOD(kstbnd, ksb))[12]; 14 | 15 | int& maxnsb = TINKER_MOD(kstbnd, maxnsb); 16 | double*& stbn = TINKER_MOD(kstbnd, stbn); 17 | char (*&ksb)[12] = TINKER_MOD(kstbnd, ksb); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/orbits.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace orbits { 6 | extern double*& qorb; 7 | extern double*& worb; 8 | extern double*& emorb; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double* TINKER_MOD(orbits, qorb); 12 | extern "C" double* TINKER_MOD(orbits, worb); 13 | extern "C" double* TINKER_MOD(orbits, emorb); 14 | 15 | double*& qorb = TINKER_MOD(orbits, qorb); 16 | double*& worb = TINKER_MOD(orbits, worb); 17 | double*& emorb = TINKER_MOD(orbits, emorb); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kantor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kantor { 6 | extern int& maxnat; 7 | extern double*& atcon; 8 | extern char (*&kat)[16]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(kantor, maxnat); 12 | extern "C" double* TINKER_MOD(kantor, atcon); 13 | extern "C" char (*TINKER_MOD(kantor, kat))[16]; 14 | 15 | int& maxnat = TINKER_MOD(kantor, maxnat); 16 | double*& atcon = TINKER_MOD(kantor, atcon); 17 | char (*&kat)[16] = TINKER_MOD(kantor, kat); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/ksttor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace ksttor { 6 | extern int& maxnbt; 7 | extern double*& btcon; 8 | extern char (*&kbt)[16]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(ksttor, maxnbt); 12 | extern "C" double* TINKER_MOD(ksttor, btcon); 13 | extern "C" char (*TINKER_MOD(ksttor, kbt))[16]; 14 | 15 | int& maxnbt = TINKER_MOD(ksttor, maxnbt); 16 | double*& btcon = TINKER_MOD(ksttor, btcon); 17 | char (*&kbt)[16] = TINKER_MOD(ksttor, kbt); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/tarray.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace tarray { 6 | extern int& ntpair; 7 | extern int*& tindex; 8 | extern double*& tdipdip; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(tarray, ntpair); 12 | extern "C" int* TINKER_MOD(tarray, tindex); 13 | extern "C" double* TINKER_MOD(tarray, tdipdip); 14 | 15 | int& ntpair = TINKER_MOD(tarray, ntpair); 16 | int*& tindex = TINKER_MOD(tarray, tindex); 17 | double*& tdipdip = TINKER_MOD(tarray, tdipdip); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/urypot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace urypot { 6 | extern double& cury; 7 | extern double& qury; 8 | extern double& ureyunit; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double TINKER_MOD(urypot, cury); 12 | extern "C" double TINKER_MOD(urypot, qury); 13 | extern "C" double TINKER_MOD(urypot, ureyunit); 14 | 15 | double& cury = TINKER_MOD(urypot, cury); 16 | double& qury = TINKER_MOD(urypot, qury); 17 | double& ureyunit = TINKER_MOD(urypot, ureyunit); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kopbnd.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kopbnd { 6 | extern int& maxnopb; 7 | extern double*& opbn; 8 | extern char (*&kopb)[16]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(kopbnd, maxnopb); 12 | extern "C" double* TINKER_MOD(kopbnd, opbn); 13 | extern "C" char (*TINKER_MOD(kopbnd, kopb))[16]; 14 | 15 | int& maxnopb = TINKER_MOD(kopbnd, maxnopb); 16 | double*& opbn = TINKER_MOD(kopbnd, opbn); 17 | char (*&kopb)[16] = TINKER_MOD(kopbnd, kopb); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kopdst.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kopdst { 6 | extern int& maxnopd; 7 | extern double*& opds; 8 | extern char (*&kopd)[16]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(kopdst, maxnopd); 12 | extern "C" double* TINKER_MOD(kopdst, opds); 13 | extern "C" char (*TINKER_MOD(kopdst, kopd))[16]; 14 | 15 | int& maxnopd = TINKER_MOD(kopdst, maxnopd); 16 | double*& opds = TINKER_MOD(kopdst, opds); 17 | char (*&kopd)[16] = TINKER_MOD(kopdst, kopd); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/rxnpot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace rxnpot { 6 | extern int& rfterms; 7 | extern double& rfsize; 8 | extern double& rfbulkd; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(rxnpot, rfterms); 12 | extern "C" double TINKER_MOD(rxnpot, rfsize); 13 | extern "C" double TINKER_MOD(rxnpot, rfbulkd); 14 | 15 | int& rfterms = TINKER_MOD(rxnpot, rfterms); 16 | double& rfsize = TINKER_MOD(rxnpot, rfsize); 17 | double& rfbulkd = TINKER_MOD(rxnpot, rfbulkd); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /src/exec.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/error.h" 2 | #include 3 | #include 4 | #include 5 | 6 | namespace tinker { 7 | std::string exec(const std::string& cmd) 8 | { 9 | std::array buffer; 10 | std::string result; 11 | std::unique_ptr pipe(popen(cmd.c_str(), "r"), pclose); 12 | 13 | if (!pipe) 14 | TINKER_THROW(format("popen(%s) failed.", cmd)); 15 | 16 | while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) { 17 | result += buffer.data(); 18 | } 19 | return result; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/stodyn.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace stodyn { 6 | extern double& friction; 7 | extern double*& fgamma; 8 | extern int& use_sdarea; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" double TINKER_MOD(stodyn, friction); 12 | extern "C" double* TINKER_MOD(stodyn, fgamma); 13 | extern "C" int TINKER_MOD(stodyn, use_sdarea); 14 | 15 | double& friction = TINKER_MOD(stodyn, friction); 16 | double*& fgamma = TINKER_MOD(stodyn, fgamma); 17 | int& use_sdarea = TINKER_MOD(stodyn, use_sdarea); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /include/ff/amoeba/emplar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "tool/rcman.h" 3 | 4 | namespace tinker { 5 | /// \ingroup mplar 6 | /// \brief Multipole and AMOEBA polarization energy. 7 | /// \note Will not be called in any of the following situations: 8 | /// - not using GPU; 9 | /// - not using CUDA as the primary GPU package; 10 | /// - not using periodic boundary condition; 11 | /// - not using both multipole and AMOEBA polarization terms. 12 | /// \note Does not count number of interactions and aborts the program 13 | /// if called erroneously (bug in the code). 14 | void emplar(int vers); 15 | } 16 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/rxnfld.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace rxnfld { 6 | extern int (&ijk)[6][6][6]; 7 | extern double (&b1)[13][40]; 8 | extern double (&b2)[13][40]; 9 | 10 | #ifdef TINKER_FORTRAN_MODULE_CPP 11 | extern "C" int TINKER_MOD(rxnfld, ijk)[6][6][6]; 12 | extern "C" double TINKER_MOD(rxnfld, b1)[13][40]; 13 | extern "C" double TINKER_MOD(rxnfld, b2)[13][40]; 14 | 15 | int (&ijk)[6][6][6] = TINKER_MOD(rxnfld, ijk); 16 | double (&b1)[13][40] = TINKER_MOD(rxnfld, b1); 17 | double (&b2)[13][40] = TINKER_MOD(rxnfld, b2); 18 | #endif 19 | } } 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/tree.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace tree { 6 | const int maxpss = 500; 7 | extern int& nlevel; 8 | extern double& etree; 9 | extern double (&ilevel)[maxpss+1]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(tree, nlevel); 13 | extern "C" double TINKER_MOD(tree, etree); 14 | extern "C" double TINKER_MOD(tree, ilevel)[maxpss+1]; 15 | 16 | int& nlevel = TINKER_MOD(tree, nlevel); 17 | double& etree = TINKER_MOD(tree, etree); 18 | double (&ilevel)[maxpss+1] = TINKER_MOD(tree, ilevel); 19 | #endif 20 | } } 21 | -------------------------------------------------------------------------------- /include/ff/switch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/precision.h" 3 | 4 | namespace tinker { 5 | /// \ingroup ff 6 | enum class Switch 7 | { 8 | DEFAULT, 9 | VDW, 10 | REPULS, 11 | DISP, 12 | CHARGE, 13 | CHGDPL, 14 | DIPOLE, 15 | MPOLE, 16 | CHGTRN, 17 | EWALD, 18 | DEWALD, 19 | USOLVE, 20 | GKV, 21 | GKSA, 22 | }; 23 | 24 | /// \ingroup ff 25 | /// \return Distance at which switching of the potential begins. 26 | real switchCut(Switch mode); 27 | 28 | /// \ingroup ff 29 | /// \return Distance at which the potential energy goes to zero. 30 | real switchOff(Switch mode); 31 | } 32 | -------------------------------------------------------------------------------- /example/dhfr.key: -------------------------------------------------------------------------------- 1 | echo ######################################################################## 2 | echo ## Joint Amber-CHARMM Benchmark on Dihydrofolate Reductase in Water ## 3 | echo ## 23558 Atoms, 62.23 Ang Cube, 9 Ang Nonbond Cutoffs, 64x64x64 PME ## 4 | echo ######################################################################## 5 | 6 | parameters ../params/amber99sb 7 | verbose 8 | neighbor-list 9 | a-axis 62.23 10 | vdw-cutoff 9.0 11 | ewald 12 | ewald-cutoff 9.0 13 | pme-grid 64 64 64 14 | pme-order 5 15 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/math.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace math { 6 | const double pi = 3.141592653589793238e0; 7 | const double elog = 2.718281828459045235e0; 8 | const double radian = 57.29577951308232088e0; 9 | const double logten = 2.302585092994045684e0; 10 | const double twosix = 1.122462048309372981e0; 11 | const double rootpi = 1.772453850905516027e0; 12 | const double root2 = 1.414213562373095049e0; 13 | const double root3 = 1.732050807568877294e0; 14 | const double third = 0.333333333333333333e0; 15 | const double third2 = 0.666666666666666667e0; 16 | } } 17 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/urey.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace urey { 6 | extern int& nurey; 7 | extern int*& iury; 8 | extern double*& uk; 9 | extern double*& ul; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(urey, nurey); 13 | extern "C" int* TINKER_MOD(urey, iury); 14 | extern "C" double* TINKER_MOD(urey, uk); 15 | extern "C" double* TINKER_MOD(urey, ul); 16 | 17 | int& nurey = TINKER_MOD(urey, nurey); 18 | int*& iury = TINKER_MOD(urey, iury); 19 | double*& uk = TINKER_MOD(urey, uk); 20 | double*& ul = TINKER_MOD(urey, ul); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/argue.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace argue { 6 | const int maxarg = 20; 7 | extern int& narg; 8 | extern int (&listarg)[maxarg+1]; 9 | extern char (&arg)[maxarg+1][240]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(argue, narg); 13 | extern "C" int TINKER_MOD(argue, listarg)[maxarg+1]; 14 | extern "C" char TINKER_MOD(argue, arg)[maxarg+1][240]; 15 | 16 | int& narg = TINKER_MOD(argue, narg); 17 | int (&listarg)[maxarg+1] = TINKER_MOD(argue, listarg); 18 | char (&arg)[maxarg+1][240] = TINKER_MOD(argue, arg); 19 | #endif 20 | } } 21 | -------------------------------------------------------------------------------- /test/file/rattle/dhfr.key: -------------------------------------------------------------------------------- 1 | parameters amber99sb 2 | neighbor-list 3 | a-axis 62.23 4 | vdw-cutoff 9.0 5 | ewald 6 | ewald-cutoff 9.0 7 | pme-grid 64 64 64 8 | pme-order 4 9 | 10 | rattle-eps 1.0e-8 11 | rattle 12 | rattle water 13 | list-buffer 0.9 14 | 15 | integrator verlet 16 | thermostat bussi 17 | 18 | openmp-threads 1 19 | torsionterm none 20 | imptorterm none 21 | chargeterm none 22 | vdwterm none 23 | bondterm none 24 | angleterm none 25 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/bndstr.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace bndstr { 6 | extern int& nbond; 7 | extern int*& ibnd; 8 | extern double*& bk; 9 | extern double*& bl; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(bndstr, nbond); 13 | extern "C" int* TINKER_MOD(bndstr, ibnd); 14 | extern "C" double* TINKER_MOD(bndstr, bk); 15 | extern "C" double* TINKER_MOD(bndstr, bl); 16 | 17 | int& nbond = TINKER_MOD(bndstr, nbond); 18 | int*& ibnd = TINKER_MOD(bndstr, ibnd); 19 | double*& bk = TINKER_MOD(bndstr, bk); 20 | double*& bl = TINKER_MOD(bndstr, bl); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kpolr.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kpolr { 6 | extern int*& pgrp; 7 | extern double*& polr; 8 | extern double*& athl; 9 | extern double*& dthl; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int* TINKER_MOD(kpolr, pgrp); 13 | extern "C" double* TINKER_MOD(kpolr, polr); 14 | extern "C" double* TINKER_MOD(kpolr, athl); 15 | extern "C" double* TINKER_MOD(kpolr, dthl); 16 | 17 | int*& pgrp = TINKER_MOD(kpolr, pgrp); 18 | double*& polr = TINKER_MOD(kpolr, polr); 19 | double*& athl = TINKER_MOD(kpolr, athl); 20 | double*& dthl = TINKER_MOD(kpolr, dthl); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /test/ref/polpair.1.txt: -------------------------------------------------------------------------------- 1 | polpair.cpp -- ewald 2 | 3 | Total Potential Energy : -131.2801 Kcal/mole 4 | 5 | Internal Virial Tensor : 18.064 36.125 27.109 6 | 36.125 73.250 54.212 7 | 27.109 54.212 41.217 8 | 9 | Cartesian Gradient Breakdown over Individual Atoms : 10 | 11 | Type Atom dE/dX dE/dY dE/dZ Norm 12 | 13 | Anlyt 1 -18.1463 -36.2484 -27.2392 48.8386 14 | Anlyt 2 18.1721 36.3837 27.1456 48.8967 15 | -------------------------------------------------------------------------------- /test/ref/polpair.2.txt: -------------------------------------------------------------------------------- 1 | polpair.cpp -- non ewald 2 | 3 | Total Potential Energy : -130.7994 Kcal/mole 4 | 5 | Internal Virial Tensor : 18.289 36.579 27.434 6 | 36.579 73.157 54.868 7 | 27.434 54.868 41.151 8 | 9 | Cartesian Gradient Breakdown over Individual Atoms : 10 | 11 | Type Atom dE/dX dE/dY dE/dZ Norm 12 | 13 | Anlyt 1 -18.2893 -36.5787 -27.4340 49.2456 14 | Anlyt 2 18.2893 36.5787 27.4340 49.2456 15 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/omega.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace omega { 6 | extern int& nomega; 7 | extern int*& iomega; 8 | extern int*& zline; 9 | extern double*& dihed; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(omega, nomega); 13 | extern "C" int* TINKER_MOD(omega, iomega); 14 | extern "C" int* TINKER_MOD(omega, zline); 15 | extern "C" double* TINKER_MOD(omega, dihed); 16 | 17 | int& nomega = TINKER_MOD(omega, nomega); 18 | int*& iomega = TINKER_MOD(omega, iomega); 19 | int*& zline = TINKER_MOD(omega, zline); 20 | double*& dihed = TINKER_MOD(omega, dihed); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/dipole.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace dipole { 6 | extern int& ndipole; 7 | extern int*& idpl; 8 | extern double*& bdpl; 9 | extern double*& sdpl; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(dipole, ndipole); 13 | extern "C" int* TINKER_MOD(dipole, idpl); 14 | extern "C" double* TINKER_MOD(dipole, bdpl); 15 | extern "C" double* TINKER_MOD(dipole, sdpl); 16 | 17 | int& ndipole = TINKER_MOD(dipole, ndipole); 18 | int*& idpl = TINKER_MOD(dipole, idpl); 19 | double*& bdpl = TINKER_MOD(dipole, bdpl); 20 | double*& sdpl = TINKER_MOD(dipole, sdpl); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /doc/manual/m/key/math.rst: -------------------------------------------------------------------------------- 1 | Mathematical Algorithms 2 | ======================= 3 | 4 | **RANDOMSEED [integer]** 5 | 6 | .. index:: RANDOMSEED 7 | 8 | Followed by an integer value, sets the initial seed value for 9 | the random number generator used by Tinker. Setting *RANDOMSEED* to the same 10 | value as an earlier run will allow exact reproduction of the earlier 11 | calculation. (Note that this will not hold across different machine types.) 12 | *RANDOMSEED* should be set to a positive integer less than about 2 billion. 13 | In the absence of the *RANDOMSEED* keyword the seed is chosen randomly 14 | based upon the number of seconds that have elapsed in the current decade. 15 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kexpl.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kexpl { 6 | extern double*& pepk; 7 | extern double*& peppre; 8 | extern double*& pepdmp; 9 | extern int*& pepl; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" double* TINKER_MOD(kexpl, pepk); 13 | extern "C" double* TINKER_MOD(kexpl, peppre); 14 | extern "C" double* TINKER_MOD(kexpl, pepdmp); 15 | extern "C" int* TINKER_MOD(kexpl, pepl); 16 | 17 | double*& pepk = TINKER_MOD(kexpl, pepk); 18 | double*& peppre = TINKER_MOD(kexpl, peppre); 19 | double*& pepdmp = TINKER_MOD(kexpl, pepdmp); 20 | int*& pepl = TINKER_MOD(kexpl, pepl); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kiprop.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kiprop { 6 | extern int& maxndi; 7 | extern double*& dcon; 8 | extern double*& tdi; 9 | extern char (*&kdi)[16]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(kiprop, maxndi); 13 | extern "C" double* TINKER_MOD(kiprop, dcon); 14 | extern "C" double* TINKER_MOD(kiprop, tdi); 15 | extern "C" char (*TINKER_MOD(kiprop, kdi))[16]; 16 | 17 | int& maxndi = TINKER_MOD(kiprop, maxndi); 18 | double*& dcon = TINKER_MOD(kiprop, dcon); 19 | double*& tdi = TINKER_MOD(kiprop, tdi); 20 | char (*&kdi)[16] = TINKER_MOD(kiprop, kdi); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kurybr.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kurybr { 6 | extern int& maxnu; 7 | extern double*& ucon; 8 | extern double*& dst13; 9 | extern char (*&ku)[12]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(kurybr, maxnu); 13 | extern "C" double* TINKER_MOD(kurybr, ucon); 14 | extern "C" double* TINKER_MOD(kurybr, dst13); 15 | extern "C" char (*TINKER_MOD(kurybr, ku))[12]; 16 | 17 | int& maxnu = TINKER_MOD(kurybr, maxnu); 18 | double*& ucon = TINKER_MOD(kurybr, ucon); 19 | double*& dst13 = TINKER_MOD(kurybr, dst13); 20 | char (*&ku)[12] = TINKER_MOD(kurybr, ku); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /include/math/lu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace tinker { 4 | /// \ingroup math 5 | /// \brief This subroutine uses the LU decomposition method to solve the linear 6 | /// system Ax = b, returning x in b. A is an n by n real symmetric matrix with 7 | /// its upper triangle (including the diagonal) stored by rows. 8 | /// 9 | /// Literature reference: 10 | /// - 11 | /// W. H. Press, S. A. Teukolsky, W. T. Vetterling and B. P. Flannery, 12 | /// Numerical Recipes (C++), 3rd Ed., Section 2.3, 13 | /// Cambridge University Press (2007). 14 | /// 15 | template 16 | void symlusolve(const T* aUpRowMajor, T* b); 17 | } 18 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/improp.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace improp { 6 | extern int& niprop; 7 | extern int*& iiprop; 8 | extern double*& kprop; 9 | extern double*& vprop; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(improp, niprop); 13 | extern "C" int* TINKER_MOD(improp, iiprop); 14 | extern "C" double* TINKER_MOD(improp, kprop); 15 | extern "C" double* TINKER_MOD(improp, vprop); 16 | 17 | int& niprop = TINKER_MOD(improp, niprop); 18 | int*& iiprop = TINKER_MOD(improp, iiprop); 19 | double*& kprop = TINKER_MOD(improp, kprop); 20 | double*& vprop = TINKER_MOD(improp, vprop); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/khbond.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace khbond { 6 | extern int& maxnhb; 7 | extern double*& radhb; 8 | extern double*& epshb; 9 | extern char (*&khb)[8]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(khbond, maxnhb); 13 | extern "C" double* TINKER_MOD(khbond, radhb); 14 | extern "C" double* TINKER_MOD(khbond, epshb); 15 | extern "C" char (*TINKER_MOD(khbond, khb))[8]; 16 | 17 | int& maxnhb = TINKER_MOD(khbond, maxnhb); 18 | double*& radhb = TINKER_MOD(khbond, radhb); 19 | double*& epshb = TINKER_MOD(khbond, epshb); 20 | char (*&khb)[8] = TINKER_MOD(khbond, khb); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/bndpot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace bndpot { 6 | extern double& cbnd; 7 | extern double& qbnd; 8 | extern double& bndunit; 9 | extern char (&bndtyp)[8]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" double TINKER_MOD(bndpot, cbnd); 13 | extern "C" double TINKER_MOD(bndpot, qbnd); 14 | extern "C" double TINKER_MOD(bndpot, bndunit); 15 | extern "C" char TINKER_MOD(bndpot, bndtyp)[8]; 16 | 17 | double& cbnd = TINKER_MOD(bndpot, cbnd); 18 | double& qbnd = TINKER_MOD(bndpot, qbnd); 19 | double& bndunit = TINKER_MOD(bndpot, bndunit); 20 | char (&bndtyp)[8] = TINKER_MOD(bndpot, bndtyp); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kpolpr.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kpolpr { 6 | extern int& maxnpp; 7 | extern double*& thlpr; 8 | extern double*& thdpr; 9 | extern char (*&kppr)[8]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(kpolpr, maxnpp); 13 | extern "C" double* TINKER_MOD(kpolpr, thlpr); 14 | extern "C" double* TINKER_MOD(kpolpr, thdpr); 15 | extern "C" char (*TINKER_MOD(kpolpr, kppr))[8]; 16 | 17 | int& maxnpp = TINKER_MOD(kpolpr, maxnpp); 18 | double*& thlpr = TINKER_MOD(kpolpr, thlpr); 19 | double*& thdpr = TINKER_MOD(kpolpr, thdpr); 20 | char (*&kppr)[8] = TINKER_MOD(kpolpr, kppr); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kvdwpr.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kvdwpr { 6 | extern int& maxnvp; 7 | extern double*& radpr; 8 | extern double*& epspr; 9 | extern char (*&kvpr)[8]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(kvdwpr, maxnvp); 13 | extern "C" double* TINKER_MOD(kvdwpr, radpr); 14 | extern "C" double* TINKER_MOD(kvdwpr, epspr); 15 | extern "C" char (*TINKER_MOD(kvdwpr, kvpr))[8]; 16 | 17 | int& maxnvp = TINKER_MOD(kvdwpr, maxnvp); 18 | double*& radpr = TINKER_MOD(kvdwpr, radpr); 19 | double*& epspr = TINKER_MOD(kvdwpr, epspr); 20 | char (*&kvpr)[8] = TINKER_MOD(kvdwpr, kvpr); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/minima.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace minima { 6 | extern int& maxiter; 7 | extern int& nextiter; 8 | extern double& fctmin; 9 | extern double& hguess; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(minima, maxiter); 13 | extern "C" int TINKER_MOD(minima, nextiter); 14 | extern "C" double TINKER_MOD(minima, fctmin); 15 | extern "C" double TINKER_MOD(minima, hguess); 16 | 17 | int& maxiter = TINKER_MOD(minima, maxiter); 18 | int& nextiter = TINKER_MOD(minima, nextiter); 19 | double& fctmin = TINKER_MOD(minima, fctmin); 20 | double& hguess = TINKER_MOD(minima, hguess); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /src/amoeba/emplar.cpp: -------------------------------------------------------------------------------- 1 | #include "ff/amoeba/empole.h" 2 | #include "ff/modamoeba.h" 3 | #include "ff/energy.h" 4 | #include "math/zero.h" 5 | #include "tool/externfunc.h" 6 | 7 | namespace tinker { 8 | TINKER_FVOID2(acc0, cu1, emplar, int); 9 | void emplar(int vers) 10 | { 11 | auto do_v = vers & calc::virial; 12 | 13 | zeroOnHost(energy_em, virial_em); 14 | 15 | mpoleInit(vers); 16 | TINKER_FCALL2(acc0, cu1, emplar, vers); 17 | torque(vers, demx, demy, demz); 18 | if (do_v) { 19 | VirialBuffer u2 = vir_trq; 20 | virial_prec v2[9]; 21 | virialReduce(v2, u2); 22 | for (int iv = 0; iv < 9; ++iv) 23 | virial_elec[iv] += v2[iv]; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /include/math/parallelcu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace tinker { 5 | template 6 | T reduceSum_cu(const T* a, size_t nelem, int queue); 7 | 8 | template 9 | void reduceSum2_cu(HT (&h_ans)[HN], DPTR v, size_t nelem, int queue); 10 | 11 | template 12 | void reduceSumOnDevice_cu(T*, const T*, size_t, int); 13 | 14 | template 15 | void reduceSum2OnDevice_cu(HT (&)[HN], DPTR, size_t, int); 16 | 17 | template 18 | void dotProd_cu(T* ans, const T* a, const T* b, size_t nelem, int queue); 19 | 20 | template 21 | void scaleArray_cu(T* dst, T scal, size_t nelem, int queue); 22 | } 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kmulti.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kmulti { 6 | extern int& maxnmp; 7 | extern double*& multip; 8 | extern char (*&mpaxis)[8]; 9 | extern char (*&kmp)[16]; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" int TINKER_MOD(kmulti, maxnmp); 13 | extern "C" double* TINKER_MOD(kmulti, multip); 14 | extern "C" char (*TINKER_MOD(kmulti, mpaxis))[8]; 15 | extern "C" char (*TINKER_MOD(kmulti, kmp))[16]; 16 | 17 | int& maxnmp = TINKER_MOD(kmulti, maxnmp); 18 | double*& multip = TINKER_MOD(kmulti, multip); 19 | char (*&mpaxis)[8] = TINKER_MOD(kmulti, mpaxis); 20 | char (*&kmp)[16] = TINKER_MOD(kmulti, kmp); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /include/seq/torque.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/precision.h" 3 | #include "seq/seq.h" 4 | 5 | namespace tinker { 6 | SEQ_ROUTINE 7 | inline real torqueDot(const real* restrict a, const real* restrict b) 8 | { 9 | return (a[0] * b[0] + a[1] * b[1] + a[2] * b[2]); 10 | } 11 | 12 | SEQ_ROUTINE 13 | inline void torqueCross(real* restrict ans, const real* restrict u, 14 | const real* restrict v) 15 | { 16 | ans[0] = u[1] * v[2] - u[2] * v[1]; 17 | ans[1] = u[2] * v[0] - u[0] * v[2]; 18 | ans[2] = u[0] * v[1] - u[1] * v[0]; 19 | } 20 | 21 | SEQ_ROUTINE 22 | inline void torqueNormal(real* restrict a, real _1_na) 23 | { 24 | a[0] *= _1_na; 25 | a[1] *= _1_na; 26 | a[2] *= _1_na; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /doc/manual/index.rst: -------------------------------------------------------------------------------- 1 | .. Tinker9 documentation master file, created by 2 | sphinx-quickstart on Fri May 8 03:18:35 2020. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | .. include:: m/replace.rst 7 | 8 | Tinker9 User Manual 9 | ===================== 10 | 11 | .. toctree:: 12 | :caption: Contents 13 | :maxdepth: 2 14 | 15 | m/intro 16 | m/install/index 17 | m/tutorial/index 18 | m/feat/index 19 | m/elec/index 20 | m/key/index 21 | 22 | .. toctree:: 23 | :caption: References 24 | 25 | m/zrefs 26 | 27 | .. only:: html 28 | 29 | .. toctree:: 30 | :caption: Index 31 | 32 | genindex 33 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/reppot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace reppot { 6 | extern double& r2scale; 7 | extern double& r3scale; 8 | extern double& r4scale; 9 | extern double& r5scale; 10 | 11 | #ifdef TINKER_FORTRAN_MODULE_CPP 12 | extern "C" double TINKER_MOD(reppot, r2scale); 13 | extern "C" double TINKER_MOD(reppot, r3scale); 14 | extern "C" double TINKER_MOD(reppot, r4scale); 15 | extern "C" double TINKER_MOD(reppot, r5scale); 16 | 17 | double& r2scale = TINKER_MOD(reppot, r2scale); 18 | double& r3scale = TINKER_MOD(reppot, r3scale); 19 | double& r4scale = TINKER_MOD(reppot, r4scale); 20 | double& r5scale = TINKER_MOD(reppot, r5scale); 21 | #endif 22 | } } 23 | -------------------------------------------------------------------------------- /doc/manual/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/routines.cpp: -------------------------------------------------------------------------------- 1 | #include "macro.hh" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #ifdef TINKER_GFORTRAN 8 | void _gfortran_set_args(int, char**); 9 | void tinkerFortranRuntimeBegin(int argc, char** argv) { _gfortran_set_args(argc, argv); } 10 | void tinkerFortranRuntimeEnd() {} 11 | #endif 12 | 13 | #ifdef TINKER_IFORT 14 | void for_rtl_init_(int*, char**); 15 | int for_rtl_finish_(); 16 | extern int for__l_argc; 17 | extern char** for__a_argv; 18 | void tinkerFortranRuntimeBegin(int argc, char** argv) { for__l_argc = argc; for__a_argv = argv; for_rtl_init_(&argc, argv); } 19 | void tinkerFortranRuntimeEnd() { for_rtl_finish_(); } 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /src/cudart/error.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/error.h" 2 | #include "tool/macro.h" 3 | #include 4 | 5 | extern "C" 6 | { 7 | struct cublasStatus_t 8 | { 9 | int foo; 10 | }; 11 | 12 | struct cufftResult_t 13 | { 14 | int foo; 15 | }; 16 | } 17 | 18 | namespace tinker { 19 | template <> 20 | std::string translateErrorCode(cudaError_t error_num) 21 | { 22 | return std::string(cudaGetErrorString(error_num)); 23 | } 24 | 25 | template <> 26 | std::string translateErrorCode(cublasStatus_t error_num) 27 | { 28 | return ""; 29 | } 30 | 31 | template <> 32 | std::string translateErrorCode(cufftResult_t error_num) 33 | { 34 | return ""; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /doc/manual/m/fig/qiframe.tex: -------------------------------------------------------------------------------- 1 | \input{begin} 2 | 3 | \def\half{0.5} 4 | \def\sqrtIII{1.732} 5 | \def\len{0.5} 6 | 7 | \coordinate (O) at (0,0); 8 | \coordinate (A) at (\len,0); 9 | \coordinate (B) at (0,\len); 10 | \node[circle,draw] (N1) at (1,1) {1}; 11 | \node[circle,draw] (N2) at (2,1+\sqrtIII) {2}; 12 | \coordinate (O2) at (2,1); 13 | \coordinate (A2) at (2+\len*\half*\sqrtIII,1-\len*\half); 14 | \coordinate (B2) at (2+\len*\half,1+\len*\half*\sqrtIII); 15 | 16 | \draw[->,>=stealth] (O) -- (A) node[right] {$y_g$}; 17 | \draw[->,>=stealth] (O) -- (B) node[above] {$z_g$}; 18 | \draw (N1) -- (N2); 19 | \draw[->,>=stealth] (O2) -- (A2) node[right] {$y_i$}; 20 | \draw[->,>=stealth] (O2) -- (B2) node[above] {$z_i$}; 21 | 22 | \input{end} 23 | -------------------------------------------------------------------------------- /test/ref/expol.1.txt: -------------------------------------------------------------------------------- 1 | expol.cpp -- NaCl 2 | 3 | Energy Component Breakdown : Kcal/mole Interactions 4 | Polarization -12.60201687 1 5 | 6 | Internal Virial Tensor : 0.000 0.000 0.000 7 | 0.000 0.000 0.000 8 | 0.000 0.000 17.443 9 | 10 | Cartesian Gradient Breakdown over Individual Atoms : 11 | 12 | Type Atom dE/dX dE/dY dE/dZ Norm 13 | 14 | Anlyt 1 0.00000000 0.00000000 -7.35974522 7.35974522 15 | Anlyt 2 0.00000000 0.00000000 7.35974522 7.35974522 16 | -------------------------------------------------------------------------------- /doc/manual/m/fig/cg.tex: -------------------------------------------------------------------------------- 1 | \documentclass[preview=true]{standalone} 2 | \usepackage{algpseudocode} 3 | \usepackage[notextcomp]{kpfonts} 4 | \usepackage[defaultsans]{lato} 5 | \usepackage{inconsolata} 6 | 7 | \begin{document} 8 | \begin{algorithmic} 9 | \Procedure{Conjugate Gradient}{} 10 | \State Guess Initial $\mu$ 11 | \State $r = E - \tilde{T}\mu$ 12 | \State $p = M r$ 13 | \While{not converged} 14 | \State $\gamma \gets r M r / p \tilde{T} p$ 15 | \State $\mu \gets \mu + \gamma p$ 16 | \State $r_1 \gets r - \gamma \tilde{T} p$ 17 | \State $\beta \gets r_1 M r_1 / r M r$ (Previous $r$ is used.) 18 | \State $p \gets M r_1 + \beta p$ 19 | \State Check Convergence 20 | \EndWhile 21 | \EndProcedure 22 | \end{algorithmic} 23 | \end{document} 24 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/zclose.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace zclose { 7 | using namespace sizes; 8 | 9 | extern int& nadd; 10 | extern int& ndel; 11 | extern int (&iadd)[maxatm][2]; 12 | extern int (&idel)[maxatm][2]; 13 | 14 | #ifdef TINKER_FORTRAN_MODULE_CPP 15 | extern "C" int TINKER_MOD(zclose, nadd); 16 | extern "C" int TINKER_MOD(zclose, ndel); 17 | extern "C" int TINKER_MOD(zclose, iadd)[maxatm][2]; 18 | extern "C" int TINKER_MOD(zclose, idel)[maxatm][2]; 19 | 20 | int& nadd = TINKER_MOD(zclose, nadd); 21 | int& ndel = TINKER_MOD(zclose, ndel); 22 | int (&iadd)[maxatm][2] = TINKER_MOD(zclose, iadd); 23 | int (&idel)[maxatm][2] = TINKER_MOD(zclose, idel); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /include/ff/rwcrd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace tinker { 5 | enum class CrdFormat 6 | { 7 | NONE, 8 | TXYZ1, 9 | TXYZ2_PBC, 10 | DCD 11 | }; 12 | 13 | class CrdR; 14 | class CrdReader 15 | { 16 | protected: 17 | CrdR* m_impl; 18 | 19 | public: 20 | ~CrdReader(); 21 | CrdReader(std::string crdfile, CrdFormat crdformat = CrdFormat::NONE); 22 | int readCurrent(); 23 | }; 24 | 25 | class CrdW; 26 | class CrdWriter 27 | { 28 | protected: 29 | CrdW* m_impl; 30 | const double *qx, *qy, *qz; 31 | 32 | public: 33 | ~CrdWriter(); 34 | CrdWriter(const double* xx, const double* yy, const double* zz, // 35 | std::string crdfile, CrdFormat crdformat = CrdFormat::NONE); 36 | int writeCurrent(); 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /test/file/aplus2022/EtOH-Wat-OH_0.70.xyz: -------------------------------------------------------------------------------- 1 | 12 Generated by lconvert.py 2 | 1 O 2.617550 -0.271870 -0.135590 1 2 3 3 | 2 H 1.816860 0.254840 -0.000920 2 1 4 | 3 H 3.013980 -0.307730 0.736370 2 1 5 | 4 O 0.552300 0.673990 0.090590 7 5 12 6 | 5 C -0.142150 -0.574820 -0.009710 8 4 6 7 8 7 | 6 C -1.642020 -0.384310 -0.067950 9 5 9 10 11 8 | 7 H 0.215970 -1.137550 -0.873420 10 5 9 | 8 H 0.142170 -1.128180 0.881510 10 5 10 | 9 H -2.147950 -1.348280 -0.097030 11 6 11 | 10 H -1.989810 0.167040 0.802570 11 6 12 | 11 H -1.927980 0.168580 -0.962750 11 6 13 | 12 H 0.313690 1.198710 -0.680130 12 4 14 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/disp.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace disp { 6 | extern int& ndisp; 7 | extern int*& idisp; 8 | extern double& csixpr; 9 | extern double*& csix; 10 | extern double*& adisp; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" int TINKER_MOD(disp, ndisp); 14 | extern "C" int* TINKER_MOD(disp, idisp); 15 | extern "C" double TINKER_MOD(disp, csixpr); 16 | extern "C" double* TINKER_MOD(disp, csix); 17 | extern "C" double* TINKER_MOD(disp, adisp); 18 | 19 | int& ndisp = TINKER_MOD(disp, ndisp); 20 | int*& idisp = TINKER_MOD(disp, idisp); 21 | double& csixpr = TINKER_MOD(disp, csixpr); 22 | double*& csix = TINKER_MOD(disp, csix); 23 | double*& adisp = TINKER_MOD(disp, adisp); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/cflux.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace cflux { 6 | extern int& nbflx; 7 | extern int& naflx; 8 | extern double*& bflx; 9 | extern double*& aflx; 10 | extern double*& abflx; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" int TINKER_MOD(cflux, nbflx); 14 | extern "C" int TINKER_MOD(cflux, naflx); 15 | extern "C" double* TINKER_MOD(cflux, bflx); 16 | extern "C" double* TINKER_MOD(cflux, aflx); 17 | extern "C" double* TINKER_MOD(cflux, abflx); 18 | 19 | int& nbflx = TINKER_MOD(cflux, nbflx); 20 | int& naflx = TINKER_MOD(cflux, naflx); 21 | double*& bflx = TINKER_MOD(cflux, bflx); 22 | double*& aflx = TINKER_MOD(cflux, aflx); 23 | double*& abflx = TINKER_MOD(cflux, abflx); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /doc/manual/m/key/dynamic.rst: -------------------------------------------------------------------------------- 1 | Molecular Dynamics and Ensembles 2 | ================================ 3 | 4 | **INTEGRATOR [VERLET / RESPA / NOSE-HOOVER / LPISTON]** 5 | 6 | .. index:: INTEGRATOR 7 | 8 | .. seealso:: 9 | 10 | :ref:`label-verlet`, 11 | :ref:`label-respa`, 12 | :ref:`label-nose-hoover`, 13 | :ref:`label-lpiston` 14 | 15 | **THERMOSTAT [NOSE-HOOVER / LPISTON]** 16 | 17 | .. index:: THERMOSTAT 18 | 19 | .. seealso:: 20 | 21 | :ref:`label-nose-hoover`, 22 | :ref:`label-lpiston` 23 | 24 | **BAROSTAT [MONTECARLO / BERENDSEN / NOSE-HOOVER / LPISTON]** 25 | 26 | .. index:: BAROSTAT 27 | 28 | .. seealso:: 29 | 30 | :ref:`label-monte-carlo-barostat`, 31 | :ref:`label-berendsen-barostat`, 32 | :ref:`label-nose-hoover`, 33 | :ref:`label-lpiston` 34 | -------------------------------------------------------------------------------- /example/dhfr2.key: -------------------------------------------------------------------------------- 1 | echo ################################################################ 2 | echo Joint Amber-CHARMM Benchmark on Dihydrofolate Reductase in Water 3 | echo 23558 Atoms, 62.23 Ang Cube, 9 Ang Nonbond Cutoffs, 64x64x64 PME 4 | echo ################################################################ 5 | 6 | parameters ../params/amoebabio09 7 | neighbor-list 8 | a-axis 62.23 9 | vdw-cutoff 12.0 10 | ewald 11 | ewald-cutoff 7.0 12 | pme-grid 64 64 64 13 | pme-order 5 14 | polarization MUTUAL 15 | polar-eps 0.00001 16 | 17 | integrator respa 18 | thermostat bussi 19 | barostat montecarlo 20 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/angbnd.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace angbnd { 6 | extern int& nangle; 7 | extern int*& iang; 8 | extern double*& ak; 9 | extern double*& anat; 10 | extern double*& afld; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" int TINKER_MOD(angbnd, nangle); 14 | extern "C" int* TINKER_MOD(angbnd, iang); 15 | extern "C" double* TINKER_MOD(angbnd, ak); 16 | extern "C" double* TINKER_MOD(angbnd, anat); 17 | extern "C" double* TINKER_MOD(angbnd, afld); 18 | 19 | int& nangle = TINKER_MOD(angbnd, nangle); 20 | int*& iang = TINKER_MOD(angbnd, iang); 21 | double*& ak = TINKER_MOD(angbnd, ak); 22 | double*& anat = TINKER_MOD(angbnd, anat); 23 | double*& afld = TINKER_MOD(angbnd, afld); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/rigid.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace rigid { 6 | extern double*& xrb; 7 | extern double*& yrb; 8 | extern double*& zrb; 9 | extern double*& rbc; 10 | extern int& use_rigid; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" double* TINKER_MOD(rigid, xrb); 14 | extern "C" double* TINKER_MOD(rigid, yrb); 15 | extern "C" double* TINKER_MOD(rigid, zrb); 16 | extern "C" double* TINKER_MOD(rigid, rbc); 17 | extern "C" int TINKER_MOD(rigid, use_rigid); 18 | 19 | double*& xrb = TINKER_MOD(rigid, xrb); 20 | double*& yrb = TINKER_MOD(rigid, yrb); 21 | double*& zrb = TINKER_MOD(rigid, zrb); 22 | double*& rbc = TINKER_MOD(rigid, rbc); 23 | int& use_rigid = TINKER_MOD(rigid, use_rigid); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /doc/manual/m/tutorial/index.rst: -------------------------------------------------------------------------------- 1 | Tutorials 2 | ========= 3 | 4 | Let's create a directory *tutorial* under the home directory and copy the 5 | directories *tinker9/example* and *tinker9/params* here. 6 | 7 | .. code-block:: text 8 | 9 | zw@Blade:~$ mkdir ~/tutorial; cd ~/tutorial 10 | zw@Blade:~/tutorial$ cp -r ~/tinker9/{example,params} . 11 | zw@Blade:~/tutorial$ ls 12 | example/ params/ 13 | zw@Blade:~/tutorial$ cd example; ls 14 | ar94.key dhfr2.key dhfr.key dhfr.seq 15 | ar94.xyz dhfr2.xyz dhfr.pdb dhfr.xyz 16 | 17 | This tutorial also assumes the executable *tinker9* is in your *PATH*. If not, 18 | prefix the directory to the *tinker9* executable. 19 | 20 | .. toctree:: 21 | 22 | filetypes 23 | cmdgui 24 | analyze 25 | minimize 26 | dynamic 27 | -------------------------------------------------------------------------------- /src/cudart/pmestream.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/cudalib.h" 2 | #include "tool/error.h" 3 | 4 | namespace tinker { 5 | void pmeStreamStartRecord(bool usePmeStream) 6 | { 7 | if (usePmeStream) { 8 | check_rt(cudaEventRecord(pme_event_start, g::s0)); 9 | } 10 | } 11 | 12 | void pmeStreamStartWait(bool usePmeStream) 13 | { 14 | if (usePmeStream) { 15 | check_rt(cudaStreamWaitEvent(g::spme, pme_event_start, 0)); 16 | } 17 | } 18 | 19 | void pmeStreamFinishRecord(bool usePmeStream) 20 | { 21 | if (usePmeStream) { 22 | check_rt(cudaEventRecord(pme_event_finish, g::spme)); 23 | } 24 | } 25 | 26 | void pmeStreamFinishWait(bool usePmeStream) 27 | { 28 | if (usePmeStream) { 29 | check_rt(cudaStreamWaitEvent(g::s0, pme_event_finish, 0)); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Tinker9 Project 2 | 3 | # bin 4 | bin/* 5 | bin*/* 6 | 7 | # build 8 | build 9 | build/* 10 | build*/* 11 | 12 | # Python 13 | __pycache__/ 14 | *.py[cod] 15 | *$py.class 16 | 17 | # Docker 18 | docker/Dockerfile* 19 | docker/*.dockerfile 20 | 21 | # Example 22 | example/*.arc 23 | example/*.dyn 24 | 25 | # Manual 26 | doc/manual/_build/* 27 | 28 | # Wiki 29 | *.wiki 30 | *.wiki/* 31 | 32 | 33 | ## OS 34 | 35 | # macOS 36 | .DS_Store 37 | ._.DS_Store 38 | 39 | 40 | ## Text Editors and IDEs 41 | 42 | # CLion 43 | .idea 44 | .idea/* 45 | 46 | # gdb 47 | *.out 48 | 49 | # Nsight 50 | Debug/* 51 | Release/* 52 | .cproject 53 | .project 54 | .settings/* 55 | 56 | # Qt Creator 57 | CMakeLists.txt.user 58 | 59 | # VSCode 60 | .vscode 61 | .vscode/* 62 | 63 | # vi 64 | *.swp 65 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kitors.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kitors { 6 | extern int& maxnti; 7 | extern double*& ti1; 8 | extern double*& ti2; 9 | extern double*& ti3; 10 | extern char (*&kti)[16]; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" int TINKER_MOD(kitors, maxnti); 14 | extern "C" double* TINKER_MOD(kitors, ti1); 15 | extern "C" double* TINKER_MOD(kitors, ti2); 16 | extern "C" double* TINKER_MOD(kitors, ti3); 17 | extern "C" char (*TINKER_MOD(kitors, kti))[16]; 18 | 19 | int& maxnti = TINKER_MOD(kitors, maxnti); 20 | double*& ti1 = TINKER_MOD(kitors, ti1); 21 | double*& ti2 = TINKER_MOD(kitors, ti2); 22 | double*& ti3 = TINKER_MOD(kitors, ti3); 23 | char (*&kti)[16] = TINKER_MOD(kitors, kti); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kvdws.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kvdws { 6 | extern double*& rad; 7 | extern double*& eps; 8 | extern double*& rad4; 9 | extern double*& eps4; 10 | extern double*& reduct; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" double* TINKER_MOD(kvdws, rad); 14 | extern "C" double* TINKER_MOD(kvdws, eps); 15 | extern "C" double* TINKER_MOD(kvdws, rad4); 16 | extern "C" double* TINKER_MOD(kvdws, eps4); 17 | extern "C" double* TINKER_MOD(kvdws, reduct); 18 | 19 | double*& rad = TINKER_MOD(kvdws, rad); 20 | double*& eps = TINKER_MOD(kvdws, eps); 21 | double*& rad4 = TINKER_MOD(kvdws, rad4); 22 | double*& eps4 = TINKER_MOD(kvdws, eps4); 23 | double*& reduct = TINKER_MOD(kvdws, reduct); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /src/cu/cmakesrc.txt: -------------------------------------------------------------------------------- 1 | set (__T9_CU_SRC 2 | amoeba/binding.cu 3 | amoeba/emplar.cu 4 | amoeba/empole.cu 5 | amoeba/epolar.cu 6 | amoeba/field.cu 7 | amoeba/pcg.cu 8 | amoeba/precond.cu 9 | amoeba/rotpole.cu 10 | amoeba/torque.cu 11 | atom.cu 12 | compilers.cu 13 | cudalib.cu 14 | cumod.cu 15 | diagprecond.cu 16 | echarge.cu 17 | echglj.cu 18 | egvop.cu 19 | ehal.cu 20 | elj.cu 21 | epolarrecip.cu 22 | evalence.cu 23 | hippo/cflux.cu 24 | hippo/echgtrn.cu 25 | hippo/edisp.cu 26 | hippo/empole.cu 27 | hippo/epolar.cu 28 | hippo/erepel.cu 29 | hippo/expol.cu 30 | hippo/field.cu 31 | hippo/pcg.cu 32 | hippo/precond.cu 33 | induce.cu 34 | mathparallel.cu 35 | mathzero.cu 36 | mdhc.cu 37 | mdintg.cu 38 | mdpq.cu 39 | mdpt.cu 40 | minimize.cu 41 | pme.cu 42 | rattle.cu 43 | spatial.cu 44 | upredict.cu 45 | ) 46 | -------------------------------------------------------------------------------- /test/cmakesrc.txt: -------------------------------------------------------------------------------- 1 | set (__T9_TEST_SRC 2 | angle.cpp 3 | angtor.cpp 4 | aplusgas.cpp 5 | aplusliquid.cpp 6 | argkey.cpp 7 | async.cpp 8 | bond.cpp 9 | bounds.cpp 10 | box.cpp 11 | chglj.cpp 12 | chgtrn.cpp 13 | disp.cpp 14 | emhippo.cpp 15 | ephippo.cpp 16 | expol.cpp 17 | geom.cpp 18 | improp.cpp 19 | imptor.cpp 20 | info.cpp 21 | kinetic.cpp 22 | localframe.cpp 23 | localframe2.cpp 24 | localframe3.cpp 25 | main.cpp 26 | mathfunc.cpp 27 | nacl.cpp 28 | nblist.cpp 29 | opbend.cpp 30 | osrw.cpp 31 | partialcharge.cpp 32 | pitors.cpp 33 | polpair.cpp 34 | rattle.cpp 35 | reduce.cpp 36 | rephippo.cpp 37 | strbnd.cpp 38 | strtor.cpp 39 | testrt.cpp 40 | text.cpp 41 | torsion.cpp 42 | tortor.cpp 43 | trimatexp.cpp 44 | truncated8.cpp 45 | urey.cpp 46 | vdw14.cpp 47 | verlet.cpp 48 | versionsuffix.cpp 49 | ) 50 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/chgpen.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace chgpen { 6 | extern int& ncp; 7 | extern double*& pcore; 8 | extern double*& pval; 9 | extern double*& pval0; 10 | extern double*& palpha; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" int TINKER_MOD(chgpen, ncp); 14 | extern "C" double* TINKER_MOD(chgpen, pcore); 15 | extern "C" double* TINKER_MOD(chgpen, pval); 16 | extern "C" double* TINKER_MOD(chgpen, pval0); 17 | extern "C" double* TINKER_MOD(chgpen, palpha); 18 | 19 | int& ncp = TINKER_MOD(chgpen, ncp); 20 | double*& pcore = TINKER_MOD(chgpen, pcore); 21 | double*& pval = TINKER_MOD(chgpen, pval); 22 | double*& pval0 = TINKER_MOD(chgpen, pval0); 23 | double*& palpha = TINKER_MOD(chgpen, palpha); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/syntrn.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace syntrn { 6 | extern double& tpath; 7 | extern double& ppath; 8 | extern double*& xmin1; 9 | extern double*& xmin2; 10 | extern double*& xm; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" double TINKER_MOD(syntrn, tpath); 14 | extern "C" double TINKER_MOD(syntrn, ppath); 15 | extern "C" double* TINKER_MOD(syntrn, xmin1); 16 | extern "C" double* TINKER_MOD(syntrn, xmin2); 17 | extern "C" double* TINKER_MOD(syntrn, xm); 18 | 19 | double& tpath = TINKER_MOD(syntrn, tpath); 20 | double& ppath = TINKER_MOD(syntrn, ppath); 21 | double*& xmin1 = TINKER_MOD(syntrn, xmin1); 22 | double*& xmin2 = TINKER_MOD(syntrn, xmin2); 23 | double*& xm = TINKER_MOD(syntrn, xm); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /include/math/parallelacc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace tinker { 5 | template 6 | T reduceSum_acc(const T* gpu_a, size_t nelem, int queue); 7 | 8 | template 9 | void reduceSum2_acc(HT (&h_ans)[HN], DPTR v, size_t nelem, int queue); 10 | 11 | template 12 | void reduceSumOnDevice_acc(T*, const T*, size_t, int); 13 | 14 | template 15 | void reduceSum2OnDevice_acc(HT (&)[HN], DPTR, size_t, int); 16 | 17 | template 18 | T dotProd_acc(const T* a, const T* b, size_t nelem, int queue); 19 | 20 | template 21 | void dotProd_acc(T* ans, const T* a, const T* b, size_t nelem, int queue); 22 | 23 | template 24 | void scaleArray_acc(T* dst, T scal, size_t nelem, int queue); 25 | } 26 | -------------------------------------------------------------------------------- /example/dhfr.seq: -------------------------------------------------------------------------------- 1 | 1 MET ILE SER LEU ILE ALA ALA LEU ALA VAL ASP ARG VAL ILE GLY 2 | 16 MET GLU ASN ALA MET PRO TRP ASN LEU PRO ALA ASP LEU ALA TRP 3 | 31 PHE LYS ARG ASN THR LEU ASP LYS PRO VAL ILE MET GLY ARG HID 4 | 46 THR TRP GLU SER ILE GLY ARG PRO LEU PRO GLY ARG LYS ASN ILE 5 | 61 ILE LEU SER SER GLN PRO GLY THR ASP ASP ARG VAL THR TRP VAL 6 | 76 LYS SER VAL ASP GLU ALA ILE ALA ALA CYS GLY ASP VAL PRO GLU 7 | 91 ILE MET VAL ILE GLY GLY GLY ARG VAL TYR GLU GLN PHE LEU PRO 8 | 106 LYS ALA GLN LYS LEU TYR LEU THR HID ILE ASP ALA GLU VAL GLU 9 | 121 GLY ASP THR HID PHE PRO ASP TYR GLU PRO ASP ASP TRP GLU SER 10 | 136 VAL PHE SER GLU PHE HID ASP ALA ASP ALA GLN ASN SER HID SER 11 | 151 TYR CYS PHE GLU ILE LEU GLU ARG ARG 12 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/files.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace files { 6 | extern int& nprior; 7 | extern int& ldir; 8 | extern int& leng; 9 | extern char (&filename)[240]; 10 | extern char (&outfile)[240]; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" int TINKER_MOD(files, nprior); 14 | extern "C" int TINKER_MOD(files, ldir); 15 | extern "C" int TINKER_MOD(files, leng); 16 | extern "C" char TINKER_MOD(files, filename)[240]; 17 | extern "C" char TINKER_MOD(files, outfile)[240]; 18 | 19 | int& nprior = TINKER_MOD(files, nprior); 20 | int& ldir = TINKER_MOD(files, ldir); 21 | int& leng = TINKER_MOD(files, leng); 22 | char (&filename)[240] = TINKER_MOD(files, filename); 23 | char (&outfile)[240] = TINKER_MOD(files, outfile); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/polpcg.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace polpcg { 6 | extern int*& mindex; 7 | extern double& pcgpeek; 8 | extern double*& minv; 9 | extern int& pcgprec; 10 | extern int& pcgguess; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" int* TINKER_MOD(polpcg, mindex); 14 | extern "C" double TINKER_MOD(polpcg, pcgpeek); 15 | extern "C" double* TINKER_MOD(polpcg, minv); 16 | extern "C" int TINKER_MOD(polpcg, pcgprec); 17 | extern "C" int TINKER_MOD(polpcg, pcgguess); 18 | 19 | int*& mindex = TINKER_MOD(polpcg, mindex); 20 | double& pcgpeek = TINKER_MOD(polpcg, pcgpeek); 21 | double*& minv = TINKER_MOD(polpcg, minv); 22 | int& pcgprec = TINKER_MOD(polpcg, pcgprec); 23 | int& pcgguess = TINKER_MOD(polpcg, pcgguess); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/imptor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace imptor { 6 | extern int& nitors; 7 | extern int*& iitors; 8 | extern double*& itors1; 9 | extern double*& itors2; 10 | extern double*& itors3; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" int TINKER_MOD(imptor, nitors); 14 | extern "C" int* TINKER_MOD(imptor, iitors); 15 | extern "C" double* TINKER_MOD(imptor, itors1); 16 | extern "C" double* TINKER_MOD(imptor, itors2); 17 | extern "C" double* TINKER_MOD(imptor, itors3); 18 | 19 | int& nitors = TINKER_MOD(imptor, nitors); 20 | int*& iitors = TINKER_MOD(imptor, iitors); 21 | double*& itors1 = TINKER_MOD(imptor, itors1); 22 | double*& itors2 = TINKER_MOD(imptor, itors2); 23 | double*& itors3 = TINKER_MOD(imptor, itors3); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/pistuf.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace pistuf { 6 | extern double*& bkpi; 7 | extern double*& blpi; 8 | extern double*& kslope; 9 | extern double*& lslope; 10 | extern double*& torsp2; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" double* TINKER_MOD(pistuf, bkpi); 14 | extern "C" double* TINKER_MOD(pistuf, blpi); 15 | extern "C" double* TINKER_MOD(pistuf, kslope); 16 | extern "C" double* TINKER_MOD(pistuf, lslope); 17 | extern "C" double* TINKER_MOD(pistuf, torsp2); 18 | 19 | double*& bkpi = TINKER_MOD(pistuf, bkpi); 20 | double*& blpi = TINKER_MOD(pistuf, blpi); 21 | double*& kslope = TINKER_MOD(pistuf, kslope); 22 | double*& lslope = TINKER_MOD(pistuf, lslope); 23 | double*& torsp2 = TINKER_MOD(pistuf, torsp2); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /src/mod.cpp: -------------------------------------------------------------------------------- 1 | #define TINKER_EXTERN_DEFINITION_FILE 1 2 | 3 | #include "ff/modamoeba.h" 4 | #include "ff/atom.h" 5 | #include "ff/box.h" 6 | #include "ff/echarge.h" 7 | #include "ff/echglj.h" 8 | #include "ff/elec.h" 9 | #include "ff/energy.h" 10 | #include "ff/energybuffer.h" 11 | #include "ff/evalence.h" 12 | #include "ff/evdw.h" 13 | #include "ff/hippo/edisp.h" 14 | #include "ff/hippo/erepel.h" 15 | #include "ff/modhippo.h" 16 | #include "ff/molecule.h" 17 | #include "ff/nblist.h" 18 | #include "ff/pme.h" 19 | #include "ff/spatial.h" 20 | 21 | #include "md/lflpiston.h" 22 | #include "md/misc.h" 23 | #include "md/osrw.h" 24 | #include "md/pq.h" 25 | #include "md/rattle.h" 26 | 27 | #include "tool/accasync.h" 28 | #include "tool/cudalib.h" 29 | #include "tool/gpucard.h" 30 | #include "tool/platform.h" 31 | #include "tool/rcman.h" 32 | -------------------------------------------------------------------------------- /example/dhfr-dyn.key: -------------------------------------------------------------------------------- 1 | echo ######################################################################## 2 | echo ## Joint Amber-CHARMM Benchmark on Dihydrofolate Reductase in Water ## 3 | echo ## 23558 Atoms, 62.23 Ang Cube, 9 Ang Nonbond Cutoffs, 64x64x64 PME ## 4 | echo ######################################################################## 5 | 6 | parameters ../params/amber99sb 7 | verbose 8 | neighbor-list 9 | a-axis 62.23 10 | vdw-cutoff 9.0 11 | ewald 12 | ewald-cutoff 9.0 13 | pme-grid 64 64 64 14 | pme-order 4 15 | 16 | rattle 17 | rattle water 18 | list-buffer 0.9 19 | 20 | integrator verlet 21 | thermostat bussi 22 | barostat montecarlo 23 | 24 | # dynamic file.xyz nsteps 2 1 4 298 1 25 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/zcoord.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace zcoord { 7 | using namespace sizes; 8 | 9 | extern int (&iz)[maxatm][4]; 10 | extern double (&zbond)[maxatm]; 11 | extern double (&zang)[maxatm]; 12 | extern double (&ztors)[maxatm]; 13 | 14 | #ifdef TINKER_FORTRAN_MODULE_CPP 15 | extern "C" int TINKER_MOD(zcoord, iz)[maxatm][4]; 16 | extern "C" double TINKER_MOD(zcoord, zbond)[maxatm]; 17 | extern "C" double TINKER_MOD(zcoord, zang)[maxatm]; 18 | extern "C" double TINKER_MOD(zcoord, ztors)[maxatm]; 19 | 20 | int (&iz)[maxatm][4] = TINKER_MOD(zcoord, iz); 21 | double (&zbond)[maxatm] = TINKER_MOD(zcoord, zbond); 22 | double (&zang)[maxatm] = TINKER_MOD(zcoord, zang); 23 | double (&ztors)[maxatm] = TINKER_MOD(zcoord, ztors); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/ewald.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace ewald { 6 | extern double& aewald; 7 | extern double& aeewald; 8 | extern double& apewald; 9 | extern double& adewald; 10 | extern char (&boundary)[7]; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" double TINKER_MOD(ewald, aewald); 14 | extern "C" double TINKER_MOD(ewald, aeewald); 15 | extern "C" double TINKER_MOD(ewald, apewald); 16 | extern "C" double TINKER_MOD(ewald, adewald); 17 | extern "C" char TINKER_MOD(ewald, boundary)[7]; 18 | 19 | double& aewald = TINKER_MOD(ewald, aewald); 20 | double& aeewald = TINKER_MOD(ewald, aeewald); 21 | double& apewald = TINKER_MOD(ewald, apewald); 22 | double& adewald = TINKER_MOD(ewald, adewald); 23 | char (&boundary)[7] = TINKER_MOD(ewald, boundary); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/ptable.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace ptable { 6 | const int maxele = 112; 7 | extern double (&atmass)[maxele]; 8 | extern double (&vdwrad)[maxele]; 9 | extern double (&covrad)[maxele]; 10 | extern char (&elemnt)[maxele][3]; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" double TINKER_MOD(ptable, atmass)[maxele]; 14 | extern "C" double TINKER_MOD(ptable, vdwrad)[maxele]; 15 | extern "C" double TINKER_MOD(ptable, covrad)[maxele]; 16 | extern "C" char TINKER_MOD(ptable, elemnt)[maxele][3]; 17 | 18 | double (&atmass)[maxele] = TINKER_MOD(ptable, atmass); 19 | double (&vdwrad)[maxele] = TINKER_MOD(ptable, vdwrad); 20 | double (&covrad)[maxele] = TINKER_MOD(ptable, covrad); 21 | char (&elemnt)[maxele][3] = TINKER_MOD(ptable, elemnt); 22 | #endif 23 | } } 24 | -------------------------------------------------------------------------------- /include/math/maxmin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace tinker { 4 | /// \ingroup math 5 | /// \see maxOf(T, T2, Ts...) 6 | template 7 | T maxOf(T a, T2 b) 8 | { 9 | return (a < b) ? b : a; 10 | } 11 | 12 | /// \ingroup math 13 | /// \return The maximum value from a variadic list of numbers. 14 | template 15 | T maxOf(T a, T2 b, Ts... cs) 16 | { 17 | return maxOf(maxOf(a, b), cs...); 18 | } 19 | 20 | /// \ingroup math 21 | /// \see minOf(T, T2, Ts...) 22 | template 23 | T minOf(T a, T2 b) 24 | { 25 | return (a < b) ? a : b; 26 | } 27 | 28 | /// \ingroup math 29 | /// \return The minimum value from a variadic list of numbers. 30 | template 31 | T minOf(T a, T2 b, Ts... cs) 32 | { 33 | return minOf(minOf(a, b), cs...); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/bound.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace bound { 6 | extern double& polycut; 7 | extern double& polycut2; 8 | extern int& use_bounds; 9 | extern int& use_replica; 10 | extern int& use_polymer; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" double TINKER_MOD(bound, polycut); 14 | extern "C" double TINKER_MOD(bound, polycut2); 15 | extern "C" int TINKER_MOD(bound, use_bounds); 16 | extern "C" int TINKER_MOD(bound, use_replica); 17 | extern "C" int TINKER_MOD(bound, use_polymer); 18 | 19 | double& polycut = TINKER_MOD(bound, polycut); 20 | double& polycut2 = TINKER_MOD(bound, polycut2); 21 | int& use_bounds = TINKER_MOD(bound, use_bounds); 22 | int& use_replica = TINKER_MOD(bound, use_replica); 23 | int& use_polymer = TINKER_MOD(bound, use_polymer); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /doc/manual/m/fig/anglep.tex: -------------------------------------------------------------------------------- 1 | \input{begin} 2 | 3 | \coordinate (cX) at (0,-1.5); 4 | \coordinate (cD) at (0,0); 5 | \coordinate (cA) at (-1,2); 6 | \coordinate (cB) at (-3,-3); 7 | \coordinate (cC) at (3,-2); 8 | 9 | \fill[fill=gray,fill opacity=0.2] (cA) -- (cB) -- (cC); 10 | \node[draw=none] (X) at (cX) {X}; 11 | \node[circle,draw,fill=white,fill opacity=1] (D) at (cD) {D}; 12 | \node[circle,draw,fill=white,fill opacity=1] (A) at (cA) {A}; 13 | \node[circle,draw,fill=white,fill opacity=1] (B) at (cB) {B}; 14 | \node[circle,draw,fill=white,fill opacity=1] (C) at (cC) {C}; 15 | 16 | \draw (A) -- (D) -- (B); 17 | \draw (C) -- (D); 18 | \draw[dashed] (D) -- (X); 19 | \draw[dashed] (A) -- (X) -- (B); 20 | \draw[dashed] (A) -- (B) -- (C) -- (A); 21 | \pic[draw,->,>=stealth,"$\theta$",angle eccentricity=1.5] {angle=A--X--B}; 22 | 23 | \input{end} 24 | -------------------------------------------------------------------------------- /include/tool/tinkersuppl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // version 5 | std::string tinker_f_version(std::string infile, std::string status); 6 | 7 | // file 8 | void tinker_f_rewind(int* unit); 9 | 10 | void tinker_f_close(int* unit); 11 | 12 | void tinker_f_open(int* unit, std::string file, std::string status); 13 | void tinker_f_open(int* unit, std::string file, std::string form, 14 | std::string status); 15 | 16 | // memory 17 | int tinker_f_allocated(void* p); 18 | 19 | void tinker_f_deallocate(void* p); 20 | 21 | void tinker_f_allocate_byte(void** pp, size_t bytes); 22 | 23 | template 24 | void tinker_f_allocate_element(T** pp, int nelem) 25 | { 26 | void** p = (void**)pp; 27 | size_t bytes = sizeof(T) * nelem; 28 | tinker_f_allocate_byte(p, bytes); 29 | } 30 | 31 | // read stdin 32 | std::string tinker_f_read_stdin_line(); 33 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/dsppot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace dsppot { 6 | extern double& dsp2scale; 7 | extern double& dsp3scale; 8 | extern double& dsp4scale; 9 | extern double& dsp5scale; 10 | extern int& use_dcorr; 11 | 12 | #ifdef TINKER_FORTRAN_MODULE_CPP 13 | extern "C" double TINKER_MOD(dsppot, dsp2scale); 14 | extern "C" double TINKER_MOD(dsppot, dsp3scale); 15 | extern "C" double TINKER_MOD(dsppot, dsp4scale); 16 | extern "C" double TINKER_MOD(dsppot, dsp5scale); 17 | extern "C" int TINKER_MOD(dsppot, use_dcorr); 18 | 19 | double& dsp2scale = TINKER_MOD(dsppot, dsp2scale); 20 | double& dsp3scale = TINKER_MOD(dsppot, dsp3scale); 21 | double& dsp4scale = TINKER_MOD(dsppot, dsp4scale); 22 | double& dsp5scale = TINKER_MOD(dsppot, dsp5scale); 23 | int& use_dcorr = TINKER_MOD(dsppot, use_dcorr); 24 | #endif 25 | } } 26 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/units.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace units { 6 | const double avogadro = 6.02214076e+23; 7 | const double lightspd = 2.99792458e-2; 8 | const double boltzmann = 0.831446262e0; 9 | const double gasconst = 1.987204259e-3; 10 | const double elemchg = 1.602176634e-19; 11 | const double vacperm = 8.854187817e-12; 12 | const double emass = 5.4857990907e-4; 13 | const double planck = 6.62607015e-34; 14 | const double joule = 4.1840e0; 15 | const double ekcal = 4.1840e+2; 16 | const double bohr = 0.52917721067e0; 17 | const double hartree = 627.5094736e0; 18 | const double evolt = 27.21138602e0; 19 | const double efreq = 2.194746314e+5; 20 | const double coulomb = 332.063713e0; 21 | const double elefield = 1439.96455e0; 22 | const double debye = 4.80321e0; 23 | const double prescon = 6.85684112e+4; 24 | } } 25 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/atoms.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace atoms { 7 | using namespace sizes; 8 | 9 | extern int& n; 10 | extern int (&type)[maxatm]; 11 | extern double (&x)[maxatm]; 12 | extern double (&y)[maxatm]; 13 | extern double (&z)[maxatm]; 14 | 15 | #ifdef TINKER_FORTRAN_MODULE_CPP 16 | extern "C" int TINKER_MOD(atoms, n); 17 | extern "C" int TINKER_MOD(atoms, type)[maxatm]; 18 | extern "C" double TINKER_MOD(atoms, x)[maxatm]; 19 | extern "C" double TINKER_MOD(atoms, y)[maxatm]; 20 | extern "C" double TINKER_MOD(atoms, z)[maxatm]; 21 | 22 | int& n = TINKER_MOD(atoms, n); 23 | int (&type)[maxatm] = TINKER_MOD(atoms, type); 24 | double (&x)[maxatm] = TINKER_MOD(atoms, x); 25 | double (&y)[maxatm] = TINKER_MOD(atoms, y); 26 | double (&z)[maxatm] = TINKER_MOD(atoms, z); 27 | #endif 28 | } } 29 | -------------------------------------------------------------------------------- /include/ff/cumodamoeba.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/amoeba/mpole.h" 3 | #include "ff/precision.h" 4 | 5 | namespace tinker { 6 | // multipole 7 | namespace d { 8 | TINKER_EXTERN __device__ 9 | const LocalFrame* restrict zaxis; 10 | TINKER_EXTERN __device__ 11 | const real (*restrict pole)[MPL_TOTAL]; 12 | TINKER_EXTERN __device__ 13 | const real (*restrict rpole)[MPL_TOTAL]; 14 | } 15 | 16 | // polarization 17 | namespace d { 18 | TINKER_EXTERN __device__ 19 | int njpolar; 20 | TINKER_EXTERN __device__ 21 | const int* restrict jpolar; 22 | TINKER_EXTERN __device__ 23 | const real* restrict thlval; 24 | 25 | TINKER_EXTERN __device__ 26 | const real* restrict polarity; 27 | TINKER_EXTERN __device__ 28 | const real* restrict thole; 29 | TINKER_EXTERN __device__ 30 | const real* restrict pdamp; 31 | 32 | TINKER_EXTERN __device__ 33 | const real* restrict polarity_inv; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /include/seq/copysign.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace tinker { 4 | /// \ingroup math 5 | /// \brief If `b < 0`, returns `-abs(a)`, otherwise, returns `abs(a)`. 6 | /// Similar to the 32-bit integer version of Fortran `SIGN(A,B)`. 7 | /// \note Standard C and CUDA libraries only have float and double versions. 8 | __device__ 9 | inline int intCopysignShift(int a, int b) 10 | { 11 | int mask = (a ^ b) >> 31; 12 | return (mask + a) ^ mask; 13 | } 14 | 15 | /// \ingroup math 16 | /// \brief If `b < 0`, returns `-abs(a)`, otherwise, returns `abs(a)`. 17 | __device__ 18 | inline int intCopysignIf(int a, int b) 19 | { 20 | int ans = abs(a); 21 | if (b < 0) ans = -ans; 22 | return ans; 23 | } 24 | 25 | /// \def INT_COPYSIGN 26 | /// \ingroup math 27 | /// \brief Defines the implementation of `int copysign(int,int);` function. 28 | #define INT_COPYSIGN intCopysignShift 29 | } 30 | -------------------------------------------------------------------------------- /include/tool/ptrtrait.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace tinker { 6 | /** 7 | * \ingroup cpp_syntax 8 | * A helper class to get the traits of the given 1D or 2D pointer type. 9 | * 10 | * Example: 11 | * | PTR | PtrTrait::type | PtrTrait::n | 12 | * |:----------:|:-------------------:|:----------------:| 13 | * | float* | float | 1 | 14 | * | int (*)[3] | int | 3 | 15 | * 16 | * \tparam PTR A pointer type. 17 | */ 18 | template 19 | struct PtrTrait; 20 | 21 | template 22 | struct PtrTrait 23 | { 24 | typedef T type; 25 | static constexpr size_t n = 1; 26 | }; 27 | 28 | template 29 | struct PtrTrait 30 | { 31 | typedef T type; 32 | static constexpr size_t n = N; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /src/mathlu.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/externfunc.h" 2 | 3 | namespace tinker { 4 | template 5 | void symlusolve_acc(const R* aUpRowMajor, R* b); 6 | } 7 | 8 | namespace tinker { 9 | // TINKER_FVOID2(acc1, cu0, symlusolve); 10 | template 11 | void symlusolve(const R* aUpRowMajor, R* b) 12 | { 13 | // TINKER_FCALL2(acc1, cu0, symlusolve); 14 | #if TINKER_GPULANG_OPENACC 15 | symlusolve_acc(aUpRowMajor, b); 16 | #elif TINKER_GPULANG_CUDA 17 | throwExceptionMissingFunction("symlusolve_cu<...>", __FILE__, __LINE__); 18 | #else 19 | symlusolve_acc(aUpRowMajor, b); 20 | #endif 21 | } 22 | 23 | template void symlusolve<3, float>(const float*, float*); 24 | template void symlusolve<6, float>(const float*, float*); 25 | template void symlusolve<3, double>(const double*, double*); 26 | template void symlusolve<6, double>(const double*, double*); 27 | } 28 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/charge.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace charge { 6 | extern int& nion; 7 | extern int*& iion; 8 | extern int*& jion; 9 | extern int*& kion; 10 | extern double*& pchg; 11 | extern double*& pchg0; 12 | 13 | #ifdef TINKER_FORTRAN_MODULE_CPP 14 | extern "C" int TINKER_MOD(charge, nion); 15 | extern "C" int* TINKER_MOD(charge, iion); 16 | extern "C" int* TINKER_MOD(charge, jion); 17 | extern "C" int* TINKER_MOD(charge, kion); 18 | extern "C" double* TINKER_MOD(charge, pchg); 19 | extern "C" double* TINKER_MOD(charge, pchg0); 20 | 21 | int& nion = TINKER_MOD(charge, nion); 22 | int*& iion = TINKER_MOD(charge, iion); 23 | int*& jion = TINKER_MOD(charge, jion); 24 | int*& kion = TINKER_MOD(charge, kion); 25 | double*& pchg = TINKER_MOD(charge, pchg); 26 | double*& pchg0 = TINKER_MOD(charge, pchg0); 27 | #endif 28 | } } 29 | -------------------------------------------------------------------------------- /doc/manual/requirements.txt: -------------------------------------------------------------------------------- 1 | alabaster==0.7.12 2 | Babel==2.10.1 3 | beautifulsoup4==4.11.1 4 | certifi==2023.7.22 5 | chardet==4.0.0 6 | charset-normalizer==2.0.12 7 | docutils==0.17.1 8 | idna==3.3 9 | imagesize==1.3.0 10 | importlib-metadata==4.11.4 11 | Jinja2==3.1.2 12 | latexcodec==2.0.1 13 | MarkupSafe==2.1.1 14 | oset==0.1.3 15 | packaging==21.3 16 | pybtex==0.24.0 17 | pybtex-docutils==1.0.2 18 | pydata-sphinx-theme==0.8.1 19 | Pygments==2.15.0 20 | pyparsing==3.0.9 21 | pytz==2022.1 22 | PyYAML==6.0 23 | requests==2.31.0 24 | six==1.16.0 25 | snowballstemmer==2.2.0 26 | soupsieve==2.3.2.post1 27 | Sphinx==4.5.0 28 | sphinxcontrib-applehelp==1.0.2 29 | sphinxcontrib-bibtex==2.4.2 30 | sphinxcontrib-devhelp==1.0.2 31 | sphinxcontrib-htmlhelp==2.0.0 32 | sphinxcontrib-jsmath==1.0.1 33 | sphinxcontrib-qthelp==1.0.3 34 | sphinxcontrib-serializinghtml==1.1.5 35 | urllib3==1.26.9 36 | zipp==3.8.0 37 | -------------------------------------------------------------------------------- /include/ff/hippo/induce.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/precision.h" 3 | 4 | namespace tinker { 5 | /// \ingroup hippopolar 6 | /// \{ 7 | // electrostatic field due to permanent multipoles 8 | void dfieldChgpen(real (*field)[3]); 9 | 10 | // mutual electrostatic field due to induced dipole moments 11 | // -Tu operator 12 | void ufieldChgpen(const real (*uind)[3], real (*field)[3]); 13 | void ufieldChgpenEwaldRecipSelf(const real (*uind)[3], real (*field)[3]); 14 | 15 | void diagPrecond2(const real (*rsd)[3], real (*zrsd)[3]); 16 | 17 | void sparsePrecondBuild2(); 18 | void sparsePrecondApply2(const real (*rsd)[3], real (*zrsd)[3]); 19 | 20 | void induce2(real (*uind)[3]); 21 | /// \} 22 | } 23 | 24 | namespace tinker { 25 | void dfieldAplus(real (*field)[3]); 26 | void ufieldAplus(const real (*uind)[3], real (*field)[3]); 27 | void sparsePrecondApply3(const real (*rsd)[3], real (*zrsd)[3]); 28 | } 29 | -------------------------------------------------------------------------------- /include/seq/pair_chgtrn.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "math/libfunc.h" 3 | #include "math/switch.h" 4 | #include "seq/seq.h" 5 | 6 | namespace tinker { 7 | #pragma acc routine seq 8 | template 9 | SEQ_CUDA 10 | void pair_chgtrn(real r, real cut, real off, real mscale, real f, real alphai, 11 | real chgi, real alphak, real chgk, real elambda, e_prec& restrict e, e_prec& restrict de) 12 | { 13 | f *= mscale; 14 | real expi = REAL_EXP(-alphai * r); 15 | real expk = REAL_EXP(-alphak * r); 16 | e = -chgi * expk - chgk * expi; 17 | e *= f * elambda; 18 | if CONSTEXPR (DO_G) { 19 | de = chgi * expk * alphak + chgk * expi * alphai; 20 | de *= f * elambda; 21 | } 22 | if (r > cut) { 23 | real taper, dtaper; 24 | switchTaper5(r, cut, off, taper, dtaper); 25 | if CONSTEXPR (DO_G) de = e * dtaper + de * taper; 26 | e *= taper; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /include/test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if __cplusplus < 201402L 4 | 5 | // Catch2 version 2.3.0 6 | // https://github.com/catchorg/Catch2/blob/v2.3.0/single_include/catch2/catch.hpp 7 | // #include 8 | 9 | // Catch2 version 2.9.1 10 | // https://github.com/catchorg/Catch2/blob/v2.9.1/single_include/catch2/catch.hpp 11 | // #include 12 | 13 | // Catch2 version 2.13.4 14 | // https://github.com/catchorg/Catch2/blob/v2.13.4/single_include/catch2/catch.hpp 15 | // #include 16 | 17 | // Catch2 version 2.13.8 18 | // https://github.com/catchorg/Catch2/blob/v2.13.8/single_include/catch2/catch.hpp 19 | // #include 20 | 21 | // Catch2 version 2.13.9 22 | // https://github.com/catchorg/Catch2/blob/v2.13.9/single_include/catch2/catch.hpp 23 | #include 24 | 25 | #else 26 | 27 | #include 28 | using namespace Catch; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/molcul.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace molcul { 6 | extern int& nmol; 7 | extern int*& imol; 8 | extern int*& kmol; 9 | extern int*& molcule; 10 | extern double& totmass; 11 | extern double*& molmass; 12 | 13 | #ifdef TINKER_FORTRAN_MODULE_CPP 14 | extern "C" int TINKER_MOD(molcul, nmol); 15 | extern "C" int* TINKER_MOD(molcul, imol); 16 | extern "C" int* TINKER_MOD(molcul, kmol); 17 | extern "C" int* TINKER_MOD(molcul, molcule); 18 | extern "C" double TINKER_MOD(molcul, totmass); 19 | extern "C" double* TINKER_MOD(molcul, molmass); 20 | 21 | int& nmol = TINKER_MOD(molcul, nmol); 22 | int*& imol = TINKER_MOD(molcul, imol); 23 | int*& kmol = TINKER_MOD(molcul, kmol); 24 | int*& molcule = TINKER_MOD(molcul, molcule); 25 | double& totmass = TINKER_MOD(molcul, totmass); 26 | double*& molmass = TINKER_MOD(molcul, molmass); 27 | #endif 28 | } } 29 | -------------------------------------------------------------------------------- /test/ref/expol.2.txt: -------------------------------------------------------------------------------- 1 | expol.cpp -- Na+ Water 2 | 3 | Energy Component Breakdown : Kcal/mole Interactions 4 | Polarization -6.23244359 3 5 | 6 | Internal Virial Tensor : 13.108 0.000 0.000 7 | 0.000 0.036 0.000 8 | 0.000 0.000 0.000 9 | 10 | Cartesian Gradient Breakdown over Individual Atoms : 11 | 12 | Type Atom dE/dX dE/dY dE/dZ Norm 13 | 14 | Anlyt 1 -5.34481097 -0.00000000 0.00000000 5.34481097 15 | Anlyt 2 -0.22137239 0.02386243 0.00000000 0.22265477 16 | Anlyt 3 -0.22137239 -0.02386243 0.00000000 0.22265477 17 | Anlyt 4 5.78755574 0.00000000 0.00000000 5.78755574 18 | -------------------------------------------------------------------------------- /test/ref/expol.3.txt: -------------------------------------------------------------------------------- 1 | expol.cpp -- Cl- Water 2 | 3 | Energy Component Breakdown : Kcal/mole Interactions 4 | Polarization -4.26380832 3 5 | 6 | Internal Virial Tensor : 14.905 0.617 0.000 7 | 0.617 0.923 0.000 8 | 0.000 0.000 0.000 9 | 10 | Cartesian Gradient Breakdown over Individual Atoms : 11 | 12 | Type Atom dE/dX dE/dY dE/dZ Norm 13 | 14 | Anlyt 1 -0.88469370 -0.36548459 0.00000000 0.95721572 15 | Anlyt 2 -0.13781954 0.82720147 0.00000000 0.83860390 16 | Anlyt 3 -5.57527609 -0.98893682 0.00000000 5.66230514 17 | Anlyt 4 6.59778934 0.52721994 0.00000000 6.61882051 18 | -------------------------------------------------------------------------------- /test/ref/expol.6.txt: -------------------------------------------------------------------------------- 1 | expol.cpp -- Screening G 2 | 3 | Energy Component Breakdown : Kcal/mole Interactions 4 | Polarization -24.89981598 6 5 | 6 | Internal Virial Tensor : 22.065 -1.907 -7.544 7 | -1.907 18.320 -5.911 8 | -7.544 -5.911 9.928 9 | 10 | Cartesian Gradient Breakdown over Individual Atoms : 11 | 12 | Type Atom dE/dX dE/dY dE/dZ Norm 13 | 14 | Anlyt 1 -2.20768138 2.73909441 -2.32249154 4.21550261 15 | Anlyt 2 -6.47893686 1.83005418 3.51447391 7.59455384 16 | Anlyt 3 -3.04773596 -10.99303159 6.28394314 13.02395406 17 | Anlyt 4 11.73435421 6.42388300 -7.47592551 15.32484270 18 | -------------------------------------------------------------------------------- /test/ref/expol.5.txt: -------------------------------------------------------------------------------- 1 | expol.cpp -- Screening S2 2 | 3 | Energy Component Breakdown : Kcal/mole Interactions 4 | Polarization -88.59818254 6 5 | 6 | Internal Virial Tensor : 76.339 50.971 -14.081 7 | 50.971 125.437 -61.029 8 | -14.081 -61.029 69.980 9 | 10 | Cartesian Gradient Breakdown over Individual Atoms : 11 | 12 | Type Atom dE/dX dE/dY dE/dZ Norm 13 | 14 | Anlyt 1 -13.78553573 11.67733212 -25.81538711 31.50928899 15 | Anlyt 2 -6.78341068 -4.70227541 14.85762924 16.99632905 16 | Anlyt 3 -38.50314991 -86.75934147 50.59101447 107.55987463 17 | Anlyt 4 59.07209632 79.78428476 -39.63325661 106.89171945 18 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/fft.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace fft { 6 | const int maxprime = 15; 7 | extern int (&iprime)[3][maxprime]; 8 | extern unsigned long long& planf; 9 | extern unsigned long long& planb; 10 | extern double*& ffttable; 11 | extern char (&ffttyp)[7]; 12 | 13 | #ifdef TINKER_FORTRAN_MODULE_CPP 14 | extern "C" int TINKER_MOD(fft, iprime)[3][maxprime]; 15 | extern "C" unsigned long long TINKER_MOD(fft, planf); 16 | extern "C" unsigned long long TINKER_MOD(fft, planb); 17 | extern "C" double* TINKER_MOD(fft, ffttable); 18 | extern "C" char TINKER_MOD(fft, ffttyp)[7]; 19 | 20 | int (&iprime)[3][maxprime] = TINKER_MOD(fft, iprime); 21 | unsigned long long& planf = TINKER_MOD(fft, planf); 22 | unsigned long long& planb = TINKER_MOD(fft, planb); 23 | double*& ffttable = TINKER_MOD(fft, ffttable); 24 | char (&ffttyp)[7] = TINKER_MOD(fft, ffttyp); 25 | #endif 26 | } } 27 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/linmin.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace linmin { 6 | extern int& intmax; 7 | extern double& stpmin; 8 | extern double& stpmax; 9 | extern double& cappa; 10 | extern double& slpmax; 11 | extern double& angmax; 12 | 13 | #ifdef TINKER_FORTRAN_MODULE_CPP 14 | extern "C" int TINKER_MOD(linmin, intmax); 15 | extern "C" double TINKER_MOD(linmin, stpmin); 16 | extern "C" double TINKER_MOD(linmin, stpmax); 17 | extern "C" double TINKER_MOD(linmin, cappa); 18 | extern "C" double TINKER_MOD(linmin, slpmax); 19 | extern "C" double TINKER_MOD(linmin, angmax); 20 | 21 | int& intmax = TINKER_MOD(linmin, intmax); 22 | double& stpmin = TINKER_MOD(linmin, stpmin); 23 | double& stpmax = TINKER_MOD(linmin, stpmax); 24 | double& cappa = TINKER_MOD(linmin, cappa); 25 | double& slpmax = TINKER_MOD(linmin, slpmax); 26 | double& angmax = TINKER_MOD(linmin, angmax); 27 | #endif 28 | } } 29 | -------------------------------------------------------------------------------- /include/seq/pairchgtrnaplus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "math/libfunc.h" 3 | #include "math/switch.h" 4 | #include "seq/seq.h" 5 | 6 | namespace tinker { 7 | #pragma acc routine seq 8 | template 9 | SEQ_CUDA 10 | void pair_chgtrn_aplus(real r, real cut, real off, real mscale, real f, 11 | real alphai, real chgi, real alphak, real chgk, real elambda, e_prec& restrict e, 12 | e_prec& restrict de) 13 | { 14 | f *= mscale; 15 | real alphaik = 0.5 * (alphai + alphak); 16 | real chgik = REAL_SQRT(chgi * chgk); 17 | e = -chgik * REAL_EXP(-alphaik * r); 18 | e *= f * elambda; 19 | if CONSTEXPR (DO_G) { 20 | de = alphaik * chgik * REAL_EXP(-alphaik * r); 21 | de *= f * elambda; 22 | } 23 | if (r > cut) { 24 | real taper, dtaper; 25 | switchTaper5(r, cut, off, taper, dtaper); 26 | if CONSTEXPR (DO_G) de = e * dtaper + de * taper; 27 | e *= taper; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/host/darray.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/darray.h" 2 | #include 3 | #include 4 | 5 | namespace tinker { 6 | void waitFor(int) {} 7 | 8 | void deviceMemoryCopyinBytesAsync(void* dst, const void* src, size_t nbytes, int) 9 | { 10 | std::memcpy(dst, src, nbytes); 11 | } 12 | 13 | void deviceMemoryCopyoutBytesAsync(void* dst, const void* src, size_t nbytes, int) 14 | { 15 | std::memcpy(dst, src, nbytes); 16 | } 17 | 18 | void deviceMemoryCopyBytesAsync(void* dst, const void* src, size_t nbytes, int) 19 | { 20 | std::memcpy(dst, src, nbytes); 21 | } 22 | 23 | void deviceMemoryZeroBytesAsync(void* dst, size_t nbytes, int) 24 | { 25 | if (dst == nullptr) 26 | return; 27 | 28 | std::memset(dst, 0, nbytes); 29 | } 30 | 31 | void deviceMemoryDeallocate(void* ptr) 32 | { 33 | std::free(ptr); 34 | } 35 | 36 | void deviceMemoryAllocateBytes(void** pptr, size_t nbytes) 37 | { 38 | *pptr = std::malloc(nbytes); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /doc/manual/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /doc/manual/m/replace.rst: -------------------------------------------------------------------------------- 1 | .. |nbsp| unicode:: U+00A0 .. non-breaking space 2 | .. |rad2| replace:: rad\ :sup:`2` 3 | .. |ang| unicode:: U+00C5 .. angstrom 4 | .. |ang2| replace:: |ang|\ :sup:`2` 5 | .. |deg2| replace:: deg\ :sup:`2` 6 | .. |deg3| replace:: deg\ :sup:`3` 7 | .. |deg4| replace:: deg\ :sup:`4` 8 | .. |e2| replace:: e\ :sup:`2` 9 | .. |bohr2| replace:: Bohr\ :sup:`2` 10 | .. |pm| unicode:: U+00B1 .. plus-minus sign 11 | .. |x| unicode:: U+00D7 .. multiplication sign 12 | 13 | .. role:: raw-latex(raw) 14 | :format: latex 15 | 16 | .. role:: raw-html(raw) 17 | :format: html 18 | 19 | .. |not9| replace:: :raw-html:`Tinker9` 20 | :raw-latex:`\sout{\textsc{Tinker9}}` 21 | .. |not8| replace:: :raw-html:`Tinker8` 22 | :raw-latex:`\sout{\textsc{Tinker8}}` 23 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/katoms.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace katoms { 6 | extern int*& atmcls; 7 | extern int*& atmnum; 8 | extern int*& ligand; 9 | extern double*& weight; 10 | extern char (*&symbol)[3]; 11 | extern char (*&describe)[24]; 12 | 13 | #ifdef TINKER_FORTRAN_MODULE_CPP 14 | extern "C" int* TINKER_MOD(katoms, atmcls); 15 | extern "C" int* TINKER_MOD(katoms, atmnum); 16 | extern "C" int* TINKER_MOD(katoms, ligand); 17 | extern "C" double* TINKER_MOD(katoms, weight); 18 | extern "C" char (*TINKER_MOD(katoms, symbol))[3]; 19 | extern "C" char (*TINKER_MOD(katoms, describe))[24]; 20 | 21 | int*& atmcls = TINKER_MOD(katoms, atmcls); 22 | int*& atmnum = TINKER_MOD(katoms, atmnum); 23 | int*& ligand = TINKER_MOD(katoms, ligand); 24 | double*& weight = TINKER_MOD(katoms, weight); 25 | char (*&symbol)[3] = TINKER_MOD(katoms, symbol); 26 | char (*&describe)[24] = TINKER_MOD(katoms, describe); 27 | #endif 28 | } } 29 | -------------------------------------------------------------------------------- /src/acc/minimize.cpp: -------------------------------------------------------------------------------- 1 | #include "ff/atom.h" 2 | 3 | namespace tinker { 4 | void xMinimizeSetXxByPos_acc(int n, double* xx, const double* scale) 5 | { 6 | #pragma acc parallel loop independent async deviceptr(xpos,ypos,zpos)\ 7 | copyin(scale[0:3*n]) copyout(xx[0:3*n]) 8 | for (int i = 0; i < n; ++i) { 9 | int j = 3 * i; 10 | xx[j + 0] = xpos[i] * scale[j + 0]; 11 | xx[j + 1] = ypos[i] * scale[j + 1]; 12 | xx[j + 2] = zpos[i] * scale[j + 2]; 13 | } 14 | #pragma acc wait 15 | } 16 | 17 | void xMinimizeSetPos_acc(int n, const double* xx, const double* scale) 18 | { 19 | #pragma acc parallel loop independent async deviceptr(xpos,ypos,zpos)\ 20 | copyin(scale[0:3*n],xx[0:3*n]) 21 | for (int i = 0; i < n; ++i) { 22 | int j = 3 * i; 23 | xpos[i] = xx[j + 0] / scale[j + 0]; 24 | ypos[i] = xx[j + 1] / scale[j + 1]; 25 | zpos[i] = xx[j + 2] / scale[j + 2]; 26 | } 27 | #pragma acc wait 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /doc/manual/m/key/parallel.rst: -------------------------------------------------------------------------------- 1 | Parallelization 2 | =============== 3 | 4 | .. include:: ../replace.rst 5 | 6 | **CUDA-DEVICE [integer]** 7 | 8 | .. index:: CUDA-DEVICE 9 | .. index:: CUDA_DEVICE 10 | 11 | Followed by an integer value starting from 0, sets the CUDA-enabled 12 | GPU device for the program. Value will be overwritten by environment variable 13 | *CUDA_DEVICE*. 14 | For instance, a node has four CUDA devices, and the *CUDA_VISIBLE_DEVICES* 15 | environment variable (part of CUDA library) has been set to 16 | *CUDA_VISIBLE_DEVICES=1,3*. This means only two CUDA devices are avaiable 17 | here, thus the valid values for *CUDA-DEVICE* are 0 and 1. 18 | 19 | **GPU-PACKAGE [CUDA / OPENACC]** |not8| 20 | 21 | .. index:: GPU-PACKAGE 22 | .. index:: GPU_PACKAGE 23 | 24 | Selects code paths for some GPU algorithms where both CUDA and 25 | OpenACC versions have been implemented. 26 | The default value is CUDA. Value will be overwritten by environment variable 27 | *GPU_PACKAGE*. 28 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/mplpot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace mplpot { 6 | extern double& m2scale; 7 | extern double& m3scale; 8 | extern double& m4scale; 9 | extern double& m5scale; 10 | extern int& use_chgpen; 11 | extern char (&pentyp)[7]; 12 | 13 | #ifdef TINKER_FORTRAN_MODULE_CPP 14 | extern "C" double TINKER_MOD(mplpot, m2scale); 15 | extern "C" double TINKER_MOD(mplpot, m3scale); 16 | extern "C" double TINKER_MOD(mplpot, m4scale); 17 | extern "C" double TINKER_MOD(mplpot, m5scale); 18 | extern "C" int TINKER_MOD(mplpot, use_chgpen); 19 | extern "C" char TINKER_MOD(mplpot, pentyp)[7]; 20 | 21 | double& m2scale = TINKER_MOD(mplpot, m2scale); 22 | double& m3scale = TINKER_MOD(mplpot, m3scale); 23 | double& m4scale = TINKER_MOD(mplpot, m4scale); 24 | double& m5scale = TINKER_MOD(mplpot, m5scale); 25 | int& use_chgpen = TINKER_MOD(mplpot, use_chgpen); 26 | char (&pentyp)[7] = TINKER_MOD(mplpot, pentyp); 27 | #endif 28 | } } 29 | -------------------------------------------------------------------------------- /src/compilers.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/ioprint.h" 2 | #include "tool/macro.h" 3 | 4 | namespace tinker { 5 | std::string cxxCompilerName() 6 | { 7 | std::string n = "unknown"; 8 | #if defined(TINKER_ICPC) 9 | n = format("icpc %d.%d", __INTEL_COMPILER, __INTEL_COMPILER_BUILD_DATE); 10 | 11 | #elif defined(TINKER_PGI) 12 | if (__PGIC__ <= 19) 13 | n = format("pgc++ %d.%d.%d", __PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__); 14 | else 15 | n = format("nvc++ %d.%d.%d", __PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__); 16 | 17 | #elif defined(TINKER_APPLE_CLANG) 18 | n = format("clang++ %d.%d.%d (xcode)", __clang_major__, __clang_minor__, __clang_patchlevel__); 19 | 20 | #elif defined(TINKER_LLVM_CLANG) 21 | n = format("clang++ %d.%d.%d (llvm)", __clang_major__, __clang_minor__, __clang_patchlevel__); 22 | 23 | #elif defined(TINKER_GCC) 24 | n = format("g++ %d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); 25 | 26 | #endif 27 | return n; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /include/ff/echglj.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/echarge.h" 3 | #include "ff/evdw.h" 4 | #include "tool/rcman.h" 5 | 6 | namespace tinker { 7 | /// \ingroup chglj 8 | void echgljData(RcOp); 9 | /// \ingroup chglj 10 | void echglj(int vers); 11 | } 12 | 13 | //====================================================================// 14 | // // 15 | // Global Variables // 16 | // // 17 | //====================================================================// 18 | 19 | // chglj 20 | namespace tinker { 21 | TINKER_EXTERN int ncvexclude; 22 | TINKER_EXTERN int (*cvexclude)[2]; 23 | TINKER_EXTERN real (*cvexclude_scale)[2]; 24 | 25 | TINKER_EXTERN bool vdwpr_in_use; 26 | 27 | TINKER_EXTERN int* mut_coalesced; // n 28 | TINKER_EXTERN real* chg_coalesced; // n 29 | TINKER_EXTERN real* radeps_coalesced; // 2*n 30 | } 31 | -------------------------------------------------------------------------------- /include/tool/platform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "tool/rcman.h" 3 | 4 | namespace tinker { 5 | /// \ingroup platform 6 | /// Flags for the major platforms. 7 | enum class Platform 8 | { 9 | UNKNOWN = 0x000, ///< Flag for the unknown platform. 10 | ACC = 0x001, ///< Flag for the OpenACC platform. 11 | CUDA = 0x002 ///< Flag for the CUDA platform. 12 | }; 13 | TINKER_ENABLE_ENUM_BITMASK(Platform); 14 | 15 | /// \ingroup platform 16 | void platformData(RcOp); 17 | } 18 | 19 | //====================================================================// 20 | // // 21 | // Global Variables // 22 | // // 23 | //====================================================================// 24 | 25 | namespace tinker { 26 | /// \ingroup platform 27 | TINKER_EXTERN Platform pltfm_config; ///< Platform in use. 28 | } 29 | -------------------------------------------------------------------------------- /test/file/expol/expol.key: -------------------------------------------------------------------------------- 1 | parameters expol.prm 2 | 3 | exchpol 2 7.57187611 1.00774942 22.92257722 0 4 | exchpol 1 8.52625781 0.26279239 2.34042498 0 5 | exchpol 7 1.28799890 14.03512371 7.21629192 1 6 | exchpol 15 0.80994925 2.03295455 1.28410603 1 7 | exchpol 8 1.09975765 6.89625706 4.51567248 1 8 | exchpol 16 0.90156301 2.17737556 1.28742270 1 9 | 10 | chgpen 7 4.090412102728663 5.346221041987701 11 | chgpen 15 9.937217338945683 3.403540591081243 12 | chgpen 8 8.689356786155788 4.550459010432590 13 | chgpen 16 12.129167017481114 3.222907140342866 14 | chgpen 20 6.298463497273733 6.755370803213201 15 | chgpen 21 12.760026532535434 5.683167591839673 16 | 17 | polarize 1 1.21889959 2 18 | polarize 2 0.14304110 1 19 | 20 | polarizeterm only 21 | -------------------------------------------------------------------------------- /src/acc/amoeba/rotpole.cpp: -------------------------------------------------------------------------------- 1 | #include "seq/rotpole.h" 2 | #include "ff/modamoeba.h" 3 | #include "ff/atom.h" 4 | #include "math/libfunc.h" 5 | 6 | namespace tinker { 7 | void chkpole_acc() 8 | { 9 | #pragma acc parallel loop independent async deviceptr(x,y,z,zaxis,pole) 10 | for (int i = 0; i < n; ++i) 11 | chkpoleAtomI(i, pole, zaxis, x, y, z); 12 | } 13 | 14 | void rotpole_acc() 15 | { 16 | #pragma acc parallel loop independent async deviceptr(x,y,z,zaxis,rpole,pole) 17 | for (int i = 0; i < n; ++i) 18 | rotpoleAtomI(i, rpole, pole, zaxis, x, y, z); 19 | } 20 | 21 | void chkrepole_acc() 22 | { 23 | #pragma acc parallel loop independent async deviceptr(x,y,z,zaxis,repole) 24 | for (int i = 0; i < n; ++i) 25 | chkpoleAtomI(i, repole, zaxis, x, y, z); 26 | } 27 | 28 | void rotrepole_acc() 29 | { 30 | #pragma acc parallel loop independent async deviceptr(x,y,z,zaxis,rrepole,repole) 31 | for (int i = 0; i < n; ++i) 32 | rotpoleAtomI(i, rrepole, repole, zaxis, x, y, z); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/acc/cudalib.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/rcman.h" 2 | #if TINKER_CUDART 3 | # include "tool/accasync.h" 4 | # include "tool/cudalib.h" 5 | # include "tool/platform.h" 6 | # include 7 | #endif 8 | 9 | namespace tinker { 10 | void cudalibDataStreamAndQ_acc(RcOp op) 11 | { 12 | #if TINKER_GPULANG_OPENACC 13 | if (op & RcOp::DEALLOC) { 14 | g::q0 = -42; 15 | g::q1 = -42; 16 | g::s0 = nullptr; 17 | g::s1 = nullptr; 18 | g::spme = nullptr; 19 | g::qpme = -42; 20 | } 21 | 22 | if (op & RcOp::ALLOC) { 23 | g::q0 = acc_get_default_async(); 24 | g::q1 = acc_async_sync; 25 | g::s0 = (cudaStream_t)acc_get_cuda_stream(g::q0); 26 | g::s1 = (cudaStream_t)acc_get_cuda_stream(g::q1); 27 | if (pltfm_config & Platform::CUDA) { 28 | g::qpme = g::q1; 29 | g::spme = g::s1; 30 | } else { 31 | g::qpme = g::q0 + 1; 32 | g::spme = (cudaStream_t)acc_get_cuda_stream(g::qpme); 33 | } 34 | } 35 | #endif 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/ascii.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace ascii { 6 | const int null = 0; 7 | const int tab = 9; 8 | const int linefeed = 10; 9 | const int formfeed = 12; 10 | const int carriage = 13; 11 | const int escape = 27; 12 | const int space = 32; 13 | const int exclamation = 33; 14 | const int quote = 34; 15 | const int pound = 35; 16 | const int dollar = 36; 17 | const int percent = 37; 18 | const int ampersand = 38; 19 | const int apostrophe = 39; 20 | const int asterisk = 42; 21 | const int plus = 43; 22 | const int comma = 44; 23 | const int minus = 45; 24 | const int dash = 45; 25 | const int period = 46; 26 | const int frontslash = 47; 27 | const int colon = 58; 28 | const int semicolon = 59; 29 | const int equal = 61; 30 | const int question = 63; 31 | const int atsign = 64; 32 | const int backslash = 92; 33 | const int caret = 94; 34 | const int underbar = 95; 35 | const int vertical = 124; 36 | const int tilde = 126; 37 | const int nbsp = 255; 38 | } } 39 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/mdstuf.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace mdstuf { 6 | extern int& nfree; 7 | extern int& irest; 8 | extern int& bmnmix; 9 | extern int& nrespa; 10 | extern double& arespa; 11 | extern int& dorest; 12 | extern char (&integrate)[11]; 13 | 14 | #ifdef TINKER_FORTRAN_MODULE_CPP 15 | extern "C" int TINKER_MOD(mdstuf, nfree); 16 | extern "C" int TINKER_MOD(mdstuf, irest); 17 | extern "C" int TINKER_MOD(mdstuf, bmnmix); 18 | extern "C" int TINKER_MOD(mdstuf, nrespa); 19 | extern "C" double TINKER_MOD(mdstuf, arespa); 20 | extern "C" int TINKER_MOD(mdstuf, dorest); 21 | extern "C" char TINKER_MOD(mdstuf, integrate)[11]; 22 | 23 | int& nfree = TINKER_MOD(mdstuf, nfree); 24 | int& irest = TINKER_MOD(mdstuf, irest); 25 | int& bmnmix = TINKER_MOD(mdstuf, bmnmix); 26 | int& nrespa = TINKER_MOD(mdstuf, nrespa); 27 | double& arespa = TINKER_MOD(mdstuf, arespa); 28 | int& dorest = TINKER_MOD(mdstuf, dorest); 29 | char (&integrate)[11] = TINKER_MOD(mdstuf, integrate); 30 | #endif 31 | } } 32 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/socket.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace socket { 6 | extern int& skttyp; 7 | extern int& cstep; 8 | extern double& cdt; 9 | extern double& cenergy; 10 | extern int& sktstart; 11 | extern int& sktstop; 12 | extern int& use_socket; 13 | 14 | #ifdef TINKER_FORTRAN_MODULE_CPP 15 | extern "C" int TINKER_MOD(socket, skttyp); 16 | extern "C" int TINKER_MOD(socket, cstep); 17 | extern "C" double TINKER_MOD(socket, cdt); 18 | extern "C" double TINKER_MOD(socket, cenergy); 19 | extern "C" int TINKER_MOD(socket, sktstart); 20 | extern "C" int TINKER_MOD(socket, sktstop); 21 | extern "C" int TINKER_MOD(socket, use_socket); 22 | 23 | int& skttyp = TINKER_MOD(socket, skttyp); 24 | int& cstep = TINKER_MOD(socket, cstep); 25 | double& cdt = TINKER_MOD(socket, cdt); 26 | double& cenergy = TINKER_MOD(socket, cenergy); 27 | int& sktstart = TINKER_MOD(socket, sktstart); 28 | int& sktstop = TINKER_MOD(socket, sktstop); 29 | int& use_socket = TINKER_MOD(socket, use_socket); 30 | #endif 31 | } } 32 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/expol.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace expol { 6 | extern int& nexpol; 7 | extern double*& kpep; 8 | extern double*& prepep; 9 | extern double*& dmppep; 10 | extern double*& polscale; 11 | extern double*& polinv; 12 | extern int*& lpep; 13 | 14 | #ifdef TINKER_FORTRAN_MODULE_CPP 15 | extern "C" int TINKER_MOD(expol, nexpol); 16 | extern "C" double* TINKER_MOD(expol, kpep); 17 | extern "C" double* TINKER_MOD(expol, prepep); 18 | extern "C" double* TINKER_MOD(expol, dmppep); 19 | extern "C" double* TINKER_MOD(expol, polscale); 20 | extern "C" double* TINKER_MOD(expol, polinv); 21 | extern "C" int* TINKER_MOD(expol, lpep); 22 | 23 | int& nexpol = TINKER_MOD(expol, nexpol); 24 | double*& kpep = TINKER_MOD(expol, kpep); 25 | double*& prepep = TINKER_MOD(expol, prepep); 26 | double*& dmppep = TINKER_MOD(expol, dmppep); 27 | double*& polscale = TINKER_MOD(expol, polscale); 28 | double*& polinv = TINKER_MOD(expol, polinv); 29 | int*& lpep = TINKER_MOD(expol, lpep); 30 | #endif 31 | } } 32 | -------------------------------------------------------------------------------- /include/ff/amoeba/mpole.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace tinker { 4 | enum 5 | { 6 | MPL_PME_0 = 0, 7 | MPL_PME_X = 1, 8 | MPL_PME_Y = 2, 9 | MPL_PME_Z = 3, 10 | MPL_PME_XX = 4, 11 | MPL_PME_YY = 5, 12 | MPL_PME_ZZ = 6, 13 | MPL_PME_XY = 7, 14 | MPL_PME_XZ = 8, 15 | MPL_PME_YZ = 9, 16 | MPL_TOTAL = 10, 17 | MPL_PME_YX = MPL_PME_XY, 18 | MPL_PME_ZX = MPL_PME_XZ, 19 | MPL_PME_ZY = MPL_PME_YZ, 20 | 21 | LFRM_NONE = 0, 22 | LFRM_Z_ONLY = 1, 23 | LFRM_Z_THEN_X = 2, 24 | LFRM_BISECTOR = 3, 25 | LFRM_Z_BISECT = 4, 26 | LFRM_3_FOLD = 5 27 | }; 28 | 29 | /// \brief Local axis type and x,y,z-axis defining atoms for each multipole site. 30 | struct LocalFrame 31 | { 32 | int zaxis; ///< Z-axis defining atom, starting from 0. 33 | int xaxis; ///< X-axis defining atom, starting from 0. 34 | int yaxis; ///< Y-axis defining atom, starting from ONE. 35 | int polaxe; ///< Local frame definition. 36 | }; 37 | 38 | enum class UPred 39 | { 40 | NONE, 41 | GEAR, 42 | ASPC, 43 | LSQR 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/kcflux.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace kcflux { 6 | extern int& maxncfb; 7 | extern int& maxncfa; 8 | extern double*& cflb; 9 | extern double*& cfla; 10 | extern double*& cflab; 11 | extern char (*&kcfb)[8]; 12 | extern char (*&kcfa)[12]; 13 | 14 | #ifdef TINKER_FORTRAN_MODULE_CPP 15 | extern "C" int TINKER_MOD(kcflux, maxncfb); 16 | extern "C" int TINKER_MOD(kcflux, maxncfa); 17 | extern "C" double* TINKER_MOD(kcflux, cflb); 18 | extern "C" double* TINKER_MOD(kcflux, cfla); 19 | extern "C" double* TINKER_MOD(kcflux, cflab); 20 | extern "C" char (*TINKER_MOD(kcflux, kcfb))[8]; 21 | extern "C" char (*TINKER_MOD(kcflux, kcfa))[12]; 22 | 23 | int& maxncfb = TINKER_MOD(kcflux, maxncfb); 24 | int& maxncfa = TINKER_MOD(kcflux, maxncfa); 25 | double*& cflb = TINKER_MOD(kcflux, cflb); 26 | double*& cfla = TINKER_MOD(kcflux, cfla); 27 | double*& cflab = TINKER_MOD(kcflux, cflab); 28 | char (*&kcfb)[8] = TINKER_MOD(kcflux, kcfb); 29 | char (*&kcfa)[12] = TINKER_MOD(kcflux, kcfa); 30 | #endif 31 | } } 32 | -------------------------------------------------------------------------------- /src/cu/cudalib.cu: -------------------------------------------------------------------------------- 1 | #include "tool/accasync.h" 2 | #include "tool/cudalib.h" 3 | #include "tool/error.h" 4 | 5 | namespace tinker { 6 | void cudalibDataStreamAndQ_cu(RcOp op) 7 | { 8 | if (op & RcOp::DEALLOC) { 9 | g::q0 = -42; 10 | g::q1 = -42; 11 | check_rt(cudaStreamDestroy(g::s1)); 12 | g::s1 = nullptr; 13 | g::s0 = nullptr; 14 | g::spme = nullptr; 15 | g::qpme = -42; 16 | } 17 | 18 | if (op & RcOp::ALLOC) { 19 | g::q0 = 0; 20 | g::q1 = 1; 21 | g::s0 = nullptr; 22 | check_rt(cudaStreamCreateWithFlags(&g::s1, cudaStreamNonBlocking)); 23 | g::qpme = g::q1; 24 | g::spme = g::s1; 25 | } 26 | } 27 | } 28 | 29 | #include "tool/externfunc.h" 30 | 31 | namespace tinker { 32 | void boxDataP1_cu(RcOp) {} 33 | 34 | void boxCopyin_cu() {} 35 | 36 | void ebuck_cu(int) 37 | { 38 | TINKER_FCALL0_ERROR__(ebuck, cu); 39 | } 40 | 41 | void emm3hb_cu(int) 42 | { 43 | TINKER_FCALL0_ERROR__(emm3hb, cu); 44 | } 45 | 46 | void egauss_cu(int) 47 | { 48 | TINKER_FCALL0_ERROR__(egauss, cu); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/acc/cmakesrc.txt: -------------------------------------------------------------------------------- 1 | set (__T9_ACC_SRC 2 | amoeba/empoleewald.cpp 3 | amoeba/empolenonewald.cpp 4 | amoeba/epolarewald.cpp 5 | amoeba/epolarnonewald.cpp 6 | amoeba/fieldewald.cpp 7 | amoeba/fieldnonewald.cpp 8 | amoeba/induce.cpp 9 | amoeba/rotpole.cpp 10 | amoeba/torque.cpp 11 | aplus/echgtrn.cpp 12 | aplus/empole.cpp 13 | aplus/epolar.cpp 14 | aplus/field.cpp 15 | aplus/induce.cpp 16 | atom.cpp 17 | box.cpp 18 | compilers.cpp 19 | cudalib.cpp 20 | eangle.cpp 21 | eangtor.cpp 22 | ebond.cpp 23 | echarge.cpp 24 | egeom.cpp 25 | egvop.cpp 26 | ehal.cpp 27 | eimprop.cpp 28 | eimptor.cpp 29 | elj.cpp 30 | eopbend.cpp 31 | epitors.cpp 32 | estrbnd.cpp 33 | estrtor.cpp 34 | etors.cpp 35 | etortor.cpp 36 | eurey.cpp 37 | hippo/cflux.cpp 38 | hippo/echgtrn.cpp 39 | hippo/edisp.cpp 40 | hippo/empole.cpp 41 | hippo/epolar.cpp 42 | hippo/erepel.cpp 43 | hippo/expol.cpp 44 | hippo/field.cpp 45 | hippo/induce.cpp 46 | lflpiston.cpp 47 | mathlu.cpp 48 | mathparallel.cpp 49 | mathzero.cpp 50 | mdintg.cpp 51 | mdpq.cpp 52 | mdpt.cpp 53 | minimize.cpp 54 | nblist.cpp 55 | osrw.cpp 56 | pme.cpp 57 | rattle.cpp 58 | ) 59 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/disgeo.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace disgeo { 6 | extern double& vdwmax; 7 | extern double& compact; 8 | extern double& pathmax; 9 | extern double*& dbnd; 10 | extern double*& georad; 11 | extern int& use_invert; 12 | extern int& use_anneal; 13 | 14 | #ifdef TINKER_FORTRAN_MODULE_CPP 15 | extern "C" double TINKER_MOD(disgeo, vdwmax); 16 | extern "C" double TINKER_MOD(disgeo, compact); 17 | extern "C" double TINKER_MOD(disgeo, pathmax); 18 | extern "C" double* TINKER_MOD(disgeo, dbnd); 19 | extern "C" double* TINKER_MOD(disgeo, georad); 20 | extern "C" int TINKER_MOD(disgeo, use_invert); 21 | extern "C" int TINKER_MOD(disgeo, use_anneal); 22 | 23 | double& vdwmax = TINKER_MOD(disgeo, vdwmax); 24 | double& compact = TINKER_MOD(disgeo, compact); 25 | double& pathmax = TINKER_MOD(disgeo, pathmax); 26 | double*& dbnd = TINKER_MOD(disgeo, dbnd); 27 | double*& georad = TINKER_MOD(disgeo, georad); 28 | int& use_invert = TINKER_MOD(disgeo, use_invert); 29 | int& use_anneal = TINKER_MOD(disgeo, use_anneal); 30 | #endif 31 | } } 32 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/nucleo.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace nucleo { 7 | using namespace sizes; 8 | 9 | extern int (&pucker)[maxres]; 10 | extern double (&glyco)[maxres]; 11 | extern double (&bkbone)[maxres][6]; 12 | extern int& dblhlx; 13 | extern int (&deoxy)[maxres]; 14 | extern char (&hlxform)[1]; 15 | 16 | #ifdef TINKER_FORTRAN_MODULE_CPP 17 | extern "C" int TINKER_MOD(nucleo, pucker)[maxres]; 18 | extern "C" double TINKER_MOD(nucleo, glyco)[maxres]; 19 | extern "C" double TINKER_MOD(nucleo, bkbone)[maxres][6]; 20 | extern "C" int TINKER_MOD(nucleo, dblhlx); 21 | extern "C" int TINKER_MOD(nucleo, deoxy)[maxres]; 22 | extern "C" char TINKER_MOD(nucleo, hlxform)[1]; 23 | 24 | int (&pucker)[maxres] = TINKER_MOD(nucleo, pucker); 25 | double (&glyco)[maxres] = TINKER_MOD(nucleo, glyco); 26 | double (&bkbone)[maxres][6] = TINKER_MOD(nucleo, bkbone); 27 | int& dblhlx = TINKER_MOD(nucleo, dblhlx); 28 | int (&deoxy)[maxres] = TINKER_MOD(nucleo, deoxy); 29 | char (&hlxform)[1] = TINKER_MOD(nucleo, hlxform); 30 | #endif 31 | } } 32 | -------------------------------------------------------------------------------- /test/ref/angle.2.txt: -------------------------------------------------------------------------------- 1 | angle.cpp 2 | 3 | Energy Component Breakdown : Kcal/mole Interactions 4 | Angle Bending 2.5040 15 5 | 6 | Internal Virial Tensor : -16.151 -18.626 5.123 7 | -18.626 8.897 -2.176 8 | 5.123 -2.176 7.254 9 | 10 | Cartesian Gradient Breakdown over Individual Atoms : 11 | 12 | Type Atom dE/dX dE/dY dE/dZ Norm 13 | 14 | Anlyt 1 17.0793 -27.7323 -7.7567 33.4806 15 | Anlyt 2 2.8974 1.1176 3.0201 4.3319 16 | Anlyt 3 -4.8330 8.3731 -0.1717 9.6694 17 | Anlyt 4 -11.1938 2.7921 0.6558 11.5554 18 | Anlyt 5 0.6160 0.4907 0.9961 1.2698 19 | Anlyt 6 -11.3931 3.0899 4.4134 12.6027 20 | Anlyt 7 6.8272 11.8690 -1.1570 13.7413 21 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/phipsi.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace phipsi { 7 | using namespace sizes; 8 | 9 | extern int (&chiral)[maxres]; 10 | extern int (&disulf)[maxres]; 11 | extern double (&phi)[maxres]; 12 | extern double (&psi)[maxres]; 13 | extern double (&omg)[maxres]; 14 | extern double (&chi)[maxres][4]; 15 | 16 | #ifdef TINKER_FORTRAN_MODULE_CPP 17 | extern "C" int TINKER_MOD(phipsi, chiral)[maxres]; 18 | extern "C" int TINKER_MOD(phipsi, disulf)[maxres]; 19 | extern "C" double TINKER_MOD(phipsi, phi)[maxres]; 20 | extern "C" double TINKER_MOD(phipsi, psi)[maxres]; 21 | extern "C" double TINKER_MOD(phipsi, omg)[maxres]; 22 | extern "C" double TINKER_MOD(phipsi, chi)[maxres][4]; 23 | 24 | int (&chiral)[maxres] = TINKER_MOD(phipsi, chiral); 25 | int (&disulf)[maxres] = TINKER_MOD(phipsi, disulf); 26 | double (&phi)[maxres] = TINKER_MOD(phipsi, phi); 27 | double (&psi)[maxres] = TINKER_MOD(phipsi, psi); 28 | double (&omg)[maxres] = TINKER_MOD(phipsi, omg); 29 | double (&chi)[maxres][4] = TINKER_MOD(phipsi, chi); 30 | #endif 31 | } } 32 | -------------------------------------------------------------------------------- /test/file/nacl/nacl4.key: -------------------------------------------------------------------------------- 1 | parameters amoeba09 2 | 3 | integrator RESPA 4 | thermostat BUSSI 5 | barostat MONTECARLO 6 | 7 | neighbor-list 8 | list-buffer 0.1 9 | vdw-cutoff 2.6 10 | mpole-cutoff 5.0 11 | 12 | a-axis 20.000 13 | pme-grid 40 40 40 14 | ewald 15 | ewald-cutoff 7.0 16 | 17 | # originally N2 parameters 18 | multipole 7 15 0 1.00000 19 | 0.00000 0.00000 0.12578 20 | 0.16329 21 | 0.00000 0.16329 22 | 0.00000 0.00000 -0.32658 23 | multipole 15 7 0 -1.00000 24 | 0.00000 0.00000 0.12578 25 | 0.16329 26 | 0.00000 0.16329 27 | 0.00000 0.00000 -0.32658 28 | -------------------------------------------------------------------------------- /src/errprint.cpp: -------------------------------------------------------------------------------- 1 | #include "ff/atom.h" 2 | #include "ff/box.h" 3 | #include "tool/darray.h" 4 | #include "tool/error.h" 5 | #include 6 | #include 7 | 8 | namespace tinker { 9 | void printError() 10 | { 11 | Box p; 12 | boxGetCurrent(p); 13 | boxSetTinker(p); 14 | darray::copyout(g::q0, n, atoms::x, xpos); 15 | darray::copyout(g::q0, n, atoms::y, ypos); 16 | darray::copyout(g::q0, n, atoms::z, zpos); 17 | waitFor(g::q0); 18 | tinker_f_prterr(); 19 | } 20 | } 21 | 22 | namespace tinker { 23 | void throwExceptionMissingFunction(const char* functionName, const char* file, int lineNum) 24 | { 25 | std::string s1 = file; 26 | std::string s2 = TINKER9_DIRSTR; 27 | std::string s3; 28 | if (s1.substr(0, s2.length()) != s2) { 29 | s3 = s1; 30 | } else { 31 | s3 = s1.substr(s2.length()); 32 | if (s3[0] == '/') 33 | s3 = s3.substr(1); 34 | } 35 | 36 | printBacktrace(); 37 | auto err = FatalError( 38 | format("Function void %s(...) is not implemented at %s:%d", functionName, s3, lineNum)); 39 | throw err; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/cell.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace cell { 6 | extern int& ncell; 7 | extern int*& icell; 8 | extern double& xcell; 9 | extern double& ycell; 10 | extern double& zcell; 11 | extern double& xcell2; 12 | extern double& ycell2; 13 | extern double& zcell2; 14 | 15 | #ifdef TINKER_FORTRAN_MODULE_CPP 16 | extern "C" int TINKER_MOD(cell, ncell); 17 | extern "C" int* TINKER_MOD(cell, icell); 18 | extern "C" double TINKER_MOD(cell, xcell); 19 | extern "C" double TINKER_MOD(cell, ycell); 20 | extern "C" double TINKER_MOD(cell, zcell); 21 | extern "C" double TINKER_MOD(cell, xcell2); 22 | extern "C" double TINKER_MOD(cell, ycell2); 23 | extern "C" double TINKER_MOD(cell, zcell2); 24 | 25 | int& ncell = TINKER_MOD(cell, ncell); 26 | int*& icell = TINKER_MOD(cell, icell); 27 | double& xcell = TINKER_MOD(cell, xcell); 28 | double& ycell = TINKER_MOD(cell, ycell); 29 | double& zcell = TINKER_MOD(cell, zcell); 30 | double& xcell2 = TINKER_MOD(cell, xcell2); 31 | double& ycell2 = TINKER_MOD(cell, ycell2); 32 | double& zcell2 = TINKER_MOD(cell, zcell2); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/torpot.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace torpot { 6 | extern double& idihunit; 7 | extern double& itorunit; 8 | extern double& torsunit; 9 | extern double& ptorunit; 10 | extern double& storunit; 11 | extern double& atorunit; 12 | extern double& ttorunit; 13 | 14 | #ifdef TINKER_FORTRAN_MODULE_CPP 15 | extern "C" double TINKER_MOD(torpot, idihunit); 16 | extern "C" double TINKER_MOD(torpot, itorunit); 17 | extern "C" double TINKER_MOD(torpot, torsunit); 18 | extern "C" double TINKER_MOD(torpot, ptorunit); 19 | extern "C" double TINKER_MOD(torpot, storunit); 20 | extern "C" double TINKER_MOD(torpot, atorunit); 21 | extern "C" double TINKER_MOD(torpot, ttorunit); 22 | 23 | double& idihunit = TINKER_MOD(torpot, idihunit); 24 | double& itorunit = TINKER_MOD(torpot, itorunit); 25 | double& torsunit = TINKER_MOD(torpot, torsunit); 26 | double& ptorunit = TINKER_MOD(torpot, ptorunit); 27 | double& storunit = TINKER_MOD(torpot, storunit); 28 | double& atorunit = TINKER_MOD(torpot, atorunit); 29 | double& ttorunit = TINKER_MOD(torpot, ttorunit); 30 | #endif 31 | } } 32 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/qmstuf.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace qmstuf { 6 | extern int& ngatom; 7 | extern double& egau; 8 | extern double*& gx; 9 | extern double*& gy; 10 | extern double*& gz; 11 | extern double*& gfreq; 12 | extern double*& gforce; 13 | extern double*& gh; 14 | 15 | #ifdef TINKER_FORTRAN_MODULE_CPP 16 | extern "C" int TINKER_MOD(qmstuf, ngatom); 17 | extern "C" double TINKER_MOD(qmstuf, egau); 18 | extern "C" double* TINKER_MOD(qmstuf, gx); 19 | extern "C" double* TINKER_MOD(qmstuf, gy); 20 | extern "C" double* TINKER_MOD(qmstuf, gz); 21 | extern "C" double* TINKER_MOD(qmstuf, gfreq); 22 | extern "C" double* TINKER_MOD(qmstuf, gforce); 23 | extern "C" double* TINKER_MOD(qmstuf, gh); 24 | 25 | int& ngatom = TINKER_MOD(qmstuf, ngatom); 26 | double& egau = TINKER_MOD(qmstuf, egau); 27 | double*& gx = TINKER_MOD(qmstuf, gx); 28 | double*& gy = TINKER_MOD(qmstuf, gy); 29 | double*& gz = TINKER_MOD(qmstuf, gz); 30 | double*& gfreq = TINKER_MOD(qmstuf, gfreq); 31 | double*& gforce = TINKER_MOD(qmstuf, gforce); 32 | double*& gh = TINKER_MOD(qmstuf, gh); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/tors.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace tors { 6 | extern int& ntors; 7 | extern int*& itors; 8 | extern double*& tors1; 9 | extern double*& tors2; 10 | extern double*& tors3; 11 | extern double*& tors4; 12 | extern double*& tors5; 13 | extern double*& tors6; 14 | 15 | #ifdef TINKER_FORTRAN_MODULE_CPP 16 | extern "C" int TINKER_MOD(tors, ntors); 17 | extern "C" int* TINKER_MOD(tors, itors); 18 | extern "C" double* TINKER_MOD(tors, tors1); 19 | extern "C" double* TINKER_MOD(tors, tors2); 20 | extern "C" double* TINKER_MOD(tors, tors3); 21 | extern "C" double* TINKER_MOD(tors, tors4); 22 | extern "C" double* TINKER_MOD(tors, tors5); 23 | extern "C" double* TINKER_MOD(tors, tors6); 24 | 25 | int& ntors = TINKER_MOD(tors, ntors); 26 | int*& itors = TINKER_MOD(tors, itors); 27 | double*& tors1 = TINKER_MOD(tors, tors1); 28 | double*& tors2 = TINKER_MOD(tors, tors2); 29 | double*& tors3 = TINKER_MOD(tors, tors3); 30 | double*& tors4 = TINKER_MOD(tors, tors4); 31 | double*& tors5 = TINKER_MOD(tors, tors5); 32 | double*& tors6 = TINKER_MOD(tors, tors6); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /include/tool/thrustcache.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace tinker { 5 | /// \ingroup platform 6 | /// \brief Device memory cache (allocator) for the Thrust Library. 7 | /// 8 | /// The strategy of this allocator is as follows: 9 | /// it only expands the size of the allocated memory, 10 | /// and does not free the memory on calling \c deallocate(value_type*, size_t), 11 | /// until \c clear() is called. 12 | class ThrustCache 13 | { 14 | public: 15 | using value_type = char; 16 | ThrustCache(); 17 | value_type* allocate(ptrdiff_t); ///< Expands and returns the allocated memory upon request. 18 | void deallocate(value_type*, size_t); ///< Does not do anything. 19 | void clear(); ///< Deallocates the memory. 20 | 21 | static ThrustCache& instance(); ///< Returns the reference to the singleton object. 22 | static void allocate(); ///< Allocates the memory managed by the singleton object. 23 | static void deallocate(); ///< Deallocates the memory managed by the singleton object. 24 | 25 | private: 26 | value_type* ptr; 27 | size_t nbytes; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /src/cudart/thrustcache.cpp: -------------------------------------------------------------------------------- 1 | #include "tool/thrustcache.h" 2 | #include "ff/atom.h" 3 | #include "tool/darray.h" 4 | 5 | namespace tinker { 6 | ThrustCache::ThrustCache() 7 | : ptr(nullptr) 8 | , nbytes(0) 9 | {} 10 | 11 | auto ThrustCache::allocate(ptrdiff_t numbyte) -> value_type* 12 | { 13 | if ((size_t)numbyte > nbytes) { 14 | nbytes = numbyte; 15 | deviceMemoryDeallocate(ptr); 16 | deviceMemoryAllocateBytes(reinterpret_cast(&ptr), nbytes); 17 | } 18 | return ptr; 19 | } 20 | 21 | void ThrustCache::deallocate(value_type*, size_t) 22 | { 23 | // does not do anything 24 | return; 25 | } 26 | 27 | void ThrustCache::clear() 28 | { 29 | deviceMemoryDeallocate(ptr); 30 | ptr = nullptr; 31 | nbytes = 0; 32 | } 33 | 34 | ThrustCache& ThrustCache::instance() 35 | { 36 | static ThrustCache thrust_cache; 37 | return thrust_cache; 38 | } 39 | 40 | void ThrustCache::deallocate() 41 | { 42 | ThrustCache::instance().clear(); 43 | } 44 | 45 | void ThrustCache::allocate() 46 | { 47 | const size_t numbyte = 10 * n * sizeof(real); 48 | ThrustCache::instance().allocate(numbyte); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /doc/manual/m/install/tinker.rst: -------------------------------------------------------------------------------- 1 | Download the Canonical Tinker 2 | ============================= 3 | 4 | Using the incorrect Tinker version, the executables are likely to fail with segfault. 5 | Since **d71f4793** (`Dec. 6, 2021 `_), 6 | downloading the required Tinker version is automated in the CMake script. 7 | For versions prior to this commit, please refer to the following. 8 | 9 | **Deprecated** 10 | 11 | If this source code was cloned by Git, you can 12 | checkout Tinker from the *tinker* Git submodule: 13 | 14 | .. code-block:: bash 15 | 16 | # checkout Tinker 17 | cd tinker-gpu 18 | git submodule update --init 19 | 20 | Alternatively, remove the directory *tinker-gpu/tinker* and clone 21 | `Tinker from GitHub `_ 22 | to replace the deleted directory, 23 | then checkout the required version **b92eacc8**. 24 | 25 | .. code-block:: bash 26 | 27 | cd tinker-gpu 28 | rm -rf tinker 29 | git clone https://github.com/tinkertools/tinker 30 | cd tinker 31 | git checkout 32 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/poltcg.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace poltcg { 6 | extern int& tcgorder; 7 | extern int& tcgnab; 8 | extern double& tcgpeek; 9 | extern double*& uad; 10 | extern double*& uap; 11 | extern double*& ubd; 12 | extern double*& ubp; 13 | extern int& tcgguess; 14 | 15 | #ifdef TINKER_FORTRAN_MODULE_CPP 16 | extern "C" int TINKER_MOD(poltcg, tcgorder); 17 | extern "C" int TINKER_MOD(poltcg, tcgnab); 18 | extern "C" double TINKER_MOD(poltcg, tcgpeek); 19 | extern "C" double* TINKER_MOD(poltcg, uad); 20 | extern "C" double* TINKER_MOD(poltcg, uap); 21 | extern "C" double* TINKER_MOD(poltcg, ubd); 22 | extern "C" double* TINKER_MOD(poltcg, ubp); 23 | extern "C" int TINKER_MOD(poltcg, tcgguess); 24 | 25 | int& tcgorder = TINKER_MOD(poltcg, tcgorder); 26 | int& tcgnab = TINKER_MOD(poltcg, tcgnab); 27 | double& tcgpeek = TINKER_MOD(poltcg, tcgpeek); 28 | double*& uad = TINKER_MOD(poltcg, uad); 29 | double*& uap = TINKER_MOD(poltcg, uap); 30 | double*& ubd = TINKER_MOD(poltcg, ubd); 31 | double*& ubp = TINKER_MOD(poltcg, ubp); 32 | int& tcgguess = TINKER_MOD(poltcg, tcgguess); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/repel.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace repel { 6 | extern int& nrep; 7 | extern int*& irep; 8 | extern int*& replist; 9 | extern double*& sizpr; 10 | extern double*& dmppr; 11 | extern double*& elepr; 12 | extern double*& repole; 13 | extern double*& rrepole; 14 | 15 | #ifdef TINKER_FORTRAN_MODULE_CPP 16 | extern "C" int TINKER_MOD(repel, nrep); 17 | extern "C" int* TINKER_MOD(repel, irep); 18 | extern "C" int* TINKER_MOD(repel, replist); 19 | extern "C" double* TINKER_MOD(repel, sizpr); 20 | extern "C" double* TINKER_MOD(repel, dmppr); 21 | extern "C" double* TINKER_MOD(repel, elepr); 22 | extern "C" double* TINKER_MOD(repel, repole); 23 | extern "C" double* TINKER_MOD(repel, rrepole); 24 | 25 | int& nrep = TINKER_MOD(repel, nrep); 26 | int*& irep = TINKER_MOD(repel, irep); 27 | int*& replist = TINKER_MOD(repel, replist); 28 | double*& sizpr = TINKER_MOD(repel, sizpr); 29 | double*& dmppr = TINKER_MOD(repel, dmppr); 30 | double*& elepr = TINKER_MOD(repel, elepr); 31 | double*& repole = TINKER_MOD(repel, repole); 32 | double*& rrepole = TINKER_MOD(repel, rrepole); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/paths.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace paths { 6 | extern double& pnorm; 7 | extern double (&acoeff)[7][7]; 8 | extern double*& pc0; 9 | extern double*& pc1; 10 | extern double*& pvect; 11 | extern double*& pstep; 12 | extern double*& pzet; 13 | extern double*& gc; 14 | 15 | #ifdef TINKER_FORTRAN_MODULE_CPP 16 | extern "C" double TINKER_MOD(paths, pnorm); 17 | extern "C" double TINKER_MOD(paths, acoeff)[7][7]; 18 | extern "C" double* TINKER_MOD(paths, pc0); 19 | extern "C" double* TINKER_MOD(paths, pc1); 20 | extern "C" double* TINKER_MOD(paths, pvect); 21 | extern "C" double* TINKER_MOD(paths, pstep); 22 | extern "C" double* TINKER_MOD(paths, pzet); 23 | extern "C" double* TINKER_MOD(paths, gc); 24 | 25 | double& pnorm = TINKER_MOD(paths, pnorm); 26 | double (&acoeff)[7][7] = TINKER_MOD(paths, acoeff); 27 | double*& pc0 = TINKER_MOD(paths, pc0); 28 | double*& pc1 = TINKER_MOD(paths, pc1); 29 | double*& pvect = TINKER_MOD(paths, pvect); 30 | double*& pstep = TINKER_MOD(paths, pstep); 31 | double*& pzet = TINKER_MOD(paths, pzet); 32 | double*& gc = TINKER_MOD(paths, gc); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/couple.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace couple { 7 | using namespace sizes; 8 | 9 | extern int (&n12)[maxatm]; 10 | extern int*& n13; 11 | extern int*& n14; 12 | extern int*& n15; 13 | extern int (&i12)[maxatm][maxval]; 14 | extern int*& i13; 15 | extern int*& i14; 16 | extern int*& i15; 17 | 18 | #ifdef TINKER_FORTRAN_MODULE_CPP 19 | extern "C" int TINKER_MOD(couple, n12)[maxatm]; 20 | extern "C" int* TINKER_MOD(couple, n13); 21 | extern "C" int* TINKER_MOD(couple, n14); 22 | extern "C" int* TINKER_MOD(couple, n15); 23 | extern "C" int TINKER_MOD(couple, i12)[maxatm][maxval]; 24 | extern "C" int* TINKER_MOD(couple, i13); 25 | extern "C" int* TINKER_MOD(couple, i14); 26 | extern "C" int* TINKER_MOD(couple, i15); 27 | 28 | int (&n12)[maxatm] = TINKER_MOD(couple, n12); 29 | int*& n13 = TINKER_MOD(couple, n13); 30 | int*& n14 = TINKER_MOD(couple, n14); 31 | int*& n15 = TINKER_MOD(couple, n15); 32 | int (&i12)[maxatm][maxval] = TINKER_MOD(couple, i12); 33 | int*& i13 = TINKER_MOD(couple, i13); 34 | int*& i14 = TINKER_MOD(couple, i14); 35 | int*& i15 = TINKER_MOD(couple, i15); 36 | #endif 37 | } } 38 | -------------------------------------------------------------------------------- /include/math/ou.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace tinker { 5 | /// \ingroup math 6 | /// \brief Returns the value of an Ornstein-Uhlenbeck process after time t. 7 | /// 8 | /// The Ornstein-Uhlenbeck process is described by 9 | /// \f$ \frac{dx}{dt} = a - \gamma x + b \frac{dW}{dt} \f$, and 10 | /// \f$ x_t = x_0 \exp(-\gamma t) + at \frac{1 - \exp(-\gamma t)}{\gamma t} 11 | /// + b R \sqrt{t} \sqrt{\frac{1 - \exp(-2\gamma t)}{2\gamma t}} \f$. 12 | /// 13 | /// \param t Length of a time interval. 14 | /// \param x0 Initial value. 15 | /// \param gamma Friction coefficient. 16 | /// \param a Parameter `a`. 17 | /// \param b Parameter `b`. 18 | /// \param R Random number of a standard normal distribution. 19 | inline double OUProcess(double t, double x0, double gamma, double a, double b, 20 | double R) 21 | { 22 | if (gamma == 0) { 23 | return x0 + a * t + b * R * std::sqrt(t); 24 | } else { 25 | auto gt = -gamma * t; 26 | auto egt = std::exp(gt); 27 | auto c1 = (1 - egt) / gamma; 28 | auto c2 = (1 - egt * egt) / (2 * gamma); 29 | return x0 * egt + a * c1 + b * R * std::sqrt(c2); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/dma.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace dma { 6 | extern double*& mp; 7 | extern double*& dpx; 8 | extern double*& dpy; 9 | extern double*& dpz; 10 | extern double*& q20; 11 | extern double*& q21c; 12 | extern double*& q21s; 13 | extern double*& q22c; 14 | extern double*& q22s; 15 | 16 | #ifdef TINKER_FORTRAN_MODULE_CPP 17 | extern "C" double* TINKER_MOD(dma, mp); 18 | extern "C" double* TINKER_MOD(dma, dpx); 19 | extern "C" double* TINKER_MOD(dma, dpy); 20 | extern "C" double* TINKER_MOD(dma, dpz); 21 | extern "C" double* TINKER_MOD(dma, q20); 22 | extern "C" double* TINKER_MOD(dma, q21c); 23 | extern "C" double* TINKER_MOD(dma, q21s); 24 | extern "C" double* TINKER_MOD(dma, q22c); 25 | extern "C" double* TINKER_MOD(dma, q22s); 26 | 27 | double*& mp = TINKER_MOD(dma, mp); 28 | double*& dpx = TINKER_MOD(dma, dpx); 29 | double*& dpy = TINKER_MOD(dma, dpy); 30 | double*& dpz = TINKER_MOD(dma, dpz); 31 | double*& q20 = TINKER_MOD(dma, q20); 32 | double*& q21c = TINKER_MOD(dma, q21c); 33 | double*& q21s = TINKER_MOD(dma, q21s); 34 | double*& q22c = TINKER_MOD(dma, q22c); 35 | double*& q22s = TINKER_MOD(dma, q22s); 36 | #endif 37 | } } 38 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/polgrp.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace polgrp { 6 | const int maxp11 = 200; 7 | const int maxp12 = 200; 8 | const int maxp13 = 200; 9 | const int maxp14 = 200; 10 | extern int*& np11; 11 | extern int*& np12; 12 | extern int*& np13; 13 | extern int*& np14; 14 | extern int*& ip11; 15 | extern int*& ip12; 16 | extern int*& ip13; 17 | extern int*& ip14; 18 | 19 | #ifdef TINKER_FORTRAN_MODULE_CPP 20 | extern "C" int* TINKER_MOD(polgrp, np11); 21 | extern "C" int* TINKER_MOD(polgrp, np12); 22 | extern "C" int* TINKER_MOD(polgrp, np13); 23 | extern "C" int* TINKER_MOD(polgrp, np14); 24 | extern "C" int* TINKER_MOD(polgrp, ip11); 25 | extern "C" int* TINKER_MOD(polgrp, ip12); 26 | extern "C" int* TINKER_MOD(polgrp, ip13); 27 | extern "C" int* TINKER_MOD(polgrp, ip14); 28 | 29 | int*& np11 = TINKER_MOD(polgrp, np11); 30 | int*& np12 = TINKER_MOD(polgrp, np12); 31 | int*& np13 = TINKER_MOD(polgrp, np13); 32 | int*& np14 = TINKER_MOD(polgrp, np14); 33 | int*& ip11 = TINKER_MOD(polgrp, ip11); 34 | int*& ip12 = TINKER_MOD(polgrp, ip12); 35 | int*& ip13 = TINKER_MOD(polgrp, ip13); 36 | int*& ip14 = TINKER_MOD(polgrp, ip14); 37 | #endif 38 | } } 39 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/valfit.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace valfit { 6 | extern int& fit_bond; 7 | extern int& fit_angle; 8 | extern int& fit_strbnd; 9 | extern int& fit_urey; 10 | extern int& fit_opbend; 11 | extern int& fit_tors; 12 | extern int& fit_struct; 13 | extern int& fit_force; 14 | 15 | #ifdef TINKER_FORTRAN_MODULE_CPP 16 | extern "C" int TINKER_MOD(valfit, fit_bond); 17 | extern "C" int TINKER_MOD(valfit, fit_angle); 18 | extern "C" int TINKER_MOD(valfit, fit_strbnd); 19 | extern "C" int TINKER_MOD(valfit, fit_urey); 20 | extern "C" int TINKER_MOD(valfit, fit_opbend); 21 | extern "C" int TINKER_MOD(valfit, fit_tors); 22 | extern "C" int TINKER_MOD(valfit, fit_struct); 23 | extern "C" int TINKER_MOD(valfit, fit_force); 24 | 25 | int& fit_bond = TINKER_MOD(valfit, fit_bond); 26 | int& fit_angle = TINKER_MOD(valfit, fit_angle); 27 | int& fit_strbnd = TINKER_MOD(valfit, fit_strbnd); 28 | int& fit_urey = TINKER_MOD(valfit, fit_urey); 29 | int& fit_opbend = TINKER_MOD(valfit, fit_opbend); 30 | int& fit_tors = TINKER_MOD(valfit, fit_tors); 31 | int& fit_struct = TINKER_MOD(valfit, fit_struct); 32 | int& fit_force = TINKER_MOD(valfit, fit_force); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/sequen.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace sequen { 7 | using namespace sizes; 8 | 9 | extern int& nseq; 10 | extern int& nchain; 11 | extern int (&ichain)[maxres][2]; 12 | extern int (&seqtyp)[maxres]; 13 | extern char (&chnnam)[maxres][1]; 14 | extern char (&seq)[maxres][3]; 15 | extern char (&chntyp)[maxres][7]; 16 | 17 | #ifdef TINKER_FORTRAN_MODULE_CPP 18 | extern "C" int TINKER_MOD(sequen, nseq); 19 | extern "C" int TINKER_MOD(sequen, nchain); 20 | extern "C" int TINKER_MOD(sequen, ichain)[maxres][2]; 21 | extern "C" int TINKER_MOD(sequen, seqtyp)[maxres]; 22 | extern "C" char TINKER_MOD(sequen, chnnam)[maxres][1]; 23 | extern "C" char TINKER_MOD(sequen, seq)[maxres][3]; 24 | extern "C" char TINKER_MOD(sequen, chntyp)[maxres][7]; 25 | 26 | int& nseq = TINKER_MOD(sequen, nseq); 27 | int& nchain = TINKER_MOD(sequen, nchain); 28 | int (&ichain)[maxres][2] = TINKER_MOD(sequen, ichain); 29 | int (&seqtyp)[maxres] = TINKER_MOD(sequen, seqtyp); 30 | char (&chnnam)[maxres][1] = TINKER_MOD(sequen, chnnam); 31 | char (&seq)[maxres][3] = TINKER_MOD(sequen, seq); 32 | char (&chntyp)[maxres][7] = TINKER_MOD(sequen, chntyp); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /include/math/switch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ff/precision.h" 3 | #include "seq/seq.h" 4 | 5 | namespace tinker { 6 | /// \ingroup math 7 | /// \brief Smooth function `F: [cut,off]->[1,0]`. 8 | /// 9 | /// Derived from the 5th order `smoothstep` function (-S2(x) + 1): 10 | /// \f[ S_2: [0,1]\rightarrow[0,1] \f] 11 | /// \f[ S_2(x) = 6 x^5 - 15 x^4 + 10 x^3 \f] 12 | /// 13 | /// \param[in] rik Distance. 14 | /// \param[in] cut Distance at which switching of the potential begins. 15 | /// \param[out] off Distance at which the potential energy goes to zero. 16 | /// \param[out] taper F value. 17 | /// \param[out] dtaper dF/dx value. 18 | /// \tparam DO_DTAPER If \c false, \c dtaper will not be calculated and its 19 | /// original value will not be altered. 20 | #pragma acc routine seq 21 | template 22 | SEQ_CUDA 23 | void switchTaper5(real rik, real cut, real off, real& restrict taper, 24 | real& restrict dtaper) 25 | { 26 | real rinv = 1 / (cut - off); 27 | real x = (rik - off) * rinv; 28 | real x2 = x * x; 29 | real x3 = x2 * x; 30 | taper = x3 * (6 * x2 - 15 * x + 10); 31 | if CONSTEXPR (DO_DTAPER) dtaper = 30 * (x * (1 - x)) * (x * (1 - x)) * rinv; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/acc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # printf "set (__T9_ACC_SRC\n%s\n)\n" "$(LC_COLLATE=C ls -1a *.cpp {amoeba,aplus,hippo}/*.cpp)" > cmakesrc.txt 2 | cmake_minimum_required (VERSION 3.18) 3 | 4 | 5 | ## libtinker9_acc.a 6 | include (cmakesrc.txt) 7 | add_library (tinker9_acc STATIC "${__T9_ACC_SRC}") 8 | target_link_libraries (tinker9_acc PRIVATE __t9_intf tinkerFToCpp) 9 | set_target_properties (tinker9_acc PROPERTIES CXX_STANDARD ${T9_CPPSTD}) 10 | 11 | 12 | ######################################################################## 13 | 14 | 15 | if (HOST) 16 | elseif (GPU_LANG STREQUAL "OPENACC") 17 | string (APPEND CMAKE_CXX_FLAGS " CUDA_HOME=${CUDA_DIR}") 18 | target_compile_options (tinker9_acc PUBLIC 19 | -acc verystrict 20 | -Minfo=accel 21 | ) 22 | ## Debug add flag: -ta=tesla:lineinfo,cc60,cc70 23 | ## Release add flag: -ta=tesla:fastmath,cc60,cc70 24 | target_compile_options (tinker9_acc PUBLIC 25 | "$<$:-ta=tesla:lineinfo${__T9_ACC_CCLST4}>" 26 | "$<$:-ta=tesla:lineinfo,fastmath${__T9_ACC_CCLST4}>" 27 | "$<$:-ta=tesla:fastmath${__T9_ACC_CCLST4}>" 28 | "$<$:-ta=tesla:fastmath${__T9_ACC_CCLST4}>" 29 | ) 30 | endif () 31 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/rgddyn.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace rgddyn { 6 | extern double*& xcmo; 7 | extern double*& ycmo; 8 | extern double*& zcmo; 9 | extern double*& vcm; 10 | extern double*& wcm; 11 | extern double*& lm; 12 | extern double*& vc; 13 | extern double*& wc; 14 | extern int*& linear; 15 | 16 | #ifdef TINKER_FORTRAN_MODULE_CPP 17 | extern "C" double* TINKER_MOD(rgddyn, xcmo); 18 | extern "C" double* TINKER_MOD(rgddyn, ycmo); 19 | extern "C" double* TINKER_MOD(rgddyn, zcmo); 20 | extern "C" double* TINKER_MOD(rgddyn, vcm); 21 | extern "C" double* TINKER_MOD(rgddyn, wcm); 22 | extern "C" double* TINKER_MOD(rgddyn, lm); 23 | extern "C" double* TINKER_MOD(rgddyn, vc); 24 | extern "C" double* TINKER_MOD(rgddyn, wc); 25 | extern "C" int* TINKER_MOD(rgddyn, linear); 26 | 27 | double*& xcmo = TINKER_MOD(rgddyn, xcmo); 28 | double*& ycmo = TINKER_MOD(rgddyn, ycmo); 29 | double*& zcmo = TINKER_MOD(rgddyn, zcmo); 30 | double*& vcm = TINKER_MOD(rgddyn, vcm); 31 | double*& wcm = TINKER_MOD(rgddyn, wcm); 32 | double*& lm = TINKER_MOD(rgddyn, lm); 33 | double*& vc = TINKER_MOD(rgddyn, vc); 34 | double*& wc = TINKER_MOD(rgddyn, wc); 35 | int*& linear = TINKER_MOD(rgddyn, linear); 36 | #endif 37 | } } 38 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/atomid.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | #include "sizes.hh" 5 | 6 | namespace tinker { namespace atomid { 7 | using namespace sizes; 8 | 9 | extern int (&tag)[maxatm]; 10 | extern int (&class_)[maxatm]; 11 | extern int (&atomic)[maxatm]; 12 | extern int (&valence)[maxatm]; 13 | extern double (&mass)[maxatm]; 14 | extern char (&name)[maxatm][3]; 15 | extern char (&story)[maxatm][24]; 16 | 17 | #ifdef TINKER_FORTRAN_MODULE_CPP 18 | extern "C" int TINKER_MOD(atomid, tag)[maxatm]; 19 | extern "C" int TINKER_MOD(atomid, class)[maxatm]; 20 | extern "C" int TINKER_MOD(atomid, atomic)[maxatm]; 21 | extern "C" int TINKER_MOD(atomid, valence)[maxatm]; 22 | extern "C" double TINKER_MOD(atomid, mass)[maxatm]; 23 | extern "C" char TINKER_MOD(atomid, name)[maxatm][3]; 24 | extern "C" char TINKER_MOD(atomid, story)[maxatm][24]; 25 | 26 | int (&tag)[maxatm] = TINKER_MOD(atomid, tag); 27 | int (&class_)[maxatm] = TINKER_MOD(atomid, class); 28 | int (&atomic)[maxatm] = TINKER_MOD(atomid, atomic); 29 | int (&valence)[maxatm] = TINKER_MOD(atomid, valence); 30 | double (&mass)[maxatm] = TINKER_MOD(atomid, mass); 31 | char (&name)[maxatm][3] = TINKER_MOD(atomid, name); 32 | char (&story)[maxatm][24] = TINKER_MOD(atomid, story); 33 | #endif 34 | } } 35 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/freeze.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace freeze { 6 | extern int& nrat; 7 | extern int& nratx; 8 | extern int*& iratx; 9 | extern int*& kratx; 10 | extern int*& irat; 11 | extern double& rateps; 12 | extern double*& krat; 13 | extern int& use_rattle; 14 | extern int*& ratimage; 15 | 16 | #ifdef TINKER_FORTRAN_MODULE_CPP 17 | extern "C" int TINKER_MOD(freeze, nrat); 18 | extern "C" int TINKER_MOD(freeze, nratx); 19 | extern "C" int* TINKER_MOD(freeze, iratx); 20 | extern "C" int* TINKER_MOD(freeze, kratx); 21 | extern "C" int* TINKER_MOD(freeze, irat); 22 | extern "C" double TINKER_MOD(freeze, rateps); 23 | extern "C" double* TINKER_MOD(freeze, krat); 24 | extern "C" int TINKER_MOD(freeze, use_rattle); 25 | extern "C" int* TINKER_MOD(freeze, ratimage); 26 | 27 | int& nrat = TINKER_MOD(freeze, nrat); 28 | int& nratx = TINKER_MOD(freeze, nratx); 29 | int*& iratx = TINKER_MOD(freeze, iratx); 30 | int*& kratx = TINKER_MOD(freeze, kratx); 31 | int*& irat = TINKER_MOD(freeze, irat); 32 | double& rateps = TINKER_MOD(freeze, rateps); 33 | double*& krat = TINKER_MOD(freeze, krat); 34 | int& use_rattle = TINKER_MOD(freeze, use_rattle); 35 | int*& ratimage = TINKER_MOD(freeze, ratimage); 36 | #endif 37 | } } 38 | -------------------------------------------------------------------------------- /src/cu/amoeba/rotpole.cu: -------------------------------------------------------------------------------- 1 | #include "ff/modamoeba.h" 2 | #include "seq/launch.h" 3 | #include "seq/rotpole.h" 4 | 5 | namespace tinker { 6 | __global__ 7 | void chkpole_cu1(int n, real (*restrict pole)[MPL_TOTAL], LocalFrame* zaxis, const real* restrict x, 8 | const real* restrict y, const real* restrict z) 9 | { 10 | for (int i = ITHREAD; i < n; i += STRIDE) 11 | chkpoleAtomI(i, pole, zaxis, x, y, z); 12 | } 13 | 14 | void chkpole_cu() 15 | { 16 | launch_k1s(g::s0, n, chkpole_cu1, n, pole, zaxis, x, y, z); 17 | } 18 | 19 | void chkrepole_cu() 20 | { 21 | launch_k1s(g::s0, n, chkpole_cu1, n, repole, zaxis, x, y, z); 22 | } 23 | } 24 | 25 | namespace tinker { 26 | __global__ 27 | void rotpole_cu1(int n, real (*restrict rpole)[MPL_TOTAL], const real (*restrict pole)[MPL_TOTAL], 28 | const LocalFrame* restrict zaxis, const real* restrict x, const real* restrict y, 29 | const real* restrict z) 30 | { 31 | for (int i = ITHREAD; i < n; i += STRIDE) 32 | rotpoleAtomI(i, rpole, pole, zaxis, x, y, z); 33 | } 34 | 35 | void rotpole_cu() 36 | { 37 | launch_k1s(g::s0, n, rotpole_cu1, n, rpole, pole, zaxis, x, y, z); 38 | } 39 | 40 | void rotrepole_cu() 41 | { 42 | launch_k1s(g::s0, n, rotpole_cu1, n, rrepole, repole, zaxis, x, y, z); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/group.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace group { 6 | extern int& ngrp; 7 | extern int*& kgrp; 8 | extern int*& grplist; 9 | extern int*& igrp; 10 | extern double*& grpmass; 11 | extern double*& wgrp; 12 | extern int& use_group; 13 | extern int& use_intra; 14 | extern int& use_inter; 15 | 16 | #ifdef TINKER_FORTRAN_MODULE_CPP 17 | extern "C" int TINKER_MOD(group, ngrp); 18 | extern "C" int* TINKER_MOD(group, kgrp); 19 | extern "C" int* TINKER_MOD(group, grplist); 20 | extern "C" int* TINKER_MOD(group, igrp); 21 | extern "C" double* TINKER_MOD(group, grpmass); 22 | extern "C" double* TINKER_MOD(group, wgrp); 23 | extern "C" int TINKER_MOD(group, use_group); 24 | extern "C" int TINKER_MOD(group, use_intra); 25 | extern "C" int TINKER_MOD(group, use_inter); 26 | 27 | int& ngrp = TINKER_MOD(group, ngrp); 28 | int*& kgrp = TINKER_MOD(group, kgrp); 29 | int*& grplist = TINKER_MOD(group, grplist); 30 | int*& igrp = TINKER_MOD(group, igrp); 31 | double*& grpmass = TINKER_MOD(group, grpmass); 32 | double*& wgrp = TINKER_MOD(group, wgrp); 33 | int& use_group = TINKER_MOD(group, use_group); 34 | int& use_intra = TINKER_MOD(group, use_intra); 35 | int& use_inter = TINKER_MOD(group, use_inter); 36 | #endif 37 | } } 38 | -------------------------------------------------------------------------------- /include/tool/dvector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "tool/darray.h" 3 | 4 | namespace tinker { 5 | template 6 | struct DeviceAllocator 7 | { 8 | typedef T value_type; 9 | 10 | DeviceAllocator() noexcept {} 11 | 12 | template 13 | DeviceAllocator(const DeviceAllocator&) noexcept 14 | {} 15 | 16 | template 17 | bool operator==(const DeviceAllocator&) const noexcept 18 | { 19 | return true; 20 | } 21 | 22 | template 23 | bool operator!=(const DeviceAllocator&) const noexcept 24 | { 25 | return false; 26 | } 27 | 28 | T* allocate(size_t n) const 29 | { 30 | T* p; 31 | if (n != 0) 32 | darray::allocate(n, &p); 33 | else 34 | p = nullptr; 35 | return p; 36 | } 37 | 38 | void deallocate(T* const p, size_t) const noexcept 39 | { 40 | if (p) darray::deallocate(p); 41 | } 42 | }; 43 | } 44 | 45 | namespace tinker { 46 | template 47 | class dvector : private std::vector> 48 | { 49 | private: 50 | typedef std::vector> Base; 51 | 52 | using Base::resize; // Resizing is not allowed. 53 | 54 | public: 55 | using Base::data; 56 | using Base::reserve; 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /test/file/local_frame/local_frame2.xyz: -------------------------------------------------------------------------------- 1 | 18 NaCl/None, H2O/Bisector/Z-then-X, nitrile/Z-Only/Z-then-X, NH3/Z-Bisect/3-Fold 2 | 1 Na+ 26.271730 20.665556 19.228894 7 3 | 2 Cl- 2.711594 -0.598518 2.376332 15 4 | 3 O -0.773598 -1.719672 2.296790 36 4 5 5 | 4 H -0.961092 -2.484670 2.812445 37 3 6 | 5 H -1.595039 -1.273391 2.032285 37 3 7 | 6 O 0.455963 1.231816 2.463924 36 7 8 8 | 7 H 0.242960 1.131161 3.447706 37 6 9 | 8 H 0.785166 0.324880 2.282715 37 6 10 | 9 N 0.553460 -1.039514 -0.686337 211 10 11 | 10 C -0.264498 -0.644361 -1.449363 210 9 11 12 | 11 C -1.334720 -0.155590 -2.273335 212 10 12 13 14 13 | 12 H -1.301899 -0.264946 -3.338952 213 11 14 | 13 H -2.200645 -0.712655 -1.964470 213 11 15 | 14 H -1.502998 0.896777 -2.105510 213 11 16 | 15 N 2.829917 0.296405 -0.791865 61 16 17 18 17 | 16 H 2.080341 1.069773 -0.834243 62 15 18 | 17 H 2.790673 -0.655458 -0.993359 62 15 19 | 18 H 2.755720 0.229243 0.269116 62 15 20 | -------------------------------------------------------------------------------- /.github/workflows/doxygen_gh_pages.yaml: -------------------------------------------------------------------------------- 1 | name: Doxygen 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | deploy: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout repository 11 | uses: actions/checkout@v3 12 | with: 13 | fetch-depth: 1 14 | - name: Install doxygen 15 | # run: sudo apt-get install -y doxygen 16 | run: | 17 | wget https://www.doxygen.nl/files/doxygen-1.9.5.linux.bin.tar.gz 18 | tar -xvzf doxygen-1.9.5.linux.bin.tar.gz 19 | ln -s doxygen-1.9.5/bin/doxygen doxygen 20 | - name: Generate doxygen html 21 | run: | 22 | mkdir build 23 | cd build 24 | wget https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/main/doxygen-awesome.css 25 | ENV_GIT_HEAD=`git log -1 --format="%h (%cd)" | tr -d "\n"` ../doxygen ../doc/Doxyfile 26 | mkdir -p html/doc 27 | cp -r ../doc/manual html/doc/ 28 | - name: Deploy 29 | uses: peaceiris/actions-gh-pages@v3 30 | with: 31 | github_token: ${{ secrets.GITHUB_TOKEN }} 32 | publish_dir: ./build/html 33 | publish_branch: gh-pages 34 | -------------------------------------------------------------------------------- /include/tool/iotext.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace tinker { 6 | /// \ingroup io_text 7 | /// \brief Plain ascii text stored by lines. 8 | class Text : public std::vector 9 | { 10 | public: 11 | /// \brief White space characters. 12 | static constexpr const char* whitespaces = " \t\n\v\f\r"; 13 | 14 | /// \brief Returns `true` if `ch` is one of the white space characters. 15 | static bool isWhiteSpace(char ch); 16 | 17 | /// \brief Returns an `std::string` object from a c-style `char` array. 18 | template 19 | static std::string string(const char (&src)[Len]) 20 | { 21 | return std::string(&src[0], &src[0] + Len); 22 | } 23 | 24 | /// \brief In string `src`, replaces all characters in `old` to `r`. 25 | static void replace(std::string& src, std::string old, char r); 26 | 27 | /// \brief Splits a string `str` by `delimiters` and 28 | /// returns a vector of strings. 29 | static std::vector split(std::string str, 30 | std::string delimiters = whitespaces); 31 | 32 | /// \brief Transforms a string to upper case. 33 | static void upcase(std::string& s); 34 | 35 | /// \brief Transforms a string to lower case. 36 | static void lowcase(std::string& s); 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/hpmf.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace hpmf { 6 | const double rcarbon = 1.7e0; 7 | const double rwater = 1.4e0; 8 | const double acsurf = 120.7628e0; 9 | const double safact = 0.3516e0; 10 | const double tgrad = 100.0e0; 11 | const double toffset = 6.0e0; 12 | const double hpmfcut = 11.0e0; 13 | const double hd1 = -0.7308004860404441194e0; 14 | const double hd2 = 0.2001645051578760659e0; 15 | const double hd3 = -0.0905499953418473502e0; 16 | const double hc1 = 3.8167879266271396155e0; 17 | const double hc2 = 5.4669162286016419472e0; 18 | const double hc3 = 7.1167694861385353278e0; 19 | const double hw1 = 1.6858993102248638341e0; 20 | const double hw2 = 1.3906405621629980285e0; 21 | const double hw3 = 1.5741657341338335385e0; 22 | extern int& npmf; 23 | extern int*& ipmf; 24 | extern double*& rpmf; 25 | extern double*& acsa; 26 | 27 | #ifdef TINKER_FORTRAN_MODULE_CPP 28 | extern "C" int TINKER_MOD(hpmf, npmf); 29 | extern "C" int* TINKER_MOD(hpmf, ipmf); 30 | extern "C" double* TINKER_MOD(hpmf, rpmf); 31 | extern "C" double* TINKER_MOD(hpmf, acsa); 32 | 33 | int& npmf = TINKER_MOD(hpmf, npmf); 34 | int*& ipmf = TINKER_MOD(hpmf, ipmf); 35 | double*& rpmf = TINKER_MOD(hpmf, rpmf); 36 | double*& acsa = TINKER_MOD(hpmf, acsa); 37 | #endif 38 | } } 39 | -------------------------------------------------------------------------------- /test/kinetic.cpp: -------------------------------------------------------------------------------- 1 | #include "md/misc.h" 2 | 3 | #include "test.h" 4 | #include "testrt.h" 5 | 6 | using namespace tinker; 7 | 8 | static const char* verlet_intg = "integrator verlet\n"; 9 | static int usage_ = calc::xyz | calc::vel | calc::mass | calc::vmask | calc::md; 10 | 11 | TEST_CASE("Kinetic-ArBox", "[ff][kinetic][arbox]") 12 | { 13 | const char* k = "test_arbox.key"; 14 | const char* d = "test_arbox.dyn"; 15 | const char* x = "test_arbox.xyz"; 16 | 17 | std::string k0 = verlet_intg; 18 | TestFile fke(TINKER9_DIRSTR "/test/file/arbox/arbox.key", k, k0); 19 | 20 | TestFile fd(TINKER9_DIRSTR "/test/file/arbox/arbox.dyn_2", d); 21 | TestFile fx(TINKER9_DIRSTR "/test/file/arbox/arbox.xyz", x); 22 | TestFile fp(TINKER9_DIRSTR "/test/file/commit_6fe8e913/amoeba09.prm"); 23 | 24 | const char* argv[] = {"dummy", x}; 25 | int argc = 2; 26 | testBeginWithArgs(argc, argv); 27 | testMdInit(0, 0); 28 | 29 | rc_flag = usage_; 30 | initialize(); 31 | 32 | T_prec temp; 33 | kinetic(temp); 34 | 35 | const double ref_eksum = 100446.40376; 36 | const double ref_temp = 156008.001336; 37 | const double eps_e = 0.0001; 38 | 39 | REQUIRE(eksum == Approx(ref_eksum).margin(eps_e)); 40 | REQUIRE(temp == Approx(ref_temp).margin(eps_e)); 41 | 42 | finish(); 43 | testEnd(); 44 | } 45 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/ring.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace ring { 6 | extern int& nring3; 7 | extern int& nring4; 8 | extern int& nring5; 9 | extern int& nring6; 10 | extern int& nring7; 11 | extern int*& iring3; 12 | extern int*& iring4; 13 | extern int*& iring5; 14 | extern int*& iring6; 15 | extern int*& iring7; 16 | 17 | #ifdef TINKER_FORTRAN_MODULE_CPP 18 | extern "C" int TINKER_MOD(ring, nring3); 19 | extern "C" int TINKER_MOD(ring, nring4); 20 | extern "C" int TINKER_MOD(ring, nring5); 21 | extern "C" int TINKER_MOD(ring, nring6); 22 | extern "C" int TINKER_MOD(ring, nring7); 23 | extern "C" int* TINKER_MOD(ring, iring3); 24 | extern "C" int* TINKER_MOD(ring, iring4); 25 | extern "C" int* TINKER_MOD(ring, iring5); 26 | extern "C" int* TINKER_MOD(ring, iring6); 27 | extern "C" int* TINKER_MOD(ring, iring7); 28 | 29 | int& nring3 = TINKER_MOD(ring, nring3); 30 | int& nring4 = TINKER_MOD(ring, nring4); 31 | int& nring5 = TINKER_MOD(ring, nring5); 32 | int& nring6 = TINKER_MOD(ring, nring6); 33 | int& nring7 = TINKER_MOD(ring, nring7); 34 | int*& iring3 = TINKER_MOD(ring, iring3); 35 | int*& iring4 = TINKER_MOD(ring, iring4); 36 | int*& iring5 = TINKER_MOD(ring, iring5); 37 | int*& iring6 = TINKER_MOD(ring, iring6); 38 | int*& iring7 = TINKER_MOD(ring, iring7); 39 | #endif 40 | } } 41 | -------------------------------------------------------------------------------- /ext/interface/cpp/tinker/detail/xtals.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "macro.hh" 4 | 5 | namespace tinker { namespace xtals { 6 | const int maxlsq = 1000; 7 | const int maxrsd = 1000; 8 | extern int& nxtal; 9 | extern int& nvary; 10 | extern int (&ivary)[maxlsq]; 11 | extern int (&iresid)[maxrsd]; 12 | extern int (&vary)[maxlsq][2]; 13 | extern double& e0_lattice; 14 | extern char (&varxtl)[maxlsq][16]; 15 | extern char (&rsdxtl)[maxrsd][16]; 16 | 17 | #ifdef TINKER_FORTRAN_MODULE_CPP 18 | extern "C" int TINKER_MOD(xtals, nxtal); 19 | extern "C" int TINKER_MOD(xtals, nvary); 20 | extern "C" int TINKER_MOD(xtals, ivary)[maxlsq]; 21 | extern "C" int TINKER_MOD(xtals, iresid)[maxrsd]; 22 | extern "C" int TINKER_MOD(xtals, vary)[maxlsq][2]; 23 | extern "C" double TINKER_MOD(xtals, e0_lattice); 24 | extern "C" char TINKER_MOD(xtals, varxtl)[maxlsq][16]; 25 | extern "C" char TINKER_MOD(xtals, rsdxtl)[maxrsd][16]; 26 | 27 | int& nxtal = TINKER_MOD(xtals, nxtal); 28 | int& nvary = TINKER_MOD(xtals, nvary); 29 | int (&ivary)[maxlsq] = TINKER_MOD(xtals, ivary); 30 | int (&iresid)[maxrsd] = TINKER_MOD(xtals, iresid); 31 | int (&vary)[maxlsq][2] = TINKER_MOD(xtals, vary); 32 | double& e0_lattice = TINKER_MOD(xtals, e0_lattice); 33 | char (&varxtl)[maxlsq][16] = TINKER_MOD(xtals, varxtl); 34 | char (&rsdxtl)[maxrsd][16] = TINKER_MOD(xtals, rsdxtl); 35 | #endif 36 | } } 37 | --------------------------------------------------------------------------------