votca 2024.2-dev
Loading...
Searching...
No Matches
gridbox.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_GRIDBOX_H
22#define VOTCA_XTP_GRIDBOX_H
23
24// Local VOTCA includes
25#include "aoshell.h"
26#include "grid_containers.h"
27
28namespace votca {
29namespace xtp {
30
35class GridBox {
36
37 public:
38 void FindSignificantShells(const AOBasis& basis);
39 AOShell::AOValues CalcAOValues(const Eigen::Vector3d& point) const;
40
41 const std::vector<Eigen::Vector3d>& getGridPoints() const { return grid_pos; }
42
43 const std::vector<double>& getGridWeights() const { return weights; }
44
45 const std::vector<const AOShell*>& getShells() const {
46 return significant_shells;
47 }
48
49 const std::vector<GridboxRange>& getAOranges() const { return aoranges; }
50
51 Index size() const { return Index(grid_pos.size()); }
52
53 Index Shellsize() const { return Index(significant_shells.size()); }
54
55 Index Matrixsize() const { return matrix_size; }
56
57 void addGridBox(const GridBox& box) {
58 grid_pos.insert(grid_pos.end(), box.grid_pos.begin(), box.grid_pos.end());
59 weights.insert(weights.end(), box.weights.begin(), box.weights.end());
60 return;
61 }
62
64 grid_pos.push_back(point.grid_pos);
65 weights.push_back(point.grid_weight);
66 };
67
68 void addShell(const AOShell* shell) {
69 significant_shells.push_back(shell);
70 matrix_size += shell->getNumFunc();
71 };
72
74
75 Eigen::MatrixXd ReadFromBigMatrix(const Eigen::MatrixXd& bigmatrix) const;
76
77 Eigen::VectorXd ReadFromBigVector(const Eigen::VectorXd& bigvector) const;
78
79 void AddtoBigMatrix(Eigen::MatrixXd& bigmatrix,
80 const Eigen::MatrixXd& smallmatrix) const;
81
82 static bool compareGridboxes(GridBox& box1, GridBox& box2) {
83 if (box1.Matrixsize() != box2.Matrixsize()) {
84 return false;
85 }
86 if (box1.Shellsize() != box2.Shellsize()) {
87 return false;
88 }
89 for (Index i = 0; i < Index(box1.significant_shells.size()); ++i) {
90 if (box1.significant_shells[i] != box2.significant_shells[i]) {
91 return false;
92 }
93 }
94 return true;
95 }
96
97 private:
99 std::vector<GridboxRange> aoranges;
100 std::vector<GridboxRange> ranges;
101 std::vector<GridboxRange> inv_ranges;
102 std::vector<Eigen::Vector3d> grid_pos;
103 std::vector<const AOShell*> significant_shells;
104 std::vector<double> weights;
105};
106
107} // namespace xtp
108} // namespace votca
109#endif // VOTCA_XTP_GRIDBOX_H
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
Index getNumFunc() const
Definition aoshell.h:103
void PrepareForIntegration()
Definition gridbox.cc:92
const std::vector< Eigen::Vector3d > & getGridPoints() const
Definition gridbox.h:41
Eigen::MatrixXd ReadFromBigMatrix(const Eigen::MatrixXd &bigmatrix) const
Definition gridbox.cc:68
void AddtoBigMatrix(Eigen::MatrixXd &bigmatrix, const Eigen::MatrixXd &smallmatrix) const
Definition gridbox.cc:55
void addShell(const AOShell *shell)
Definition gridbox.h:68
void addGridBox(const GridBox &box)
Definition gridbox.h:57
std::vector< GridboxRange > inv_ranges
Definition gridbox.h:101
std::vector< double > weights
Definition gridbox.h:104
const std::vector< const AOShell * > & getShells() const
Definition gridbox.h:45
const std::vector< GridboxRange > & getAOranges() const
Definition gridbox.h:49
const std::vector< double > & getGridWeights() const
Definition gridbox.h:43
std::vector< const AOShell * > significant_shells
Definition gridbox.h:103
std::vector< Eigen::Vector3d > grid_pos
Definition gridbox.h:102
Eigen::VectorXd ReadFromBigVector(const Eigen::VectorXd &bigvector) const
Definition gridbox.cc:82
static bool compareGridboxes(GridBox &box1, GridBox &box2)
Definition gridbox.h:82
AOShell::AOValues CalcAOValues(const Eigen::Vector3d &point) const
Definition gridbox.cc:44
Index size() const
Definition gridbox.h:51
std::vector< GridboxRange > aoranges
Definition gridbox.h:99
Index Matrixsize() const
Definition gridbox.h:55
std::vector< GridboxRange > ranges
Definition gridbox.h:100
void FindSignificantShells(const AOBasis &basis)
Definition gridbox.cc:27
Index Shellsize() const
Definition gridbox.h:53
void addGridPoint(const GridContainers::Cartesian_gridpoint &point)
Definition gridbox.h:63
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26