crystal_MP_simple プログラム仕様

概要: マデルングポテンシャルを単純総和法で計算するスクリプト。 詳細説明:

このスクリプトは、指定された結晶構造(格子定数とサイト情報)に基づき、 単純総和法を用いてマデルングポテンシャルを計算します。 計算されたポテンシャルは、中心イオンからの距離の関数としてプロットされます。 tkcrystalbase.pyモジュールに依存します。

関連リンク:

crystal_MP_simple_usage

crystal.crystal_MP_simple.draw_box(ax, aij, nrange, color='black')

概要: 結晶の単位格子境界を3Dプロットに描画します。 詳細説明: 単位格子の辺を黒線(または指定された色)で描画します。

この関数はdraw_unitcellから呼び出されますが、nrangeは現在の実装では使用されていません。

引数:
param ax:

matplotlibの3D軸オブジェクト。

type ax:

matplotlib.axes._subplots.Axes3DSubplot

param aij:

(3, 3)のndarray、格子ベクトルa, b, cを表す。

type aij:

numpy.ndarray

param nrange:

描画する単位格子の範囲。[[xmin, xmax], [ymin, ymax], [zmin, zmax]]の形式。(現状未使用)

type nrange:

list of list of float

param color:

描画する線の色。デフォルトは'black'。

type color:

str

戻り値:
returns:

なし

rtype:

None

crystal.crystal_MP_simple.draw_unitcell(ax, sites, aij, nrange, color='black')

概要: 結晶の単位格子とその中の原子を3Dプロットに描画します。 詳細説明: draw_box関数を呼び出して単位格子を描画し、その後、sitesリスト内の原子を分数座標から

デカルト座標に変換してプロットします。nrangeは描画する単位格子の範囲を指定しますが、 このスクリプトのmain関数では現在呼び出されていません。

引数:
param ax:

matplotlibの3D軸オブジェクト。

type ax:

matplotlib.axes._subplots.Axes3DSubplot

param sites:

サイト情報のリスト。各サイトは[atom_name, site_label, atomic_number, atomic_mass, charge, radius, color, position]の形式。

type sites:

list of list

param aij:

(3, 3)のndarray、格子ベクトルa, b, cを表す。

type aij:

numpy.ndarray

param nrange:

描画する単位格子の範囲。[[xmin, xmax], [ymin, ymax], [zmin, zmax]]の形式。

type nrange:

list of list of int

param color:

単位格子を描画する線の色。デフォルトは'black'。

type color:

str

戻り値:
returns:

なし

rtype:

None

crystal.crystal_MP_simple.main()

概要: マデルングポテンシャルの計算と結果のプロットを実行します。 詳細説明:

格子定数から格子ベクトルや逆格子ベクトルを計算し、その情報を表示します。 指定された範囲rmax内で、原点にあるイオンに対するマデルングポテンシャルを 単純総和法で計算します。 計算されたポテンシャルは、距離rに対するグラフとして表示されます。 プログラム起動時のコマンドライン引数でrmaxとnrを設定することができます。

戻り値:
returns:

なし

rtype:

None

crystal.crystal_MP_simple.terminate()

概要: エラー発生時に使用方法を表示してスクリプトを終了します。 詳細説明: usage関数を呼び出して使用方法を出力した後、システムを終了します。 :returns: なし (スクリプトが終了するため) :rtype: None

crystal.crystal_MP_simple.usage()

概要: スクリプトの正しい使用方法を表示します。 詳細説明: コマンドライン引数rmaxとnrの指定方法をユーザーに示します。 :returns: なし :rtype: None