lib/vasputils/poscar.rb in vasputils-0.1.3 vs lib/vasputils/poscar.rb in vasputils-0.1.4

- old
+ new

@@ -44,11 +44,11 @@ #line 3-5: axes (3x3 Array of float) axes = [] 3.times do |i| #each axis of a, b, c. vec = io.readline.strip.split(/\s+/) #in x,y,z directions - axes << vec.collect! { |i| i.to_f * scale } #multiply scaling factor + axes << vec.collect! { |j| j.to_f * scale } #multiply scaling factor end # Element symbol (vasp 5). Nothing in vasp 4. #elements = io.readline.strip.split(/\s+/).map{|i| i.to_i} @@ -218,11 +218,11 @@ ) total_id += 1 end end - cell = klass.new(axes, atoms) + klass.new(axes, atoms) end # selective_dynamics は常に on にする。 # 各要素の真偽値は 2つの POSCAR の論理積。 # 指定がなければ true と見做す。 @@ -268,12 +268,12 @@ other.selective_dynamics ), :direct => true, :positions => new_positions } - correct = VaspUtils::Poscar.new(hash) + VaspUtils::Poscar.new(hash) end # def ==(other) result = true @@ -377,16 +377,14 @@ end def sprint_position(i) str = sprintf(" % 18.15f % 18.15f % 18.15f", * @positions[i]) if @selective_dynamics - if @movable_flags - @movable_flags[i].each do |flag| - (flag == true) ? str += " T" : str += " F" - end - else - str += " T T T" + @selective_dynamics[i].each do |flag| + (flag == true) ? str += " T" : str += " F" end + else + #str += " T T T" end str end end