OSDN Git Service

AMBER prmtop/inpcrd export is improved for periodic systems.
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Wed, 20 Jul 2011 09:29:07 +0000 (09:29 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Wed, 20 Jul 2011 09:29:07 +0000 (09:29 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@74 a2be9bc6-48de-4e38-9406-05402d4bc13c

MolLib/MD/MDCore.c
MolLib/Ruby_bind/ruby_md.c
Scripts/md.rb

index 031049a..4e6dfc4 100644 (file)
@@ -1570,6 +1570,7 @@ md_prepare(MDArena *arena, int check_only)
        /*  Parameter checking only  */
        if (check_only) {
                arena->is_initialized = 1;  /*  Only static fields are ready  */
+               arena->mol->needsMDRebuild = 0;
                return NULL;
        }
        
index 96d11cd..099706f 100644 (file)
@@ -261,6 +261,7 @@ s_MDArena_Prepare(int argc, VALUE *argv, VALUE self)
                        IntGroupRelease(ig1);
                        free(upbuf);
                }
+               mol->needsMDRebuild = 0;  /*  We know the "modified" parameters are consistent with the MDArena  */
        }
 
        if (missing)
index 4d15dc2..fbba7c6 100755 (executable)
@@ -680,7 +680,7 @@ class Molecule
       ary.each_with_index { |x, i|
         fp.printf(fmts, x, (i % num == num - 1 ? "\n" : ""))
       }
-      fp.print "\n"
+      fp.print "\n" if ary.count % num != 0
     end
   
     par = self.parameter
@@ -711,7 +711,7 @@ class Molecule
           return nil
         end
         fragments.push(gr.length)
-        if last_solute == nil && self.atoms[gr[0]].seq_name == "SOLV"
+        if last_solute == nil && self.atoms[gr[0]].seg_name == "SOLV"
           #  Calculate the residue number of the last solute atom (gr[0] - 1)
           n = gr[0] - 1
           if n < 0
@@ -1008,6 +1008,9 @@ class Molecule
       fp.printf "%-80.80s\n", self.name
       fp.printf "%6d\n", self.natoms
       format_print(fp, 6, "12.7f", self.atoms.map { |ap| [ap.x, ap.y, ap.z] }.flatten )
+         if periodic
+           fp.printf "%12.7f%12.7f%12.7f%12.7f%12.7f%12.7f\n", box[0].length, box[1].length, box[2].length, 90, 90, 90
+         end
     }
   
     return true