24#include <boost/format.hpp>
60 mode_ = options.
get(
".mode").
as<std::string>();
61 if (
mode_ ==
"subtract") {
70 <<
"Reading serialized QM data from " <<
orbfile_ << std::flush;
88 <<
" Reading first cube from " <<
infile1_ << std::flush;
92 <<
" Reading second cube from " <<
infile2_ << std::flush;
102 out << s <<
" substraction\n";
113 bool do_amplitude =
false;
124 if (tempint != natoms) {
125 throw std::runtime_error(
"Atom numbers do not match");
128 if (tempdouble != xstart) {
129 throw std::runtime_error(
"Xstart does not match");
132 if (tempdouble != ystart) {
133 throw std::runtime_error(
"Ystart does not match");
136 if (tempdouble != zstart) {
137 throw std::runtime_error(
"Zstart does not match");
140 out << boost::format(
"%1$lu %2$f %3$f %4$f \n") % natoms % xstart % ystart %
165 if (tempint != xsteps) {
166 throw std::runtime_error(
"xsteps does not match");
169 if (tempdouble != xincr) {
170 throw std::runtime_error(
"xincr does not match");
175 if (tempint != ysteps) {
176 throw std::runtime_error(
"ysteps does not match");
180 if (tempdouble != yincr) {
181 throw std::runtime_error(
"yincr does not match");
185 if (tempint != zsteps) {
186 throw std::runtime_error(
"zsteps does not match");
191 if (tempdouble != zincr) {
192 throw std::runtime_error(
"zincr does not match");
195 out << boost::format(
"%1$d %2$f 0.0 0.0 \n") % xsteps % xincr;
196 out << boost::format(
"%1$d 0.0 %2$f 0.0 \n") % ysteps % yincr;
197 out << boost::format(
"%1$d 0.0 0.0 %2$f \n") % zsteps % zincr;
201 for (
Index iatom = 0; iatom < std::abs(natoms); iatom++) {
218 if (tempint != atnum) {
219 throw std::runtime_error(
"atnum does not match");
222 if (tempdouble != crg) {
223 throw std::runtime_error(
"crg does not match");
226 if (tempdouble != x) {
227 throw std::runtime_error(
"x does not match");
230 if (tempdouble != y) {
231 throw std::runtime_error(
"y does not match");
234 if (tempdouble != z) {
235 throw std::runtime_error(
"z does not match");
237 out << boost::format(
"%1$d %2$f %3$f %4$f %5$f\n") % atnum % crg % x % y %
248 if (tempint != ntotal) {
249 throw std::runtime_error(
"ntotal does not match");
252 if (tempint != nis) {
253 throw std::runtime_error(
"nis does not match");
255 out << boost::format(
" 1 %1$d \n") % nis;
260 for (
Index ix = 0; ix < xsteps; ix++) {
261 for (
Index iy = 0; iy < ysteps; iy++) {
263 for (
Index iz = 0; iz < zsteps; iz++) {
267 if (Nrecord == 6 || iz == zsteps - 1) {
268 out << boost::format(
"%1$E \n") % (val1 - val2);
271 out << boost::format(
"%1$E ") % (val1 - val2);
279 <<
"Wrote subtracted cube data to " <<
output_file_ << std::flush;
290 if (
mode_ ==
"new") {
292 }
else if (
mode_ ==
"subtract") {
void WriteFile(const std::string &filename, const Orbitals &orb, QMState state, bool dostateonly) const
void ParseOptions(const tools::Property &user_options)
Eigen::Array< Index, 3, 1 > steps_
void setReportLevel(Log::Level ReportLevel)
void setMultithreading(bool maverick)
void setCommonPreface(const std::string &preface)
container for molecular orbitals
void ReadFromCpt(const std::string &filename)
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
#define XTP_LOG(level, log)
base class for all analysis tools
static Level current_level