31 assert(!type.empty() &&
"Shelltype must be non empty!");
32 assert(type.size() == 1 &&
"Shelltype size must be one");
33 const char t = type.back();
41 }
else if (type ==
'P') {
43 }
else if (type ==
'D') {
45 }
else if (type ==
'F') {
47 }
else if (type ==
'G') {
49 }
else if (type ==
'H') {
51 }
else if (type ==
'I') {
54 throw std::runtime_error(
"FindLmax: Shelltype '" + std::string(1, type) +
104 return (lindex + 1) * (lindex + 2) / 2;
128 if (shelltype.empty()) {
131 std::vector<char> allowed_shells = {
'S',
'P',
'D',
'F',
'G',
'H',
'I'};
132 std::vector<char>::iterator it =
133 std::find(allowed_shells.begin(), allowed_shells.end(), shelltype[0]);
134 if (it == allowed_shells.end()) {
137 Index index = std::distance(allowed_shells.begin(), it);
138 for (
Index i = 1; i <
Index(shelltype.size()); i++) {
139 if (index + i >
Index(allowed_shells.size()) ||
140 shelltype[i] != allowed_shells[index + i]) {
154 if (name.find(
".xml") != std::string::npos) {
162 std::vector<tools::Property*> elementProps =
163 basis_property.
Select(
"basis.element");
166 std::string elementName = elementProp->getAttribute<std::string>(
"name");
168 std::vector<tools::Property*> shellProps = elementProp->Select(
"shell");
170 std::string shellType = shellProp->getAttribute<std::string>(
"type");
172 throw std::runtime_error(
"Shelltype: '" + shellType +
173 "' is not a valid shelltype!");
175 for (
char subtype : shellType) {
177 double shellScale = shellProp->getAttribute<
double>(
"scale");
180 std::vector<tools::Property*> constProps =
181 shellProp->Select(
"constant");
183 double decay = constProp->getAttribute<
double>(
"decay");
184 std::vector<tools::Property*> contrProps =
185 constProp->Select(
"contractions");
186 double contraction = 0.0;
188 std::string contrType =
189 contrProp->getAttribute<std::string>(
"type");
190 if (contrType != std::string(1, subtype)) {
193 contraction = contrProp->getAttribute<
double>(
"factor");
195 shell.addGaussian(decay, contraction);
207 throw std::runtime_error(
"Inserting element into basisset failed!");
209 return e.first->second;
213 std::map<std::string, Element>::const_iterator itm =
216 throw std::runtime_error(
"Basis set " +
name_ +
217 " does not have element of type " + element_type);
226 for (
const auto& gaussian : shell.
gaussians_) {
227 out <<
" Gaussian Decay: " << gaussian.decay();
228 out <<
" Contraction: " << gaussian.contraction();
235 out <<
"Element:" << element.getType() <<
"\n";
236 for (
const auto& shell : element) {
243 out <<
"BasisSet:" << basis.
name_ <<
"\n";
244 for (
const auto& element : basis) {
245 out << element.second;
const Element & getElement(std::string element_type) const
void Load(const std::string &name)
std::map< std::string, Element > elements_
Element & addElement(std::string elementType)
GaussianPrimitive & addGaussian(double decay, double contraction)
std::vector< GaussianPrimitive > gaussians_
Index getnumofFunc() const
std::string EnumToString(L l)
bool CheckShellType(const std::string &shelltype)
Index OffsetFuncShell(L l)
Index NumFuncShell_cartesian(L l)
L StringToEnum(const std::string &type)
Index OffsetFuncShell_cartesian(L l)
base class for all analysis tools