ergo
ergo_scripted.h
Go to the documentation of this file.
00001 /* Ergo, version 3.2, a program for linear scaling electronic structure
00002  * calculations.
00003  * Copyright (C) 2012 Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek.
00004  * 
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation, either version 3 of the License, or
00008  * (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  * 
00018  * Primary academic reference:
00019  * Kohn−Sham Density Functional Theory Electronic Structure Calculations 
00020  * with Linearly Scaling Computational Time and Memory Usage,
00021  * Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek,
00022  * J. Chem. Theory Comput. 7, 340 (2011),
00023  * <http://dx.doi.org/10.1021/ct100611z>
00024  * 
00025  * For further information about Ergo, see <http://www.ergoscf.org>.
00026  */
00027 
00028 #ifndef ERGO_SCRIPTED_HEADER
00029 #define ERGO_SCRIPTED_HEADER
00030 
00039 #ifdef __cplusplus
00040 #define EXTERN_C extern "C"
00041 #else
00042 #define EXTERN_C
00043 #endif
00044 
00045 extern int ergo_scanner_lineno;
00046 extern int ergo_scanner_reading_stdin;
00047 
00049 enum VarType { VAR_STRING, VAR_FLOAT, VAR_INT, VAR_LIST };
00050 
00052 struct variable {
00053   const char *name;
00054   const char *description;
00055   union {
00056     char   *str;
00057     double    num;
00058     int       vint;  
00059     struct variable *list;
00060   } v;
00061   enum VarType type;
00062   struct variable *next;
00063 };
00064 
00067 enum MolType { MOL_MAIN, MOL_GHOST };
00068 
00069 EXTERN_C void es_assign_num(struct variable *var, double val);
00070 EXTERN_C void es_assign_str(struct variable *var, const char*str);
00071 EXTERN_C int es_assign_range(enum MolType mt, int rangeNo,
00072                              int start, int cnt, const char *name);
00073 EXTERN_C struct variable *es_find_var(struct variable *root, const char *name);
00074 
00075 EXTERN_C void es_mol_begin(enum MolType moleculeClass);
00076 EXTERN_C void es_add_atom(const char *name, double x, double y, double z);
00077 EXTERN_C void es_mol_commit(void);
00078 EXTERN_C void es_mol_unit_angstrom(void);
00079 
00080 EXTERN_C int es_mol_read_molecule(const char *fname,
00081                                   enum MolType moleculeClass);
00082 
00083 EXTERN_C void es_print_help();
00084 EXTERN_C void es_print_help_var(const struct variable *root);
00085 EXTERN_C void es_print_precision();
00086 EXTERN_C int es_run(const char *mode, int save_pot);
00087 EXTERN_C void es_warranty(void);
00088 EXTERN_C int es_getexc(const char *mode, int modes);
00089 EXTERN_C int es_get_polarisability(const char *mode, const char *opname,
00090                                    double freq);
00091 
00092 EXTERN_C int es_set_nthreads(int nThreads);
00093 EXTERN_C int es_set_nthreads_string(const char *str);
00094 extern int es_quit;
00095 
00096 #endif /* ERGO_SCRIPTED_HEADER */