votca 2024.2-dev
Loading...
Searching...
No Matches
ecpbasisset.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_ECPBASISSET_H
22#define VOTCA_XTP_ECPBASISSET_H
23
24// Local VOTCA includes
25#include "basisset.h"
26
27namespace votca {
28namespace xtp {
29
31 public:
32 ECPGaussianPrimitive(Index power, double decay, double contraction)
33 : power_(power), decay_(decay), contraction_(contraction) {
34 ;
35 }
36
38 double decay_;
40};
41
42class ECPShell {
43
44 public:
45 ECPShell(L l) : l_(l) { ; }
46 L getL() const { return l_; }
47
48 Index getnumofFunc() const { return NumFuncShell(l_); }
49
50 Index getOffset() const { return OffsetFuncShell(l_); }
51
52 Index getSize() const { return gaussians_.size(); }
53
54 std::vector<ECPGaussianPrimitive>::const_iterator begin() const {
55 return gaussians_.begin();
56 }
57 std::vector<ECPGaussianPrimitive>::const_iterator end() const {
58 return gaussians_.end();
59 }
60
61 // adds a Gaussian of a pseudopotential
62 ECPGaussianPrimitive& addGaussian(Index power, double decay,
63 double contraction);
64
65 friend std::ostream& operator<<(std::ostream& out, const ECPShell& shell);
66
67 private:
69 // vector of pairs of decay constants and contraction coefficients
70 std::vector<ECPGaussianPrimitive> gaussians_;
71};
72
73/*
74 * A collection of shells associated with a specific element
75 */
77 public:
78 ECPElement(std::string type, L lmax, Index ncore)
79 : type_(type), lmax_(lmax), ncore_(ncore) {
80 ;
81 }
82 using ECPShellIterator = std::vector<ECPShell>::const_iterator;
83 ECPShellIterator begin() const { return shells_.begin(); }
84 ECPShellIterator end() const { return shells_.end(); }
85
86 const std::string& getType() const { return type_; }
87
88 L getLmax() const { return lmax_; }
89
90 Index getNcore() const { return ncore_; }
91
93 shells_.push_back(ECPShell(l));
94 return shells_.back();
95 }
96
97 Index NumOfShells() const { return shells_.size(); }
98
99 friend std::ostream& operator<<(std::ostream& out, const ECPElement& element);
100
101 private:
102 std::string type_;
103 // applies to the highest angular momentum lmax
105 // replaces ncore electrons
107
108 std::vector<ECPShell> shells_;
109};
110
111/*
112 * A collection of elements and shells forms the basis set
113 */
115 public:
116 void Load(const std::string& name);
117
118 ECPElement& addElement(std::string elementType, L lmax, Index ncore);
119
120 const ECPElement& getElement(std::string element_type) const;
121
122 std::map<std::string, std::shared_ptr<ECPElement> >::iterator begin() {
123 return elements_.begin();
124 }
125 std::map<std::string, std::shared_ptr<ECPElement> >::iterator end() {
126 return elements_.end();
127 }
128
129 const std::string& Name() const { return name_; }
130
131 std::map<std::string, std::shared_ptr<ECPElement> >::const_iterator begin()
132 const {
133 return elements_.begin();
134 }
135 std::map<std::string, std::shared_ptr<ECPElement> >::const_iterator end()
136 const {
137 return elements_.end();
138 }
139
140 friend std::ostream& operator<<(std::ostream& out, const ECPBasisSet& basis);
141
142 private:
143 std::string name_;
144 std::map<std::string, std::shared_ptr<ECPElement> > elements_;
145};
146
147} // namespace xtp
148} // namespace votca
149
150#endif // VOTCA_XTP_ECPBASISSET_H
std::map< std::string, std::shared_ptr< ECPElement > >::const_iterator end() const
std::map< std::string, std::shared_ptr< ECPElement > >::iterator begin()
ECPElement & addElement(std::string elementType, L lmax, Index ncore)
const std::string & Name() const
friend std::ostream & operator<<(std::ostream &out, const ECPBasisSet &basis)
void Load(const std::string &name)
std::map< std::string, std::shared_ptr< ECPElement > > elements_
std::map< std::string, std::shared_ptr< ECPElement > >::iterator end()
const ECPElement & getElement(std::string element_type) const
std::map< std::string, std::shared_ptr< ECPElement > >::const_iterator begin() const
ECPShellIterator begin() const
Definition ecpbasisset.h:83
std::vector< ECPShell >::const_iterator ECPShellIterator
Definition ecpbasisset.h:82
std::vector< ECPShell > shells_
friend std::ostream & operator<<(std::ostream &out, const ECPElement &element)
ECPShell & addShell(L l)
Definition ecpbasisset.h:92
Index getNcore() const
Definition ecpbasisset.h:90
const std::string & getType() const
Definition ecpbasisset.h:86
Index NumOfShells() const
Definition ecpbasisset.h:97
ECPShellIterator end() const
Definition ecpbasisset.h:84
ECPElement(std::string type, L lmax, Index ncore)
Definition ecpbasisset.h:78
ECPGaussianPrimitive(Index power, double decay, double contraction)
Definition ecpbasisset.h:32
std::vector< ECPGaussianPrimitive >::const_iterator begin() const
Definition ecpbasisset.h:54
std::vector< ECPGaussianPrimitive >::const_iterator end() const
Definition ecpbasisset.h:57
ECPGaussianPrimitive & addGaussian(Index power, double decay, double contraction)
Index getSize() const
Definition ecpbasisset.h:52
Index getOffset() const
Definition ecpbasisset.h:50
std::vector< ECPGaussianPrimitive > gaussians_
Definition ecpbasisset.h:70
friend std::ostream & operator<<(std::ostream &out, const ECPShell &shell)
Index getnumofFunc() const
Definition ecpbasisset.h:48
Index NumFuncShell(L l)
Definition basisset.cc:100
Index OffsetFuncShell(L l)
Definition basisset.cc:80
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26