atomes 1.3.1
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.", i18n("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 1199 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 727 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 328 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 630 of file cp2k_init.c.

◆ cp2k_fix_molecule()

void cp2k_fix_molecule ( )
extern

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

Definition at line 244 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 794 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 464 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 815 of file cp2k_init.c.

◆ cp2k_with_motion()

gboolean cp2k_with_motion ( )

CP2K MD calculation ?

Definition at line 1177 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 975 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 244 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 672 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 1433 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 359 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 1030 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 1245 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 1101 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 1152 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 1095 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 906 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 1011 of file cp2k_init.c.

◆ thermo_box()

GtkWidget * thermo_box ( )
extern

create the thermostat configuration widgets

Definition at line 1891 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 587 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 547 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 994 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:
= {{i18n("Single Point Energy Calculation"),
i18n("Single Point Energy and Forces Calculation"),
i18n("Geometry Optimization"), i18n("Molecular Dynamics"),
i18n("Vibrational Analysis"), i18n("Linear Response Calculation"), i18n("Ehrenfest Dynamics"), " ", " ", " ", " "},
{i18n("Low"), i18n("Medium"), i18n("High"), " ", " ", " ", " ", " ", " ", " ", " "},
{i18n("Gaussian and Plane Waves Method"),
i18n("Gaussian and Augmented Plane Waves Method"),
i18n("Gaussian and Augmented Plane Waves Method Only for XC"), " ", " ", " ", " ", " ", " ", " ", " "},
{i18n("Generate an Atomic Density Using the Atomic Code"),
i18n("Diagonalize the Core Hamiltonian"),
i18n("Use Random Wave-function Coefficients"),
i18n("Use the RESTART File"), " ", " ", " ", " ", " ", " ", " "},
{i18n("Broyden Mixing Approximating the Inverse Hessian"),
i18n("Conjugate Gradients"), i18n("Direct Inversion in the Iterative Subspace"), " ", " ", " ", " ", " ", " ", " ", " "},
{"Becke + Lee-Yang-Parr", i18n("Becke Three-parameters Hybrid + LYP"), i18n("Bayesian Error Estimation + van der Walls"),
"Becke + Perdew", "Hamprecht-Cohen-Tozer-Handy", i18n("Local Density Approximation"), "Handy-Cohen + LYP", "Padé",
"Perdew + Burke-Ernzerhof", i18n("Parameter-free PBE"), "Tao-Perdew-Staroverov-Scuseria"},
{i18n("3 Dimensional (XYZ)"), i18n("2 Dimensional (XY)"), i18n("2 Dimensional (XZ)"), i18n("2 Dimensional (YZ)"),
i18n("1 Dimensional (X)"), i18n("1 Dimensional (Y)"), i18n("1 Dimensional (Z)"), i18n("Isolated System"), " ", " ", " "},
{i18n("Box Parameters (a,b,c and α,β,γ)"), i18n("Lattice Vectors"), " ", " ", " ", " ", " ", " ", " ", " ", " "},
{i18n("Cubic (a = b = c, α = β = γ = 90°)"), i18n("Hexagonal (a = b ≠ c, α = β = 90°, γ = 60°)"),
i18n("Orthorhombic (a ≠ b ≠ c, α = β = γ = 90°)"), i18n("Rhombohedral (a = b = c, α = β = γ ≠ 90°)"),
i18n("Tetragonal (a = b ≠ c, α = β = γ = 90°)"), i18n("Tetragonal (a = c ≠ b, α = β = γ = 90°)"), i18n("Tetragonal (a ≠ b = c, α = β = γ = 90°)"),
i18n("Monoclinic (a ≠ b ≠ c ≠ a, α = γ = 90°, β ≠ 90°)"), i18n("Triclinic (a ≠ b ≠ c ≠ a, α ≠ β ≠ γ ≠ α ≠ 90°)"), i18n("No Cell Symmetry"), " "},
{i18n("Constant kinetic energy"), i18n("Langevin dynamics (constant temperature)"), i18n("Constant pressure ensemble (no thermostat)"),
i18n("Constant pressure ensemble using an isotropic cell (no thermostat)"), i18n("Constant temperature and pressure using a flexible cell"),
i18n("Constant temperature and pressure using an isotropic cell"), i18n("Constant energy (µ-canonical)"), i18n("Constant temperature and volume (canonical)"),
i18n("Adiabatic dynamics in constant temperature and volume ensemble (CAFES)"), " ", " "},
{i18n("Diagonalization of a full Hessian matrix"), i18n("Conjugate gradients"), " ", " ", " ", " ", " ", " ", " ", " ", " "}}
#define i18n(String)
Definition global.c:80

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.", i18n("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:
= {{i18n("Dion-Rydberg-Schroeder-Langreth-Lundqvist non-local van der Waals density functional"),
i18n("Lee-Murray-Kong-Lundqvist-Langreth non-local van der Waals density functional"),
i18n("Revised Vydrov-van Voorhis non-local van der Waals density functional")},
{i18n("Grimme D2 method"), i18n("Grimme D3 method (zero damping)"), i18n("Grimme D3 method (Becke-Johnson damping)")}}

Definition at line 147 of file cp2k_init.c.

◆ cpelemts

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