[bcf653] | 1 | /*
|
---|
| 2 | * Project: MoleCuilder
|
---|
| 3 | * Description: creates and alters molecular systems
|
---|
[0aa122] | 4 | * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
|
---|
[94d5ac6] | 5 | *
|
---|
| 6 | *
|
---|
| 7 | * This file is part of MoleCuilder.
|
---|
| 8 | *
|
---|
| 9 | * MoleCuilder is free software: you can redistribute it and/or modify
|
---|
| 10 | * it under the terms of the GNU General Public License as published by
|
---|
| 11 | * the Free Software Foundation, either version 2 of the License, or
|
---|
| 12 | * (at your option) any later version.
|
---|
| 13 | *
|
---|
| 14 | * MoleCuilder is distributed in the hope that it will be useful,
|
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 17 | * GNU General Public License for more details.
|
---|
| 18 | *
|
---|
| 19 | * You should have received a copy of the GNU General Public License
|
---|
| 20 | * along with MoleCuilder. If not, see <http://www.gnu.org/licenses/>.
|
---|
[bcf653] | 21 | */
|
---|
| 22 |
|
---|
[43dad6] | 23 | /*
|
---|
| 24 | * MpqcParser.cpp
|
---|
| 25 | *
|
---|
| 26 | * Created on: 12.06.2010
|
---|
| 27 | * Author: heber
|
---|
| 28 | */
|
---|
| 29 |
|
---|
[bf3817] | 30 | // include config.h
|
---|
| 31 | #ifdef HAVE_CONFIG_H
|
---|
| 32 | #include <config.h>
|
---|
| 33 | #endif
|
---|
| 34 |
|
---|
[52cac0] | 35 | #include <iomanip>
|
---|
[aa8ef2] | 36 | #include <iostream>
|
---|
[03a589] | 37 | #include <boost/foreach.hpp>
|
---|
[aa8ef2] | 38 | #include <boost/tokenizer.hpp>
|
---|
[52cac0] | 39 | #include <sstream>
|
---|
[aa8ef2] | 40 | #include <string>
|
---|
| 41 |
|
---|
[ad011c] | 42 | #include "CodePatterns/MemDebug.hpp"
|
---|
[bbbad5] | 43 |
|
---|
[1b2d30] | 44 | #include "MpqcParser.hpp"
|
---|
[c1db05] | 45 | #include "MpqcParser_Parameters.hpp"
|
---|
[1b2d30] | 46 |
|
---|
[6f0841] | 47 | #include "Atom/atom.hpp"
|
---|
[41a467] | 48 | #include "CodePatterns/Log.hpp"
|
---|
| 49 | #include "CodePatterns/toString.hpp"
|
---|
[1b2d30] | 50 | #include "config.hpp"
|
---|
[3bdb6d] | 51 | #include "Element/element.hpp"
|
---|
[41a467] | 52 | #include "Element/periodentafel.hpp"
|
---|
| 53 | #include "LinearAlgebra/Vector.hpp"
|
---|
[aa8ef2] | 54 | #include "molecule.hpp"
|
---|
[42127c] | 55 | #include "MoleculeListClass.hpp"
|
---|
[1b2d30] | 56 | #include "World.hpp"
|
---|
| 57 |
|
---|
[765f16] | 58 | // declare specialized static variables
|
---|
| 59 | const std::string FormatParserTrait<mpqc>::name = "mpqc";
|
---|
| 60 | const std::string FormatParserTrait<mpqc>::suffix = "in";
|
---|
| 61 | const ParserTypes FormatParserTrait<mpqc>::type = mpqc;
|
---|
[1b2d30] | 62 |
|
---|
[ee50c1] | 63 | // a converter we often need
|
---|
| 64 | ConvertTo<bool> FormatParser<mpqc>::Converter;
|
---|
[1b2d30] | 65 |
|
---|
| 66 | /** Constructor of MpqcParser.
|
---|
| 67 | *
|
---|
| 68 | */
|
---|
[765f16] | 69 | FormatParser< mpqc >::FormatParser() :
|
---|
| 70 | FormatParser_common(new MpqcParser_Parameters())
|
---|
| 71 | {}
|
---|
[1b2d30] | 72 |
|
---|
| 73 | /** Destructor of MpqcParser.
|
---|
| 74 | *
|
---|
| 75 | */
|
---|
[765f16] | 76 | FormatParser< mpqc >::~FormatParser()
|
---|
| 77 | {}
|
---|
[1b2d30] | 78 |
|
---|
| 79 | /** Load an MPQC config file into the World.
|
---|
| 80 | * \param *file input stream
|
---|
| 81 | */
|
---|
[765f16] | 82 | void FormatParser< mpqc >::load(istream *file)
|
---|
[1b2d30] | 83 | {
|
---|
[4cbca0] | 84 | bool MpqcSection = false;
|
---|
| 85 | bool MoleculeSection = false;
|
---|
| 86 | bool GeometrySection = false;
|
---|
| 87 | bool BasisSection = false;
|
---|
| 88 | bool AuxBasisSection = false;
|
---|
[aa8ef2] | 89 | char line[MAXSTRINGSIZE];
|
---|
| 90 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
---|
| 91 | boost::char_separator<char> sep("[]");
|
---|
[4cbca0] | 92 | boost::char_separator<char> angularsep("<>");
|
---|
[311da7b] | 93 | boost::char_separator<char> equalitysep(" =");
|
---|
[aa8ef2] | 94 | boost::char_separator<char> whitesep(" \t");
|
---|
| 95 | ConvertTo<double> toDouble;
|
---|
| 96 |
|
---|
| 97 | molecule *newmol = World::getInstance().createMolecule();
|
---|
| 98 | newmol->ActiveFlag = true;
|
---|
[4cbca0] | 99 | // TODO: Remove the insertion into molecule when saving does not depend on them anymore. Also, remove molecule.hpp include
|
---|
| 100 | World::getInstance().getMolecules()->insert(newmol);
|
---|
[aa8ef2] | 101 | while (file->good()) {
|
---|
| 102 | file->getline(line, MAXSTRINGSIZE-1);
|
---|
| 103 | std::string linestring(line);
|
---|
| 104 | if ((linestring.find("atoms geometry") == string::npos) && (linestring.find("}") != string::npos)) {
|
---|
[4cbca0] | 105 | GeometrySection = false;
|
---|
[aa8ef2] | 106 | }
|
---|
[4cbca0] | 107 | if ((linestring.find(")") != string::npos)) { // ends a section which do not overlap
|
---|
| 108 | MpqcSection = false;
|
---|
| 109 | MoleculeSection = false;
|
---|
| 110 | BasisSection = false;
|
---|
| 111 | AuxBasisSection = false;
|
---|
| 112 | }
|
---|
| 113 | if (MoleculeSection) {
|
---|
| 114 | if (GeometrySection) { // we have an atom
|
---|
| 115 | tokenizer tokens(linestring, sep);
|
---|
| 116 | // if (tokens.size() != 2)
|
---|
| 117 | // throw MpqcParseException;
|
---|
| 118 | tokenizer::iterator tok_iter = tokens.begin();
|
---|
[311da7b] | 119 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 120 | "FormatParser< mpqc >::load() - missing token for MoleculeSection in line "+linestring+"!");
|
---|
[4cbca0] | 121 | std::stringstream whitespacefilter(*tok_iter++);
|
---|
| 122 | std::string element;
|
---|
[311da7b] | 123 | whitespacefilter >> ws >> element;
|
---|
| 124 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 125 | "FormatParser< mpqc >::load() - missing token for MoleculeSection in line "+linestring+"!");
|
---|
[4cbca0] | 126 | std::string vector = *tok_iter;
|
---|
| 127 | tokenizer vectorcomponents(vector, whitesep);
|
---|
| 128 | Vector X;
|
---|
| 129 | // if (vectorcomponents.size() != NDIM)
|
---|
| 130 | // throw MpqcParseException;
|
---|
| 131 | tok_iter = vectorcomponents.begin();
|
---|
| 132 | for (int i=0; i<NDIM; ++i) {
|
---|
| 133 | X[i] = toDouble(*tok_iter++);
|
---|
| 134 | }
|
---|
| 135 | // create atom
|
---|
| 136 | atom *newAtom = World::getInstance().createAtom();
|
---|
| 137 | newAtom->setType(World::getInstance().getPeriode()->FindElement(element));
|
---|
| 138 | newAtom->setPosition(X);
|
---|
| 139 | newmol->AddAtom(newAtom);
|
---|
[47d041] | 140 | LOG(1, "Adding atom " << *newAtom);
|
---|
[4cbca0] | 141 | }
|
---|
| 142 | }
|
---|
| 143 | if (MpqcSection) {
|
---|
[311da7b] | 144 | if (linestring.find("mole<") != string::npos) { // get theory
|
---|
[4cbca0] | 145 | tokenizer tokens(linestring, angularsep);
|
---|
| 146 | tokenizer::iterator tok_iter = tokens.begin();
|
---|
[311da7b] | 147 | ++tok_iter;
|
---|
| 148 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 149 | "FormatParser< mpqc >::load() - missing token in brackets<> for mole< in line "+linestring+"!");
|
---|
[311da7b] | 150 | std::string value(*tok_iter);
|
---|
[4cbca0] | 151 | std::stringstream linestream("theory = "+value);
|
---|
[c1db05] | 152 | linestream >> getParams();
|
---|
[4cbca0] | 153 | } else if (linestring.find("integrals<") != string::npos) { // get theory
|
---|
| 154 | tokenizer tokens(linestring, angularsep);
|
---|
| 155 | tokenizer::iterator tok_iter = tokens.begin();
|
---|
[311da7b] | 156 | ++tok_iter;
|
---|
| 157 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 158 | "FormatParser< mpqc >::load() - missing token in brackets<> for integrals< in line "+linestring+"!");
|
---|
[311da7b] | 159 | std::string value(*tok_iter);
|
---|
[4cbca0] | 160 | std::stringstream linestream("integration = "+value);
|
---|
[c1db05] | 161 | linestream >> getParams();
|
---|
[311da7b] | 162 | } else if ((linestring.find("molecule") == string::npos) && (linestring.find("basis") == string::npos)){
|
---|
| 163 | // molecule and basis must not be parsed in this section
|
---|
| 164 | tokenizer tokens(linestring, equalitysep);
|
---|
| 165 | tokenizer::iterator tok_iter = tokens.begin();
|
---|
| 166 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 167 | "FormatParser< mpqc >::load() - missing token before '=' for MpqcSection in line "+linestring+"!");
|
---|
[311da7b] | 168 | std::stringstream whitespacefilter(*tok_iter);
|
---|
| 169 | std::string key;
|
---|
| 170 | whitespacefilter >> ws >> key;
|
---|
[ee50c1] | 171 | if (getParams().haveParameter(key)) {
|
---|
[311da7b] | 172 | std::stringstream linestream(linestring);
|
---|
[c1db05] | 173 | linestream >> getParams();
|
---|
[311da7b] | 174 | } else { // unknown keys are simply ignored as long as parser is incomplete
|
---|
[47d041] | 175 | LOG(2, "INFO: '"+key+"' is unknown and ignored.");
|
---|
[311da7b] | 176 | }
|
---|
[4cbca0] | 177 | }
|
---|
| 178 | }
|
---|
| 179 | if (BasisSection) {
|
---|
| 180 | tokenizer tokens(linestring, equalitysep);
|
---|
| 181 | tokenizer::iterator tok_iter = tokens.begin();
|
---|
[311da7b] | 182 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 183 | "FormatParser< mpqc >::load() - missing token for BasisSection in line "+linestring+"!");
|
---|
[4cbca0] | 184 | std::string key(*tok_iter++);
|
---|
[311da7b] | 185 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 186 | "FormatParser< mpqc >::load() - missing value for BasisSection after key "+key+" in line "+linestring+"!");
|
---|
[4cbca0] | 187 | std::string value(*tok_iter);
|
---|
[311da7b] | 188 | tok_iter++;
|
---|
[4cbca0] | 189 | // TODO: use exception instead of ASSERT
|
---|
| 190 | ASSERT(tok_iter == tokens.end(),
|
---|
[765f16] | 191 | "FormatParser< mpqc >::load() - more than (key = value) on line "+linestring+".");
|
---|
[4cbca0] | 192 | if (key == "name") {
|
---|
| 193 | std::stringstream linestream("basis = "+value);
|
---|
[c1db05] | 194 | linestream >> getParams();
|
---|
[4cbca0] | 195 | }
|
---|
| 196 | }
|
---|
| 197 | if (AuxBasisSection) {
|
---|
| 198 | tokenizer tokens(linestring, equalitysep);
|
---|
| 199 | tokenizer::iterator tok_iter = tokens.begin();
|
---|
[311da7b] | 200 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 201 | "FormatParser< mpqc >::load() - missing token for AuxBasisSection in line "+linestring+"!");
|
---|
[4cbca0] | 202 | std::string key(*tok_iter++);
|
---|
[311da7b] | 203 | ASSERT(tok_iter != tokens.end(),
|
---|
[765f16] | 204 | "FormatParser< mpqc >::load() - missing value for BasisSection after key "+key+" in line "+linestring+"!");
|
---|
[4cbca0] | 205 | std::string value(*tok_iter);
|
---|
[311da7b] | 206 | tok_iter++;
|
---|
[4cbca0] | 207 | // TODO: use exception instead of ASSERT
|
---|
| 208 | ASSERT(tok_iter == tokens.end(),
|
---|
[765f16] | 209 | "FormatParser< mpqc >::load() - more than (key = value) on line "+linestring+".");
|
---|
[4cbca0] | 210 | if (key == "name") {
|
---|
| 211 | std::stringstream linestream("aux_basis = "+value);
|
---|
[c1db05] | 212 | linestream >> getParams();
|
---|
[aa8ef2] | 213 | }
|
---|
| 214 | }
|
---|
| 215 | // set some scan flags
|
---|
[4cbca0] | 216 | if (linestring.find("mpqc:") != string::npos) {
|
---|
| 217 | MpqcSection = true;
|
---|
| 218 | }
|
---|
| 219 | if (linestring.find("molecule<Molecule>:") != string::npos) {
|
---|
| 220 | MoleculeSection = true;
|
---|
| 221 | }
|
---|
[aa8ef2] | 222 | if (linestring.find("atoms geometry") != string::npos) {
|
---|
[4cbca0] | 223 | GeometrySection = true;
|
---|
| 224 | }
|
---|
| 225 | if ((linestring.find("basis<GaussianBasisSet>:") != string::npos) && ((linestring.find("abasis<") == string::npos))) {
|
---|
| 226 | BasisSection = true;
|
---|
| 227 | }
|
---|
| 228 | if (linestring.find("abasis<") != string::npos) {
|
---|
| 229 | AuxBasisSection = true;
|
---|
[aa8ef2] | 230 | }
|
---|
| 231 | }
|
---|
[4afa46] | 232 | // refresh atom::nr and atom::name
|
---|
| 233 | newmol->getAtomCount();
|
---|
[1b2d30] | 234 | }
|
---|
| 235 |
|
---|
[03a589] | 236 | void FormatParser< mpqc >::OutputMPQCLine(ostream * const out, const atom &_atom, const Vector *center) const
|
---|
| 237 | {
|
---|
| 238 | Vector recentered(_atom.getPosition());
|
---|
| 239 | recentered -= *center;
|
---|
[52cac0] | 240 | *out << "\t\t" << _atom.getType()->getSymbol() << " [ ";
|
---|
| 241 | {
|
---|
| 242 | std::stringstream posstream;
|
---|
| 243 | posstream << std::setprecision(12) << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2];
|
---|
| 244 | *out << posstream.str();
|
---|
| 245 | }
|
---|
| 246 | *out << " ]" << std::endl;
|
---|
[03a589] | 247 | };
|
---|
| 248 |
|
---|
| 249 |
|
---|
[f31edc] | 250 | /** Saves all atoms and data into a MPQC config file.
|
---|
[1b2d30] | 251 | * \param *file output stream
|
---|
[73916f] | 252 | * \param atoms atoms to store
|
---|
[1b2d30] | 253 | */
|
---|
[765f16] | 254 | void FormatParser< mpqc >::save(ostream *file, const std::vector<atom *> &atoms)
|
---|
[1b2d30] | 255 | {
|
---|
| 256 | Vector center;
|
---|
[f7c19e] | 257 | // vector<atom *> allatoms = World::getInstance().getAllAtoms();
|
---|
[1b2d30] | 258 |
|
---|
[d6b8e1] | 259 | // calculate center
|
---|
[e9dc19] | 260 | // for (std::vector<atom *>::const_iterator runner = atoms.begin();runner != atoms.end(); ++runner)
|
---|
| 261 | // center += (*runner)->getPosition();
|
---|
| 262 | // center.Scale(1./(double)atoms.size());
|
---|
| 263 | center.Zero();
|
---|
[d6b8e1] | 264 |
|
---|
[1b2d30] | 265 | // first without hessian
|
---|
| 266 | if (file->fail()) {
|
---|
[47d041] | 267 | ELOG(1, "Cannot open mpqc output file.");
|
---|
[1b2d30] | 268 | } else {
|
---|
| 269 | *file << "% Created by MoleCuilder" << endl;
|
---|
| 270 | *file << "mpqc: (" << endl;
|
---|
[ee50c1] | 271 | *file << "\tsavestate = " << getParams().getParameter(MpqcParser_Parameters::savestateParam) << endl;
|
---|
| 272 | *file << "\tdo_gradient = " << getParams().getParameter(MpqcParser_Parameters::do_gradientParam) << endl;
|
---|
| 273 | if (Converter(getParams().getParameter(MpqcParser_Parameters::hessianParam))) {
|
---|
[f31edc] | 274 | *file << "\tfreq<MolecularFrequencies>: (" << endl;
|
---|
| 275 | *file << "\t\tmolecule=$:molecule" << endl;
|
---|
| 276 | *file << "\t)" << endl;
|
---|
| 277 | }
|
---|
[ee50c1] | 278 | const std::string theory = getParams().getParameter(MpqcParser_Parameters::theoryParam);
|
---|
| 279 | if (theory == getParams().getTheoryName(MpqcParser_Parameters::CLHF)) {
|
---|
| 280 | *file << "\tmole<" << getParams().getParameter(MpqcParser_Parameters::theoryParam) << ">: (" << endl;
|
---|
| 281 | *file << "\t\tmolecule = $:molecule" << endl;
|
---|
| 282 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::basisParam) << " = $:basis" << endl;
|
---|
| 283 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::maxiterParam)
|
---|
| 284 | << " = " << getParams().getParameter(MpqcParser_Parameters::maxiterParam)<< endl;
|
---|
| 285 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::memoryParam)
|
---|
| 286 | << " = " << getParams().getParameter(MpqcParser_Parameters::memoryParam) << endl;
|
---|
| 287 | *file << "\t)" << endl;
|
---|
| 288 | } else if (theory == getParams().getTheoryName(MpqcParser_Parameters::CLKS)) {
|
---|
| 289 | *file << "\tmole<" << getParams().getParameter(MpqcParser_Parameters::theoryParam) << ">: (" << endl;
|
---|
| 290 | *file << "\t\tfunctional<StdDenFunctional>:(name=B3LYP)" << endl;
|
---|
| 291 | *file << "\t\tmolecule = $:molecule" << endl;
|
---|
| 292 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::basisParam) << " = $:basis" << endl;
|
---|
| 293 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::maxiterParam)
|
---|
| 294 | << " = " << getParams().getParameter(MpqcParser_Parameters::maxiterParam)<< endl;
|
---|
| 295 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::memoryParam)
|
---|
| 296 | << " = " << getParams().getParameter(MpqcParser_Parameters::memoryParam) << endl;
|
---|
| 297 | *file << "\t)" << endl;
|
---|
| 298 | } else if (theory == getParams().getTheoryName(MpqcParser_Parameters::MBPT2)) {
|
---|
| 299 | *file << "\tmole<" << getParams().getParameter(MpqcParser_Parameters::theoryParam) << ">: (" << endl;
|
---|
| 300 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::basisParam) << " = $:basis" << endl;
|
---|
| 301 | *file << "\t\tmolecule = $:molecule" << endl;
|
---|
| 302 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::memoryParam)
|
---|
| 303 | << " = " << getParams().getParameter(MpqcParser_Parameters::memoryParam) << endl;
|
---|
| 304 | *file << "\t\treference<CLHF>: (" << endl;
|
---|
| 305 | *file << "\t\t\t" << getParams().getParameterName(MpqcParser_Parameters::maxiterParam)
|
---|
| 306 | << " = " << getParams().getParameter(MpqcParser_Parameters::maxiterParam)<< endl;
|
---|
| 307 | *file << "\t\t\t" << getParams().getParameterName(MpqcParser_Parameters::basisParam) << " = $:basis" << endl;
|
---|
| 308 | *file << "\t\t\tmolecule = $:molecule" << endl;
|
---|
| 309 | *file << "\t\t\t" << getParams().getParameterName(MpqcParser_Parameters::memoryParam)
|
---|
| 310 | << " = " << getParams().getParameter(MpqcParser_Parameters::memoryParam) << endl;
|
---|
| 311 | *file << "\t\t)" << endl;
|
---|
| 312 | *file << "\t)" << endl;
|
---|
| 313 | } else if (theory == getParams().getTheoryName(MpqcParser_Parameters::MBPT2_R12)) {
|
---|
| 314 | *file << "\tmole<" << getParams().getParameter(MpqcParser_Parameters::theoryParam) << ">: (" << endl;
|
---|
| 315 | *file << "\t\tmolecule = $:molecule" << endl;
|
---|
| 316 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::basisParam) << " = $:basis" << endl;
|
---|
| 317 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::aux_basisParam) << " = $:abasis" << endl;
|
---|
| 318 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::stdapproxParam)
|
---|
| 319 | << " = \"" << getParams().getParameter(MpqcParser_Parameters::stdapproxParam) << "\"" << endl;
|
---|
| 320 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::nfzcParam)
|
---|
| 321 | << " = " << getParams().getParameter(MpqcParser_Parameters::nfzcParam) << endl;
|
---|
| 322 | *file << "\t\t" << getParams().getParameterName(MpqcParser_Parameters::memoryParam)
|
---|
| 323 | << " = " << getParams().getParameter(MpqcParser_Parameters::memoryParam) << endl;
|
---|
| 324 | *file << "\t\tintegrals<IntegralCints>:()" << endl;
|
---|
| 325 | *file << "\t\treference<CLHF>: (" << endl;
|
---|
| 326 | *file << "\t\t\tmolecule = $:molecule" << endl;
|
---|
| 327 | *file << "\t\t\t" << getParams().getParameterName(MpqcParser_Parameters::basisParam) << " = $:basis" << endl;
|
---|
| 328 | *file << "\t\t\tmaxiter = " << getParams().getParameter(MpqcParser_Parameters::maxiterParam) << endl;
|
---|
| 329 | *file << "\t\t\tmemory = " << getParams().getParameter(MpqcParser_Parameters::memoryParam) << endl;
|
---|
| 330 | *file << "\t\t\tintegrals<" << getParams().getParameter(MpqcParser_Parameters::integrationParam) << ">:()" << endl;
|
---|
| 331 | *file << "\t\t)" << endl;
|
---|
| 332 | *file << "\t)" << endl;
|
---|
| 333 | } else {
|
---|
[47d041] | 334 | ELOG(0, "Unknown level of theory requested for MPQC output file.");
|
---|
[1b2d30] | 335 | }
|
---|
| 336 | *file << ")" << endl;
|
---|
| 337 | *file << "molecule<Molecule>: (" << endl;
|
---|
| 338 | *file << "\tunit = " << (World::getInstance().getConfig()->GetIsAngstroem() ? "angstrom" : "bohr" ) << endl;
|
---|
| 339 | *file << "\t{ atoms geometry } = {" << endl;
|
---|
| 340 | // output of atoms
|
---|
[03a589] | 341 | BOOST_FOREACH(const atom *_atom, atoms) {
|
---|
| 342 | OutputMPQCLine(file, *_atom, ¢er);
|
---|
[1b2d30] | 343 | }
|
---|
| 344 | *file << "\t}" << endl;
|
---|
| 345 | *file << ")" << endl;
|
---|
| 346 | *file << "basis<GaussianBasisSet>: (" << endl;
|
---|
[ee50c1] | 347 | *file << "\tname = \"" << getParams().getParameter(MpqcParser_Parameters::basisParam) << "\"" << endl;
|
---|
[1b2d30] | 348 | *file << "\tmolecule = $:molecule" << endl;
|
---|
| 349 | *file << ")" << endl;
|
---|
[ee50c1] | 350 | if (theory == getParams().getTheoryName(MpqcParser_Parameters::MBPT2_R12)) {
|
---|
[f31edc] | 351 | *file << "% auxiliary basis set specification" << endl;
|
---|
| 352 | *file << "\tabasis<GaussianBasisSet>: (" << endl;
|
---|
[ee50c1] | 353 | *file << "\tname = \"" << getParams().getParameter(MpqcParser_Parameters::aux_basisParam) << "\"" << endl;
|
---|
[f31edc] | 354 | *file << "\tmolecule = $:molecule" << endl;
|
---|
| 355 | *file << ")" << endl;
|
---|
| 356 | }
|
---|
[1b2d30] | 357 | }
|
---|
| 358 | }
|
---|
| 359 |
|
---|
[963321a] | 360 |
|
---|