votca 2024.2-dev
Loading...
Searching...
No Matches
qmatom.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2023 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_QMATOM_H
22#define VOTCA_XTP_QMATOM_H
23
24// VOTCA includes
25#include "eigen.h"
27#include <votca/tools/types.h>
28
29namespace votca {
30namespace xtp {
31class CptTable;
37class QMAtom {
38 friend class ECPAOBasis;
39
40 public:
41 struct data {
43 char* element;
44 double x;
45 double y;
46 double z;
49 };
50
51 QMAtom(Index index, std::string element, Eigen::Vector3d pos);
52
53 QMAtom(const data& d);
54
55 const Eigen::Vector3d& getPos() const { return pos_; }
56
57 void Translate(const Eigen::Vector3d& shift) { pos_ += shift; }
58
59 void Rotate(const Eigen::Matrix3d& R, const Eigen::Vector3d& refPos);
60
61 void setPos(const Eigen::Vector3d& position) { pos_ = position; }
62
63 const std::string& getElement() const { return element_; }
64
65 Index getId() const { return index_; }
66
67 void setID(const Index index) { index_ = index; }
68
70
71 Index getElementNumber() const { return nuccharge_; }
72
73 std::string identify() const { return "qmatom"; }
74
75 friend std::ostream& operator<<(std::ostream& out, const QMAtom& atom) {
76 out << atom.getId() << " " << atom.getElement();
77 out << " " << atom.getPos().x() << "," << atom.getPos().y() << ","
78 << atom.getPos().z() << " " << atom.getNuccharge() << "\n";
79 return out;
80 }
81
82 private:
84 std::string element_;
85 Eigen::Vector3d pos_; // Bohr
87 Index ecpcharge_ = 0; // ecp charge is set in ecpaobasis.fill
88
89 public:
90 static void SetupCptTable(CptTable& table);
91
92 void WriteData(data& d) const;
93
94 void ReadData(const data& d);
95};
96} // namespace xtp
97} // namespace votca
98
99#endif // VOTCA_XTP_QMATOM_H
Container to hold ECPs for all atoms.
Definition ecpaobasis.h:43
container for QM atoms
Definition qmatom.h:37
friend std::ostream & operator<<(std::ostream &out, const QMAtom &atom)
Definition qmatom.h:75
std::string element_
Definition qmatom.h:84
const Eigen::Vector3d & getPos() const
Definition qmatom.h:55
void Translate(const Eigen::Vector3d &shift)
Definition qmatom.h:57
Eigen::Vector3d pos_
Definition qmatom.h:85
Index getElementNumber() const
Definition qmatom.h:71
void setPos(const Eigen::Vector3d &position)
Definition qmatom.h:61
void WriteData(data &d) const
Definition qmatom.cc:50
Index getId() const
Definition qmatom.h:65
const std::string & getElement() const
Definition qmatom.h:63
void Rotate(const Eigen::Matrix3d &R, const Eigen::Vector3d &refPos)
Definition qmatom.cc:34
static void SetupCptTable(CptTable &table)
Definition qmatom.cc:40
std::string identify() const
Definition qmatom.h:73
Index getNuccharge() const
Definition qmatom.h:69
void ReadData(const data &d)
Definition qmatom.cc:60
QMAtom(Index index, std::string element, Eigen::Vector3d pos)
Definition qmatom.cc:26
void setID(const Index index)
Definition qmatom.h:67
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26