votca 2024.2-dev
Loading...
Searching...
No Matches
couplingbase.cc
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// Local VOTCA includes
22#include "votca/xtp/aomatrix.h"
23
24namespace votca {
25namespace xtp {
26
28 const Orbitals& orbitalsAB) const {
29 AOBasis dftbasis = orbitalsAB.getDftBasis();
30 AOOverlap dftAOoverlap;
31 dftAOoverlap.Fill(dftbasis);
32 return dftAOoverlap.Matrix();
33}
34
36 const Orbitals& orbitalsB,
37 const Orbitals& orbitalsAB) const {
38 const QMMolecule& atomsA = orbitalsA.QMAtoms();
39 const QMMolecule& atomsB = orbitalsB.QMAtoms();
40 const QMMolecule& atomsAll = orbitalsAB.QMAtoms();
41 bool coordinates_agree = true;
42 for (Index i = 0; i < atomsAll.size(); i++) {
43 const QMAtom& dimer = atomsAll[i];
44 const QMAtom* monomer = nullptr;
45
46 if (i < atomsA.size()) {
47 monomer = &atomsA[i];
48 } else if (i < atomsB.size() + atomsA.size()) {
49 monomer = &atomsB[i - atomsA.size()];
50 } else {
51 // Linker
53 << (boost::format(
54 "Neither Monomer A nor Monomer B contains "
55 "atom %s on line %u. Hence, this atom is part of a linker.") %
56 dimer.getElement() % (i + 1))
57 .str()
58 << std::flush;
59 continue;
60 }
61
62 if (!monomer->getPos().isApprox(dimer.getPos(), 0.001)) {
63 coordinates_agree = false;
64 }
65
66 if (monomer->getElement() != dimer.getElement()) {
67 throw std::runtime_error(
68 "Atom types do not agree in dimer and monomers\n");
69 }
70 }
71
72 if (!coordinates_agree) {
74 << "======WARNING=======\n Coordinates of monomer "
75 "and dimer atoms do not agree"
76 << std::flush;
77 }
78}
79
80} // namespace xtp
81} // namespace votca
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
void Fill(const AOBasis &aobasis) final
const Eigen::MatrixXd & Matrix() const
Definition aomatrix.h:52
Eigen::MatrixXd CalculateOverlapMatrix(const Orbitals &orbitalsAB) const
void CheckAtomCoordinates(const Orbitals &orbitalsA, const Orbitals &orbitalsB, const Orbitals &orbitalsAB) const
container for molecular orbitals
Definition orbitals.h:46
const QMMolecule & QMAtoms() const
Definition orbitals.h:172
const AOBasis & getDftBasis() const
Definition orbitals.h:208
container for QM atoms
Definition qmatom.h:37
const Eigen::Vector3d & getPos() const
Definition qmatom.h:55
const std::string & getElement() const
Definition qmatom.h:63
#define XTP_LOG(level, log)
Definition logger.h:40
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26