From 10a6aae6d351f5164d2918b9b67b7b81b18cd7bb Mon Sep 17 00:00:00 2001 From: toshinagata1964 Date: Tue, 26 Aug 2014 11:40:08 +0000 Subject: [PATCH] On importing Gamess log file, 'energy' property values are sometimes set incorrectly. Fixed. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@564 a2be9bc6-48de-4e38-9406-05402d4bc13c --- Scripts/loadsave.rb | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Scripts/loadsave.rb b/Scripts/loadsave.rb index 7167ae0..afa2215 100755 --- a/Scripts/loadsave.rb +++ b/Scripts/loadsave.rb @@ -268,9 +268,9 @@ class Molecule 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 + # 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 @@ -311,8 +311,21 @@ class Molecule new_unit = false # create_frame else - if search_mode != 1 || nsearch > 1 - # The first frame for geometry search has the same coordinates as input + dont_create = false + if (search_mode == 1 && nsearch == 1) || first_line + # The input coordinate and the first frame for geometry search + # can have the same coordinate as the last frame; if this is the case, then + # do not create the new frame + select_frame(nframes - 1) + dont_create = true + each_atom { |ap| + if (ap.r - coords[ap.index]).length2 > 1e-8 + dont_create = false + break + end + } + end + if !dont_create create_frame([coords]) # Should not be (coords) end end -- 2.11.0