104 " PROJECT_NAME ",
"SYSTEM",
105 "\n RUN_TYPE ",
"RUN",
106 "\n PRINT_LEVEL ",
"PRINT",
107 "\n WALLTIME ",
"CPU_TIME",
112 " RESTART_DEFAULT F\n"
113 " RESTART_FILE_NAME ",
"RESTART_FILE",
115 " RESTART_COUNTERS T\n"
116 " @IF ( ",
"RUN",
" == MOLECULAR_DYNAMICS )\n"
118 " RESTART_THERMOSTAT T\n"
120 " &END EXT_RESTART\n"
124 "! Always a FORCE_EVAL section that describes\n"
125 "! the method to compute energy and forces\n"
128 " METHOD QUICKSTEP\n"
130 "! First specify files that will be used thereafter \n"
131 " BASIS_SET_FILE_NAME ",
"BASIS_FILE",
132 "\n POTENTIAL_FILE_NAME ",
"PSEUDO_FILE",
133 "\n@IF ( ",
"USE_RESTART",
" == TRUE )\n"
134 " WFN_RESTART_FILE_NAME ",
"WAVE_FILE",
137 "\n! Going to the Multi-grids section\n"
139 " CUTOFF ",
"CUTOFF",
" ! => Cutoff of the finest grid level\n"
140 " NGRIDS ",
"GRIDS",
" ! => Number of multigrids to use, default = 4\n"
142 "! Going to the Quickstep Setup section\n"
144 " METHOD ",
"QS_METHOD",
145 "\n EPS_DEFAULT 1.0E-12 ! => Default value is 1.0E-10\n"
146 " MAP_CONSISTENT TRUE ! => This is the default value\n"},
147 {
" EXTRAPOLATION_ORDER 3 ! => This is the default value\n"
149 {
"! Going to the Self Consistent Field section\n"
151 "! Maximum number of cycle\n"
152 " SCF_GUESS ",
"SCF_GUESS",
" ! => Initial guess for the wave-function\n"
153 " MAX_SCF ",
"SCF_NCYCLES",
" ! => Maximum number of SCF cycles\n"
154 " EPS_SCF ",
"SCF_NCONV",
" ! => Threshold for the SCF convergence\n"
155 "! If after the ${SCF_NCYCLES} first SCF steps no convergence has been reached\n"
156 "! more SCF cycles can be done updating the preconditioner. \n"
157 "! Detail information is then presented in the 'Outer' SCF section\n"
159 " MAX_SCF ",
"SCF_OCYCLES",
" ! => We update the preconditioner and start a new SCF cycle\n"
160 " ! up to ${SCF_NCYCLES} x ${SCF_OCYCLES} can be computed\n"
161 " EPS_SCF ",
"SCF_OCONV",
" ! => Convergence threshold for the extra cycles\n"
162 " &END OUTER_SCF\n\n"
163 "! Going to the Orbital Transformation section\n"
165 " MINIMIZER ",
"OT_MINI",
166 "\n PRECONDITIONER FULL_ALL ! => Preconditioner for the minimization scheme,\n"
167 " ! FULL_ALL is the most effective state selective\n"
168 " ! preconditioner and is based on diagonalization\n"
169 " ENERGY_GAP 0.001 ! => Underestimated value of the Gap (HOMO-LUMO) in a.u.\n"
170 " ! to be used with the FULL_ALL preconditioner\n"
173 "! To tune the printing of the restart file\n"
175 " LOG_PRINT_KEY T ! => Printing on screen when restart file is written\n"
177 " QS_SCF 0 ! => Never write restart file(s) during the SCF cycle\n"},
179 " ADD_LAST NUMERIC\n"
183 "! Going to the exchange-correlation section\n"
185 " &XC_FUNCTIONAL ",
"FUNCTIONAL",
186 "\n &END XC_FUNCTIONAL\n"},
188 {
"! Spin polarized calculation\n"
189 " UKS ",
"SPIN_POLARIZED",
190 "\n MULTIPLICITY ",
"SPIN_MULTIPLICITY"},
193gchar *
qs_extrapo[2]={
" EXTRAPOLATION ASPC ! => ASPC recommended for MD, PS otherwise\n",
194 " EXTRAPOLATION PS ! => ASPC recommended for MD, PS otherwise\n"};
196gchar *
scf_wrestart[3][3]={{
"JUST_ENERGY ",
"OUT_STEPS",
" ! => Write restart file every ${OUT_STEPS} SCF steps\n"},
197 {
"GEO_OPT ",
"OUT_STEPS",
" ! => Write restart file every ${OUT_STEPS} GEO_OPT steps\n"},
198 {
"MD ",
"OUT_STEPS",
" ! => Write restart file every ${OUT_STEPS} MD steps\n"}};
214 "\n &END DEFINE_REGION"};
217 "\n TIMECON_LANGEVIN ",
223 "\n &END AD_LANGEVIN\n"},
237 " MINIMIZER ",
"GEO_MINI",
238 "\n MAX_ITER ",
"GEO_STEPS",
239 "\n MAX_FORCE ",
"GEO_CONV",
245 " GEO_OPT ",
"OUT_STEPS",
247 " ADD_LAST NUMERIC\n"
253 " GEO_OPT ",
"OUT_STEPS",
255 " ADD_LAST NUMERIC\n"
260 " ENSEMBLE ",
"MD_ENSEMBLE",
261 "\n STEPS ",
"MD_STEPS",
262 "\n TIMESTEP ",
"MD_DELTA_T",
263 "\n TEMPERATURE ",
"MD_TEMP"},
271 " ADD_LAST NUMERIC\n"
275 " FORMAT ",
"OUT_FORM",
276 "\n UNIT ",
"OUT_UNIT",
280 " ADD_LAST NUMERIC\n"
281 " &END TRAJECTORY\n\n"
284 " FORMAT ",
"OUT_FORM",
285 "\n UNIT ",
"OUT_UNIT",
289 " ADD_LAST NUMERIC\n"
295 "! Always a SUBSYS section that describes\n"
296 "! the chemistry and the periodicity of the system\n"
300 " PERIODIC ",
"PBC",
"\n"},
302 " &COORD",
"\n &END COORD\n"
306 "! Using an XYZ file, coordinates are always Cartesian and in angstrom\n"
308 " COORD_FILE_NAME ",
"COORD_FILE",
309 "\n &END TOPOLOGY\n"}};
311gchar *
cp2klat[2][19] = {{
" ABC ",
"A",
" ",
"B",
" ",
"C",
312 "\n ALPHA_BETA_GAMMA ",
"ALPHA",
" ",
"BETA",
" ",
"GAMMA",
313 "\n SYMMETRY ",
"SYM",
" ",
" ",
" ",
" ",
" "},
314 {
" A ",
"AX",
" ",
"AY",
" ",
"AZ",
315 "\n B ",
"BX",
" ",
"BY",
" ",
"BZ",
316 "\n C ",
"CX",
" ",
"CY",
" ",
"CZ",
"\n"}};
319 "@SET SPIN_MULTIPLICITY "};
322 "@SET ROKS_SCALING ",
323 "@SET ROKS_SPIN_CONFIG "};
325gchar *
cp2kroks[7] = {
" ROKS ",
"ROKS",
" ! => Restricted Open Kohn-Sham calculation\n"
327 " ENERGY_SCALING ",
"ROKS_SCALING",
328 "\n SPIN_CONFIGURATION ",
"ROKS_SPIN_CONFIG",
329 "\n &END LOW_SPIN_ROKS\n"};
336 "\n NLUMO ",
"NUM_LUMO",
337 "\n WRITE_CUBES ",
"CUBES",
346 " POTENTIAL_TYPE ",
"VDW_FCT",
349 " TYPE ",
"VDW_TYPE",
350 "\n CUTOFF ",
"VDW_CUTOFF",
351 "\n &END NON_LOCAL\n"},
353 " TYPE ",
"VDW_TYPE",
354 "\n R_CUTOFF ",
"VDW_CUTOFF",
355 "\n LONG_RANGE_CORRECTION ",
"VDW_LONG",
356 "\n &END PAIR_POTENTIAL\n"},
357 {
" &END VDW_POTENTIAL\n"}};
359gchar *
vdw_fct[2] = {
"NON_LOCAL",
"PAIR_POTENTIAL"};
361gchar *
cp2k_cons[2] = {
"\n &CONSTRAINT\n",
" &END CONSTRAINT\n"};
363gchar *
cp2k_fix[4] = {
" &FIXED_ATOMS\n COMPONENTS_TO_FIX ",
365 "\n &END FIXED_ATOMS\n"};
394 for (i=0; i<num; i++)
418 return g_strdup_printf (
"TRUE");
422 return g_strdup_printf (
"FALSE");
441 for (i=0; i<n_thermo; i++)
445 str = g_strdup_printf (
"\n! Thermostat N°%d", i+1);
454 if (thermo -> sys > 0)
458 if (thermo -> sys == 1)
461 for (j=0; j <
qm_proj-> nspec; j++)
463 for (k=0; k <
qm_proj-> natomes; k++)
468 for (m=0; m < thermo -> natoms; m++)
470 if (thermo -> list[m] == k)
472 str = g_strdup_printf (
" %d", l);
483 str = g_strdup_printf (
" MOL-%d", thermo -> natoms+1);
490 for (j=0; j<
v_thermo[1][thermo -> type]; j++)
493 if (thermo -> type == 4 && j != 2)
495 str = g_strdup_printf (
"%d", (
int)thermo -> params[j]);
499 str = g_strdup_printf (
"%f", thermo -> params[j]);
506 if (thermo -> next != NULL) thermo = thermo -> next;
521 gchar * intro =
"!\n"
522 "! Always a MOTION section that describes\n"
523 "! how to move the atoms\n"
538 gchar * fixec[7] = {
"X\n",
"Y\n",
"Z\n",
"XY\n",
"XZ\n",
"YZ\n",
"XYZ\n"};
539 int fixed[7][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {1, 1, 0}, {1, 0, 1}, {0, 1, 1}, {1, 1, 1}};
551 for (k=0; k<
tmp_cp2k -> fixat[i]; k++)
553 if (
tmp_cp2k -> fixcoord[i][k][0] == fixed[j][0] &&
554 tmp_cp2k -> fixcoord[i][k][1] == fixed[j][1] &&
555 tmp_cp2k -> fixcoord[i][k][2] == fixed[j][2])
573 for (k=0; k<
tmp_cp2k -> fixat[i]; k++)
575 if (
tmp_cp2k -> fixcoord[i][k][0] == fixed[j][0] &&
576 tmp_cp2k -> fixcoord[i][k][1] == fixed[j][1] &&
577 tmp_cp2k -> fixcoord[i][k][2] == fixed[j][2])
581 str = g_strdup_printf (
" %d",
tmp_cp2k -> fixlist[i][k]+1);
585 str = g_strdup_printf (
" MOL-%d",
tmp_cp2k -> fixlist[i][k]+1);
613 gchar * str = g_strdup_printf (
"\t%d\n# This file was prepared using %s",
qm_proj -> natomes, PACKAGE);
618 for (i=0; i<
qm_proj -> nspec; i++)
620 for (j=0; j<
qm_proj -> natomes; j++)
626 str = g_strdup_printf (
" %15.10lf %15.10lf %15.10lf",
667 print_info (
"! What follow is tricky and tests are recommended\n"
668 "! Atomic basis set and pseudo-potential must be provided for all chemical species\n"
669 "! the exact sequences '${BASIS_FOR_*}' '${POTENTIAL_FOR_*}' appear\n"
670 "! inside the files that contain respectively the basis sets and the pseudo-potentials\n"
671 "! in front of the name of the '*' element\n" , NULL, buffer);
672 for (i=0; i<
qm_proj -> nspec; i++)
703 gchar * fileinfo[5] = {
"! This file contains the restart information:",
704 "! This file contains the basis set(s):",
705 "! This file contains the pseudo-potential(s):",
706 "! This file contains the wave-function:",
707 "! This file contains the atomic coordinates in XYZ format:"};
749 str = g_strdup_printf (
"%f",
tmp_cp2k -> extra_opts[1][0]);
754 str = g_strdup_printf (
"%d", (
int)
tmp_cp2k -> extra_opts[1][1] + 1);
764 str = g_strdup_printf (
"%d", (
int)
tmp_cp2k -> extra_opts[2][j]);
785 str = g_strdup_printf (
"%f",
tmp_cp2k -> extra_opts[0][2]);
789 if (
tmp_cp2k -> extra_opts[0][0] == 1.0)
815 if ((
tmp_cp2k -> opts[i] == 1.0 && (j==0 || j==3)) || (j==1 || j==2))
print_info (
"\t\t! A file is required !",
"bold_red", buffer);
836 j = (i >
CP2SNO) ? i+7 : i+1;
838 str = g_strdup_printf (
"%d", (
int)
tmp_cp2k -> opts[i]);
869 j = (i >
CP2SCO) ? i+7 : i+1;
871 str = g_strdup_printf (
"%f",
tmp_cp2k -> opts[i]);
903 str = g_strdup_printf (
"%f",
qm_proj -> cell.box[0].param[k][j-3*k]);
918 str = g_strdup_printf (
"%f",
qm_proj -> cell.box[0].vect[k][j-3*k]);
932 for (j=0; j<
qm_proj -> nspec;j++)
938 if (
tmp_cp2k -> spec_data[j][0] > -1)
945 print_info (
"\t\t! A keyword is required !",
"bold_red", buffer);
952 if (
tmp_cp2k -> spec_data[j][1] > -1)
959 print_info (
"\t\t! A keyword is required !",
"bold_red", buffer);
984 print_info (
"! The mandatory FORCE_EVAL section include file\n", NULL, buffer);
993 print_info (
"! The mandatory MOTION section include file\n", NULL, buffer);
1025 print_info (
" LOG_PRINT_KEY T ! => Printing on screen when restart file is written\n", NULL, buffer);
1034 print_info (
" ADD_LAST NUMERIC\n", NULL, buffer);
1111 print_info (
"! The mandatory SUBSYS section include file\n", NULL, buffer);
1117 print_info (
"&END FORCE_EVAL\n", NULL, buffer);
1124 print_info (
"\n&END FORCE_EVAL\n", NULL, buffer);
1136 if (f == 5 || f == 6)
1138 for (i=0; i<
qm_proj -> nspec; i++)
1140 if (
tmp_cp2k -> spec_data[i][f-5] > -1)
Variable declarations for the MD input preparation assistants.
integer(kind=c_int) function chemistry()
Variable declarations for the creation of the CP2K input file(s)
gchar * get_nth_key(int sp, int id, int obj)
retrieve basis or pseudopotential key string for element from global list
gchar * get_nth_elem(int sp, int id, int obj)
retrieve basis or pseudopotential name string for element from global list
gchar * cp2k_vdw_keywords[2][3]
gchar * cp2k_default_keywords[11][11]
void print_cp2k(int f, GtkTextBuffer *buffer)
print the CP2K input file section
void print_variables_cp2k(GtkTextBuffer *buffer)
print the list of the CP2K input variables
void print_thermostat_cp2k(int n_thermo, GtkTextBuffer *buffer)
print CP2K thermostat(s) information
gchar * scf_wrestart[3][3]
int v_thermo[2][CP2NTHERM]
void print_coord_cp2k(GtkTextBuffer *buffer)
print atomic coordinates in CP2K input format
void print_cp2k_print(gchar *spaces, gchar *info, int i, int j, GtkTextBuffer *buffer)
print CP2K input file PRINT section content
void print_motion_cp2k(int m, GtkTextBuffer *buffer)
print the CP2K input MOTION section
gchar * cp2kmotion[4][15]
void print_cp2k_var(gchar *var, GtkTextBuffer *buffer)
print a CP2K variable name
void print_global_cp2k(GtkTextBuffer *buffer)
print the CP2K input file GLOBAL section
void print_var_section(int num, gchar **section, GtkTextBuffer *buffer)
print CP2K input file variable section
gchar * cp2kbool(double opt)
print CP2K boolean
gchar * thermo_type[4][5]
void print_subsys_cp2k(GtkTextBuffer *buffer)
print the CP2K input SUBSYS section
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
Global variable declarations Global convenience function declarations Global data structure defin...
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
gchar * exact_name(gchar *name)
short cut to print string without spaces
Messaging function declarations.
gboolean append(atom_search *asearch, project *this_proj, int i, int j)
test if the atom 'i' of species 'j' must be added to the tree store or not