votca 2024.2-dev
Loading...
Searching...
No Matches
espfit.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_ESPFIT_H
22#define VOTCA_XTP_ESPFIT_H
23
24// Local VOTCA includes
25#include "classicalsegment.h"
26#include "logger.h"
27#include "qmfragment.h"
33namespace votca {
34namespace xtp {
35class Orbitals;
36class Grid;
37class QMState;
38class QMMolecule;
39
40class Espfit {
41 public:
42 Espfit(Logger& log) : log_(log) {
43 pairconstraint_.resize(0);
44 regionconstraint_.resize(0);
45 }
46
47 void setUseSVD(double conditionnumber) {
48 do_svd_ = true;
49 conditionnumber_ = conditionnumber;
50 }
51
52 void setPairConstraint(std::vector<std::pair<Index, Index> > pairconstraint) {
53 pairconstraint_ = pairconstraint;
54 }
55
56 void setRegionConstraint(std::vector<QMFragment<double> > regionconstraint) {
57 regionconstraint_ = regionconstraint;
58 }
59
60 StaticSegment Fit2Density(const Orbitals& orbitals, const QMState& state,
61 std::string gridsize);
62
63 private:
65 bool do_svd_ = true;
66 double conditionnumber_ = 1e-8;
67
68 std::vector<std::pair<Index, Index> > pairconstraint_; // pairconstraint[i]
69 // is all the
70 // atomindices which
71 // have the same
72 // charge
73
74 std::vector<QMFragment<double> > regionconstraint_;
75
76 void EvalNuclearPotential(const QMMolecule& atoms, Grid& grid);
77
78 // Fits partial charges to Potential on a grid, constrains net charge
79 StaticSegment FitPartialCharges(const Orbitals& orbitals, const Grid& grid,
80 double netcharge);
81};
82} // namespace xtp
83} // namespace votca
84
85#endif // VOTCA_XTP_ESPFIT_H
Espfit(Logger &log)
Definition espfit.h:42
std::vector< QMFragment< double > > regionconstraint_
Definition espfit.h:74
Logger & log_
Definition espfit.h:64
void setRegionConstraint(std::vector< QMFragment< double > > regionconstraint)
Definition espfit.h:56
StaticSegment FitPartialCharges(const Orbitals &orbitals, const Grid &grid, double netcharge)
Definition espfit.cc:124
std::vector< std::pair< Index, Index > > pairconstraint_
Definition espfit.h:68
void setUseSVD(double conditionnumber)
Definition espfit.h:47
StaticSegment Fit2Density(const Orbitals &orbitals, const QMState &state, std::string gridsize)
Definition espfit.cc:35
void setPairConstraint(std::vector< std::pair< Index, Index > > pairconstraint)
Definition espfit.h:52
double conditionnumber_
Definition espfit.h:66
void EvalNuclearPotential(const QMMolecule &atoms, Grid &grid)
Definition espfit.cc:105
Logger is used for thread-safe output of messages.
Definition logger.h:164
container for molecular orbitals
Definition orbitals.h:46
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
Definition qmstate.h:132
base class for all analysis tools
Definition basebead.h:33