00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef included_MPQC_ChemistryOpt_CoordinateModel_Impl_hh
00014 #define included_MPQC_ChemistryOpt_CoordinateModel_Impl_hh
00015
00016 #ifndef included_sidl_cxx_hh
00017 #include "sidl_cxx.hh"
00018 #endif
00019 #ifndef included_MPQC_ChemistryOpt_CoordinateModel_IOR_h
00020 #include "MPQC_ChemistryOpt_CoordinateModel_IOR.h"
00021 #endif
00022
00023
00024
00025 #ifndef included_Chemistry_QC_Model_hh
00026 #include "Chemistry_QC_Model.hh"
00027 #endif
00028 #ifndef included_MPQC_ChemistryOpt_CoordinateModel_hh
00029 #include "MPQC_ChemistryOpt_CoordinateModel.hh"
00030 #endif
00031 #ifndef included_gov_cca_CCAException_hh
00032 #include "gov_cca_CCAException.hh"
00033 #endif
00034 #ifndef included_gov_cca_Services_hh
00035 #include "gov_cca_Services.hh"
00036 #endif
00037 #ifndef included_sidl_BaseInterface_hh
00038 #include "sidl_BaseInterface.hh"
00039 #endif
00040 #ifndef included_sidl_ClassInfo_hh
00041 #include "sidl_ClassInfo.hh"
00042 #endif
00043
00044
00045
00046 #include <Chemistry_MoleculeViewer.hh>
00047 #include <Chemistry_QC_ModelFactory.hh>
00048 #include <chemistry/molecule/coor.h>
00049 #include "CoordinateModel.h"
00050 #include "Chemistry_Chemistry_Molecule.hh"
00051 #include "cca.h"
00052 #include "dc/babel/babel-cca/server/ccaffeine_TypeMap.hh"
00053 #include "dc/babel/babel-cca/server/ccaffeine_ports_PortTranslator.hh"
00054 #include "util/IO.h"
00055 #include "jc++/jc++.h"
00056 #include "jc++/util/jc++util.h"
00057 #include "parameters/parametersStar.h"
00058 #include "port/portInterfaces.h"
00059 #include "port/supportInterfaces.h"
00060
00061
00062 namespace MPQC {
00063
00067 class ChemistryOpt_CoordinateModel_impl
00068
00069 : public CcaChemGeneric::CoordinateModel
00070
00118
00119 {
00120
00121 private:
00122
00123
00124 ChemistryOpt_CoordinateModel self;
00125
00126
00127 gov::cca::Services services_;
00128 CcaChemGeneric::CoordinateModel genericModel_;
00129 Chemistry::QC::Model model_;
00130 Chemistry::Chemistry_Molecule molecule_;
00131 sc::Ref<sc::MolecularCoor> scCoor_;
00132 sc::Ref<sc::Molecule> scMol_;
00133 sc::Ref<sc::SCMatrixKit> kit_;
00134 sc::Ref<sc::SCMatrixKit> rkit_;
00135 sc::RefSymmSCMatrix ihess_;
00136 DoubleParameter *grad_rms_, *grad_max_, *disp_rms_, *disp_max_;
00137 BoolParameter *multiple_guess_h_, *use_current_geom_;
00138 StringParameter *coordinates_;
00139 StringParameter *extra_bonds_;
00140 double convFrom_;
00141 bool have_guess_h_;
00142 enum {cart,symm,redund};
00143 int coorType_;
00144 int numCoor_;
00145 int natom3_;
00146
00147 ConfigurableParameterPort*
00148 setup_parameters(ConfigurableParameterFactory *);
00149
00150 void draw();
00151
00152
00153 private:
00154
00155 ChemistryOpt_CoordinateModel_impl()
00156 {}
00157
00158 public:
00159
00160
00161
00162 ChemistryOpt_CoordinateModel_impl( struct
00163 MPQC_ChemistryOpt_CoordinateModel__object * s ) : self(s,
00164 true) { _ctor(); }
00165
00166
00167 void _ctor();
00168
00169
00170 virtual ~ChemistryOpt_CoordinateModel_impl() { _dtor(); }
00171
00172
00173 void _dtor();
00174
00175
00176 static void _load();
00177
00178 public:
00179
00180
00186 int32_t
00187 initialize() throw ()
00188 ;
00189
00194 int32_t
00195 finalize() throw ()
00196 ;
00197
00204 void
00205 set_model (
00206 ::Chemistry::QC::Model model
00207 )
00208 throw ()
00209 ;
00210
00211
00216 ::Chemistry::QC::Model
00217 get_model() throw ()
00218 ;
00219
00224 int32_t
00225 get_n_coor() throw ()
00226 ;
00227
00233 ::sidl::array<double>
00234 get_coor() throw ()
00235 ;
00236
00247 double
00248 get_energy (
00249 ::sidl::array<double> x
00250 )
00251 throw ()
00252 ;
00253
00254
00266 ::sidl::array<double>
00267 get_gradient (
00268 ::sidl::array<double> x
00269 )
00270 throw ()
00271 ;
00272
00273
00285 ::sidl::array<double>
00286 get_hessian (
00287 ::sidl::array<double> x
00288 )
00289 throw ()
00290 ;
00291
00292
00306 void
00307 get_energy_and_gradient (
00308 ::sidl::array<double> x,
00309 double& f,
00310 ::sidl::array<double> g
00311 )
00312 throw ()
00313 ;
00314
00315
00327 void
00328 guess_hessian_solve (
00329 ::sidl::array<double> effective_grad,
00330 ::sidl::array<double> effective_step,
00331 void* first_geom
00332 )
00333 throw ()
00334 ;
00335
00336
00342 void
00343 checkConvergence (
00344 int32_t& flag
00345 )
00346 throw ()
00347 ;
00348
00349
00356 void
00357 monitor() throw ()
00358 ;
00359
00377 void
00378 setServices (
00379 ::gov::cca::Services services
00380 )
00381 throw (
00382 ::gov::cca::CCAException
00383 );
00384
00385 };
00386
00387 }
00388
00389
00390
00391
00392
00393 #endif