Commit 6edd89b1 authored by Ask Hjorth Larsen's avatar Ask Hjorth Larsen

enable more tests and fix sections when parsing structure relaxations

parent f3f4cfae
......@@ -255,29 +255,25 @@ infoFileDescription = SM(
name='name&version', required=True),
SM(r'reinit: System Label:\s*\S*', name='syslabel', forwardMatch=True,
adHoc=context.set_label),
SM(r'', weak=True, forwardMatch=True, name='system section',
sections=['section_system'],
subMatchers=[
ArraySM(r'siesta: Atomic coordinates \(Bohr\) and species',
r'siesta:\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+',
add_positions_and_labels),
ArraySM(r'siesta: Automatic unit cell vectors \(Ang\):',
r'siesta:\s*\S+\s*\S+\s*\S+',
get_array('simulation_cell', float, 1, 4, unit='angstrom'))
]),
SM(r'\s*Single-point calculation|\s*Begin \S+ opt\.',
name='singleconfig',
repeats=True,
# XXX some of the matchers should not be in single config calculation
sections=['section_single_configuration_calculation'],
sections=['section_single_configuration_calculation', 'section_system'],
subFlags=SM.SubFlags.Sequenced,
subMatchers=[
SM(r'', weak=True, forwardMatch=True, name='system section',
subMatchers=[
ArraySM(r'siesta: Atomic coordinates \(Bohr\) and species',
r'siesta:\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+',
add_positions_and_labels),
ArraySM(r'siesta: Automatic unit cell vectors \(Ang\):',
r'siesta:\s*\S+\s*\S+\s*\S+',
get_array('simulation_cell', float, 1, 4, unit='angstrom'))
]),
ArraySM(r'outcoor: Atomic coordinates \(Ang\):',
r'\s*\S+\s*\S+\s*\S+',
get_array('atom_positions', float, 0, 3, unit='angstrom')),
#ArraySM(r'outcell: Unit cell vectors \(Ang\):',
# r'\s*\S+\s*\S+\s*\S+',
# build_cell),
SM(r'\s*scf:\s*iscf', name='scf', required=True),
SM(r'SCF cycle converged after\s*%s\s*iterations'
% integer('number_of_scf_iterations'), name='scf-iterations'),
......@@ -291,9 +287,6 @@ infoFileDescription = SM(
# that pertains only to the last one, basically eigs and occs.
# Therefore we read a bit past the last config and try to trigger
# this as appropriate.
#SM(r'outcoor: Relaxed atomic coordinates',
# adHoc=read_eigenvalues),
#])
SM(r'', weak=True, name='After singleconfigs',
subFlags=SM.SubFlags.Sequenced,
subMatchers=[
......
......@@ -4,11 +4,35 @@ import org.specs2.mutable.Specification
object SiestaParserSpec extends Specification {
"SiestaParserTest" >> {
"test with json-events" >> {
"test H2O with json-events" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/H2O/out", "json-events") must_== ParseResult.ParseSuccess
}
"test with json" >> {
"test H2O with json" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/H2O/out", "json") must_== ParseResult.ParseSuccess
}
"test H2O-relax with json-events" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/H2O-relax/out", "json-events") must_== ParseResult.ParseSuccess
}
"test H2O-relax with json" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/H2O-relax/out", "json") must_== ParseResult.ParseSuccess
}
"test Al-bulk with json-events" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/Al-bulk/out", "json-events") must_== ParseResult.ParseSuccess
}
"test Al-bulk with json" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/Al-bulk/out", "json") must_== ParseResult.ParseSuccess
}
"test Al-slab with json-events" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/Al-slab/out", "json-events") must_== ParseResult.ParseSuccess
}
"test Al-slab with json" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/Al-slab/out", "json") must_== ParseResult.ParseSuccess
}
"test Fe with json-events" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/Fe/out", "json-events") must_== ParseResult.ParseSuccess
}
"test Fe with json" >> {
ParserRun.parse(SiestaParser, "parsers/siesta/test/examples/Fe/out", "json") must_== ParseResult.ParseSuccess
}
}
}
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