• R/O
  • SSH
  • HTTPS

molby: Commit


Commit MetaInfo

Revision92 (tree)
Time2011-08-03 19:09:48
Authortoshinagata1964

Log Message

On importing frcmod, atom type with a single character (like "c") was not recognized properly. Fixed.

Change Summary

Incremental Difference

--- trunk/Scripts/md.rb (revision 91)
+++ trunk/Scripts/md.rb (revision 92)
@@ -534,7 +534,8 @@
534534 name, weight = s.split
535535 wtable[name] = Float(weight)
536536 when 2
537- types, k, r0, com = s.split(" ", 4)
537+ types = s[0..4]
538+ k, r0, com = s[5..-1].split(" ", 3)
538539 pp = par.bonds.lookup(types, :local, :missing) || par.bonds.insert
539540 pp.atom_types = types
540541 pp.k = k
@@ -541,7 +542,8 @@
541542 pp.r0 = r0
542543 pp.comment = com
543544 when 3
544- types, k, a0, com = s.split(" ", 4)
545+ types = s[0..7]
546+ k, a0, com = s[8..-1].split(" ", 3)
545547 pp = par.angles.lookup(types, :local, :missing) || par.angles.insert
546548 pp.atom_types = types
547549 pp.k = k
@@ -548,7 +550,8 @@
548550 pp.a0 = a0
549551 pp.comment = com
550552 when 4
551- types, n, k, phi0, period, com = s.split(" ", 6)
553+ types = s[0..10]
554+ n, k, phi0, period, com = s[11..-1].split(" ", 5)
552555 pp = par.dihedrals.lookup(types, :local, :missing) || par.dihedrals.insert
553556 pp.atom_types = types
554557 pp.mult = 1
@@ -557,7 +560,8 @@
557560 pp.period = Float(period).round
558561 pp.comment = com
559562 when 5
560- types, k, phi0, period, com = s.split(" ", 5)
563+ types = s[0..10]
564+ k, phi0, period, com = s[11..-1].split(" ", 4)
561565 pp = par.impropers.lookup(types, :local, :missing) || par.impropers.insert
562566 pp.atom_types = types
563567 pp.mult = 1
Show on old repository browser