votca 2024.1-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#include <boost/filesystem.hpp>
29
30// Local VOTCA includes
31#include "votca/xtp/gyration.h"
32#include "votca/xtp/logger.h"
33
34namespace votca {
35namespace xtp {
36
37class DensityAnalysis final : public QMTool {
38 public:
39 std::string Identify() const { return "densityanalysis"; }
40
41 protected:
42 void ParseOptions(const tools::Property& user_options);
43 bool Run();
44
45 private:
46 std::string orbfile_;
47 std::string output_file_;
49
51};
52
54
55 orbfile_ = options.ifExistsReturnElseReturnDefault<std::string>(
56 ".input", job_name_ + ".orb");
57
58 gyration_options_ = options;
59}
60
64
65 log_.setCommonPreface("\n... ...");
66
67 Orbitals orbitals;
69 << " Loading QM data from " << orbfile_ << std::flush;
70 orbitals.ReadFromCpt(orbfile_);
71
72 Density2Gyration density2gyration(log_);
73 density2gyration.Initialize(gyration_options_);
74 density2gyration.AnalyzeDensity(orbitals);
75
76 return true;
77}
78
79} // namespace xtp
80} // namespace votca
81
82#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:321
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
void setReportLevel(Log::Level ReportLevel)
Definition logger.h:185
void setMultithreading(bool maverick)
Definition logger.h:186
void setCommonPreface(const std::string &preface)
Definition logger.h:198
container for molecular orbitals
Definition orbitals.h:46
void ReadFromCpt(const std::string &filename)
Definition orbitals.cc:692
std::string job_name_
Definition qmtool.h:50
#define XTP_LOG(level, log)
Definition logger.h:40
base class for all analysis tools
Definition basebead.h:33
static Level current_level
Definition globals.h:30