Commit 17564899 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Added parsing of cell periodicity from the the input file.

parent f3aa76b7
...@@ -54,7 +54,6 @@ lib/ ...@@ -54,7 +54,6 @@ lib/
env/ env/
# CP2K files # CP2K files
*.inp
*.wfn *.wfn
*.cube *.cube
parser/parser-cp2k/cp2kparser/versions/**/input_data/*.xml parser/parser-cp2k/cp2kparser/versions/**/input_data/*.xml
......
<HTML><BODY><HEAD><TITLE>The cp2k units list</TITLE>
<H1>CP2K Available Units of Measurement</H1>
<H2>Undefined</H2>
If the default unit of a keyword is explicitly undefined, all possible units of measurement can be used to define a proper value.<BR><DL>
<DD><B>internal_cp2k</B></DD>
</DL><P>
<H2>Energy</H2>
Possible units of measurement for Energies. The [energy] entry acts like a dummy flag (assumes the unit of measurement of energy is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>hartree</B></DD>
<DD><B>wavenumber_e</B></DD>
<DD><B>joule</B></DD>
<DD><B>kcalmol</B></DD>
<DD><B>kjmol</B></DD>
<DD><B>Ry</B></DD>
<DD><B>eV</B></DD>
<DD><B>K_e</B></DD>
<DD><B>energy</B></DD>
</DL><P>
<H2>Length</H2>
Possible units of measurement for Lengths. The [length] entry acts like a dummy flag (assumes the unit of measurement of length is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>bohr</B></DD>
<DD><B>m</B></DD>
<DD><B>pm</B></DD>
<DD><B>nm</B></DD>
<DD><B>angstrom</B></DD>
<DD><B>length</B></DD>
</DL><P>
<H2>Temperature</H2>
Possible units of measurement for Temperature. The [temperature] entry acts like a dummy flag (assumes the unit of measurement of temperature is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>K</B></DD>
<DD><B>au_temp</B></DD>
<DD><B>temperature</B></DD>
</DL><P>
<H2>Pressure</H2>
Possible units of measurement for Pressure. The [pressure] entry acts like a dummy flag (assumes the unit of measurement of pressure is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>bar</B></DD>
<DD><B>atm</B></DD>
<DD><B>kbar</B></DD>
<DD><B>Pa</B></DD>
<DD><B>MPa</B></DD>
<DD><B>GPa</B></DD>
<DD><B>au_p</B></DD>
<DD><B>pressure</B></DD>
</DL><P>
<H2>Angle</H2>
Possible units of measurement for Angles. The [angle] entry acts like a dummy flag (assumes the unit of measurement of angle is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>rad</B></DD>
<DD><B>deg</B></DD>
<DD><B>angle</B></DD>
</DL><P>
<H2>Time</H2>
Possible units of measurement for Time. The [time] entry acts like a dummy flag (assumes the unit of measurement of time is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>s</B></DD>
<DD><B>fs</B></DD>
<DD><B>ps</B></DD>
<DD><B>au_t</B></DD>
<DD><B>wavenumber_t</B></DD>
<DD><B>time</B></DD>
</DL><P>
<H2>Mass</H2>
Possible units of measurement for Masses. The [mass] entry acts like a dummy flag (assumes the unit of measurement of mass is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>kg</B></DD>
<DD><B>amu</B></DD>
<DD><B>m_e</B></DD>
<DD><B>mass</B></DD>
</DL><P>
<H2>Potential</H2>
Possible units of measurement for potentials. The [potential] entry acts like a dummy flag (assumes the unit of measurement of potential is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>volt</B></DD>
<DD><B>au_pot</B></DD>
<DD><B>potential</B></DD>
</DL><P>
<H2>Force</H2>
Possible units of measurement for forces. The [force] entry acts like a dummy flag (assumes the unit of measurement of force is in internal units), useful for dimensional analysis.<BR><DL>
<DD><B>N</B></DD>
<DD><B>Newton</B></DD>
<DD><B>mN</B></DD>
<DD><B>mNewton</B></DD>
<DD><B>au_f</B></DD>
<DD><B>force</B></DD>
</DL><P>
</BODY></HTML>
...@@ -23,6 +23,7 @@ class CP2KInputParser(BasicParser): ...@@ -23,6 +23,7 @@ class CP2KInputParser(BasicParser):
# Gather the information from the input file # Gather the information from the input file
self.fill_input_tree(self.file_path) self.fill_input_tree(self.file_path)
#=======================================================================
# Parse the used XC_functionals and their parameters # Parse the used XC_functionals and their parameters
xc = self.input_tree.get_section("FORCE_EVAL/DFT/XC/XC_FUNCTIONAL") xc = self.input_tree.get_section("FORCE_EVAL/DFT/XC/XC_FUNCTIONAL")
if xc is not None: if xc is not None:
...@@ -94,6 +95,31 @@ class CP2KInputParser(BasicParser): ...@@ -94,6 +95,31 @@ class CP2KInputParser(BasicParser):
if xc_summary is not "": if xc_summary is not "":
self.backend.addValue("XC_functional", xc_summary) self.backend.addValue("XC_functional", xc_summary)
#=======================================================================
# Cell periodicity
periodicity = self.input_tree.get_keyword("FORCE_EVAL/SUBSYS/CELL/PERIODIC").upper()
periodicity_list = None
if periodicity == "NONE":
periodicity_list = (False, False, False)
elif periodicity == "X":
periodicity_list = (True, False, False)
elif periodicity == "XY":
periodicity_list = (True, True, False)
elif periodicity == "XYZ":
periodicity_list = (True, True, True)
elif periodicity == "XZ":
periodicity_list = (True, False, True)
elif periodicity == "Y":
periodicity_list = (False, True, False)
elif periodicity == "YZ":
periodicity_list = (False, True, True)
elif periodicity == "Z":
periodicity_list = (False, False, True)
if periodicity_list is not None:
self.backend.addValue("configuration_periodic_dimensions", periodicity_list)
else:
logger.warning("Could not determine cell periodicity from FORCE_EVAL/SUBSYS/CELL/PERIODIC")
def fill_input_tree(self, file_path): def fill_input_tree(self, file_path):
"""Parses a CP2K input file into an object tree. """Parses a CP2K input file into an object tree.
......
&GLOBAL
PROJECT Si_bulk8
RUN_TYPE ENERGY_FORCE
PRINT_LEVEL MEDIUM
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&SUBSYS
&KIND Si
ELEMENT Si
BASIS_SET DZVP-GTH-PADE
POTENTIAL GTH-PADE-q4
&END KIND
&CELL
A 5.430697500 0.000000000 0.000000000
B 0.000000000 5.430697500 0.000000000
C 0.000000000 0.000000000 5.430697500
&END CELL
&COORD
Si 0.000000000 0.000000000 0.000000000
Si 0.000000000 2.715348700 2.715348700
Si 2.715348700 2.715348700 0.000000000
Si 2.715348700 0.000000000 2.715348700
Si 4.073023100 1.357674400 4.073023100
Si 1.357674400 1.357674400 1.357674400
Si 1.357674400 4.073023100 4.073023100
Si 4.073023100 4.073023100 1.357674400
&END COORD
&END SUBSYS
&DFT
BASIS_SET_FILE_NAME ../BASIS_SET
POTENTIAL_FILE_NAME ../GTH_POTENTIALS
&QS
EPS_DEFAULT 1.0E-10
&END QS
&MGRID
NGRIDS 4
CUTOFF 300
REL_CUTOFF 60
&END MGRID
&XC
&XC_FUNCTIONAL PADE
&END XC_FUNCTIONAL
&END XC
&SCF
SCF_GUESS ATOMIC
EPS_SCF 1.0E-7
MAX_SCF 300
&DIAGONALIZATION ON
ALGORITHM STANDARD
&END DIAGONALIZATION
&MIXING T
METHOD BROYDEN_MIXING
ALPHA 0.4
NBROYDEN 8
&END MIXING
&END SCF
&END DFT
&PRINT
&FORCES ON
&END FORCES
&END PRINT
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03
SCF_GUESS ATOMIC
&PRINT
&RESTART OFF
BACKUP_COPIES 0
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL B3LYP
&END XC_FUNCTIONAL
&END XC
&MGRID
CUTOFF 50
NGRIDS 2
REL_CUTOFF 25
&END MGRID
&END DFT
&SUBSYS
&COORD
Si 0.0 0.0 0.0
&END COORD
&CELL
A 5.4306975 0.0 0.0
C 0.0 0.0 5.4306975
B 0.0 5.4306975 0.0
PERIODIC XYZ
&END CELL
&KIND Si
POTENTIAL GTH-PADE-q4
BASIS_SET DZVP-GTH-PADE
&END KIND
&END SUBSYS
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03
SCF_GUESS ATOMIC
&PRINT
&RESTART OFF
BACKUP_COPIES 0
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL BLYP
&END XC_FUNCTIONAL
&END XC
&MGRID
CUTOFF 50
NGRIDS 2
REL_CUTOFF 25
&END MGRID
&END DFT
&SUBSYS
&COORD
Si 0.0 0.0 0.0
&END COORD
&CELL
A 5.4306975 0.0 0.0
C 0.0 0.0 5.4306975
B 0.0 5.4306975 0.0
PERIODIC XYZ
&END CELL
&KIND Si
POTENTIAL GTH-PADE-q4
BASIS_SET DZVP-GTH-PADE
&END KIND
&END SUBSYS
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03
SCF_GUESS ATOMIC
&PRINT
&RESTART OFF
BACKUP_COPIES 0
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL HCTH120
&END XC_FUNCTIONAL
&END XC
&MGRID
CUTOFF 50
NGRIDS 2
REL_CUTOFF 25
&END MGRID
&END DFT
&SUBSYS
&COORD
Si 0.0 0.0 0.0
&END COORD
&CELL
A 5.4306975 0.0 0.0
C 0.0 0.0 5.4306975
B 0.0 5.4306975 0.0
PERIODIC XYZ
&END CELL
&KIND Si
POTENTIAL GTH-PADE-q4
BASIS_SET DZVP-GTH-PADE
&END KIND
&END SUBSYS
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
PRINT_LEVEL MEDIUM
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03
SCF_GUESS ATOMIC
&PRINT
&RESTART OFF
BACKUP_COPIES 0
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL LDA
&END XC_FUNCTIONAL
&END XC
&MGRID
CUTOFF 50
NGRIDS 2
REL_CUTOFF 25
&END MGRID
&END DFT
&SUBSYS
&COORD
Si 0.0 0.0 0.0
&END COORD
&CELL
A 5.4306975 0.0 0.0
C 0.0 0.0 5.4306975
B 0.0 5.4306975 0.0
PERIODIC XYZ
&END CELL
&KIND Si
POTENTIAL GTH-PADE-q4
BASIS_SET DZVP-GTH-PADE
&END KIND
&END SUBSYS
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03
SCF_GUESS ATOMIC
&PRINT
&RESTART OFF
BACKUP_COPIES 0
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL OLYP
&END XC_FUNCTIONAL
&END XC
&MGRID
CUTOFF 50
NGRIDS 2
REL_CUTOFF 25
&END MGRID
&END DFT
&SUBSYS
&COORD
Si 0.0 0.0 0.0
&END COORD
&CELL
A 5.4306975 0.0 0.0
C 0.0 0.0 5.4306975
B 0.0 5.4306975 0.0
PERIODIC XYZ
&END CELL
&KIND Si
POTENTIAL GTH-PADE-q4
BASIS_SET DZVP-GTH-PADE
&END KIND
&END SUBSYS
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03
SCF_GUESS ATOMIC
&PRINT
&RESTART OFF
BACKUP_COPIES 0
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL PADE
&END XC_FUNCTIONAL
&END XC
&MGRID
CUTOFF 50
NGRIDS 2
REL_CUTOFF 25
&END MGRID
&END DFT
&SUBSYS
&COORD
Si 0.0 0.0 0.0
&END COORD
&CELL
A 5.4306975 0.0 0.0
C 0.0 0.0 5.4306975
B 0.0 5.4306975 0.0
PERIODIC XYZ
&END CELL
&KIND Si
POTENTIAL GTH-PADE-q4
BASIS_SET DZVP-GTH-PADE
&END KIND
&END SUBSYS
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03
SCF_GUESS ATOMIC
&PRINT
&RESTART OFF
BACKUP_COPIES 0
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL PBE
&END XC_FUNCTIONAL
&END XC
&MGRID
CUTOFF 50
NGRIDS 2
REL_CUTOFF 25
&END MGRID
&END DFT
&SUBSYS
&COORD
Si 0.0 0.0 0.0
&END COORD
&CELL
A 5.4306975 0.0 0.0
C 0.0 0.0 5.4306975
B 0.0 5.4306975 0.0
PERIODIC XYZ
&END CELL
&KIND Si
POTENTIAL GTH-PADE-q4
BASIS_SET DZVP-GTH-PADE
&END KIND
&END SUBSYS
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03
SCF_GUESS ATOMIC
&PRINT
&RESTART OFF
BACKUP_COPIES 0
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL PBE0
&END XC_FUNCTIONAL
&END XC
&MGRID
CUTOFF 50
NGRIDS 2
REL_CUTOFF 25
&END MGRID
&END DFT
&SUBSYS
&COORD
Si 0.0 0.0 0.0
&END COORD
&CELL
A 5.4306975 0.0 0.0
C 0.0 0.0 5.4306975
B 0.0 5.4306975 0.0
PERIODIC XYZ
&END CELL
&KIND Si
POTENTIAL GTH-PADE-q4
BASIS_SET DZVP-GTH-PADE
&END KIND
&END SUBSYS
&END FORCE_EVAL
&GLOBAL
RUN_TYPE ENERGY_FORCE
PROJECT_NAME si_bulk
PRINT_LEVEL MEDIUM
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
POTENTIAL_FILE_NAME ../../GTH_POTENTIALS
BASIS_SET_FILE_NAME ../../BASIS_SET
&QS
EPS_DEFAULT 1e-3
&END QS
&SCF
MAX_SCF 100
EPS_SCF 1e-03