atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
cp2k_print.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2026 by CNRS and University of Strasbourg */
15
21
22/*
23* This file: 'cp2k_print.c'
24*
25* Contains:
26*
27
28 - The functions to print the CP2K input file(s)
29
30*
31* List of functions:
32
33 gchar * cp2kbool (double opt);
34
35 void print_cp2k_var (gchar * var, GtkTextBuffer * buffer);
36 void print_var_section (int num, gchar ** section, int i18p, int * i18pos, GtkTextBuffer * buffer);
37 void print_thermostat_cp2k (int n_thermo, GtkTextBuffer * buffer);
38 void print_motion_cp2k (int m, GtkTextBuffer * buffer);
39 void print_coord_cp2k (GtkTextBuffer * buffer);
40 void print_subsys_cp2k (GtkTextBuffer * buffer);
41 void print_variables_cp2k (GtkTextBuffer * buffer);
42 void print_global_cp2k (GtkTextBuffer * buffer);
43 void print_cp2k_print (gchar * spaces, gchar * info, int i, int j, GtkTextBuffer * buffer);
44 void print_cp2k (int f, GtkTextBuffer * buffer);
45
46*/
47
48#include "global.h"
49#include "interface.h"
50#include "calc.h"
51#include "cp2k.h"
52
53gchar * globopts[49] = {"@SET SYSTEM ", // 0 | - char
54 "@SET RUN ", // 1 | 0 - char(int)
55 "@SET CPU_TIME ", // 2 | 1 - int
56 "@SET PRINT ", // 3 | 2 - char(int)
57 "@SET USE_RESTART ", // 4 | 3 - bool(int)
58 "@SET RESTART_FILE ", // 5 | 4 - char
59 "@SET BASIS_FILE ", // 6 | 5 - char
60 "@SET PSEUDO_FILE ", // 7 | 6 - char
61 "@SET WAVE_FILE ", // 8 | 7 - char
62 "@SET CHARGE ", // 9 | 8 - int
63 "@SET CUTOFF ", // 10 | 9 - double
64 "@SET GRIDS ", // 11 | 10 - int
65 "@SET QS_METHOD ", // 12 | 11 - char(int)
66 "@SET SCF_GUESS ", // 13 | 12 - char(int)
67 "@SET SCF_NCYCLES ", // 13 | 13 - int
68 "@SET SCF_NCONV ", // 14 | 14 - double
69 "@SET SCF_OCYCLES ", // 16 | 15 - int
70 "@SET SCF_OCONV ", // 17 | 16 - double
71 "@SET OT_MINI ", // 18 | 17 - char(int)
72 "@SET FUNCTIONAL ", // 19 | 18 - char(int)
73 "@SET PBC ", // 20 | 29 - char(int)
74 "@SET SYM ", // 21 | 31 - int
75 "@SET A ", // 22 | - double
76 "@SET B ", // 23 | - double
77 "@SET C ", // 24 | - double
78 "@SET ALPHA ", // 25 | - double
79 "@SET BETA ", // 26 | - double
80 "@SET GAMMA ", // 27 | - double
81 "@SET AX ", // 28 | - double
82 "@SET AY ", // 29 | - double
83 "@SET AZ ", // 30 | - double
84 "@SET BX ", // 31 | - double
85 "@SET BY ", // 32 | - double
86 "@SET BZ ", // 33 | - double
87 "@SET CX ", // 34 | - double
88 "@SET CY ", // 35 | - double
89 "@SET CZ ", // 36 | - double
90 "@SET COORD_FILE ", // 37 | - char
91 "@SET MD_ENSEMBLE ", // 38 | 32 - char(int)
92 "@SET MD_STEPS ", // 39 | 34 - int
93 "@SET MD_DELTA_T ", // 40 | 35 - double
94 "@SET MD_TEMP ", // 41 | 36 - double
95 "@SET GEO_MINI ", // 42 | 37 - char(int)
96 "@SET GEO_STEPS ", // 43 | 38 - int
97 "@SET GEO_CONV ", // 44 | 39 - double
98 "@SET OUT_STEPS ", // 45 | 40 - int
99 "@SET OUT_UNIT ", // 46 | 42 - char(int)
100 "@SET OUT_FORM ", // 47 | XYZ
101 "@SET OUT_UNIT "};// 48 | Angstrom
102
103gchar * cp2kglobal[9] = {"&GLOBAL\n"
104 " PROJECT_NAME ","SYSTEM",
105 "\n RUN_TYPE ","RUN",
106 "\n PRINT_LEVEL ","PRINT",
107 "\n WALLTIME ","CPU_TIME",
108 "\n&END GLOBAL\n"};
109
110gchar * cp2krestart[7] = {"@IF ( ","USE_RESTART"," == TRUE )\n"
111 " &EXT_RESTART ON\n"
112 " RESTART_DEFAULT F\n"
113 " RESTART_FILE_NAME ","RESTART_FILE",
114 "\n RESTART_POS T\n"
115 " RESTART_COUNTERS T\n"
116 " @IF ( ","RUN"," == MOLECULAR_DYNAMICS )\n"
117 " RESTART_VEL T\n"
118 " RESTART_THERMOSTAT T\n"
119 " @ENDIF\n"
120 " &END EXT_RESTART\n"
121 "@ENDIF\n"};
122
123gchar * cp2kfev[8][17] = {{i18n("!\n"
124 "! Always a FORCE_EVAL section that describes\n"
125 "! the method to compute energy and forces\n"
126 "!\n"
127 "&FORCE_EVAL\n"
128 " METHOD QUICKSTEP\n"
129 " &DFT\n"
130 "! First specify files that will be used thereafter \n"
131 " BASIS_SET_FILE_NAME "),
132 "BASIS_FILE",
133 "\n POTENTIAL_FILE_NAME ", "PSEUDO_FILE",
134 "\n@IF ( ","USE_RESTART"," == TRUE )\n"
135 " WFN_RESTART_FILE_NAME ","WAVE_FILE",
136 "\n@ENDIF\n"
137 " CHARGE ","CHARGE",
138 i18n("\n! Going to the Multi-grids section\n"
139 " &MGRID\n"
140 " CUTOFF "),
141 "CUTOFF",
142 i18n(" ! => Cutoff of the finest grid level\n"
143 " NGRIDS "),
144 "GRIDS",
145 i18n(" ! => Number of multigrids to use, default = 4\n"
146 " &END MGRID\n"
147 "! Going to the Quickstep Setup section\n"
148 " &QS\n"
149 " METHOD "),
150 "QS_METHOD",
151 i18n("\n EPS_DEFAULT 1.0E-12 ! => Default value is 1.0E-10\n"
152 " MAP_CONSISTENT TRUE ! => This is the default value\n")},
153 {i18n(" EXTRAPOLATION_ORDER 3 ! => This is the default value\n"
154 " &END QS\n")},
155 {i18n("! Going to the Self Consistent Field section\n"
156 " &SCF\n"
157 "! Maximum number of cycle\n"
158 " SCF_GUESS "),
159 "SCF_GUESS",
160 i18n(" ! => Initial guess for the wave-function\n"
161 " MAX_SCF "),"SCF_NCYCLES",
162 i18n(" ! => Maximum number of SCF cycles\n"
163 " EPS_SCF "),"SCF_NCONV",
164 i18n(" ! => Threshold for the SCF convergence\n"
165 "! If after the ${SCF_NCYCLES} first SCF steps no convergence has been reached\n"
166 "! more SCF cycles can be done updating the preconditioner. \n"
167 "! Detail information is then presented in the 'Outer' SCF section\n"
168 " &OUTER_SCF\n"
169 " MAX_SCF "),
170 "SCF_OCYCLES",
171 i18n(" ! => We update the preconditioner and start a new SCF cycle\n"
172 " ! up to ${SCF_NCYCLES} x ${SCF_OCYCLES} can be computed\n"
173 " EPS_SCF "),
174 "SCF_OCONV",
175 i18n(" ! => Convergence threshold for the extra cycles\n"
176 " &END OUTER_SCF\n\n"
177 "! Going to the Orbital Transformation section\n"
178 " &OT ON\n"
179 " MINIMIZER "),
180 "OT_MINI",
181 i18n("\n PRECONDITIONER FULL_ALL ! => Preconditioner for the minimization scheme,\n"
182 " ! FULL_ALL is the most effective state selective\n"
183 " ! preconditioner and is based on diagonalization\n"
184 " ENERGY_GAP 0.001 ! => Underestimated value of the Gap (HOMO-LUMO) in a.u.\n"
185 " ! to be used with the FULL_ALL preconditioner\n"
186 " &END OT\n\n"
187 " &PRINT\n"
188 "! To tune the printing of the restart file\n"
189 " &RESTART\n"
190 " LOG_PRINT_KEY T ! => Printing on screen when restart file is written\n"
191 " &EACH\n"
192 " QS_SCF 0 ! => Never write restart file(s) during the SCF cycle\n")},
193 {" &END EACH\n"
194 " ADD_LAST NUMERIC\n"
195 " &END RESTART\n"},
196 {i18n(" &END PRINT\n\n"
197 " &END SCF\n"
198 "! Going to the exchange-correlation section\n"
199 " &XC\n"
200 " &XC_FUNCTIONAL "),
201 "FUNCTIONAL",
202 "\n &END XC_FUNCTIONAL\n"},
203 {" &END XC\n"},
204 {i18n("! Spin polarized calculation\n"
205 " UKS "),
206 "SPIN_POLARIZED",
207 "\n MULTIPLICITY ", "SPIN_MULTIPLICITY"},
208 {" &END DFT\n"}};
209
210gchar * qs_extrapo[2]={i18n(" EXTRAPOLATION ASPC ! => ASPC recommended for MD, PS otherwise\n"),
211 i18n(" EXTRAPOLATION PS ! => ASPC recommended for MD, PS otherwise\n")};
212
213gchar * scf_wrestart[3][3]={{"JUST_ENERGY ","OUT_STEPS",i18n(" ! => Write restart file every ${OUT_STEPS} SCF steps\n")},
214 {"GEO_OPT ","OUT_STEPS",i18n(" ! => Write restart file every ${OUT_STEPS} GEO_OPT steps\n")},
215 {"MD ","OUT_STEPS",i18n(" ! => Write restart file every ${OUT_STEPS} MD steps\n")}};
216
217gchar * cp2kincludes[3] = {"forces.inc", "system.inc", "motion.inc"};
218
219gchar * thermostatr[4] = {"\n &THERMOSTAT\n",
220 " TYPE ",
221 "\n REGION ",
222 " &END THERMOSTAT"};
223
224gchar * cp2k_thermo[4] = {"AD_LANGEVIN", "CSVR", "GLE", "NOSE"};
225
226gchar * thermo_region[3] = {"GLOBAL", "DEFINED", "MOLECULE"};
227
228gchar * define_region[4] = {"\n &DEFINE_REGION",
229 "\n LIST",
230 "\n MOLECULE",
231 "\n &END DEFINE_REGION"};
232
233gchar * thermo_type[4][5] = {{"\n &AD_LANGEVIN"
234 "\n TIMECON_LANGEVIN ",
235 "\n TIMECON_NH ",
236 "\n &CHI ",
237 "\n &END CHI"
238 "\n &MASS ",
239 "\n &END MASS"
240 "\n &END AD_LANGEVIN\n"},
241 {"\n &CSVR"
242 "\n TIMECON ",
243 "\n &END CSVR\n"},
244 {"\n"},
245 {"\n &NOSE"
246 "\n LENGTH ",
247 "\n MTS ",
248 "\n TIMECON ",
249 "\n YOSHIDA ",
250 "\n &END NOSE\n"}};
251
252gchar * cp2kmotion[4][15] = {{"&MOTION\n\n"
253 " &GEO_OPT\n"
254 " MINIMIZER ","GEO_MINI",
255 "\n MAX_ITER ","GEO_STEPS",
256 "\n MAX_FORCE ","GEO_CONV",
257 "\n &END GEO_OPT\n"
258 " &PRINT\n"
259 " &RESTART\n"
260 " LOG_PRINT_KEY T\n"
261 " &EACH\n"
262 " GEO_OPT ","OUT_STEPS",
263 "\n &END EACH\n"
264 " ADD_LAST NUMERIC\n"
265 " &END RESTART\n"
266 " &TRAJECTORY\n"
267 " LOG_PRINT_KEY T\n"
268 " FORMAT XYZ\n"
269 " &EACH\n"
270 " GEO_OPT ","OUT_STEPS",
271 "\n &END EACH\n"
272 " ADD_LAST NUMERIC\n"
273 " &END TRAJECTORY\n"
274 " &END PRINT\n"},
275 {"&MOTION\n\n"
276 " &MD\n"
277 " ENSEMBLE ","MD_ENSEMBLE",
278 "\n STEPS ","MD_STEPS",
279 "\n TIMESTEP ","MD_DELTA_T",
280 "\n TEMPERATURE ","MD_TEMP"},
281 {"\n &END MD\n\n"
282 " &PRINT\n"
283 " &RESTART\n"
284 " LOG_PRINT_KEY T\n"
285 " &EACH\n"
286 " MD ","OUT_STEPS",
287 "\n &END EACH\n"
288 " ADD_LAST NUMERIC\n"
289 " &END RESTART\n\n"
290 " &TRAJECTORY\n"
291 " LOG_PRINT_KEY T\n"
292 " FORMAT ","OUT_FORM",
293 "\n UNIT ","OUT_UNIT",
294 "\n &EACH\n"
295 " MD ","OUT_STEPS",
296 "\n &END EACH\n"
297 " ADD_LAST NUMERIC\n"
298 " &END TRAJECTORY\n\n"
299 " &VELOCITIES\n"
300 " LOG_PRINT_KEY T\n"
301 " FORMAT ","OUT_FORM",
302 "\n UNIT ","OUT_UNIT",
303 "\n &EACH\n"
304 " MD ","OUT_STEPS",
305 "\n &END EACH\n"
306 " ADD_LAST NUMERIC\n"
307 " &END VELOCITIES\n"
308 " &END PRINT\n"},
309 {"\n&END MOTION"}};
310
311gchar * cp2ksyst[3][3] = {{i18n("!\n"
312 "! Always a SUBSYS section that describes\n"
313 "! the chemistry and the periodicity of the system\n"
314 "!\n"
315 "&SUBSYS\n"
316 " &CELL\n"
317 " PERIODIC "),
318 "PBC","\n"},
319 {"\n &END CELL\n"
320 " &COORD","\n &END COORD\n"
321 },
322 {i18n("\n &END CELL\n"
323 " &TOPOLOGY\n"
324 "! Using an XYZ file, coordinates are always Cartesian and in angstrom\n"
325 " COORDINATE XYZ\n"
326 " COORD_FILE_NAME "),
327 "COORD_FILE",
328 "\n &END TOPOLOGY\n"}};
329
330gchar * cp2klat[2][19] = {{" ABC ","A"," ","B"," ","C",
331 "\n ALPHA_BETA_GAMMA ","ALPHA"," ","BETA"," ","GAMMA",
332 "\n SYMMETRY ","SYM"," "," "," "," "," "},
333 {" A ","AX"," ","AY"," ","AZ",
334 "\n B ","BX"," ","BY"," ","BZ",
335 "\n C ","CX"," ","CY"," ","CZ","\n"}};
336
337gchar * cp2kspin[2] = {"@SET SPIN_POLARIZED ",
338 "@SET SPIN_MULTIPLICITY "};
339
340gchar * cp2ksroks[3] = {"@SET ROKS ",
341 "@SET ROKS_SCALING ",
342 "@SET ROKS_SPIN_CONFIG "};
343
344gchar * cp2kroks[7] = {" ROKS ","ROKS",
345 i18n(" ! => Restricted Open Kohn-Sham calculation\n"
346 " &LOW_SPIN_ROKS\n"
347 " ENERGY_SCALING "),
348 "ROKS_SCALING",
349 "\n SPIN_CONFIGURATION ", "ROKS_SPIN_CONFIG",
350 "\n &END LOW_SPIN_ROKS\n"};
351
352gchar * cp2kmocu[3] = {"@SET NUM_HOMO ",
353 "@SET NUM_LUMO ",
354 "@SET CUBES "};
355
356gchar * cp2kmocubes[7] = {" NHOMO ","NUM_HOMO",
357 "\n NLUMO ","NUM_LUMO",
358 "\n WRITE_CUBES ","CUBES",
359 "\n"};
360
361gchar * cp2ksvdw[4] = {"@SET VDW_FCT ",
362 "@SET VDW_TYPE ",
363 "@SET VDW_CUTOFF ",
364 "@SET VDW_LONG "};
365
366gchar * cp2kvdw[4][7] = {{" &VDW_POTENTIAL\n"
367 " POTENTIAL_TYPE ", "VDW_FCT",
368 "\n "},
369 {"&NON_LOCAL\n"
370 " TYPE ", "VDW_TYPE",
371 "\n CUTOFF ", "VDW_CUTOFF",
372 "\n &END NON_LOCAL\n"},
373 {"&PAIR_POTENTIAL\n"
374 " TYPE ", "VDW_TYPE",
375 "\n R_CUTOFF ", "VDW_CUTOFF",
376 "\n LONG_RANGE_CORRECTION ","VDW_LONG",
377 "\n &END PAIR_POTENTIAL\n"},
378 {" &END VDW_POTENTIAL\n"}};
379
380gchar * vdw_fct[2] = {"NON_LOCAL", "PAIR_POTENTIAL"};
381
382gchar * cp2k_cons[2] = {"\n &CONSTRAINT\n", " &END CONSTRAINT\n"};
383
384gchar * cp2k_fix[4] = {" &FIXED_ATOMS\n COMPONENTS_TO_FIX ",
385 " LIST", " MOLNAME",
386 "\n &END FIXED_ATOMS\n"};
387
396void print_cp2k_var (gchar * var, GtkTextBuffer * buffer)
397{
398 print_info ("${", "bold", buffer);
399 print_info (var, "bold_blue", buffer);
400 print_info ("}", "bold", buffer);
401}
402
414void print_var_section (int num, gchar ** section, int i18p, int * i18pos, GtkTextBuffer * buffer)
415{
416 int i, j;
417 for (i=0; i<num; i++)
418 {
419 if (i%2)
420 {
421 print_cp2k_var (section[i], buffer);
422 }
423 else
424 {
425 if (i18pos)
426 {
427 gboolean do_translate = FALSE;
428 for (j=0; j<i18p; j++)
429 {
430 if (i == i18pos[j])
431 {
432 do_translate = TRUE;
433 break;
434 }
435 }
436 print_info ((do_translate) ? _(section[i]) : section[i], NULL, buffer);
437 }
438 else
439 {
440 print_info (section[i], NULL, buffer);
441 }
442 }
443 }
444}
445
453gchar * cp2kbool (double opt)
454{
455 if (opt == 1.0)
456 {
457 return g_strdup_printf ("TRUE");
458 }
459 else
460 {
461 return g_strdup_printf ("FALSE");
462 }
463}
464
465extern int v_thermo[2][CP2NTHERM];
466
475void print_thermostat_cp2k (int n_thermo, GtkTextBuffer * buffer)
476{
477 int i, j, k, l, m;
478 gchar * str;
479 thermostat * thermo = tmp_cp2k -> ions_thermostat;
480 for (i=0; i<n_thermo; i++)
481 {
482 if (n_thermo > 1)
483 {
484 str = g_strdup_printf (_("\n! Thermostat N°%d"), i+1);
485 print_info (str, NULL, buffer);
486 g_free (str);
487 }
488 print_info (thermostatr[0], NULL, buffer);
489 print_info (thermostatr[1], NULL, buffer);
490 print_info (cp2k_thermo[thermo -> type-1], "red", buffer);
491 print_info (thermostatr[2], NULL, buffer);
492 print_info (thermo_region[thermo -> sys], "red", buffer);
493 if (thermo -> sys > 0)
494 {
495 print_info (define_region[0], NULL, buffer);
496 print_info (define_region[thermo -> sys], NULL, buffer);
497 if (thermo -> sys == 1)
498 {
499 l = 0;
500 for (j=0; j < qm_proj-> nspec; j++)
501 {
502 for (k=0; k < qm_proj-> natomes; k++)
503 {
504 if (qm_proj -> atoms[0][k].sp == j)
505 {
506 l++;
507 for (m=0; m < thermo -> natoms; m++)
508 {
509 if (thermo -> list[m] == k)
510 {
511 str = g_strdup_printf (" %d", l);
512 print_info (str, "red", buffer);
513 g_free (str);
514 }
515 }
516 }
517 }
518 }
519 }
520 else
521 {
522 str = g_strdup_printf (" MOL-%d", thermo -> natoms+1);
523 print_info (str, "red", buffer);
524 g_free (str);
525 }
526 print_info (define_region[3], NULL, buffer);
527 }
528
529 for (j=0; j<v_thermo[1][thermo -> type]; j++)
530 {
531 print_info (thermo_type[thermo -> type-1][j], NULL, buffer);
532 if (thermo -> type == 4 && j != 2)
533 {
534 str = g_strdup_printf ("%d", (int)thermo -> params[j]);
535 }
536 else
537 {
538 str = g_strdup_printf ("%f", thermo -> params[j]);
539 }
540 print_info (str, "red", buffer);
541 g_free (str);
542 }
543 print_info (thermo_type[thermo -> type-1][j], NULL, buffer);
544
545 if (thermo -> next != NULL) thermo = thermo -> next;
546 }
547 print_info (thermostatr[3], NULL, buffer);
548}
549
558void print_motion_cp2k (int m, GtkTextBuffer * buffer)
559{
560 gchar * intro = _("!\n"
561 "! Always a MOTION section that describes\n"
562 "! how to move the atoms\n"
563 "!\n");
564 print_info (intro, NULL, buffer);
565 print_var_section ((m==0) ? 11 : 8, cp2kmotion[m], 0, NULL, buffer);
566 if (m)
567 {
568 if ((int)tmp_cp2k -> opts[CP2ENS] != 2 && (int)tmp_cp2k -> opts[CP2ENS] != 3)
569 {
570 if (tmp_cp2k -> ions_thermostat -> type) print_thermostat_cp2k (tmp_cp2k -> thermostats, buffer);
571 }
572 print_var_section (15, cp2kmotion[m+1], 0, NULL, buffer);
573 }
574
575 if ((int)tmp_cp2k -> opts[CP2CON])
576 {
577 gchar * fixec[7] = {"X\n", "Y\n", "Z\n", "XY\n", "XZ\n", "YZ\n", "XYZ\n"};
578 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}};
579 int i, j, k;
580 gchar * str;
581 gboolean doit;
582 for (i=0; i<2; i++)
583 {
584 if (tmp_cp2k -> fixat[i] > 0)
585 {
586 print_info (cp2k_cons[0], NULL, buffer);
587 for (j=0; j<7; j++)
588 {
589 doit = FALSE;
590 for (k=0; k<tmp_cp2k -> fixat[i]; k++)
591 {
592 if (tmp_cp2k -> fixcoord[i][k][0] == fixed[j][0] &&
593 tmp_cp2k -> fixcoord[i][k][1] == fixed[j][1] &&
594 tmp_cp2k -> fixcoord[i][k][2] == fixed[j][2])
595 {
596 print_info (cp2k_fix[0], NULL, buffer);
597 print_info (fixec[j], NULL, buffer);
598 if (i==0)
599 {
600 print_info (cp2k_fix[1], NULL, buffer);
601 }
602 else
603 {
604 print_info (cp2k_fix[2], NULL, buffer);
605 }
606 doit= TRUE;
607 break;
608 }
609 }
610 if (doit)
611 {
612 for (k=0; k<tmp_cp2k -> fixat[i]; k++)
613 {
614 if (tmp_cp2k -> fixcoord[i][k][0] == fixed[j][0] &&
615 tmp_cp2k -> fixcoord[i][k][1] == fixed[j][1] &&
616 tmp_cp2k -> fixcoord[i][k][2] == fixed[j][2])
617 {
618 if (i ==0)
619 {
620 str = g_strdup_printf (" %d", tmp_cp2k -> fixlist[i][k]+1);
621 }
622 else
623 {
624 str = g_strdup_printf (" MOL-%d", tmp_cp2k -> fixlist[i][k]+1);
625 }
626 print_info (str, NULL, buffer);
627 g_free (str);
628 }
629 }
630 print_info (cp2k_fix[3], NULL, buffer);
631 }
632 }
633 print_info (cp2k_cons[1], NULL, buffer);
634 }
635 }
636 }
637 print_info (cp2kmotion[3][0], NULL, buffer);
638}
639
647void print_coord_cp2k (GtkTextBuffer * buffer)
648{
649 gchar * str;
650 if (tmp_cp2k -> input_type)
651 {
652 gchar * str = g_strdup_printf (_("\t%d\n# This file was prepared using %s"), qm_proj -> natomes, PACKAGE);
653 print_info (str, NULL, buffer);
654 g_free (str);
655 }
656 int i, j;
657 for (i=0; i<qm_proj -> nspec; i++)
658 {
659 for (j=0; j<qm_proj -> natomes; j++)
660 {
661 if (qm_proj -> atoms[0][j].sp == i)
662 {
663 print_info ("\n", NULL, buffer);
664 print_info (qm_proj -> chemistry -> label[i], NULL, buffer);
665 str = g_strdup_printf (" %15.10lf %15.10lf %15.10lf",
666 qm_proj -> atoms[0][j].x, qm_proj -> atoms[0][j].y, qm_proj -> atoms[0][j].z);
667 print_info (str, NULL, buffer);
668 g_free (str);
669 /*if (qm_view -> bonding)
670 {
671 if (tmp_cp2k -> fixat[1] > 0 || tmp_cp2k -> ions_thermostat -> sys > 1)
672 {
673 str = g_strdup_printf (" MOL-%d", qm_proj -> atoms[0][j].coord[3]+1);
674 print_info (str, NULL, buffer);
675 g_free (str);
676 }
677 }*/
678 }
679 }
680 }
681}
682
690void print_subsys_cp2k (GtkTextBuffer * buffer)
691{
692 int totrans[] = {0};
693 print_var_section (3, cp2ksyst[0], 1, totrans, buffer);
694 int i = ((int)tmp_cp2k -> opts[CP2LAT]) ? 19 : 14;
695 print_var_section (i, cp2klat[(int)tmp_cp2k -> opts[CP2LAT]], 0, NULL, buffer);
696 if (! tmp_cp2k -> input_type)
697 {
698 print_info (cp2ksyst[1][0], NULL, buffer);
699 print_coord_cp2k (buffer);
700 print_info (cp2ksyst[1][1], NULL, buffer);
701 }
702 else
703 {
704 print_var_section (3, cp2ksyst[2], 1, totrans, buffer);
705 }
706 gchar * str;
707 print_info (_("! What follow is tricky and tests are recommended\n"
708 "! Atomic basis set and pseudo-potential must be provided for all chemical species\n"
709 "! the exact sequences '${BASIS_FOR_*}' '${POTENTIAL_FOR_*}' appear\n"
710 "! inside the files that contain respectively the basis sets and the pseudo-potentials\n"
711 "! in front of the name of the '*' element\n") ,
712 NULL, buffer);
713 for (i=0; i<qm_proj -> nspec; i++)
714 {
715 str = g_strdup_printf (" &KIND %s\n BASIS_SET ", exact_name(qm_proj -> chemistry -> label[i]));
716 print_info (str, NULL, buffer);
717 g_free (str);
718 str = g_strdup_printf ("BASIS_FOR_%s", exact_name(qm_proj -> chemistry -> label[i]));
719 print_cp2k_var (str, buffer);
720 g_free (str);
721 if (strlen(exact_name(qm_proj -> chemistry -> label[i])) == 1) print_info (" ",NULL, buffer);
722 print_info ("\n POTENTIAL ", NULL, buffer);
723
724 str = g_strdup_printf ("POTENTIAL_FOR_%s", exact_name(qm_proj -> chemistry -> label[i]));
725 print_cp2k_var (str, buffer);
726 g_free (str);
727 print_info ("\n &END KIND\n", NULL, buffer);
728 }
729 print_info ("&END SUBSYS", NULL, buffer);
730}
731
739void print_variables_cp2k (GtkTextBuffer * buffer)
740{
741 int i, j, k, l;
742 gchar * str;
743 gboolean append;
744 gchar * fileinfo[5] = {i18n("! This file contains the restart information:"),
745 i18n("! This file contains the basis set(s):"),
746 i18n("! This file contains the pseudo-potential(s):"),
747 i18n("! This file contains the wave-function:"),
748 i18n("! This file contains the atomic coordinates in XYZ format:")};
749 l = 0;
750 for (i=0; i<41; i++)
751 {
752 if (i==0)
753 {
754 print_info (globopts[0], NULL, buffer);
755 print_info (exact_name(qm_proj -> name), "bold", buffer);
756 print_info ("\n", NULL, buffer);
757 print_info (globopts[i+1], NULL, buffer);
758 print_info (cp2k_default_keywords[l][(int)tmp_cp2k -> opts[i]], "blue", buffer);
759 print_info ("\n", NULL, buffer);
760 l++;
761 }
762 else if (i == CP2SPI)
763 {
764 if ((int)tmp_cp2k -> opts[CP2SPI])
765 {
766 print_info (cp2kspin[0], NULL, buffer);
767 print_info (cp2kbool (tmp_cp2k -> opts[CP2SPI]), "blue", buffer);
768 print_info ("\n", NULL, buffer);
769 print_info (cp2kspin[1], NULL, buffer);
770 str = g_strdup_printf ("%d", (int)tmp_cp2k -> opts[CP2SPM]);
771 print_info (str, "blue", buffer);
772 g_free (str);
773 print_info ("\n", NULL, buffer);
774 }
775 }
776 else if (i==CP2PLE || i==CP2QSM || i==CP2SCG || i==CP2SMI || i==CP2FCT)
777 {
778 print_info (globopts[i+1], NULL, buffer);
779 print_info (cp2k_default_keywords[l][(int)tmp_cp2k -> opts[i]], "blue", buffer);
780 print_info ("\n", NULL, buffer);
781 l++;
782 if (i==CP2SMI)
783 {
784 if ((int)tmp_cp2k -> opts[CP2ROK])
785 {
786 print_info (cp2ksroks[0], NULL, buffer);
787 print_info (cp2kbool (tmp_cp2k -> opts[CP2ROK]), "blue", buffer);
788 print_info ("\n", NULL, buffer);
789 print_info (cp2ksroks[1], NULL, buffer);
790 str = g_strdup_printf ("%f", tmp_cp2k -> extra_opts[1][0]);
791 print_info (str, "blue", buffer);
792 g_free (str);
793 print_info ("\n", NULL, buffer);
794 print_info (cp2ksroks[2], NULL, buffer);
795 str = g_strdup_printf ("%d", (int)tmp_cp2k -> extra_opts[1][1] + 1);
796 print_info (str, "blue", buffer);
797 g_free (str);
798 print_info ("\n", NULL, buffer);
799 }
800 if ((int)tmp_cp2k -> opts[CP2POR])
801 {
802 for (j=0; j<2; j++)
803 {
804 print_info (cp2kmocu[j], NULL, buffer);
805 str = g_strdup_printf ("%d", (int)tmp_cp2k -> extra_opts[2][j]);
806 print_info (str, "blue", buffer);
807 g_free (str);
808 print_info ("\n", NULL, buffer);
809 }
810 print_info (cp2kmocu[j], NULL, buffer);
811 print_info (cp2kbool (tmp_cp2k -> extra_opts[2][2]), "blue", buffer);
812 print_info ("\n", NULL, buffer);
813 }
814 }
815 if (i==CP2FCT)
816 {
817 if ((int)tmp_cp2k -> opts[CP2VDW])
818 {
819 print_info (cp2ksvdw[0], NULL, buffer);
820 print_info (vdw_fct[(int)tmp_cp2k -> extra_opts[0][0]], "blue", buffer);
821 print_info ("\n", NULL, buffer);
822 print_info (cp2ksvdw[1], NULL, buffer);
823 print_info (cp2k_vdw_keywords[(int)tmp_cp2k -> extra_opts[0][0]][(int)tmp_cp2k -> extra_opts[0][1]], "blue", buffer);
824 print_info ("\n", NULL, buffer);
825 print_info (cp2ksvdw[2], NULL, buffer);
826 str = g_strdup_printf ("%f", tmp_cp2k -> extra_opts[0][2]);
827 print_info (str, "blue", buffer);
828 g_free (str);
829 print_info ("\n", NULL, buffer);
830 if (tmp_cp2k -> extra_opts[0][0] == 1.0)
831 {
832 print_info (cp2ksvdw[3], NULL, buffer);
833 print_info (cp2kbool (tmp_cp2k -> extra_opts[0][3]), "blue", buffer);
834 print_info ("\n", NULL, buffer);
835 }
836 }
837 }
838 }
839 else if (i == CP2RES)
840 {
841 print_info (globopts[4], NULL, buffer);
842 print_info (cp2kbool (tmp_cp2k -> opts[i]), "blue", buffer);
843 print_info ("\n", NULL, buffer);
844 for (j=0; j<4; j++)
845 {
846 print_info (_(fileinfo[j]), "bold_red", buffer);
847 print_info ("\n", NULL, buffer);
848 print_info (globopts[5+j], NULL, buffer);
849 if (tmp_cp2k -> files[j] != NULL)
850 {
851 print_info (tmp_cp2k -> files[j], "blue", buffer);
852 }
853 else
854 {
855 print_info ("None", "blue", buffer);
856 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);
857 }
858 print_info ("\n", NULL, buffer);
859 }
860 }
861 else if (i==CP2KTI || i==CP2CHA || i==CP2GRI || i==CP2SNN ||i==CP2SNO || i==CP2NST || i==CP2MAG ||i==CP2OUF)
862 {
863 if (i==CP2NST && tmp_cp2k -> opts[CP2RUN] != 3.0)
864 {
865 append = FALSE;
866 }
867 else if (i==CP2MAG && tmp_cp2k -> opts[CP2RUN] != 2.0)
868 {
869 append = FALSE;
870 }
871 else
872 {
873 append = TRUE;
874 }
875 if (append)
876 {
877 j = (i > CP2SNO) ? i+7 : i+1;
878 print_info (globopts[j], NULL, buffer);
879 str = g_strdup_printf ("%d", (int)tmp_cp2k -> opts[i]);
880 print_info (str, "blue", buffer);
881 g_free (str);
882 print_info ("\n", NULL, buffer);
883 if (i==CP2OUF)
884 {
885 print_info (globopts[47], NULL, buffer);
886 print_info ("XYZ", "blue", buffer);
887 print_info ("\n", NULL, buffer);
888 print_info (globopts[48], NULL, buffer);
889 print_info ("ANGSTROM", "blue", buffer);
890 print_info ("\n", NULL, buffer);
891 }
892 }
893 }
894 else if (i==CP2CUT || i==CP2SCN || i==CP2SCO || i==CP2DLT || i==CP2TMP || i==CP2GEF)
895 {
896 if ((i == CP2DLT || i == CP2TMP) && tmp_cp2k -> opts[CP2RUN] != 3.0)
897 {
898 append = FALSE;
899 }
900 else if (i == CP2GEF && tmp_cp2k -> opts[CP2RUN] != 2.0)
901 {
902 append = FALSE;
903 }
904 else
905 {
906 append = TRUE;
907 }
908 if (append)
909 {
910 j = (i > CP2SCO) ? i+7 : i+1;
911 print_info (globopts[j], NULL, buffer);
912 str = g_strdup_printf ("%f", tmp_cp2k -> opts[i]);
913 print_info (str, "blue", buffer);
914 g_free (str);
915 print_info ("\n", NULL, buffer);
916 }
917 }
918 else if (i == CP2PBC)
919 {
920 print_info (globopts[i-8], NULL, buffer);
921 print_info (cp2k_default_keywords[6][(int)tmp_cp2k -> opts[i]], "blue", buffer);
922 print_info ("\n", NULL, buffer);
923 }
924 else if (i == CP2ENS && tmp_cp2k -> opts[CP2RUN] == 3.0)
925 {
926 print_info (globopts[38], NULL, buffer);
927 print_info (cp2k_default_keywords[9][(int)tmp_cp2k -> opts[i]], "blue", buffer);
928 print_info ("\n", NULL, buffer);
929 }
930 else if (i == CP2GMI && tmp_cp2k -> opts[CP2RUN] == 2.0)
931 {
932 print_info (globopts[42], NULL, buffer);
933 print_info (cp2k_default_keywords[10][(int)tmp_cp2k -> opts[i]], "blue", buffer);
934 print_info ("\n", NULL, buffer);
935 }
936 else if (i == CP2LAT)
937 {
938 if (tmp_cp2k -> opts[i] == 0.0)
939 {
940 for (j=0; j<6; j++)
941 {
942 print_info (globopts[22+j], NULL, buffer);
943 k = j/3;
944 str = g_strdup_printf ("%f", qm_proj -> cell.box[0].param[k][j-3*k]);
945 print_info (str, "blue", buffer);
946 g_free (str);
947 print_info ("\n", NULL, buffer);
948 }
949 print_info (globopts[21], NULL, buffer);
950 print_info (cp2k_default_keywords[8][(int)tmp_cp2k -> opts[CP2SYM]], "blue", buffer);
951 print_info ("\n", NULL, buffer);
952 }
953 else
954 {
955 for (j=0; j<3; j++)
956 {
957 print_info (globopts[28+j], NULL, buffer);
958 k = j/3;
959 str = g_strdup_printf ("%f", qm_proj -> cell.box[0].vect[k][j-3*k]);
960 print_info (str, "blue", buffer);
961 g_free (str);
962 print_info ("\n", NULL, buffer);
963 }
964 }
965 if (tmp_cp2k -> input_type)
966 {
967 print_info (_(fileinfo[4]), "bold_red", buffer);
968 print_info ("\n", NULL, buffer);
969 print_info (globopts[37], NULL, buffer);
970 print_info ("coord.inc", "blue", buffer);
971 print_info ("\n", NULL, buffer);
972 }
973 for (j=0; j<qm_proj -> nspec;j++)
974 {
975 str = g_strdup_printf ("@SET BASIS_FOR_%s ", exact_name(qm_proj -> chemistry -> label[j]));
976 print_info (str, NULL, buffer);
977 g_free (str);
978 if (strlen(exact_name(qm_proj -> chemistry -> label[j])) == 1) print_info (" ",NULL, buffer);
979 if (tmp_cp2k -> spec_data[j][0] > -1)
980 {
981 print_info (get_nth_key (j, tmp_cp2k -> spec_data[j][0], 0), "blue", buffer);
982 }
983 else
984 {
985 print_info ("None", "blue", buffer);
986 print_info (_("\t\t! A keyword is required !"), "bold_red", buffer);
987 }
988 print_info ("\n", NULL, buffer);
989 str = g_strdup_printf ("@SET POTENTIAL_FOR_%s ", exact_name(qm_proj -> chemistry -> label[j]));
990 print_info (str, NULL, buffer);
991 g_free (str);
992 if (strlen(exact_name(qm_proj -> chemistry -> label[j])) == 1) print_info (" ",NULL, buffer);
993 if (tmp_cp2k -> spec_data[j][1] > -1)
994 {
995 print_info (get_nth_key (j, tmp_cp2k -> spec_data[j][1], 1), "blue", buffer);
996 }
997 else
998 {
999 print_info ("None", "blue", buffer);
1000 print_info (_("\t\t! A keyword is required !"), "bold_red", buffer);
1001 }
1002 print_info ("\n", NULL, buffer);
1003 }
1004 }
1005 }
1006 print_info ("\n", NULL, buffer);
1007}
1008
1016void print_global_cp2k (GtkTextBuffer * buffer)
1017{
1018 print_variables_cp2k (buffer);
1019 print_var_section (9, cp2kglobal, 0, NULL, buffer);
1020
1021 if (tmp_cp2k -> input_type)
1022 {
1023 print_info ("\n", NULL, buffer);
1024 print_info ("!\n", NULL, buffer);
1025 print_info (_("! The mandatory FORCE_EVAL section include file\n"), NULL, buffer);
1026 print_info ("!\n", NULL, buffer);
1027 print_info ("@INCLUDE '", "bold", buffer);
1028 print_info (cp2kincludes[0], "red", buffer);
1029 print_info ("'", "bold", buffer);
1030 print_info ("\n\n", NULL, buffer);
1031 if (tmp_cp2k -> opts[CP2RUN] > 1.0 && tmp_cp2k -> opts[CP2RUN] < 4.0)
1032 {
1033 print_info ("!\n", NULL, buffer);
1034 print_info (_("! The mandatory MOTION section include file\n"), NULL, buffer);
1035 print_info ("!\n", NULL, buffer);
1036 print_info ("@INCLUDE '", "bold", buffer);
1037 print_info (cp2kincludes[2], "red", buffer);
1038 print_info ("'", "bold", buffer);
1039 print_info ("\n\n", NULL, buffer);
1040 }
1041 }
1042 else
1043 {
1044 print_info ("\n", NULL, buffer);
1045 }
1046}
1047
1059void print_cp2k_print (gchar * spaces, gchar * info, int i, int j, GtkTextBuffer * buffer)
1060{
1061 print_info (spaces, NULL, buffer);
1062 print_info ("&", NULL, buffer);
1063 print_info (info, NULL, buffer);
1064 print_info ("\n", NULL, buffer);
1065 print_info (spaces, NULL, buffer);
1066 print_info (_(" LOG_PRINT_KEY T ! => Printing on screen when restart file is written\n"), NULL, buffer);
1067 print_info (spaces, NULL, buffer);
1068 print_info (" &EACH\n", NULL, buffer);
1069 print_info (spaces, NULL, buffer);
1070 print_info (" ", NULL, buffer);
1071 int totrans[] = {2};
1072 print_var_section (3, scf_wrestart[i], 1, totrans, buffer);
1073 print_info (spaces, NULL, buffer);
1074 print_info (" &END EACH\n", NULL, buffer);
1075 print_info (spaces, NULL, buffer);
1076 print_info (" ADD_LAST NUMERIC\n", NULL, buffer);
1077 if (j)
1078 {
1079 print_var_section (7, cp2kmocubes, 0, NULL, buffer);
1080 }
1081 print_info (spaces, NULL, buffer);
1082 print_info ("&END ", NULL, buffer);
1083 print_info (info, NULL, buffer);
1084 print_info ("\n", NULL, buffer);
1085}
1086
1095void print_cp2k (int f, GtkTextBuffer * buffer)
1096{
1097 int i;
1098 int * totrans;
1099 switch (f)
1100 {
1101 case 0:
1102 print_global_cp2k (buffer);
1103 if (tmp_cp2k -> input_type && (int)tmp_cp2k -> opts[CP2RES]) print_var_section (7, cp2krestart, 0, NULL, buffer);
1104 break;
1105 case 1:
1106 totrans = allocint (5);
1107 totrans[0] = 0;
1108 totrans[1] = 10;
1109 totrans[2] = 12;
1110 totrans[3] = 14;
1111 totrans[4] = 16;
1112 print_var_section (17, cp2kfev[0], 5, totrans, buffer);
1113 g_free (totrans);
1114 i = ((int)tmp_cp2k -> opts[CP2RUN] == 3) ? 0 : 1;
1115 print_info (_(qs_extrapo[i]), NULL, buffer);
1116 g_free (totrans);
1117 totrans = allocint (1);
1118 totrans[0] = 0;
1119 print_var_section (1, cp2kfev[1], 1, totrans, buffer);
1120 i = ((int)tmp_cp2k -> opts[CP2RUN] == 2 || (int)tmp_cp2k -> opts[CP2RUN] == 3) ? (int)tmp_cp2k -> opts[CP2RUN] - 1 : 0;
1121 if ((int)tmp_cp2k -> opts[CP2ROK])
1122 {
1123 totrans[0] = 1;
1124 print_var_section (7, cp2kroks, 1, totrans, buffer);
1125 }
1126 g_free (totrans);
1127 if ((int)tmp_cp2k -> opts[CP2POR])
1128 {
1129 print_info (" &PRINT\n", NULL, buffer);
1130 print_cp2k_print (" ", "MO_CUBES", i, 1, buffer);
1131 print_info (" &END PRINT\n", NULL, buffer);
1132 }
1133 totrans = allocint (7);
1134 totrans[0] = 0;
1135 totrans[1] = 2;
1136 totrans[2] = 3;
1137 totrans[3] = 4;
1138 totrans[4] = 6;
1139 totrans[5] = 8;
1140 totrans[6] = 10;
1141 print_var_section (13, cp2kfev[2], 7, totrans, buffer);
1142 g_free (totrans);
1143 print_info (" ", NULL, buffer);
1144 totrans = allocint (1);
1145 totrans[0] = 2;
1146 print_var_section (3, scf_wrestart[i], 1, totrans, buffer);
1147 g_free (totrans);
1148 print_var_section (1, cp2kfev[3], 0, NULL, buffer);
1149 if ((int)tmp_cp2k -> opts[CP2PMU]) print_cp2k_print (" ", "MULLIKEN", i, 0, buffer);
1150 if ((int)tmp_cp2k -> opts[CP2PLO]) print_cp2k_print (" ", "LOWDIN", i, 0, buffer);
1151 totrans[0] = 0;
1152 print_var_section (3, cp2kfev[4], 1, totrans, buffer);
1153 g_free (totrans);
1154 if ((int)tmp_cp2k -> opts[CP2VDW])
1155 {
1156 print_var_section (3, cp2kvdw[0], 0, NULL, buffer);
1157 print_var_section ((int)tmp_cp2k -> extra_opts[0][0]*2+5, cp2kvdw[(int)tmp_cp2k -> extra_opts[0][0]+1], 0, NULL, buffer);
1158 print_var_section (1, cp2kvdw[3], 0, NULL, buffer);
1159 }
1160 print_info (cp2kfev[5][0], NULL, buffer);
1161 if ((int)tmp_cp2k -> opts[CP2SPI])
1162 {
1163 print_var_section (4, cp2kfev[6], 1, totrans, buffer);
1164 print_info ("\n", NULL, buffer);
1165 }
1166 print_info (cp2kfev[7][0], NULL, buffer);
1167
1168 if ((int)tmp_cp2k -> opts[CP2PFO] || (int)tmp_cp2k -> opts[CP2PST])
1169 {
1170 print_info ("\n", NULL, buffer);
1171 print_info (" &PRINT\n", NULL, buffer);
1172 if ((int)tmp_cp2k -> opts[CP2PFO]) print_cp2k_print (" ", "FORCES", i, 0, buffer);
1173 if ((int)tmp_cp2k -> opts[CP2PST]) print_cp2k_print (" ", "STRESS_TENSOR", i, 0, buffer);
1174 print_info (" &END PRINT\n", NULL, buffer);
1175 }
1176
1177 if (tmp_cp2k -> input_type)
1178 {
1179 print_info ("\n", NULL, buffer);
1180 print_info ("!\n", NULL, buffer);
1181 print_info (_("! The mandatory SUBSYS section include file\n"), NULL, buffer);
1182 print_info ("!\n", NULL, buffer);
1183 print_info ("@INCLUDE '", "bold", buffer);
1184 print_info (cp2kincludes[1], "red", buffer);
1185 print_info ("'", "bold", buffer);
1186 print_info ("\n\n", NULL, buffer);
1187 print_info ("&END FORCE_EVAL\n", NULL, buffer);
1188 }
1189 break;
1190 case 2:
1191 print_subsys_cp2k (buffer);
1192 if (! tmp_cp2k -> input_type)
1193 {
1194 print_info ("\n&END FORCE_EVAL\n", NULL, buffer);
1195 if ((int)tmp_cp2k -> opts[CP2RUN] != 2 && (int)tmp_cp2k -> opts[CP2RUN] != 3 && (int)tmp_cp2k -> opts[CP2RES])
1196 {
1197 print_info ("\n", NULL, buffer);
1198 print_var_section (7, cp2krestart, 0, NULL, buffer);
1199 }
1200 }
1201 break;
1202 case 4:
1203 print_coord_cp2k (buffer);
1204 break;
1205 default:
1206 if (f == 5 || f == 6)
1207 {
1208 for (i=0; i<qm_proj -> nspec; i++)
1209 {
1210 if (tmp_cp2k -> spec_data[i][f-5] > -1)
1211 {
1212 print_info (get_nth_elem (i, tmp_cp2k -> spec_data[i][f-5], f-5), NULL, buffer);
1213 }
1214 }
1215 }
1216 else
1217 {
1218 if (tmp_cp2k -> opts[CP2RUN] > 1.0 && tmp_cp2k -> opts[CP2RUN] < 4.0)
1219 {
1220 print_motion_cp2k ((int)tmp_cp2k -> opts[CP2RUN]- 2, buffer);
1221 }
1222 if (! tmp_cp2k -> input_type && (int)tmp_cp2k -> opts[CP2RES]) print_var_section (7, cp2krestart, 0, NULL, buffer);
1223 }
1224 break;
1225 }
1226}
project * qm_proj
Definition calc.c:67
Variable declarations for the MD input preparation assistants.
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
#define PACKAGE
Definition config.h:46
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
Definition cp2k_files.c:132
gchar * get_nth_elem(int sp, int id, int obj)
retrieve basis or pseudopotential name string for element from global list
Definition cp2k_files.c:66
#define CP2VDW
Definition cp2k.h:64
#define CP2PLO
Definition cp2k.h:69
#define CP2GEF
Definition cp2k.h:80
#define CP2PMU
Definition cp2k.h:68
#define CP2SCG
Definition cp2k.h:55
#define CP2GMI
Definition cp2k.h:78
#define CP2QSM
Definition cp2k.h:54
#define CP2DLT
Definition cp2k.h:76
#define CP2ENS
Definition cp2k.h:74
#define CP2SPM
Definition cp2k.h:63
#define CP2RUN
Definition cp2k.h:43
#define CP2PLE
Definition cp2k.h:45
gchar * cp2k_vdw_keywords[2][3]
Definition cp2k_init.c:115
#define CP2OUF
Definition cp2k.h:81
#define CP2KTI
Definition cp2k.h:44
#define CP2PBC
Definition cp2k.h:71
#define CP2MAG
Definition cp2k.h:79
#define CP2ROK
Definition cp2k.h:65
#define CP2SNN
Definition cp2k.h:56
#define CP2RES
Definition cp2k.h:46
#define CP2POR
Definition cp2k.h:70
#define CP2NST
Definition cp2k.h:75
#define CP2CON
Definition cp2k.h:82
#define CP2SPI
Definition cp2k.h:62
gchar * cp2k_default_keywords[11][11]
Definition cp2k_init.c:101
#define CP2PST
Definition cp2k.h:67
#define CP2PFO
Definition cp2k.h:66
#define CP2SNO
Definition cp2k.h:58
#define CP2GRI
Definition cp2k.h:53
#define CP2CUT
Definition cp2k.h:52
#define CP2SYM
Definition cp2k.h:73
cp2k * tmp_cp2k
Definition cp2k_init.c:86
#define CP2FCT
Definition cp2k.h:61
#define CP2SCN
Definition cp2k.h:57
#define CP2TMP
Definition cp2k.h:77
#define CP2SMI
Definition cp2k.h:60
#define CP2LAT
Definition cp2k.h:72
#define CP2NTHERM
Definition cp2k.h:86
#define CP2SCO
Definition cp2k.h:59
#define CP2CHA
Definition cp2k.h:51
gchar * thermostatr[4]
Definition cp2k_print.c:219
void print_cp2k(int f, GtkTextBuffer *buffer)
print the CP2K input file section
gchar * cp2krestart[7]
Definition cp2k_print.c:110
gchar * cp2k_cons[2]
Definition cp2k_print.c:382
void print_variables_cp2k(GtkTextBuffer *buffer)
print the list of the CP2K input variables
Definition cp2k_print.c:739
gchar * cp2kspin[2]
Definition cp2k_print.c:337
gchar * cp2kincludes[3]
Definition cp2k_print.c:217
gchar * cp2ksroks[3]
Definition cp2k_print.c:340
gchar * vdw_fct[2]
Definition cp2k_print.c:380
void print_thermostat_cp2k(int n_thermo, GtkTextBuffer *buffer)
print CP2K thermostat(s) information
Definition cp2k_print.c:475
gchar * cp2ksvdw[4]
Definition cp2k_print.c:361
gchar * scf_wrestart[3][3]
Definition cp2k_print.c:213
gchar * cp2kglobal[9]
Definition cp2k_print.c:103
void print_var_section(int num, gchar **section, int i18p, int *i18pos, GtkTextBuffer *buffer)
print CP2K input file variable section
Definition cp2k_print.c:414
gchar * cp2kfev[8][17]
Definition cp2k_print.c:123
int v_thermo[2][CP2NTHERM]
Definition cpmd_nose.c:125
void print_coord_cp2k(GtkTextBuffer *buffer)
print atomic coordinates in CP2K input format
Definition cp2k_print.c:647
void print_cp2k_print(gchar *spaces, gchar *info, int i, int j, GtkTextBuffer *buffer)
print CP2K input file PRINT section content
gchar * cp2ksyst[3][3]
Definition cp2k_print.c:311
void print_motion_cp2k(int m, GtkTextBuffer *buffer)
print the CP2K input MOTION section
Definition cp2k_print.c:558
gchar * cp2kmocubes[7]
Definition cp2k_print.c:356
gchar * cp2kmotion[4][15]
Definition cp2k_print.c:252
void print_cp2k_var(gchar *var, GtkTextBuffer *buffer)
print a CP2K variable name
Definition cp2k_print.c:396
gchar * cp2k_fix[4]
Definition cp2k_print.c:384
gchar * cp2kmocu[3]
Definition cp2k_print.c:352
void print_global_cp2k(GtkTextBuffer *buffer)
print the CP2K input file GLOBAL section
gchar * globopts[49]
Definition cp2k_print.c:53
gchar * thermo_region[3]
Definition cp2k_print.c:226
gchar * cp2kbool(double opt)
print CP2K boolean
Definition cp2k_print.c:453
gchar * thermo_type[4][5]
Definition cp2k_print.c:233
gchar * cp2kroks[7]
Definition cp2k_print.c:344
gchar * cp2klat[2][19]
Definition cp2k_print.c:330
gchar * define_region[4]
Definition cp2k_print.c:228
gchar * cp2k_thermo[4]
Definition cp2k_print.c:224
gchar * cp2kvdw[4][7]
Definition cp2k_print.c:366
gchar * qs_extrapo[2]
Definition cp2k_print.c:210
void print_subsys_cp2k(GtkTextBuffer *buffer)
print the CP2K input SUBSYS section
Definition cp2k_print.c:690
int atoms[NUM_STYLES][2]
int * allocint(int val)
allocate an int * pointer
Definition global.c:301
#define i18n(String)
Definition global.c:80
Global variable declarations Global convenience function declarations Global data structure defin...
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Definition interface.c:869
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:434
Messaging function declarations.
double z
Definition ogl_draw.c:63
double y
Definition ogl_draw.c:63
double x
Definition ogl_draw.c:63
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
Definition w_search.c:756