1 | //
|
---|
2 | // File: MPQC_Chemistry_QC_ModelFactory_Impl.hh
|
---|
3 | // Symbol: MPQC.Chemistry_QC_ModelFactory-v0.2
|
---|
4 | // Symbol Type: class
|
---|
5 | // Babel Version: 0.10.2
|
---|
6 | // Description: Server-side implementation for MPQC.Chemistry_QC_ModelFactory
|
---|
7 | //
|
---|
8 | // WARNING: Automatically generated; only changes within splicers preserved
|
---|
9 | //
|
---|
10 | // babel-version = 0.10.2
|
---|
11 | //
|
---|
12 |
|
---|
13 | #ifndef included_MPQC_Chemistry_QC_ModelFactory_Impl_hh
|
---|
14 | #define included_MPQC_Chemistry_QC_ModelFactory_Impl_hh
|
---|
15 |
|
---|
16 | #ifndef included_sidl_cxx_hh
|
---|
17 | #include "sidl_cxx.hh"
|
---|
18 | #endif
|
---|
19 | #ifndef included_MPQC_Chemistry_QC_ModelFactory_IOR_h
|
---|
20 | #include "MPQC_Chemistry_QC_ModelFactory_IOR.h"
|
---|
21 | #endif
|
---|
22 | //
|
---|
23 | // Includes for all method dependencies.
|
---|
24 | //
|
---|
25 | #ifndef included_Chemistry_Molecule_hh
|
---|
26 | #include "Chemistry_Molecule.hh"
|
---|
27 | #endif
|
---|
28 | #ifndef included_Chemistry_QC_GaussianBasis_IntegralEvaluatorFactory_hh
|
---|
29 | #include "Chemistry_QC_GaussianBasis_IntegralEvaluatorFactory.hh"
|
---|
30 | #endif
|
---|
31 | #ifndef included_Chemistry_QC_Model_hh
|
---|
32 | #include "Chemistry_QC_Model.hh"
|
---|
33 | #endif
|
---|
34 | #ifndef included_MPQC_Chemistry_QC_ModelFactory_hh
|
---|
35 | #include "MPQC_Chemistry_QC_ModelFactory.hh"
|
---|
36 | #endif
|
---|
37 | #ifndef included_gov_cca_CCAException_hh
|
---|
38 | #include "gov_cca_CCAException.hh"
|
---|
39 | #endif
|
---|
40 | #ifndef included_gov_cca_Services_hh
|
---|
41 | #include "gov_cca_Services.hh"
|
---|
42 | #endif
|
---|
43 | #ifndef included_sidl_BaseException_hh
|
---|
44 | #include "sidl_BaseException.hh"
|
---|
45 | #endif
|
---|
46 | #ifndef included_sidl_BaseInterface_hh
|
---|
47 | #include "sidl_BaseInterface.hh"
|
---|
48 | #endif
|
---|
49 | #ifndef included_sidl_ClassInfo_hh
|
---|
50 | #include "sidl_ClassInfo.hh"
|
---|
51 | #endif
|
---|
52 |
|
---|
53 |
|
---|
54 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_QC_ModelFactory._includes)
|
---|
55 |
|
---|
56 | #include <string>
|
---|
57 | #include "Chemistry_MoleculeFactory.hh"
|
---|
58 | #include <util/group/message.h>
|
---|
59 | #include <util/group/memory.h>
|
---|
60 | #include <util/group/mstate.h>
|
---|
61 | #include <util/group/thread.h>
|
---|
62 | #include <util/group/pregtime.h>
|
---|
63 | //#include <util/group/messmpi.h>
|
---|
64 | #include <chemistry/qc/intcca/intcca.h>
|
---|
65 | #include <chemistry/qc/basis/integral.h>
|
---|
66 | #include "cca.h"
|
---|
67 | #include "dc/babel/babel-cca/server/ccaffeine_TypeMap.hh"
|
---|
68 | #include "dc/babel/babel-cca/server/ccaffeine_ports_PortTranslator.hh"
|
---|
69 | #include "util/IO.h"
|
---|
70 | #include "jc++/jc++.h"
|
---|
71 | #include "jc++/util/jc++util.h"
|
---|
72 | #include "parameters/parametersStar.h"
|
---|
73 | #include "port/portInterfaces.h"
|
---|
74 | #include "port/supportInterfaces.h"
|
---|
75 |
|
---|
76 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_QC_ModelFactory._includes)
|
---|
77 |
|
---|
78 | namespace MPQC {
|
---|
79 |
|
---|
80 | /**
|
---|
81 | * Symbol "MPQC.Chemistry_QC_ModelFactory" (version 0.2)
|
---|
82 | */
|
---|
83 | class Chemistry_QC_ModelFactory_impl
|
---|
84 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_QC_ModelFactory._inherits)
|
---|
85 |
|
---|
86 | /** Chemistry_QC_ModelFactory_impl implements a component interface for
|
---|
87 | supplying quantum chemistry models.
|
---|
88 |
|
---|
89 | This is an implementation of a SIDL interface.
|
---|
90 | The stub code is generated by the Babel tool. Do not make
|
---|
91 | modifications outside of splicer blocks, as these will be lost.
|
---|
92 | This is a server implementation for a Babel class, the Babel
|
---|
93 | client code is provided by the cca-chem-generic package.
|
---|
94 |
|
---|
95 | For use directly in a framework, the parameter port recognizes
|
---|
96 | the following parameters:
|
---|
97 | <dl>
|
---|
98 |
|
---|
99 | <dt><tt>string theory</tt><dd> Method to employ.
|
---|
100 | The default is <tt>HF</tt>.
|
---|
101 |
|
---|
102 | <dt><tt>string basis</tt><dd> Gaussian basis set to use.
|
---|
103 | The default is <tt>STO-3G</tt>.
|
---|
104 |
|
---|
105 | <dt><tt>string molecule_filename</tt><dd> Name of file providing
|
---|
106 | molecule data. See cca-chem documentation for formatting details.
|
---|
107 |
|
---|
108 | <dt><tt>string keyval_filename</tt><dd> Name of file providing
|
---|
109 | MPQC keyval input.
|
---|
110 |
|
---|
111 | <dt><tt>string integral_buffer</tt><dd> Type of integral buffer to use:
|
---|
112 | <tt>opaque</tt> or <tt>array</tt>. See <tt>IntegralEvaluator</tt>
|
---|
113 | documentation for details. The default is <tt>opaque</tt>.
|
---|
114 |
|
---|
115 | </dl>
|
---|
116 |
|
---|
117 | These parameters must be set by the client for embedded use.
|
---|
118 | */
|
---|
119 |
|
---|
120 | // Put additional inheritance here...
|
---|
121 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_QC_ModelFactory._inherits)
|
---|
122 | {
|
---|
123 |
|
---|
124 | private:
|
---|
125 | // Pointer back to IOR.
|
---|
126 | // Use this to dispatch back through IOR vtable.
|
---|
127 | Chemistry_QC_ModelFactory self;
|
---|
128 |
|
---|
129 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_QC_ModelFactory._implementation)
|
---|
130 | std::string theory_;
|
---|
131 | std::string basis_;
|
---|
132 | std::string molecule_filename_;
|
---|
133 | StringParameter *theory_param_, *basis_param_, *molecule_filename_param_,
|
---|
134 | *keyval_filename_param_, *integral_buffer_param_;
|
---|
135 |
|
---|
136 | gov::cca::Services services_;
|
---|
137 |
|
---|
138 | Chemistry::MoleculeFactory molecule_factory_;
|
---|
139 | Chemistry::Molecule molecule_;
|
---|
140 | Chemistry::QC::GaussianBasis::IntegralEvaluatorFactory eval_factory_;
|
---|
141 |
|
---|
142 | sc::Ref<sc::MessageGrp> grp_;
|
---|
143 | sc::Ref<sc::ThreadGrp> thread_;
|
---|
144 | sc::Ref<sc::MemoryGrp> memory_;
|
---|
145 |
|
---|
146 | sc::Ref<sc::IntegralCCA> intcca_;
|
---|
147 |
|
---|
148 | ConfigurableParameterPort*
|
---|
149 | setup_parameters(ConfigurableParameterFactory*);
|
---|
150 |
|
---|
151 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_QC_ModelFactory._implementation)
|
---|
152 |
|
---|
153 | private:
|
---|
154 | // private default constructor (required)
|
---|
155 | Chemistry_QC_ModelFactory_impl()
|
---|
156 | {}
|
---|
157 |
|
---|
158 | public:
|
---|
159 | // sidl constructor (required)
|
---|
160 | // Note: alternate Skel constructor doesn't call addref()
|
---|
161 | // (fixes bug #275)
|
---|
162 | Chemistry_QC_ModelFactory_impl( struct
|
---|
163 | MPQC_Chemistry_QC_ModelFactory__object * s ) : self(s,true) { _ctor(); }
|
---|
164 |
|
---|
165 | // user defined construction
|
---|
166 | void _ctor();
|
---|
167 |
|
---|
168 | // virtual destructor (required)
|
---|
169 | virtual ~Chemistry_QC_ModelFactory_impl() { _dtor(); }
|
---|
170 |
|
---|
171 | // user defined destruction
|
---|
172 | void _dtor();
|
---|
173 |
|
---|
174 | // static class initializer
|
---|
175 | static void _load();
|
---|
176 |
|
---|
177 | public:
|
---|
178 |
|
---|
179 |
|
---|
180 | /**
|
---|
181 | * Starts up a component presence in the calling framework.
|
---|
182 | * @param Svc the component instance's handle on the framework world.
|
---|
183 | * Contracts concerning Svc and setServices:
|
---|
184 | *
|
---|
185 | * The component interaction with the CCA framework
|
---|
186 | * and Ports begins on the call to setServices by the framework.
|
---|
187 | *
|
---|
188 | * This function is called exactly once for each instance created
|
---|
189 | * by the framework.
|
---|
190 | *
|
---|
191 | * The argument Svc will never be nil/null.
|
---|
192 | *
|
---|
193 | * Those uses ports which are automatically connected by the framework
|
---|
194 | * (so-called service-ports) may be obtained via getPort during
|
---|
195 | * setServices.
|
---|
196 | */
|
---|
197 | void
|
---|
198 | setServices (
|
---|
199 | /* in */ ::gov::cca::Services services
|
---|
200 | )
|
---|
201 | throw (
|
---|
202 | ::gov::cca::CCAException
|
---|
203 | );
|
---|
204 |
|
---|
205 |
|
---|
206 | /**
|
---|
207 | * Set the theory name for Model's created with get_model.
|
---|
208 | * @param theory A string giving the name of the theory, for example, B3LYP.
|
---|
209 | */
|
---|
210 | void
|
---|
211 | set_theory (
|
---|
212 | /* in */ const ::std::string& theory
|
---|
213 | )
|
---|
214 | throw ()
|
---|
215 | ;
|
---|
216 |
|
---|
217 |
|
---|
218 | /**
|
---|
219 | * Set the basis set name for Model's created with get_model.
|
---|
220 | * @param basis The basis set name to use, for example, aug-cc-pVDZ.
|
---|
221 | */
|
---|
222 | void
|
---|
223 | set_basis (
|
---|
224 | /* in */ const ::std::string& basis
|
---|
225 | )
|
---|
226 | throw ()
|
---|
227 | ;
|
---|
228 |
|
---|
229 |
|
---|
230 | /**
|
---|
231 | * Set the Molecule to use for Model's created with get_model.
|
---|
232 | * @param molecule An object of type Molecule.
|
---|
233 | */
|
---|
234 | void
|
---|
235 | set_molecule (
|
---|
236 | /* in */ ::Chemistry::Molecule molecule
|
---|
237 | )
|
---|
238 | throw ()
|
---|
239 | ;
|
---|
240 |
|
---|
241 |
|
---|
242 | /**
|
---|
243 | * Set the object to use to compute integrals for Model's created with get_model.
|
---|
244 | *
|
---|
245 | * @param intfact An object of type GaussianBasis.IntegralEvaluatorFactory.
|
---|
246 | */
|
---|
247 | void
|
---|
248 | set_integral_factory (
|
---|
249 | /* in */ ::Chemistry::QC::GaussianBasis::IntegralEvaluatorFactory intfact
|
---|
250 | )
|
---|
251 | throw ()
|
---|
252 | ;
|
---|
253 |
|
---|
254 |
|
---|
255 | /**
|
---|
256 | * Returns a newly created Model. Before get_model can be called, set_theory,
|
---|
257 | * set_basis, and set_molecule must be called.
|
---|
258 | * @return The new Model instance.
|
---|
259 | */
|
---|
260 | ::Chemistry::QC::Model
|
---|
261 | get_model() throw (
|
---|
262 | ::sidl::BaseException
|
---|
263 | );
|
---|
264 |
|
---|
265 | /**
|
---|
266 | * This can be called when this Model object is no longer needed. No other
|
---|
267 | * members may be called after finalize.
|
---|
268 | */
|
---|
269 | int32_t
|
---|
270 | finalize() throw ()
|
---|
271 | ;
|
---|
272 | }; // end class Chemistry_QC_ModelFactory_impl
|
---|
273 |
|
---|
274 | } // end namespace MPQC
|
---|
275 |
|
---|
276 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_QC_ModelFactory._misc)
|
---|
277 | // Put miscellaneous things here...
|
---|
278 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_QC_ModelFactory._misc)
|
---|
279 |
|
---|
280 | #endif
|
---|