/*************************************************************************** md_common.cpp - description ------------------- begin : Sun Jan 4 11:45:27 2004 copyright : (C) 2002 by Cavalli Andrea email : cavalli@bioc.unizh.ch **************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include #include #include #include #include #include #include using namespace Almost; template inline string to_string(const MDOptions & c19md_opt){ stringstream s; s< */ /* MDOptions c19_md_options(){ */ /* return MDOptions(MDOptions::C19); */ /* } */ template MDOptions c22_md_options(int FF,int algo){ MDOptions opts(MDOptions::C22); if(algo==MDOptions::LANGEVIN){ opts.algorithm = MDOptions::LANGEVIN; } else opts.algorithm = MDOptions::BERENDSEN; if(FF==MDOptions::EEF1){ opts.elec = MDOptions::RDIE; opts. elec_cutoff = MDOptions::SWITCH; opts.vdw = MDOptions::LJ; opts.vdw_cutoff = MDOptions::SWITCH; opts.eps = 1.0; opts.solv = MDOptions::EEF1; opts.cut_on = 7.0; opts.cut_off =9.0; opts.cut_nb = 10.0; } else opts.solv = MDOptions::NONE; return opts; } template MDOptions amber_md_options(int FF,int algo){ MDOptions opts(MDOptions::AMBER); if(algo==MDOptions::LANGEVIN){ opts.algorithm = MDOptions::LANGEVIN; } else opts.algorithm = MDOptions::BERENDSEN; opts.solv = MDOptions::NONE; return opts; } template MDOptions c19_defaults(int FF, int algo){ MDOptions opts; if(FF==MDOptions::EEF1){ opts.elec = MDOptions::RDIE; opts. elec_cutoff = MDOptions::SWITCH; opts.vdw = MDOptions::LJ; opts.vdw_cutoff = MDOptions::SWITCH; opts.eps = 1.0; opts.solv = MDOptions::EEF1; opts.cut_on = 7.0; opts.cut_off = 9.0; opts.cut_nb = 10.0; } else if(FF!=MDOptions::SASA) opts.solv = MDOptions::NONE; if(algo==MDOptions::LANGEVIN){ opts.algorithm = MDOptions::LANGEVIN; } else opts.algorithm = MDOptions::BERENDSEN; return opts; } template DynaType const_md(ConstraintCollection & cc){ return DynaType(cc); } template struct OperatorHelperElec; template<> struct OperatorHelperElec<0> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"NO ELEC"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"NO ELEC"< struct OperatorHelperElec<1> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"ELEC"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"ELEC"< struct OperatorHelperSolv; template<> struct OperatorHelperSolv<0> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"NO SOLV"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"NO SOLV"< struct OperatorHelperSolv<1> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"SOLV"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"SOLV"< struct OperatorHelperSolv<2> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"SOLV"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"SOLV"< struct OperatorHelperSolv<3> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"SOLV"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"SOLV"< struct OperatorHelperSolv<5> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"SOLV"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"SOLV"< struct OperatorHelperUb; template<> struct OperatorHelperUb<0> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"NO UB"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"NO UB"< struct OperatorHelperUb<1> { template static typename FF::FloatType helper(MDImplData & data){ // cout<<"UB"< static typename FF::FloatType helper(SMDImplData & data){ // cout<<"UB"< DynaLogStream & operator<<(DynaLogStream &log, MDImplData & data){ char buff[256]; typename FF::FloatType time = ((typename FF::FloatType)data.step)*data.time_step; string prmpt=Almost::DynaStatPr; log.stream()<::helper(data), data.ff_data.vdw_energy, OperatorHelperSolv::helper(data), OperatorHelperUb::helper(data)); log.stream()< DynaDataStream & operator<<(DynaDataStream & dat, MDImplData & data){ typename FF::FloatType time = ((typename FF::FloatType)data.step)*data.time_step; dat.stream()<::helper(data)<<" " <::helper(data)<<" " <::helper(data)<<" " < DynaLogStream & operator<<(DynaLogStream &log, SMDImplData & data){ char buff[256]; typename FF::FloatType time = ((typename FF::FloatType)data.step)*data.time_step; string prmpt=Almost::DynaStatPr; log.stream()<::helper(data), data.ff_data.vdw_energy, OperatorHelperSolv::helper(data), OperatorHelperUb::helper(data)); log.stream()< DynaDataStream & operator<<(DynaDataStream & dat, SMDImplData & data){ typename FF::FloatType time = ((typename FF::FloatType)data.step)*data.time_step; dat.stream()<::helper(data)<<" " <::helper(data)<<" " <::helper(data)<<" " < >(mod.self(),"mdoptions") \ .REGATTR(MDOptions< type >,kind,FFDoc)\ .REGATTR(MDOptions< type >,elec,FFDoc)\ .REGATTR(MDOptions< type >,elec_cutoff,FFDoc)\ .REGATTR(MDOptions< type >,vdw,FFDoc) \ .REGATTR(MDOptions< type >,vdw_cutoff,FFDoc) \ .REGATTR(MDOptions< type >,solv,FFDoc) \ .REGATTR(MDOptions< type >,solv_ignore_h,FFDoc) \ .REGATTR(MDOptions< type >,cut_on,FFDoc) \ .REGATTR(MDOptions< type >,cut_off,FFDoc) \ .REGATTR(MDOptions< type >,cut_nb,FFDoc) \ .REGATTR(MDOptions< type >,e_zero,FFDoc) \ .REGATTR(MDOptions< type >,e_14,FFDoc) \ .REGATTR(MDOptions< type >,eps,FFDoc) \ .REGATTR(MDOptions< type >,r_water,FFDoc) \ .REGATTR(MDOptions< type >,gamma_water,RunDoc) \ .REGATTR(MDOptions< type >,alpha,FFDoc) \ .REGATTR(MDOptions< type >,vect,RunDoc) \ .REGATTR(MDOptions< type >,algorithm,RunDoc) \ .REGATTR(MDOptions< type >,geometry,RunDoc) \ .REGATTR(MDOptions< type >,Lx,RunDoc) \ .REGATTR(MDOptions< type >,Ly,RunDoc) \ .REGATTR(MDOptions< type >,Lz,RunDoc) \ .REGATTR(MDOptions< type >,granularity,RunDoc) \ .REGATTR(MDOptions< type >,trj,RunDoc) \ .REGATTR(MDOptions< type >,vtrj,RunDoc)\ .REGATTR(MDOptions< type >,rst,RunDoc)\ .REGATTR(MDOptions< type >,log,RunDoc)\ .REGATTR(MDOptions< type >,dat,RunDoc)\ .REGATTR(MDOptions< type >,steps,RunDoc)\ .REGATTR(MDOptions< type >,nprint,RunDoc)\ .REGATTR(MDOptions< type >,nsave,RunDoc)\ .REGATTR(MDOptions< type >,nupdate,RunDoc)\ .REGATTR(MDOptions< type >,nrottrans,RunDoc)\ .REGATTR(MDOptions< type >,shake_mode,RunDoc)\ .REGATTR(MDOptions< type >,shake_tol,RunDoc)\ .REGATTR(MDOptions< type >,temp,RunDoc)\ .REGATTR(MDOptions< type >,time_step,RunDoc)\ .REGATTR(MDOptions< type >,tau,RunDoc)\ .REGATTR(MDOptions< type >,seed,RunDoc)\ .REGATTR(MDOptions< type >,save_fitted,RunDoc)\ .REGATTR(MDOptions< type >,selection,RunDoc)\ .REGATTR2(MDOptions< type >,rgbmax,"Undocumented")\ .REGATTR2(MDOptions< type >,fsmax,"Undocumented")\ .REGATTR2(MDOptions< type >,eps_water,"Undocumented")\ .REGATTR2(MDOptions< type >,surftens,"Undocumented")\ .REGATTR2(MDOptions< type >,offset,"Undocumented")\ .REGATTR2(MDOptions< type >,nsmooth,"Undocumented")\ .REGATTR2(MDOptions< type >,memb_width,"Undocumented")\ .REGATTR2(MDOptions< type >,elec_strength,"Undocumented"); #define REGISTER_CONST(type)\ mod\ .def_const("C19",(int)MDOptions< type >::C19)\ .def_const("C22",(int)MDOptions< type >::C22)\ .def_const("NONE",(int)MDOptions< type >::NONE)\ .def_const("LJ",(int)MDOptions< type >::LJ)\ .def_const("HS",(int)MDOptions< type >::HS)\ .def_const("SOFT",(int)MDOptions< type >::SOFT)\ .def_const("SASA",(int)MDOptions< type >::SASA)\ .def_const("EEF1",(int)MDOptions< type >::EEF1)\ .def_const("IMM1",(int)MDOptions< type >::IMM1)\ .def_const("GB",(int)MDOptions< type >::GB)\ .def_const("GB2",(int)MDOptions< type >::GB2)\ .def_const("BERENDSEN",(int)MDOptions< type >::BERENDSEN)\ .def_const("LANGEVIN",(int)MDOptions< type >::LANGEVIN)\ .def_const("BERE",(int)MDOptions< type >::BERENDSEN)\ .def_const("LANG",(int)MDOptions< type >::LANGEVIN)\ .def_const("OFF",(int)MDOptions< type >::OFF)\ .def_const("RDIE",(int)MDOptions< type >::RDIE)\ .def_const("CDIE",(int)MDOptions< type >::CDIE)\ .def_const("LJ",(int)MDOptions< type >::LJ)\ .def_const("SHIFT",(int)MDOptions< type >::SHIFT)\ .def_const("SWITCH",(int)MDOptions< type >::SWITCH)\ .def_const("TRUNC",(int)MDOptions< type >::TRUNC)\ .def_const("PLAIN",(int)MDOptions< type >::PLAIN)\ .def_const("CUBIC",(int)MDOptions< type >::CUBIC)\ .def_const("NONE",(int)Shake< type >::NONE)\ .def_const("BONDH",(int)Shake< type >::BONDH)\ .def_const("BONDALL",(int)Shake< type >::BONDALL)\ .def_const("ANGLEALL",(int)Shake< type >::ANGLEALL)\ ;