/*************************************************************************** mcf_mod.cpp - description ------------------- begin : Mon Jan 12 05:20:12 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 #include #include //#include #include #include #include #include using namespace Almost; typedef DynaImpl > * (MCF::*mcf_factory_19)(const Molecules & molecules, const MCFOptions & options, const MDB & mdb); #if (__GNUC__ >= 3) template<> #endif map MCF::factory #if (__GNUC__ >= 3) = map(); #endif ; template<> inline string to_string(const MCFOptions & opt){ stringstream s; s< inline string to_string(const MCF &){ return ""; } template struct OperatorHelperMCFSolv; template struct OperatorHelperMCFSolv { template static typename FF::FloatType helper(const MCFOptionsType & data){ // cout<<"NO SOLV"< struct OperatorHelperMCFSolv { template static typename FF::FloatType helper(const MCFDataType & data){ // cout<<"SOLV"< struct OperatorHelperMCFSolv { template static typename FF::FloatType helper(const MCFDataType & data){ // cout<<"SOLV"< struct OperatorHelperMCFUb; template<> struct OperatorHelperMCFUb<0> { template static typename FF::FloatType helper(const MCFData & data){ // cout<<"NO UB"< struct OperatorHelperMCFUb<1> { template static typename FF::FloatType helper(const MCFData & data){ // cout<<"UB"< struct OperatorHelperMCFElec; template struct OperatorHelperMCFElec { template static typename FF::FloatType helper(const MCFOptionsType & data){ // cout<<"NO ELEC"< struct OperatorHelperMCFElec { template static typename FF::FloatType helper(const MCFDataType & data){ // cout<<"ELEC"< DynaLogStream & operator<<(DynaLogStream &log, const MCFData & data){ char buff[256]; string prmpt=Almost::DynaStatPr; log.stream()<::helper(data), data.ff_data.vdw_energy, OperatorHelperMCFSolv::helper(data), OperatorHelperMCFUb::helper(data)); log.stream()< DynaDataStream & operator<<(DynaDataStream & dat, const MCFData & data){ dat.stream()<::helper(data)<<" " <::helper(data)<<" " <::helper(data)<<" " < inline string to_string(const Molecules & molecules){ return ""; } template<> inline string to_string(const MDB & mdb){ return ""; } template MCFType const_mcf(MoveSet & ms, ConstraintCollection & cc){ return MCFType(ms,cc); } MCFOptions c19_defaults__mcf(int FF){ MCFOptions opts(MCFOptions::C19); if(FF==MCFOptions::EEF1){ opts.elec = MCFOptions::RDIE; opts. elec_cutoff = MCFOptions::SWITCH; opts.vdw = MCFOptions::LJ; opts.vdw_cutoff = MCFOptions::SWITCH; opts.eps = 1.0; opts.solv = MCFOptions::EEF1; opts.cut_on = 7.0; opts.cut_off = 9.0; opts.cut_nb = 10.0; } else if(FF!=MCFOptions::SASA) opts.solv = MCFOptions::NONE; return opts; } MCFOptions c19_options_mcf(){ return MCFOptions(MCFOptions::C19); } MCFOptions c22_options_mcf(){ return MCFOptions(MCFOptions::C22); } extern "C" { void init_mcf(){ //declarations here Module mod = Module("mcf"); Class >(mod.self(),"options") .def_attribute("kind",&MCFOptions::kind,"Undocumented") .def_attribute("elec",&MCFOptions::elec,"Undocumented") .def_attribute("elec_cutoff",&MCFOptions::elec_cutoff,"Undocumented") .def_attribute("vdw",&MCFOptions::vdw,"Undocumented") .def_attribute("vdw_cutoff",&MCFOptions::vdw_cutoff,"Undocumented") .def_attribute("solv",&MCFOptions::solv,"Undocumented") .def_attribute("solv_ignore_h",&MCFOptions::solv_ignore_h,"Undocumented") .def_attribute("cut_on",&MCFOptions::cut_on,"Undocumented") .def_attribute("cut_off",&MCFOptions::cut_off,"Undocumented") .def_attribute("e_zero",&MCFOptions::e_zero,"Undocumented") .def_attribute("e_14",&MCFOptions::e_14,"Undocumented") .def_attribute("eps",&MCFOptions::eps,"Undocumented") .def_attribute("r_water",&MCFOptions::r_water,"Undocumented") .def_attribute("vect",&MCFOptions::vect,"Undocumented") .def_attribute("trj",&MCFOptions::trj,"Undocumented") .def_attribute("rst",&MCFOptions::rst,"Undocumented") .def_attribute("log",&MCFOptions::log,"Undocumented") .def_attribute("dat",&MCFOptions::dat,"Undocumented") .def_attribute("steps",&MCFOptions::steps,"Undocumented") .def_attribute("nprint",&MCFOptions::nprint,"Undocumented") .def_attribute("nsave",&MCFOptions::nsave,"Undocumented") .def_attribute("temp",&MCFOptions::temp,"Undocumented") .def_attribute("seed",&MCFOptions::seed,"Undocumented") .def_attribute("Ax",&MCFOptions::Ax,"Undocumented") .def_attribute("Ay",&MCFOptions::Ay,"Undocumented") .def_attribute("Az",&MCFOptions::Az,"Undocumented") .def_attribute("theta",&MCFOptions::theta,"Undocumented") .def_attribute("selection",&MCFOptions::selection,"Undocumented") .def_attribute("save_fitted",&MCFOptions::save_fitted,"Undocumented"); Class,ArgList1 & > >(mod.self(),"mcf") .def_method("run", &MCF::run) .def_method("run_from_mol", &MCF::run_from_mol) .def_method("cont",&MCF::cont) .def_method("restart", &MCF::restart) ; mod.def_function("const_mcf","Run a constrained MC simulation", const_mcf >); mod .def_const("C19",(int)MCFOptions::C19) .def_const("C22",(int)MCFOptions::C22) .def_const("NONE",(int)MCFOptions::NONE) .def_const("SASA",(int)MCFOptions::SASA) .def_const("EEF1",(int)MCFOptions::EEF1) ; mod .def_function("c19_defaults","Return options with right defaults",c19_defaults__mcf) .def_function("c19_options","Return options with right defaults",c19_options_mcf) .def_function("c22_options","Return options with right defaults",c22_options_mcf); } }