/*************************************************************************** mbmd_common.h - description ------------------- begin : Sun Mar 12 22:54:23 2006 copyright : (C) 2004 by Cavalli Andrea author : $Author$ date : $Date$ id : $Id$ 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. * * * ***************************************************************************/ #ifndef __MBMD_COMMON__ #define __MBMD_COMMON__ #include #include #include #include #include #include #include #include #include using namespace Almost; template inline string to_string(const MBMDOptions & c19md_opt){ stringstream s; s< inline string to_string(const MBMD &){ return ""; } template MBMDOptions c19_md_options(){ return MBMDOptions(MBMDOptions::C19); } template MBMDOptions c22_md_options(){ return MBMDOptions(MBMDOptions::C22); } template MBMDOptions c19_defaults(int FF, int algo){ MBMDOptions opts; if(FF==MBMDOptions::EEF1){ opts.elec = MBMDOptions::RDIE; opts. elec_cutoff = MBMDOptions::SWITCH; opts.vdw = MBMDOptions::LJ; opts.vdw_cutoff = MBMDOptions::SWITCH; opts.eps = 1.0; opts.solv = MBMDOptions::EEF1; opts.cut_on = 7.0; opts.cut_off = 9.0; opts.cut_nb = 10.0; } else if(FF!=MBMDOptions::SASA) opts.solv = MBMDOptions::NONE; if(algo==MBMDOptions::LANGEVIN){ opts.algorithm = MBMDOptions::LANGEVIN; } else opts.algorithm = MBMDOptions::BERENDSEN; return opts; } template DynaType const_mbmd(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(SMBMDImplData & 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(MBMDOptions< type >,kind,FFDoc)\ .REGATTR(MBMDOptions< type >,elec,FFDoc)\ .REGATTR(MBMDOptions< type >,elec_cutoff,FFDoc)\ .REGATTR(MBMDOptions< type >,vdw,FFDoc) \ .REGATTR(MBMDOptions< type >,vdw_cutoff,FFDoc) \ .REGATTR(MBMDOptions< type >,solv,FFDoc) \ .REGATTR(MBMDOptions< type >,solv_ignore_h,FFDoc) \ .REGATTR(MBMDOptions< type >,cut_on,FFDoc) \ .REGATTR(MBMDOptions< type >,cut_off,FFDoc) \ .REGATTR(MBMDOptions< type >,cut_nb,FFDoc) \ .REGATTR(MBMDOptions< type >,e_zero,FFDoc) \ .REGATTR(MBMDOptions< type >,e_14,FFDoc) \ .REGATTR(MBMDOptions< type >,eps,FFDoc) \ .REGATTR(MBMDOptions< type >,r_water,FFDoc) \ .REGATTR(MBMDOptions< type >,gamma_water,RunDoc) \ .REGATTR(MBMDOptions< type >,vect,RunDoc) \ .REGATTR(MBMDOptions< type >,algorithm,RunDoc) \ .REGATTR(MBMDOptions< type >,geometry,RunDoc) \ .REGATTR(MBMDOptions< type >,Lx,RunDoc) \ .REGATTR(MBMDOptions< type >,Ly,RunDoc) \ .REGATTR(MBMDOptions< type >,Lz,RunDoc) \ .REGATTR(MBMDOptions< type >,granularity,RunDoc) \ .REGATTR(MBMDOptions< type >,trj,RunDoc) \ .REGATTR(MBMDOptions< type >,vtrj,RunDoc)\ .REGATTR(MBMDOptions< type >,rst,RunDoc)\ .REGATTR(MBMDOptions< type >,log,RunDoc)\ .REGATTR(MBMDOptions< type >,dat,RunDoc)\ .REGATTR(MBMDOptions< type >,steps,RunDoc)\ .REGATTR(MBMDOptions< type >,nprint,RunDoc)\ .REGATTR(MBMDOptions< type >,nsave,RunDoc)\ .REGATTR(MBMDOptions< type >,nupdate,RunDoc)\ .REGATTR(MBMDOptions< type >,nrottrans,RunDoc)\ .REGATTR(MBMDOptions< type >,shake_mode,RunDoc)\ .REGATTR(MBMDOptions< type >,shake_tol,RunDoc)\ .REGATTR(MBMDOptions< type >,temp,RunDoc)\ .REGATTR(MBMDOptions< type >,time_step,RunDoc)\ .REGATTR(MBMDOptions< type >,tau,RunDoc)\ .REGATTR(MBMDOptions< type >,seed,RunDoc)\ .REGATTR(MBMDOptions< type >,save_fitted,RunDoc)\ .REGATTR(MBMDOptions< type >,selection,RunDoc); #define REGISTER_MBMD_CONST(type)\ mod\ .def_const("C19",(int)MBMDOptions< type >::C19)\ .def_const("C22",(int)MBMDOptions< type >::C22)\ .def_const("NONE",(int)MBMDOptions< type >::NONE)\ .def_const("SASA",(int)MBMDOptions< type >::SASA)\ .def_const("EEF1",(int)MBMDOptions< type >::EEF1)\ .def_const("BERENDSEN",(int)MBMDOptions< type >::BERENDSEN)\ .def_const("LANGEVIN",(int)MBMDOptions< type >::LANGEVIN)\ .def_const("BERE",(int)MBMDOptions< type >::BERENDSEN)\ .def_const("LANG",(int)MBMDOptions< type >::LANGEVIN)\ .def_const("OFF",(int)MBMDOptions< type >::OFF)\ .def_const("RDIE",(int)MBMDOptions< type >::RDIE)\ .def_const("CDIE",(int)MBMDOptions< type >::CDIE)\ .def_const("LJ",(int)MBMDOptions< type >::LJ)\ .def_const("SHIFT",(int)MBMDOptions< type >::SHIFT)\ .def_const("SWITCH",(int)MBMDOptions< type >::SWITCH)\ .def_const("PLAIN",(int)MBMDOptions< type >::PLAIN)\ .def_const("CUBIC",(int)MBMDOptions< 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)\ ; #endif // Local Variables: // mode:C++ // End: