lib/crystalcell/cell.rb in crystalcell-0.0.6 vs lib/crystalcell/cell.rb in crystalcell-0.1.0

- old
+ new

@@ -133,11 +133,11 @@ #a_max : a 軸方向のセルの方向を整数で示したときの最大値 #b_min : b 軸方向のセルの方向を整数で示したときの最小値 #b_max : b 軸方向のセルの方向を整数で示したときの最大値 #c_min : c 軸方向のセルの方向を整数で示したときの最小値 #c_max : c 軸方向のセルの方向を整数で示したときの最大値 - #-1, 1, -1, 1, -1, 1 と指定すれば 3x3x3 の 27倍体積の構造になる。 + #-1, 1, -1, 1, -1, 1 と指定すれば 3x3x3 の 27倍の原子数になる。 def atoms_in_supercell( a_min, a_max, b_min, b_max, c_min, c_max ) results = [] @atoms.each do |atom| a_min.upto( a_max ) do |a| b_min.upto( b_max ) do |b| @@ -289,11 +289,11 @@ end #Generate a new cell with the same lattice consants, #containing atoms of indicated elements. #Argument 'elems' must be an array of element names. - #含まれる @atoms の順序は、保存される。元素ごとに並び換えたりしない。 + #含まれる @atoms の順序は保存される。元素ごとに並び換えたりしない。 #CrystalCell::Atom.element が elems の要素のどれかと完全一致しているもののみ対象となる。 #サブクラスのインスタンスで実行した場合には、 #サブクラスのインスタンスとして生成する。 def cell_of_elements( elems ) result = self.class.new( @axes ) @@ -517,10 +517,15 @@ get_spg_dataset[12] end #ptg_symbol, ptg_num, trans_mat = getptg(rotations) + def to_povcell + #pp @axes + CrystalCell::Povray::Cell.new(@axes, @atoms) + end + private def get_spg_dataset axes_t = @axes.to_a.transpose poss = positions.map {|pos| pos.to_a} @@ -528,10 +533,10 @@ types = elements.map do |elem| table[elem] = ((table.size) +1) unless table.keys.include? elem table[elem] end hall_num= 0 - dataset = get_dataset(axes_t, poss, types, hall_num, @symprec, @angle_tolerance) + get_dataset(axes_t, poss, types, hall_num, @symprec, @angle_tolerance) end #POSCAR の内容の文字列を生成。 #文字列の配列ではなく、改行文字を含む1つの文字列である点に注意。 #