| 1 | //
|
|---|
| 2 | // File: MPQC_Chemistry_Molecule_Impl.cc
|
|---|
| 3 | // Symbol: MPQC.Chemistry_Molecule-v0.2
|
|---|
| 4 | // Symbol Type: class
|
|---|
| 5 | // Babel Version: 0.8.6
|
|---|
| 6 | // Description: Server-side implementation for MPQC.Chemistry_Molecule
|
|---|
| 7 | //
|
|---|
| 8 | // WARNING: Automatically generated; only changes within splicers preserved
|
|---|
| 9 | //
|
|---|
| 10 | // babel-version = 0.8.6
|
|---|
| 11 | //
|
|---|
| 12 | #include "MPQC_Chemistry_Molecule_Impl.hh"
|
|---|
| 13 |
|
|---|
| 14 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule._includes)
|
|---|
| 15 | #include "MPQC_Physics_Units_Impl.hh"
|
|---|
| 16 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule._includes)
|
|---|
| 17 |
|
|---|
| 18 | // user defined constructor
|
|---|
| 19 | void MPQC::Chemistry_Molecule_impl::_ctor() {
|
|---|
| 20 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule._ctor)
|
|---|
| 21 | net_charge = 0;
|
|---|
| 22 | mol = new sc::Molecule;
|
|---|
| 23 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule._ctor)
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 | // user defined destructor
|
|---|
| 27 | void MPQC::Chemistry_Molecule_impl::_dtor() {
|
|---|
| 28 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule._dtor)
|
|---|
| 29 | // add destruction details here
|
|---|
| 30 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule._dtor)
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | // user defined static methods: (none)
|
|---|
| 34 |
|
|---|
| 35 | // user defined non-static methods:
|
|---|
| 36 | /**
|
|---|
| 37 | * Method: initialize_pointer[]
|
|---|
| 38 | */
|
|---|
| 39 | void
|
|---|
| 40 | MPQC::Chemistry_Molecule_impl::initialize_pointer (
|
|---|
| 41 | /*in*/ void* ptr )
|
|---|
| 42 | throw ()
|
|---|
| 43 | {
|
|---|
| 44 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.initialize_pointer)
|
|---|
| 45 |
|
|---|
| 46 | mol = static_cast<sc::Molecule*>(ptr);
|
|---|
| 47 |
|
|---|
| 48 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.initialize_pointer)
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | /**
|
|---|
| 52 | * Obtain Services handle, through which the
|
|---|
| 53 | * component communicates with the framework.
|
|---|
| 54 | * This is the one method that every CCA Component
|
|---|
| 55 | * must implement. The component will be called
|
|---|
| 56 | * with a nil/null Services pointer when it is
|
|---|
| 57 | * to shut itself down.
|
|---|
| 58 | */
|
|---|
| 59 | void
|
|---|
| 60 | MPQC::Chemistry_Molecule_impl::setServices (
|
|---|
| 61 | /*in*/ ::gov::cca::Services services )
|
|---|
| 62 | throw ()
|
|---|
| 63 | {
|
|---|
| 64 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.setServices)
|
|---|
| 65 | // insert implementation here
|
|---|
| 66 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.setServices)
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | /**
|
|---|
| 70 | * Method: initialize[]
|
|---|
| 71 | */
|
|---|
| 72 | void
|
|---|
| 73 | MPQC::Chemistry_Molecule_impl::initialize (
|
|---|
| 74 | /*in*/ int32_t natom )
|
|---|
| 75 | throw ()
|
|---|
| 76 | {
|
|---|
| 77 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.initialize)
|
|---|
| 78 | // insert implementation here
|
|---|
| 79 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.initialize)
|
|---|
| 80 | }
|
|---|
| 81 |
|
|---|
| 82 | /**
|
|---|
| 83 | * Method: get_units[]
|
|---|
| 84 | */
|
|---|
| 85 | ::Physics::Units
|
|---|
| 86 | MPQC::Chemistry_Molecule_impl::get_units ()
|
|---|
| 87 | throw ()
|
|---|
| 88 |
|
|---|
| 89 | {
|
|---|
| 90 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.get_units)
|
|---|
| 91 | MPQC::Physics_Units units = MPQC::Physics_Units::_create();
|
|---|
| 92 | MPQC::Physics_Units_impl *unitsi
|
|---|
| 93 | = reinterpret_cast<MPQC::Physics_Units_impl*>(units._get_ior()->d_data);
|
|---|
| 94 | unitsi->set_units(new sc::Units("bohr"));
|
|---|
| 95 | return units;
|
|---|
| 96 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.get_units)
|
|---|
| 97 | }
|
|---|
| 98 |
|
|---|
| 99 | /**
|
|---|
| 100 | * Method: get_n_atom[]
|
|---|
| 101 | */
|
|---|
| 102 | int64_t
|
|---|
| 103 | MPQC::Chemistry_Molecule_impl::get_n_atom ()
|
|---|
| 104 | throw ()
|
|---|
| 105 |
|
|---|
| 106 | {
|
|---|
| 107 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.get_n_atom)
|
|---|
| 108 | return mol->natom();
|
|---|
| 109 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.get_n_atom)
|
|---|
| 110 | }
|
|---|
| 111 |
|
|---|
| 112 | /**
|
|---|
| 113 | * Method: get_atomic_number[]
|
|---|
| 114 | */
|
|---|
| 115 | int64_t
|
|---|
| 116 | MPQC::Chemistry_Molecule_impl::get_atomic_number (
|
|---|
| 117 | /*in*/ int64_t atomnum )
|
|---|
| 118 | throw ()
|
|---|
| 119 | {
|
|---|
| 120 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.get_atomic_number)
|
|---|
| 121 | return mol->Z(atomnum);
|
|---|
| 122 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.get_atomic_number)
|
|---|
| 123 | }
|
|---|
| 124 |
|
|---|
| 125 | /**
|
|---|
| 126 | * Method: set_atomic_number[]
|
|---|
| 127 | */
|
|---|
| 128 | void
|
|---|
| 129 | MPQC::Chemistry_Molecule_impl::set_atomic_number (
|
|---|
| 130 | /*in*/ int64_t atomnum,
|
|---|
| 131 | /*in*/ int64_t atomic_number )
|
|---|
| 132 | throw ()
|
|---|
| 133 | {
|
|---|
| 134 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.set_atomic_number)
|
|---|
| 135 | // insert implementation here
|
|---|
| 136 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.set_atomic_number)
|
|---|
| 137 | }
|
|---|
| 138 |
|
|---|
| 139 | /**
|
|---|
| 140 | * Method: get_net_charge[]
|
|---|
| 141 | */
|
|---|
| 142 | double
|
|---|
| 143 | MPQC::Chemistry_Molecule_impl::get_net_charge ()
|
|---|
| 144 | throw ()
|
|---|
| 145 |
|
|---|
| 146 | {
|
|---|
| 147 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.get_net_charge)
|
|---|
| 148 | return net_charge;
|
|---|
| 149 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.get_net_charge)
|
|---|
| 150 | }
|
|---|
| 151 |
|
|---|
| 152 | /**
|
|---|
| 153 | * Method: set_net_charge[]
|
|---|
| 154 | */
|
|---|
| 155 | void
|
|---|
| 156 | MPQC::Chemistry_Molecule_impl::set_net_charge (
|
|---|
| 157 | /*in*/ double charge )
|
|---|
| 158 | throw ()
|
|---|
| 159 | {
|
|---|
| 160 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.set_net_charge)
|
|---|
| 161 | net_charge = charge;
|
|---|
| 162 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.set_net_charge)
|
|---|
| 163 | }
|
|---|
| 164 |
|
|---|
| 165 | /**
|
|---|
| 166 | * Method: get_cart_coor[]
|
|---|
| 167 | */
|
|---|
| 168 | double
|
|---|
| 169 | MPQC::Chemistry_Molecule_impl::get_cart_coor (
|
|---|
| 170 | /*in*/ int64_t atomnum,
|
|---|
| 171 | /*in*/ int32_t xyz )
|
|---|
| 172 | throw ()
|
|---|
| 173 | {
|
|---|
| 174 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.get_cart_coor)
|
|---|
| 175 | return mol->r(atomnum)[xyz];
|
|---|
| 176 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.get_cart_coor)
|
|---|
| 177 | }
|
|---|
| 178 |
|
|---|
| 179 | /**
|
|---|
| 180 | * Method: set_cart_coor[]
|
|---|
| 181 | */
|
|---|
| 182 | void
|
|---|
| 183 | MPQC::Chemistry_Molecule_impl::set_cart_coor (
|
|---|
| 184 | /*in*/ int64_t atomnum,
|
|---|
| 185 | /*in*/ int32_t xyz,
|
|---|
| 186 | /*in*/ double val )
|
|---|
| 187 | throw ()
|
|---|
| 188 | {
|
|---|
| 189 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.set_cart_coor)
|
|---|
| 190 | mol->r(atomnum)[xyz] = val;
|
|---|
| 191 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.set_cart_coor)
|
|---|
| 192 | }
|
|---|
| 193 |
|
|---|
| 194 | /**
|
|---|
| 195 | * Method: get_atomic_label[]
|
|---|
| 196 | */
|
|---|
| 197 | ::std::string
|
|---|
| 198 | MPQC::Chemistry_Molecule_impl::get_atomic_label (
|
|---|
| 199 | /*in*/ int64_t atomnum )
|
|---|
| 200 | throw ()
|
|---|
| 201 | {
|
|---|
| 202 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.get_atomic_label)
|
|---|
| 203 | return mol->label(atomnum);
|
|---|
| 204 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.get_atomic_label)
|
|---|
| 205 | }
|
|---|
| 206 |
|
|---|
| 207 | /**
|
|---|
| 208 | * Method: set_atomic_label[]
|
|---|
| 209 | */
|
|---|
| 210 | void
|
|---|
| 211 | MPQC::Chemistry_Molecule_impl::set_atomic_label (
|
|---|
| 212 | /*in*/ int64_t atomnum,
|
|---|
| 213 | /*in*/ const ::std::string& label )
|
|---|
| 214 | throw ()
|
|---|
| 215 | {
|
|---|
| 216 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.set_atomic_label)
|
|---|
| 217 | // insert implementation here
|
|---|
| 218 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.set_atomic_label)
|
|---|
| 219 | }
|
|---|
| 220 |
|
|---|
| 221 | /**
|
|---|
| 222 | * Method: get_symmetry[]
|
|---|
| 223 | */
|
|---|
| 224 | ::Physics::PointGroup
|
|---|
| 225 | MPQC::Chemistry_Molecule_impl::get_symmetry ()
|
|---|
| 226 | throw ()
|
|---|
| 227 |
|
|---|
| 228 | {
|
|---|
| 229 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.get_symmetry)
|
|---|
| 230 | // insert implementation here
|
|---|
| 231 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.get_symmetry)
|
|---|
| 232 | }
|
|---|
| 233 |
|
|---|
| 234 | /**
|
|---|
| 235 | * Method: get_coor[]
|
|---|
| 236 | */
|
|---|
| 237 | ::sidl::array<double>
|
|---|
| 238 | MPQC::Chemistry_Molecule_impl::get_coor ()
|
|---|
| 239 | throw ()
|
|---|
| 240 |
|
|---|
| 241 | {
|
|---|
| 242 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.get_coor)
|
|---|
| 243 | // insert implementation here
|
|---|
| 244 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.get_coor)
|
|---|
| 245 | }
|
|---|
| 246 |
|
|---|
| 247 | /**
|
|---|
| 248 | * Method: set_coor[]
|
|---|
| 249 | */
|
|---|
| 250 | void
|
|---|
| 251 | MPQC::Chemistry_Molecule_impl::set_coor (
|
|---|
| 252 | /*in*/ ::sidl::array<double> x )
|
|---|
| 253 | throw ()
|
|---|
| 254 | {
|
|---|
| 255 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule.set_coor)
|
|---|
| 256 | // insert implementation here
|
|---|
| 257 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule.set_coor)
|
|---|
| 258 | }
|
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 | // DO-NOT-DELETE splicer.begin(MPQC.Chemistry_Molecule._misc)
|
|---|
| 262 | // Put miscellaneous code here
|
|---|
| 263 | // DO-NOT-DELETE splicer.end(MPQC.Chemistry_Molecule._misc)
|
|---|
| 264 |
|
|---|