lineno = 0
last_line = ""
search_mode = 0
+ nserch = -1
rflag = 0
ne_alpha = ne_beta = 0
mo_count = 0
size = fplog.tell
last_i = nil
i = 0
- nserch = -1
while i < lines.count
line = lines[i]
if line =~ /GEOMETRY SEARCH POINT NSERCH= *(\d+)/
last_i = i
search_mode = 1
energy = nil
+ elsif line =~ /START OF DRC CALCULATION/
+ search_mode = 3
+ nserch = 1
+ energy = nil
elsif line =~ /CONSTRAINED OPTIMIZATION POINT/
search_mode = 2
energy = nil
elsif nserch > 0 && line =~ /ddikick\.x/
last_i = -1
break
- elsif mol && nserch > 0 && line =~ /COORDINATES OF ALL ATOMS/
- # There should be (natoms + 2) lines
- if i + mol.natoms + 3 <= lines.count
+ elsif mol && nserch > 0 && (line =~ /COORDINATES OF ALL ATOMS/ || line =~ /COORDINATES \(IN ANGSTROM\) FOR \$DATA GROUP ARE/)
+ # There should be (natoms) lines
+ if line =~ /COORDINATES OF ALL ATOMS/
+ # Skip header lines
+ i += 2
+ end
+ if i + mol.natoms + 1 <= lines.count
coords = []
- (i + 3...i + 3 + mol.natoms).each { |j|
+ (i + 1...i + 1 + mol.natoms).each { |j|
name, charge, x, y, z = lines[j].split
coords.push(Vector3D[x.to_f, y.to_f, z.to_f])
}
mol.set_property("energy", energy)
end
mol.display
- last_i = i + mol.natoms + 2
+ last_i = i + mol.natoms
i = last_i # Skip the processed lines
end
end
break
end
line.chomp!
- if line =~ /ATOM\s+ATOMIC\s+COORDINATES/ || line =~ /COORDINATES OF ALL ATOMS ARE/
+ if line =~ /ATOM\s+ATOMIC\s+COORDINATES/ || line =~ /COORDINATES OF ALL ATOMS ARE/ || line =~ /COORDINATES \(IN ANGSTROM\) FOR \$DATA GROUP ARE/
set_progress_message(mes + "\nReading atomic coordinates...")
if line =~ /ATOMIC/
first_line = true
if !new_unit
next # Skip initial atomic coordinates unless loading into an empty molecule
end
+ line = fp.gets # Skip one line
else
first_line = false
nsearch += 1
+ if line =~ /COORDINATES OF ALL ATOMS ARE/
+ line = fp.gets # Skip one line
+ end
end
- line = fp.gets # Skip one line
n = 0
coords = []
names = []
while (line = fp.gets) != nil
- break if line =~ /^\s*$/ || line =~ /END OF ONE/
+ break if line =~ /^\s*$/ || line =~ /END OF ONE/ || line =~ /\$END/
next if line =~ /-----/
name, charge, x, y, z = line.split
v = Vector3D[x, y, z]