1 /* Ergo, version 3.8, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2019 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4  * and Anastasia Kruchinina.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Primary academic reference:
20  * Ergo: An open-source program for linear-scaling electronic structure
21  * calculations,
22  * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23  * Kruchinina,
24  * SoftwareX 7, 107 (2018),
25  * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26  *
27  * For further information about Ergo, see <http://www.ergoscf.org>.
28  */
29 
30 /** @file basisset.h
31 
32     \brief Code for representing basis set information for Gaussian
33     basis sets, and for parsing a text file specifying such a
34     basisset.
35 
36     @author: Elias Rudberg <em>responsible</em>.
37 */
38 
39 /* -*-mode:c; c-style:k&r; c-basic-offset:4; indent-tabs-mode: nil -*- */
40 #ifndef BASISSET_HEADER
41 #define BASISSET_HEADER
42 
43 #include <vector>
44 #include "realtype.h"
45 #include "polydegree.h"
46 
47 #define MAX_NO_OF_ATOM_TYPES 100
48 
49 #ifndef BASIS_FUNC_POLY_MAX_DEGREE
50 #error The constant BASIS_FUNC_POLY_MAX_DEGREE must be defined.
51 #endif
52 #if BASIS_FUNC_POLY_MAX_DEGREE<6
53 #define MAX_NO_OF_SHELLS_PER_ATOM 44
54 #else
55 #define MAX_NO_OF_SHELLS_PER_ATOM 88
56 #endif
57 
58 #define MAX_NO_OF_CONTR 44
59 
60 typedef struct
61 {
62   int type;
63   int contrCount;
64   int shell_ID;
65   ergo_real exponentList[MAX_NO_OF_CONTR];
66   ergo_real coeffList[MAX_NO_OF_CONTR];
67 } basisset_shell_struct;
68 
69 typedef struct
70 {
71   int noOfShells;
72   basisset_shell_struct shells[MAX_NO_OF_SHELLS_PER_ATOM];
73 } basisset_atom_struct;
74 
75 struct basisset_info {
76   std::vector<basisset_atom_struct> atoms;
77   basisset_info();
78   void clear();
79   // Stuff needed for Chunks&Tasks usage
80   void write_to_buffer ( char * dataBuffer, size_t const bufferSize ) const;
81   size_t get_size() const;
82   void assign_from_buffer ( char const * dataBuffer, size_t const bufferSize);
83 };
84 
85 int read_basisset_file(basisset_info & result,
86 		       const char* fileName,
87 		       int dirc,
88 		       const char *dirv[],
89 		       int print_raw);
90 
91 
92 #endif
93