104 bool diff2gs)
const {
106 throw std::runtime_error(
".orb file does not contain a basisset name");
111 std::ofstream outFile(basename +
".fchk");
113 if (outFile.is_open()) {
115 <<
"Start writing to " << (basename +
".fchk") << std::flush;
118 outFile << basename <<
", fchk created by VOTCA-XTP\n";
122 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Number of atoms" %
"I" % orbitals.
QMAtoms().
size();
123 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Charge" %
"I" % 0;
124 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Multiplicity" %
"I" % 1;
128 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Number of basis functions" %
"I" % basis.
AOBasisSize();
129 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Number of independent functions" %
"I" % basis.
AOBasisSize();
132 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
"Atomic numbers" %
"I" %
135 for (
const auto& atom : orbitals.
QMAtoms()) {
136 outFile << boost::format(
"%12d") % atom.getElementNumber();
137 if (temp_int % 6 == 0) {
142 outFile << ((temp_int - 1) % 6 == 0 ?
"" :
"\n");
144 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
"Nuclear charges" %
"R" %
147 for (
const auto& atom : orbitals.
QMAtoms()) {
148 outFile << boost::format(
"%16.8e") % (double)atom.getNuccharge();
149 if (temp_int % 5 == 0) {
154 outFile << ((temp_int - 1) % 5 == 0 ?
"" :
"\n");
156 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
157 "Current cartesian coordinates" %
"R" %
158 (3 * orbitals.
QMAtoms().size());
160 for (
const auto& atom : orbitals.
QMAtoms()) {
161 for (
int i = 0; i < 3; ++i) {
162 outFile << boost::format(
"%16.8e") % atom.getPos()(i);
163 if (temp_int % 5 == 0) {
169 outFile << ((temp_int - 1) % 5 == 0 ?
"" :
"\n");
171 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Number of primitive shells" %
174 outFile << boost::format(
"%-43s%-2s%15d\n") %
177 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Pure/Cartesian d shells " %
180 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Pure/Cartesian f shells " %
183 outFile << boost::format(
"%-43s%-2s%15d\n") %
"Highest angular momentum " %
186 outFile << boost::format(
"%-43s%-2s%15d\n") %
187 "Largest degree of contraction " %
"I" % basis.
getMaxNprim();
189 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
"Shell types" %
"I" %
192 for (
const auto& shell : basis) {
193 outFile << boost::format(
"%12d") %
toGaussianL(shell.getL());
194 if (temp_int % 6 == 0) {
199 outFile << ((temp_int - 1) % 6 == 0 ?
"" :
"\n");
201 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
202 "Number of primitives per shell" %
"I" %
203 (basis.getNumofShells());
205 for (
const AOShell& shell : basis) {
206 outFile << boost::format(
"%12d") % shell.getSize();
207 if (temp_int % 6 == 0) {
212 outFile << ((temp_int - 1) % 6 == 0 ?
"" :
"\n");
214 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
"Shell to atom map" %
215 "I" % (basis.getNumofShells());
217 for (
const AOShell& shell : basis) {
219 outFile << boost::format(
"%12d") % (shell.getAtomIndex() + 1);
220 if (temp_int % 6 == 0) {
225 outFile << ((temp_int - 1) % 6 == 0 ?
"" :
"\n");
227 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
"Primitive exponents" %
228 "R" % basis.getNumberOfPrimitives();
230 for (
const AOShell& shell : basis) {
232 outFile << boost::format(
"%16.8e") % prim.getDecay();
233 if (temp_int % 5 == 0) {
239 outFile << ((temp_int - 1) % 5 == 0 ?
"" :
"\n");
241 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
242 "Contraction coefficients" %
"R" %
243 basis.getNumberOfPrimitives();
245 for (
const AOShell& shell : basis) {
247 outFile << boost::format(
"%16.8e") % prim.getContraction();
248 if (temp_int % 5 == 0) {
254 outFile << ((temp_int - 1) % 5 == 0 ?
"" :
"\n");
256 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
257 "Coordinates of each shell" %
"R" %
258 (3 * basis.getNumofShells());
260 for (
const AOShell& shell : basis) {
261 for (
int i = 0; i < 3; ++i) {
262 outFile << boost::format(
"%16.8e") % shell.getPos()(i);
263 if (temp_int % 5 == 0) {
269 outFile << ((temp_int - 1) % 5 == 0 ?
"" :
"\n");
271 outFile << boost::format(
"%-43s%-2s%22.15e\n") %
"Total Energy" %
"R" %
274 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
275 "Alpha Orbital Energies" %
"R" %
278 for (
Index i = 0; i < orbitals.
MOs().eigenvalues().size(); ++i) {
279 outFile << boost::format(
"%16.8e") % orbitals.
MOs().
eigenvalues()[i];
280 if (temp_int % 5 == 0) {
285 outFile << ((temp_int - 1) % 5 == 0 ?
"" :
"\n");
287 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
"Alpha MO coefficients" %
289 (orbitals.
MOs().eigenvalues().size() *
293 outFile << boost::format(
"%-43s%-2s N= %10d\n") %
"Total SCF Density" %
295 ((orbitals.
MOs().eigenvalues().size() *