atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
cp2k_init.c File Reference

Initialization of the CP2K input assistant. More...

#include "global.h"
#include "callbacks.h"
#include "interface.h"
#include "project.h"
#include "glwindow.h"
#include "glview.h"
#include "calc.h"
#include "cp2k.h"
#include "cpmd.h"
+ Include dependency graph for cp2k_init.c:

Go to the source code of this file.

Macros

#define NC2OP   20
 

Functions

GtkWidget * thermo_box ()
 create the thermostat configuration widgets
 
void print_cp2k (int f, GtkTextBuffer *buffer)
 print the CP2K input file section
 
ColRGBA init_color (int id, int numid)
 initialize color based id number over total number of elements
 
GtkWidget * qm_preview_box (int c, int s, int l)
 prepare preview section widgets
 
void field_unselect_all ()
 unselect all atoms
 
GtkWidget * cpmd_box (GtkWidget *box, gchar *lab, int v_space, int h_space, int dim)
 prepare a labelled box widget for the CPMD input creation assistant
 
void create_selection_button (GtkWidget *box, int num, int id, gpointer data)
 create thermostat atom(s) selection button
 
void cp2k_fix_molecule ()
 CP2K assistant fixing fragment(s) - creating the dialog.
 
void print_start_buffer ()
 update of the GtkTextBuffer showing the CP2K input
 
G_MODULE_EXPORT void update_cp2k_option (GtkEntry *res, gpointer data)
 update CP2K option entry callback
 
G_MODULE_EXPORT void update_cp2k_option_check (GtkToggleButton *but, gpointer data)
 CP2K option toggle callback GTK3.
 
GtkWidget * create_vdw_box (int id)
 create the VdW informaiton and option(s) widgets
 
G_MODULE_EXPORT void changed_cp2k_option_box (GtkComboBox *box, gpointer data)
 change a GtkComboBox while creating a CP2K input file
 
G_MODULE_EXPORT void cp2k_option_dialog (GtkWidget *but, gpointer data)
 CP2K option dialog - creating the dialog.
 
G_MODULE_EXPORT void update_cp2k_parameter (GtkEntry *res, gpointer data)
 update some CP2K parameters
 
G_MODULE_EXPORT void update_cp2k_check (GtkToggleButton *but, gpointer data)
 update some CP2K parameter toggle callback GTK3
 
G_MODULE_EXPORT void cp2k_file_info (GtkTextBuffer *textbuf, gpointer data)
 update the C2PK information textview
 
GtkWidget * create_cp2k_spec_box (int spec)
 create a CP2K chemical species option combo box
 
gboolean cp2k_with_motion ()
 CP2K MD calculation ?
 
GtkWidget * vbox_cp2k (int s)
 create the CP2K assistant page vertical box
 
gchar * page_name_cp2k (int p)
 get CP2K assistant page name
 
G_MODULE_EXPORT void changed_cp2k_box (GtkComboBox *box, gpointer data)
 change CP2K option
 
void cp2k_option_box (GtkWidget *box, int id)
 create a CP2K option combo box
 
GtkWidget * cp2k_section_box (int s)
 create the CP2K assistant section box
 
gchar * cp_section_name (int p)
 get CP2K section name
 
G_MODULE_EXPORT void select_input_type (GtkToggleButton *but, gpointer data)
 select the input file type
 
GtkWidget * file_info (int id)
 create the assistant page that present the input file(s) properties
 
GtkWidget * init_cp2k ()
 initialize the CP2K input creation assistant
 
void add_cp2k_pages ()
 add pages to the CP2 assistant
 
int find_cp2k_sym ()
 find the CP2K symmetry parameter based on the cell properties
 

Variables

cp2ktmp_cp2k
 
double default_cp2k_options [41]
 
double default_vdw_cut [2] = {-2.00000000E+000, 1.05835442E+001}
 
