Commit 3d3e3d06 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed issue in not giving the geometry optimization completion flag properly,...

Fixed issue in not giving the geometry optimization completion flag properly, fixed issue in reading geometry optimization frames if maximum number of steps reached.
parent 13e0bfa7
......@@ -44,6 +44,8 @@ class CP2KGeoOptParser(MainHierarchicalParser):
self.cache_service.add("frame_sequence_potential_energy", [])
self.cache_service.add("frame_sequence_local_frames_ref", [])
self.cache_service.add("geometry_optimization_method")
self.cache_service.add("geometry_optimization_converged")
self.cache_service.add("geometry_opt_max_reached")
#=======================================================================
# Cache levels
......@@ -62,15 +64,12 @@ class CP2KGeoOptParser(MainHierarchicalParser):
subMatchers=[
SM( " *** CONJUGATE GRADIENTS ***".replace("*", "\*"),
adHoc=self.adHoc_conjugate_gradient(),
otherMetaInfo=["geometry_optimization_method"],
),
SM( " *** BFGS ***".replace("*", "\*"),
adHoc=self.adHoc_bfgs(),
otherMetaInfo=["geometry_optimization_method"],
),
SM( " *** L-BFGS ***".replace("*", "\*"),
adHoc=self.adHoc_bfgs(),
otherMetaInfo=["geometry_optimization_method"],
),
# SM( "",
# forwardMatch=True,
......@@ -79,11 +78,8 @@ class CP2KGeoOptParser(MainHierarchicalParser):
# self.cm.quickstep_calculation(),
# SM( " -------- Informations at step"),
# SM( " Optimization Method =\s+(?P<x_cp2k_optimization_method>{})".format(self.regexs.word)),
# SM( " Total Energy =\s+(?P<x_cp2k_optimization_energy__hartree>{})".format(self.regexs.float),
# otherMetaInfo=["frame_sequence_potential_energy"]
# ),
# SM( " Total Energy =\s+(?P<x_cp2k_optimization_energy__hartree>{})".format(self.regexs.float)),
# ],
# otherMetaInfo=["atom_positions"],
# adHoc=self.adHoc_step(),
# ),
SM( " OPTIMIZATION STEP:",
......@@ -94,9 +90,6 @@ class CP2KGeoOptParser(MainHierarchicalParser):
SM( "",
forwardMatch=True,
sections=["x_cp2k_section_geometry_optimization_step"],
otherMetaInfo=[
"atom_positions",
],
subMatchers=[
# SM( "",
# forwardMatch=True,
......@@ -126,23 +119,17 @@ class CP2KGeoOptParser(MainHierarchicalParser):
# ),
SM( " -------- Informations at step"),
SM( " Optimization Method =\s+(?P<x_cp2k_optimization_method>{})".format(self.regexs.word)),
SM( " Total Energy =\s+(?P<x_cp2k_optimization_energy__hartree>{})".format(self.regexs.float),
otherMetaInfo=["frame_sequence_potential_energy"]
),
SM( " Total Energy =\s+(?P<x_cp2k_optimization_energy__hartree>{})".format(self.regexs.float)),
SM( " Real energy change =\s+(?P<x_cp2k_optimization_energy_change__hartree>{})".format(self.regexs.float)),
SM( " Decrease in energy =\s+(?P<x_cp2k_optimization_energy_decrease>{})".format(self.regexs.word)),
SM( " Used time =\s+(?P<x_cp2k_optimization_used_time>{})".format(self.regexs.float)),
SM( " Max. step size =\s+(?P<x_cp2k_optimization_max_step_size__bohr>{})".format(self.regexs.float)),
SM( " Conv. limit for step size =\s+(?P<x_cp2k_optimization_step_size_convergence_limit__bohr>{})".format(self.regexs.float),
otherMetaInfo=["geometry_optimization_geometry_change"]
),
SM( " Conv. limit for step size =\s+(?P<x_cp2k_optimization_step_size_convergence_limit__bohr>{})".format(self.regexs.float)),
SM( " Convergence in step size =\s+(?P<x_cp2k_optimization_step_size_convergence>{})".format(self.regexs.word)),
SM( " RMS step size =\s+(?P<x_cp2k_optimization_rms_step_size__bohr>{})".format(self.regexs.float)),
SM( " Convergence in RMS step =\s+(?P<x_cp2k_optimization_rms_step_size_convergence>{})".format(self.regexs.word)),
SM( " Max. gradient =\s+(?P<x_cp2k_optimization_max_gradient__bohr_1hartree>{})".format(self.regexs.float)),
SM( " Conv. limit for gradients =\s+(?P<x_cp2k_optimization_gradient_convergence_limit__bohr_1hartree>{})".format(self.regexs.float),
otherMetaInfo=["geometry_optimization_threshold_force"]
),
SM( " Conv. limit for gradients =\s+(?P<x_cp2k_optimization_gradient_convergence_limit__bohr_1hartree>{})".format(self.regexs.float)),
SM( " Conv. for gradients =\s+(?P<x_cp2k_optimization_max_gradient_convergence>{})".format(self.regexs.word)),
SM( " RMS gradient =\s+(?P<x_cp2k_optimization_rms_gradient__bohr_1hartree>{})".format(self.regexs.float)),
SM( " Conv. in RMS gradients =\s+(?P<x_cp2k_optimization_rms_gradient_convergence>{})".format(self.regexs.word)),
......@@ -153,7 +140,9 @@ class CP2KGeoOptParser(MainHierarchicalParser):
),
SM( " *** GEOMETRY OPTIMIZATION COMPLETED ***".replace("*", "\*"),
adHoc=self.adHoc_geo_opt_converged(),
otherMetaInfo=["geometry_optimization_converged"]
),
SM( " *** MAXIMUM NUMBER OF OPTIMIZATION STEPS REACHED ***".replace("*", "\*"),
adHoc=self.adHoc_geo_opt_max_steps_reached(),
),
SM( " Reevaluating energy at the minimum",
# sections=["x_cp2k_section_geometry_optimization_energy_reevaluation"],
......@@ -192,6 +181,12 @@ class CP2KGeoOptParser(MainHierarchicalParser):
]
)
#===========================================================================
# onOpen triggers
def onOpen_section_frame_sequence(self, backend, gIndex, section):
self.cache_service["geometry_optimization_converged"] = False
self.cache_service["geometry_opt_max_reached"] = False
#===========================================================================
# onClose triggers
def onClose_x_cp2k_section_geometry_optimization(self, backend, gIndex, section):
......@@ -229,8 +224,13 @@ class CP2KGeoOptParser(MainHierarchicalParser):
if add_last_setting == "NUMERIC" or add_last_setting == "SYMBOLIC":
add_last = True
# Push the trajectory
# Determine number of steps. If the optimization was quit due to
# maximum number of steps reached, the energy for the last step is not
# calculated, and thus the final geometry is not reported. This is
# detected and then the number of frames is adjusted.
n_steps = len(steps) + 1
if self.cache_service["geometry_opt_max_reached"]:
n_steps -= 1
last_step = n_steps - 1
# First push the original system geometry
......@@ -259,6 +259,9 @@ class CP2KGeoOptParser(MainHierarchicalParser):
self.cache_service.addArrayValues("frame_sequence_local_frames_ref")
backend.addValue("number_of_frames_in_sequence", n_steps)
def onClose_section_frame_sequence(self, backend, gIndex, section):
self.cache_service.addValue("geometry_optimization_converged")
def onClose_section_sampling_method(self, backend, gIndex, section):
self.backend.addValue("sampling_method", "geometry_optimization")
......@@ -297,14 +300,14 @@ class CP2KGeoOptParser(MainHierarchicalParser):
"""Called when the geometry optimization converged.
"""
def wrapper(parser):
parser.backend.addValue("geometry_optimization_converged", True)
self.cache_service["geometry_optimization_converged"] = True
return wrapper
def adHoc_geo_opt_not_converged(self):
"""Called when the geometry optimization did not converge.
def adHoc_geo_opt_max_steps_reached(self):
"""Called when the geometry optimization converged.
"""
def wrapper(parser):
parser.backend.addValue("geometry_optimization_converged", False)
self.cache_service["geometry_opt_max_reached"] = True
return wrapper
def adHoc_conjugate_gradient(self):
......
56
i = 1, E = 6751.8458923182
Cu 10.0038483358 9.9964245383 10.1626345673
Cu 9.9918414925 10.0166342305 12.5893164842
Cu 9.9483296945 10.0234409113 15.1657471299
Cu 11.8029710681 8.7129873345 13.7502748196
Cu 11.7725866377 8.6870689041 11.2065902397
Cu 11.7651820719 11.3084974262 11.2077589322
Cu 9.3490966802 12.0458387804 11.1980966471
Cu 7.8558864592 9.9968833362 11.1931526222
Cu 9.3519593754 7.9428146361 11.2069696414
Cu 10.6474583740 7.9573548911 9.0613859246
Cu 12.1371295080 10.0053564133 9.0688759615
Cu 10.6338213394 12.0284236281 9.0848824442
Cu 8.2727763588 11.2812746736 9.0773392949
Cu 8.2601857027 8.7174679928 9.0699563717
Cu 9.9882007968 9.9940988703 7.7565531865
Cu 13.6595070001 7.3809001882 12.4331750188
Cu 13.6260224226 12.6110857427 12.4190129259
Cu 8.6602787364 14.1886037021 12.3585962399
Cu 5.6150927855 10.0119630985 12.3542863533
Cu 8.6256441717 5.7715334757 12.4024438582
Cu 11.2973238334 5.8395562303 7.8908821441
Cu 14.3438124527 10.0236828775 7.8949490722
Cu 11.2703503155 14.1090566168 7.9271543979
Cu 6.5116779780 12.4912816781 7.9366921857
Cu 6.4492991075 7.5257952008 7.9288143114
Cu 9.9787505953 10.0383432331 5.3355004413
Cu 11.8124932603 11.3644452087 13.7713524595
Cu 9.3381384594 12.1435834931 13.7414160693
Cu 7.7211871670 10.0165022106 13.7292922250
Cu 9.3427058165 7.8237493433 13.7654563551
Cu 13.7072324286 10.0206741440 12.3557096913
Cu 11.1569286085 6.4638918547 12.3574481084
Cu 12.5460991029 6.4757536595 10.1426510785
Cu 14.0233576337 8.7105511326 10.1309283850
Cu 11.1299223737 13.5097063375 12.3261848599
Cu 14.0158847430 11.3622265795 10.1315403839
Cu 12.5257457270 13.5059868130 10.1419201081
Cu 7.1105443296 12.1529818751 12.3077367914
Cu 9.9745395667 14.1856255859 10.1331141342
Cu 7.4861991723 13.4482986994 10.1340694049
Cu 7.0910677779 7.8818215430 12.3386326416
Cu 6.0589192796 11.2830091973 10.1408567747
Cu 6.0106974685 8.6943678244 10.1512083871
Cu 7.4408494742 6.5211461100 10.1540157466
Cu 9.9822722513 5.7717379840 10.1454899438
Cu 12.8594478368 7.8726888619 7.9319249022
Cu 8.8519995377 6.5689228890 7.9418754633
Cu 10.6051046314 7.9347912155 6.5289006652
Cu 12.8327079519 12.1110734093 7.9440382170
Cu 12.1853528421 10.0115385537 6.5499356056
Cu 8.8442735060 13.4070294260 7.9732743339
Cu 10.5853967474 12.1114715774 6.5948379189
Cu 6.4185162167 10.0197683736 7.9679222131
Cu 8.2187119797 11.2744701327 6.5785363435
Cu 8.2163773512 8.7181027225 6.5535408968
H 7.5234889970 11.8150136913 5.2465575104
56
i = 2, E = 8430.9216586947
Cu 10.0277566069 9.9765145373 10.2169439392
Cu 9.9822183062 10.0474587163 12.5906194476
Cu 9.9196940410 10.0325333839 15.1762151270
Cu 11.6730591712 8.8567266661 13.5002748196
Cu 11.7661004319 8.6560706966 11.1679546980
Cu 11.7682629295 11.3377219798 11.1890223984
Cu 9.3948654687 12.0100626185 11.2283313401
Cu 7.9078035025 9.9633460648 11.2163534200
Cu 9.3872110251 7.9624932954 11.1772374388
Cu 10.6530096230 7.9513520711 9.0993563595
Cu 12.1386383789 9.9930304826 9.1204545896
Cu 10.6206751001 11.9789185604 9.1455378160
Cu 8.3193171562 11.2859579208 9.1280891650
Cu 8.2940745426 8.6798975000 9.1011344970
Cu 10.0013969983 9.9553040479 7.8162962737
Cu 13.6458953131 7.4433625659 12.5175470224
Cu 13.7303674350 12.6371210965 12.5531191082
Cu 8.6511072940 14.3211676125 12.4540525731
Cu 5.5003663354 10.0156879056 12.4442239185
Cu 8.6216437765 5.6884314177 12.5172715742
Cu 11.2639485662 5.7297584750 7.7611090122
Cu 14.4205811553 10.0535609472 7.7706445681
Cu 11.2212992376 14.1578709694 7.8497301583
Cu 6.4831689834 12.4444721077 7.8515280503
Cu 6.3489679592 7.5618430994 7.8435905463
Cu 9.9689464850 10.0710992053 5.3086186326
Cu 11.7611011263 11.3978763341 13.6717951386
Cu 9.3909960818 12.2005896861 13.8346261348
Cu 7.6491471521 10.0060572245 13.7879167211
Cu 9.4311041370 7.8403788939 13.6085767947
Cu 13.6509710212 10.0597047220 12.2583093625
Cu 11.1445375041 6.4921017803 12.2528180323
Cu 12.6419954328 6.3321407002 10.1837233286
Cu 14.0729545117 8.7472257272 10.1766957847
Cu 11.1576567968 13.6481818703 12.3329350579
Cu 14.0723423260 11.4461861624 10.1396556491
Cu 12.6220650109 13.6322954397 10.1745187539
Cu 7.1191755324 12.2066973904 12.3220659640
Cu 9.9719118171 14.1731699077 10.1557665134
Cu 7.4288201598 13.5116392661 10.1475568138
Cu 7.0549791729 7.8327890001 12.3579913664
Cu 6.1279260994 11.2316173791 10.1599985539
Cu 6.0241041693 8.6318029427 10.1974309130
Cu 7.3479237604 6.4131175055 10.1815455982
Cu 9.9893024752 5.7092357329 10.1778337829
Cu 12.8793462104 7.8007781305 7.9721840339
Cu 8.8220458319 6.4859192586 7.9730714969
Cu 10.5486497856 7.9333609136 6.4649979505
Cu 12.8183647811 12.1413067409 7.9807220907
Cu 12.1964830736 10.0072556743 6.5352506267
Cu 8.7917784784 13.4281367044 8.0197588421
Cu 10.5031022245 12.1119184052 6.6356271462
Cu 6.4144252618 10.0232152787 8.0071159578
Cu 8.2324315178 11.2183911386 6.5829356012
Cu 8.2384208941 8.6820670686 6.5069590389
H 7.6399737181 11.7305963176 5.4782809830
56
i = 3, E = 8899.0076198564
Cu 10.0393671799 9.9664993238 10.2415248987
Cu 10.0713624282 9.9770916382 12.6243983096
Cu 9.9443298234 10.0152780092 15.1399794368
Cu 11.5261357209 8.9417731398 13.2502748196
Cu 11.7236990782 8.6650133115 11.2510439321
Cu 11.7939729928 11.2900556938 11.2649509158
Cu 9.4039886980 11.9906089401 11.2445155487
Cu 7.9276006476 9.9581062683 11.2345656409
Cu 9.4634255563 7.9461517798 11.2899224224
Cu 10.6655393470 7.9516408893 9.1268265898
Cu 12.1412370452 9.9803527901 9.1468102197
Cu 10.6207475801 11.9713011815 9.1511118765
Cu 8.3238579279 11.2821308918 9.1330563949
Cu 8.3025918143 8.6815670352 9.1101490121
Cu 10.0030666427 9.9537569593 7.8241356359
Cu 13.5910959514 7.4866580594 12.5206333219
Cu 13.7357869725 12.5978042556 12.6020955810
Cu 8.6569084213 14.3194533049 12.4732460182
Cu 5.5042142245 10.0096418486 12.4631256785
Cu 8.6600733158 5.7192814102 12.5390399758
Cu 11.2752055563 5.7183761150 7.7776184090
Cu 14.4352752611 10.0461874206 7.7852917153
Cu 11.2196781775 14.1553896596 7.8495577828
Cu 6.4847563282 12.4428942740 7.8522471460
Cu 6.3503931169 7.5646503978 7.8430192150
Cu 9.9690322966 10.0714271138 5.3109735828
Cu 11.6705000138 11.3081590368 13.5423925064
Cu 9.4405019437 12.1350493102 13.7973789225
Cu 7.7072709840 9.9991265301 13.7459570210
Cu 9.5053052588 7.9424649456 13.4188407450
Cu 13.5206944815 10.0215760740 12.1889220636
Cu 11.0941449142 6.6458268261 12.1528032618
Cu 12.5824971443 6.3756061135 10.2211190640
Cu 13.9878925786 8.7782974951 10.2328302591
Cu 11.1657642196 13.6220346371 12.3502409555
Cu 14.0614021919 11.4293913766 10.1598727568
Cu 12.6205263387 13.6252363726 10.1764209700
Cu 7.1243482605 12.2012039289 12.3232973342
Cu 9.9718831695 14.1676320927 10.1541000045
Cu 7.4298333519 13.5075006357 10.1463843310
Cu 7.1141756285 7.8349612902 12.3746431432
Cu 6.1332070959 11.2303507084 10.1602213792
Cu 6.0299244094 8.6338296923 10.1978428942
Cu 7.3589869654 6.4070732538 10.1999660081
Cu 10.0198991516 5.7552324768 10.2347565574
Cu 12.8778798601 7.8018028912 7.9851797305
Cu 8.8232980265 6.4910440839 7.9761538533
Cu 10.5481515452 7.9365664878 6.4683461013
Cu 12.8142366878 12.1385047735 7.9842755788
Cu 12.1931062816 10.0066439573 6.5388527840
Cu 8.7922829351 13.4252961501 8.0213713767
Cu 10.5024807676 12.1101415221 6.6385884228
Cu 6.4175107700 10.0231586347 8.0092274153
Cu 8.2337164380 11.2170121066 6.5859262884
Cu 8.2397134165 8.6830878201 6.5098392152
H 7.6399178479 11.7306700261 5.4781909067
&MOTION
&GEO_OPT
TYPE MINIMIZATION
OPTIMIZER BFGS
MAX_ITER 3
RMS_FORCE 3.0E-4
MAX_FORCE 4.5E-4
&END GEO_OPT
&END MOTION
&GLOBAL
PREFERRED_FFT_LIBRARY FFTSG
RUN_TYPE GEO_OPT
PROJECT_NAME gopt
EXTENDED_FFT_LENGTHS
PRINT_LEVEL MEDIUM
&END GLOBAL
&FORCE_EVAL
METHOD QuickStep
&PRINT
&FORCES
FILENAME forces
&EACH
MD 1
&END EACH
&END FORCES
&END PRINT
&SUBSYS
&PRINT
&CELL ON
&END CELL
&END PRINT
&TOPOLOGY
COORD_FILE_NAME adsorbate_structure.xyz
COORD_FILE_FORMAT XYZ
&CENTER_COORDINATES T
&END CENTER_COORDINATES
&END TOPOLOGY
&CELL
ABC [angstrom] 20 20 20
PERIODIC NONE
&END CELL
&KIND S
POTENTIAL GTH-PBE-q6
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Au
POTENTIAL GTH-PBE-q11
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND H
POTENTIAL GTH-PBE-q1
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Pt
POTENTIAL GTH-PBE-q18
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Y
POTENTIAL GTH-PBE-q11
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Zr
POTENTIAL GTH-PBE-q12
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Nb
POTENTIAL GTH-PBE-q13
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Mo
POTENTIAL GTH-PBE-q14
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Tc
POTENTIAL GTH-PBE-q15
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Fe
POTENTIAL GTH-PBE-q16
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Co
POTENTIAL GTH-PBE-q17
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Ni
POTENTIAL GTH-PBE-q18
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Cu
POTENTIAL GTH-PBE-q11
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&KIND Zn
POTENTIAL GTH-PBE-q12
BASIS_SET DZVP-MOLOPT-SR-GTH
&END KIND
&END SUBSYS
&DFT
POTENTIAL_FILE_NAME POTENTIAL
UKS
BASIS_SET_FILE_NAME BASIS_MOLOPT
&POISSON
PERIODIC NONE
POISSON_SOLVER WAVELET
&END POISSON
&QS
MAP_CONSISTENT
EXTRAPOLATION ASPC
EXTRAPOLATION_ORDER 4
METHOD GPW
EPS_DEFAULT 1.0E-12
&END QS
&MGRID
NGRIDS 4
REL_CUTOFF 30
CUTOFF 300
&END MGRID
&PRINT
&LOWDIN ON
FILENAME lowdin
&EACH
MD 1
&END EACH
&END LOWDIN
&PDOS
LOG_PRINT_KEY TRUE
APPEND
FILENAME dosfile
NLUMO -1
COMPONENTS .FALSE.
&END PDOS
&END PRINT
&XC
&VDW_POTENTIAL
POTENTIAL_TYPE PAIR_POTENTIAL
&PAIR_POTENTIAL
LONG_RANGE_CORRECTION .TRUE.
TYPE DFTD3(BJ)
CALCULATE_C9_TERM .TRUE.
REFERENCE_FUNCTIONAL PBE
REFERENCE_C9_TERM .TRUE.
PARAMETER_FILE_NAME dftd3.dat
&END PAIR_POTENTIAL
&END VDW_POTENTIAL
&XC_GRID
XC_SMOOTH_RHO NONE
XC_DERIV SPLINE2
&END XC_GRID
&XC_FUNCTIONAL PBE
&END XC_FUNCTIONAL
&END XC
&SCF
EPS_LUMO 0.000001
CHOLESKY INVERSE_DBCSR
MAX_SCF 1
EPS_SCF 1.0E-6
SCF_GUESS RESTART
ADDED_MOS 200
MAX_ITER_LUMO 10000
&SMEAR ON
ELECTRONIC_TEMPERATURE [K] 300
METHOD FERMI_DIRAC
&END SMEAR
&PRINT
&RESTART_HISTORY OFF
&END RESTART_HISTORY
&RESTART LOW
BACKUP_COPIES 0
&END RESTART
&END PRINT
&DIAGONALIZATION
ALGORITHM STANDARD
&END DIAGONALIZATION
&OUTER_SCF
EPS_SCF 1.0E-6
MAX_SCF 1
&END OUTER_SCF
&MIXING
NBUFFER 8
METHOD BROYDEN_MIXING
BETA 1.5
ALPHA 0.1
&END MIXING
&END SCF
&END DFT
&END FORCE_EVAL
This diff is collapsed.
......@@ -781,6 +781,44 @@ class TestGeoOpt(unittest.TestCase):
self.assertTrue(np.array_equal(result_end, expected_end))
class TestGeoOptMaxSteps(unittest.TestCase):
"""Tests that if a maximum number of steps is reached in geometry
optimization, the correct amount of frames is reported.
"""
@classmethod
def setUpClass(cls):
cls.results = get_result("geo_opt/max_steps")
def test_geometry_optimization_converged(self):
result = self.results["geometry_optimization_converged"]
self.assertFalse(result)
def test_number_of_frames_in_sequence(self):
result = self.results["number_of_frames_in_sequence"]
self.assertEqual(result, 3)
def test_frame_sequence_to_sampling_ref(self):
result = self.results["frame_sequence_to_sampling_ref"]
self.assertEqual(result, 0)
def test_frame_sequence_local_frames_ref(self):
result = self.results["frame_sequence_local_frames_ref"]
expected_result = np.array([0, 1, 2])
self.assertTrue(np.array_equal(result, expected_result))
def test_sampling_method(self):
result = self.results["sampling_method"]
self.assertEqual(result, "geometry_optimization")
def test_frame_sequence_potential_energy(self):
result = self.results["frame_sequence_potential_energy"]
self.assertEqual(len(result), 3)
def test_atom_positions(self):
result = self.results["atom_positions"]
self.assertEqual(len(result), 3)
class TestGeoOptTrajFormats(unittest.TestCase):
"""Different trajectory formats in geometry optimization.
"""
......@@ -1370,6 +1408,7 @@ if __name__ == '__main__':
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestForceFiles))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestPreprocessor))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOpt))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptMaxSteps))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajFormats))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptOptimizers))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajectory))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment