votca 2026-dev
Loading...
Searching...
No Matches
densityanalysis.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_DENSITYANALYSIS_H
22#define VOTCA_XTP_DENSITYANALYSIS_H
23
24// Standard includes
25#include <cstdio>
26
27// Third party includes
28
29// Local VOTCA includes
30#include "votca/xtp/gyration.h"
31#include "votca/xtp/logger.h"
32
33namespace votca {
34namespace xtp {
35
36class DensityAnalysis final : public QMTool {
37 public:
38 std::string Identify() const { return "densityanalysis"; }
39
40 protected:
41 void ParseOptions(const tools::Property& user_options);
42 bool Run();
43
44 private:
45 std::string orbfile_;
46 std::string output_file_;
48
50};
51
53
54 orbfile_ = options.ifExistsReturnElseReturnDefault<std::string>(
55 ".input", job_name_ + ".orb");
56
57 gyration_options_ = options;
58}
59
61 log_.setReportLevel(Log::current_level);
62 log_.setMultithreading(true);
63
64 log_.setCommonPreface("\n... ...");
65
66 Orbitals orbitals;
68 << " Loading QM data from " << orbfile_ << std::flush;
69 orbitals.ReadFromCpt(orbfile_);
70
71 Density2Gyration density2gyration(log_);
72 density2gyration.Initialize(gyration_options_);
73 density2gyration.AnalyzeDensity(orbitals);
74
75 return true;
76}
77
78} // namespace xtp
79} // namespace votca
80
81#endif // VOTCA_XTP_DENSITYANALYSIS_H
class to manage program options with xml serialization functionality
Definition property.h:55
T ifExistsReturnElseReturnDefault(const std::string &key, T defaultvalue) const
Definition property.h:332
void Initialize(tools::Property &options)
Definition gyration.cc:35
void AnalyzeDensity(const Orbitals &orbitals)
Definition gyration.cc:44
tools::Property gyration_options_
void ParseOptions(const tools::Property &user_options)
std::string Identify() const
Calculator name.
Logger is used for thread-safe output of messages.
Definition logger.h:164
Container for molecular orbitals and derived one-particle data.
Definition orbitals.h:47
void ReadFromCpt(const std::string &filename)
Read the orbital container from a checkpoint file on disk.
Definition orbitals.cc:1215
std::string job_name_
Definition qmtool.h:50
#define XTP_LOG(level, log)
Definition logger.h:40
Provides a means for comparing floating point numbers.
Definition basebead.h:33
static Level current_level
Definition globals.h:30