double default_cp2k_extra [3][4] = {{0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {-1.0, -1.0, 1.0, 0.0}}
 
gchar * cp2k_unit [6] ={"s", "Ry", "fs", "K", "a.u.", "steps"}
 
int cp2k_default_num [12] = {7, 3, 3, 4, 3, 11, 8, 4, 10, 9, 4, 2}
 
gchar * cp2k_default_keywords [11][11]
 
gchar * cp2k_vdw_keywords [2][3] = {{"DRSLL", "LMKLL", "RVV10"}, {"DFTD2", "DFTD3", "DFTD3(BJ)"}}
 
gchar * cp2k_default_text [11][11]
 
gchar * cp2k_vdw_text [2][3]
 
int var_by_cp2sections [4] = {8, 20, 3, 10}
 
gchar * global_opts [40]
 
gchar * cpelemts [7]
 
gchar * cpsect [4]
 
char * k_thermo [CP2NTHERM][4]
 
int cp2k_opts_type [4][NC2OP]
 
int idunit
 
int checkb
 
int optionb
 
int motionb
 
GtkWidget * print_box
 
GtkWidget * vfbox [2]
 
GtkWidget * filebut [2]
 
GtkWidget * fileinf [2]
 
GtkWidget * cp2k_combo
 
GtkWidget * cp2k_label
 
GtkWidget * checked_box [2]
 
GtkWidget * option_box [4]
 
GtkWidget * motion_box [2]
 
GtkWidget * cp2k_vdw_box [2]
 
GtkWidget * cp2k_spec_box [2]
 
GtkWidget * cp2k_spec_combo
 
GtkWidget * spec_data_combo [2]
 
GtkWidget * cp2k_thermo_box
 

Detailed Description

Initialization of the CP2K input assistant.

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file cp2k_init.c.

Macro Definition Documentation

◆ NC2OP

#define NC2OP   20

Definition at line 212 of file cp2k_init.c.

Function Documentation

◆ add_cp2k_pages()

void add_cp2k_pages ( )

add pages to the CP2 assistant

Definition at line 1190 of file cp2k_init.c.

◆ changed_cp2k_box()

G_MODULE_EXPORT void changed_cp2k_box ( GtkComboBox * box,
gpointer data )

change CP2K option

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 734 of file cp2k_init.c.

◆ changed_cp2k_option_box()

G_MODULE_EXPORT void changed_cp2k_option_box ( GtkComboBox * box,
gpointer data )

change a GtkComboBox while creating a CP2K input file

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 332 of file cp2k_init.c.

◆ cp2k_file_info()

G_MODULE_EXPORT void cp2k_file_info ( GtkTextBuffer * textbuf,
gpointer data )

update the C2PK information textview

Parameters
textbufthe GtkTextBuffer sending the signal
datathe associated data pointer

Definition at line 638 of file cp2k_init.c.

◆ cp2k_fix_molecule()

void cp2k_fix_molecule ( )
extern

CP2K assistant fixing fragment(s) - creating the dialog.

Definition at line 243 of file cp2k_mol.c.

◆ cp2k_option_box()

void cp2k_option_box ( GtkWidget * box,
int id )

create a CP2K option combo box

Parameters
boxthe box to insert the new widgets in
idthe option id

Definition at line 801 of file cp2k_init.c.

◆ cp2k_option_dialog()

G_MODULE_EXPORT void cp2k_option_dialog ( GtkWidget * but,
gpointer data )

CP2K option dialog - creating the dialog.

Parameters
butthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 468 of file cp2k_init.c.

◆ cp2k_section_box()

GtkWidget * cp2k_section_box ( int s)

create the CP2K assistant section box

Parameters
sthe section id

Definition at line 822 of file cp2k_init.c.

◆ cp2k_with_motion()

gboolean cp2k_with_motion ( )

CP2K MD calculation ?

Definition at line 1169 of file cp2k_init.c.

◆ cp_section_name()

gchar * cp_section_name ( int p)

get CP2K section name

Parameters
pthe section id

Definition at line 972 of file cp2k_init.c.

◆ cpmd_box()

GtkWidget * cpmd_box ( GtkWidget * box,
gchar * lab,
int v_space,
int h_space,
int dim )
extern

prepare a labelled box widget for the CPMD input creation assistant

Parameters
boxthe GtkWidget sending the signal
labthe label
v_spacevertical spacing
h_spacehorizontal spacing
dimlabel width

Definition at line 248 of file cpmd_init.c.

◆ create_cp2k_spec_box()

GtkWidget * create_cp2k_spec_box ( int spec)

create a CP2K chemical species option combo box

Parameters
specthe chemical species

Definition at line 680 of file cp2k_init.c.

◆ create_selection_button()

void create_selection_button ( GtkWidget * box,
int num,
int id,
gpointer data )
extern

create thermostat atom(s) selection button

Parameters
boxthe GtkWidget sending the signal
numthe number of atom(s) already selected
id0 = ionic, 1 = fictitious electronic
datathe associated data pointer

Definition at line 1430 of file cpmd_nose.c.

◆ create_vdw_box()

GtkWidget * create_vdw_box ( int id)

create the VdW informaiton and option(s) widgets

Parameters
idthe type of VdW interactions

Definition at line 363 of file cp2k_init.c.

◆ field_unselect_all()

void field_unselect_all ( )
extern

unselect all atoms

Definition at line 130 of file dlp_viz.c.

◆ file_info()

GtkWidget * file_info ( int id)

create the assistant page that present the input file(s) properties

Parameters
idthe input file(s) type (0 = single, 1 = multiple)

Definition at line 1023 of file cp2k_init.c.

◆ find_cp2k_sym()

int find_cp2k_sym ( )

find the CP2K symmetry parameter based on the cell properties

Definition at line 1236 of file cp2k_init.c.

◆ init_color()

ColRGBA init_color ( int id,
int numid )
extern

initialize color based id number over total number of elements

Parameters
idthe id number
numidthe total number of elements

Definition at line 81 of file initcoord.c.

◆ init_cp2k()

GtkWidget * init_cp2k ( )

initialize the CP2K input creation assistant

Definition at line 1093 of file cp2k_init.c.

◆ page_name_cp2k()

gchar * page_name_cp2k ( int p)

get CP2K assistant page name

Parameters
pthe page id

Definition at line 1144 of file cp2k_init.c.

◆ print_cp2k()

void print_cp2k ( int f,
GtkTextBuffer * buffer )
extern

print the CP2K input file section

Parameters
fthe section id
bufferthe GtkTextBuffer to print into

Definition at line 1053 of file cp2k_print.c.

◆ print_start_buffer()

void print_start_buffer ( )

update of the GtkTextBuffer showing the CP2K input

Definition at line 245 of file cp2k_init.c.

◆ qm_preview_box()

GtkWidget * qm_preview_box ( int c,
int s,
int l )
extern

prepare preview section widgets

Parameters
c0 = CPMD, 1 = CP2K
ssection id
lspacing

Definition at line 890 of file cpmd_init.c.

◆ select_input_type()

G_MODULE_EXPORT void select_input_type ( GtkToggleButton * but,
gpointer data )

select the input file type

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 1008 of file cp2k_init.c.

◆ thermo_box()

GtkWidget * thermo_box ( )
extern

create the thermostat configuration widgets

Definition at line 1888 of file cpmd_nose.c.

◆ update_cp2k_check()

G_MODULE_EXPORT void update_cp2k_check ( GtkToggleButton * but,
gpointer data )

update some CP2K parameter toggle callback GTK3

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 591 of file cp2k_init.c.

◆ update_cp2k_option()

G_MODULE_EXPORT void update_cp2k_option ( GtkEntry * res,
gpointer data )

update CP2K option entry callback

Parameters
resthe GtkEntry the signal is coming from
datathe associated data pointer

Definition at line 266 of file cp2k_init.c.

◆ update_cp2k_option_check()

G_MODULE_EXPORT void update_cp2k_option_check ( GtkToggleButton * but,
gpointer data )

CP2K option toggle callback GTK3.

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 309 of file cp2k_init.c.

◆ update_cp2k_parameter()

G_MODULE_EXPORT void update_cp2k_parameter ( GtkEntry * res,
gpointer data )

update some CP2K parameters

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer

Definition at line 551 of file cp2k_init.c.

◆ vbox_cp2k()

GtkWidget * vbox_cp2k ( int s)

create the CP2K assistant page vertical box

Parameters
sthe section id

Definition at line 991 of file cp2k_init.c.

Variable Documentation

◆ checkb

int checkb

Definition at line 221 of file cp2k_init.c.

◆ checked_box

GtkWidget* checked_box[2]

Definition at line 230 of file cp2k_init.c.

◆ cp2k_combo

GtkWidget* cp2k_combo

Definition at line 228 of file cp2k_init.c.

◆ cp2k_default_keywords

gchar* cp2k_default_keywords[11][11]
Initial value:
= {{"ENERGY", "ENERGY_FORCES", "GEOMETRY_OPTIMIZATION", "MOLECULAR_DYNAMICS",
"VIBRATIONAL_ANALYSIS", "LINEAR_RESPONSE", "EHRENFEST_DYN", " ", " ", " ", " "},
{"LOW", "MEDIUM", "HIGH", " ", " ", " ", " ", " ", " ", " ", " "},
{"GPW", "GAPW", "GAPW_XC", " ", " ", " ", " ", " ", " ", " ", " "},
{"ATOMIC", "CORE", "RANDOM", "RESTART", " ", " ", " ", " ", " ", " ", " "},
{"BROYDEN", "CG", "DIIS", " ", " ", " ", " ", " ", " ", " ", " "},
{"BLYP", "B3LYP", "BEEFVDW", "BP", "HCTH120", "LDA", "OLYP", "PADE", "PBE", "PBE0", "TPSS"},
{"XYZ", "XY", "XZ", "YZ", "X", "Y", "Z", "NONE", " ", " ", " "},
{" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
{"CUBIC", "HEXAGONAL", "ORTHORHOMBIC", "RHOMBOHEDRAL",
"TETRAGONAL_AB", "TETRAGONAL_AC", "TETRAGONAL_BC", "MONOCLINIC", "TRICLINIC", "NONE", " "},
{"ISOKIN", "LANGEVIN", "NPE_F", "NPE_I", "NPT_F", "NPT_I", "NVE", "NVT", "NVT_ADIABATIC", " ", " "},
{"BFGS", "CG", " ", " ", " ", " ", " ", " ", " ", " ", " "}}

Definition at line 101 of file cp2k_init.c.

◆ cp2k_default_num

int cp2k_default_num[12] = {7, 3, 3, 4, 3, 11, 8, 4, 10, 9, 4, 2}

Definition at line 99 of file cp2k_init.c.

◆ cp2k_default_text

gchar* cp2k_default_text[11][11]
Initial value:
= {{"Single point energy calculation",
"Single point energy and forces calculation",
"Geometry optimization", "Molecular dynamics",
"Vibrational analysis", "Linear response calculation", "Ehrenfest dynamics", " ", " ", " ", " "},
{"Low", "Medium", "High", " ", " ", " ", " ", " ", " ", " ", " "},
{"Gaussian and plane waves method",
"Gaussian and augmented plane waves method",
"Gaussian and augmented plane waves method only for XC", " ", " ", " ", " ", " ", " ", " ", " "},
{"Generate an atomic density using the atomic code",
"Diagonalize the core Hamiltonian",
"Use random wave-function coefficients",
"Use the RESTART file", " ", " ", " ", " ", " ", " ", " "},
{"Broyden mixing approximating the inverse Hessian",
"Conjugate Gradients", "Direct inversion in the iterative subspace", " ", " ", " ", " ", " ", " ", " ", " "},
{"Becke + Lee-Yang-Parr", "Becke three-parameters hybrid + LYP", "Bayesian error estimation + van der Walls",
"Becke + Perdew", "Hamprecht-Cohen-Tozer-Handy", "Local Density Approximation", "Handy-Cohen + LYP", "Padé",
"Perdew + Burke-Ernzerhof", "Parameter-free PBE", "Tao-Perdew-Staroverov-Scuseria"},
{"3 dimensional (XYZ)", "2 dimensional (XY)", "2 dimensional (XZ)", "2 dimensional (YZ)",
"1 dimensional (X)", "1 dimensional (Y)", "1 dimensional (Z)", "Isolated system", " ", " ", " "},
{"Box parameters (a,b,c and α,β,γ)", "Lattice vectors", " ", " ", " ", " ", " ", " ", " ", " ", " "},
{"Cubic (a = b = c, α = β = γ = 90°)", "Hexagonal (a = b ≠ c, α = β = 90°, γ = 60°)",
"Orthorhombic (a ≠ b ≠ c, α = β = γ = 90°)", "Rhombohedral (a = b = c, α = β = γ ≠ 90°)",
"Tetragonal (a = b ≠ c, α = β = γ = 90°)", "Tetragonal (a = c ≠ b, α = β = γ = 90°)", "Tetragonal (a ≠ b = c, α = β = γ = 90°)",
"Monoclinic (a ≠ b ≠ c ≠ a, α = γ = 90°, β ≠ 90°)", "Triclinic (a ≠ b ≠ c ≠ a, α ≠ β ≠ γ ≠ α ≠ 90°)", "No cell symmetry", " "},
{"Constant kinetic energy", "Langevin dynamics (constant temperature)", "Constant pressure ensemble (no thermostat)",
"Constant pressure ensemble using an isotropic cell (no thermostat)", "Constant temperature and pressure using a flexible cell",
"Constant temperature and pressure using an isotropic cell", "Constant energy (µ-canonical)", "Constant temperature and volume (canonical)",
"Adiabatic dynamics in constant temperature and volume ensemble (CAFES)", " ", " "},
{"Diagonalization of a full Hessian matrix", "Conjugate gradients", " ", " ", " ", " ", " ", " ", " ", " ", " "}}

Definition at line 117 of file cp2k_init.c.

◆ cp2k_label

GtkWidget* cp2k_label

Definition at line 229 of file cp2k_init.c.

◆ cp2k_opts_type

int cp2k_opts_type[4][NC2OP]
Initial value:
= {{ 2, 1, 2, 3, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 3, 1, 3, 3, 3, 3, 3, 3, 3},
{ 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 2, -2, 1, 1, 1, 2, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}

Definition at line 215 of file cp2k_init.c.

◆ cp2k_spec_box

GtkWidget* cp2k_spec_box[2]

Definition at line 234 of file cp2k_init.c.

◆ cp2k_spec_combo

GtkWidget* cp2k_spec_combo

Definition at line 235 of file cp2k_init.c.

◆ cp2k_thermo_box

GtkWidget* cp2k_thermo_box

Definition at line 237 of file cp2k_init.c.

◆ cp2k_unit

gchar* cp2k_unit[6] ={"s", "Ry", "fs", "K", "a.u.", "steps"}

Definition at line 97 of file cp2k_init.c.

◆ cp2k_vdw_box

GtkWidget* cp2k_vdw_box[2]

Definition at line 233 of file cp2k_init.c.

◆ cp2k_vdw_keywords

gchar* cp2k_vdw_keywords[2][3] = {{"DRSLL", "LMKLL", "RVV10"}, {"DFTD2", "DFTD3", "DFTD3(BJ)"}}

Definition at line 115 of file cp2k_init.c.

◆ cp2k_vdw_text

gchar* cp2k_vdw_text[2][3]
Initial value:
= {{"Dion-Rydberg-Schroeder-Langreth-Lundqvist non-local van der Waals density functional",
"Lee-Murray-Kong-Lundqvist-Langreth non-local van der Waals density functional",
"Revised Vydrov-van Voorhis non-local van der Waals density functional"},
{"Grimme D2 method", "Grimme D3 method (zero damping)", "Grimme D3 method (Becke-Johnson damping)"}}

Definition at line 147 of file cp2k_init.c.

◆ cpelemts

gchar* cpelemts[7]
Initial value:
= {"The CP2K input structure",
"provides the general control parameters for the calculation to be performed",
"describes how the interatomic forces will be evaluated",
"describes the model: symmetry, periodicity and atomic species, pseudo-potentials and coordinates",
"describes the displacement of the atoms for molecular dynamics of geometry optimization",
"To describe the thermostat(s) for molecular dynamics",
"To describe the parameters required for restart"}

Definition at line 194 of file cp2k_init.c.

◆ cpsect

gchar* cpsect[4]
Initial value:
= {"GLOBAL",
"FORCE_EVAL",
"SUBSYS",
"MOTION"}

Definition at line 202 of file cp2k_init.c.

◆ default_cp2k_extra

double default_cp2k_extra[3][4] = {{0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {-1.0, -1.0, 1.0, 0.0}}

Definition at line 95 of file cp2k_init.c.

◆ default_cp2k_options

double default_cp2k_options[41]
Initial value:
= {0.0, 86400.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 300.0,
4.0, 0.0, 0.0, 50.0, 0.000001, 20.0, 0.00001, 2.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 7.0, 10000.0, 2.5, 300.0, 1.0, 10000.0, 0.0001, 10.0, 0.0,
0.0}

Definition at line 88 of file cp2k_init.c.

◆ default_vdw_cut

double default_vdw_cut[2] = {-2.00000000E+000, 1.05835442E+001}

Definition at line 94 of file cp2k_init.c.

◆ filebut

GtkWidget* filebut[2]

Definition at line 226 of file cp2k_init.c.

◆ fileinf

GtkWidget* fileinf[2]

Definition at line 227 of file cp2k_init.c.

◆ global_opts

gchar* global_opts[40]

Definition at line 153 of file cp2k_init.c.

◆ idunit

int idunit

Definition at line 220 of file cp2k_init.c.

◆ k_thermo

char* k_thermo[CP2NTHERM][4]
Initial value:
= {{"TIMECON_LANGEVIN", "TIMECON_NH", "MASS", "CHI"},
{"TIMECON", " ", " ", " "},
{" ", " ", " ", " "},
{"LENGTH", "MTS", "TIMECON", "YOSHIDA"}}

Definition at line 207 of file cp2k_init.c.

◆ motion_box

GtkWidget* motion_box[2]

Definition at line 232 of file cp2k_init.c.

◆ motionb

int motionb

Definition at line 223 of file cp2k_init.c.

◆ option_box

GtkWidget* option_box[4]

Definition at line 231 of file cp2k_init.c.

◆ optionb

int optionb

Definition at line 222 of file cp2k_init.c.

◆ print_box

GtkWidget* print_box

Definition at line 224 of file cp2k_init.c.

◆ spec_data_combo

GtkWidget* spec_data_combo[2]

Definition at line 236 of file cp2k_init.c.

◆ tmp_cp2k

cp2k* tmp_cp2k

Definition at line 86 of file cp2k_init.c.

◆ var_by_cp2sections

int var_by_cp2sections[4] = {8, 20, 3, 10}

Definition at line 152 of file cp2k_init.c.

◆ vfbox

GtkWidget* vfbox[2]

Definition at line 225 of file cp2k_init.c.