- 追加された行はこの色です。
- 削除された行はこの色です。
現在(&lastmod;)作成中です。
既に書いている内容も&color(#ff0000){大幅に変わる};可能性が高いので注意。
-------
神戸大学 大学院システム情報学研究科 計算科学専攻 陰山 聡
-------
-------
【目次】
#contents
-------
前回の宿題は、「thermal_diffusion.f90を理解しておくこと」であったので、
その中身がわかっているものと仮定して今回は話を進める。
* 2次元可視化 [#bf59a9bb]
* 2次元可視化 [#k39ed7ce]
今回は2次元データの可視化を行う。
前回と同様gnuplotを利用する。
gnuplotで2次元データをプロットする場合、そのデータのフォーマットは
x00 y00 関数値
x01 y00 関数値
x02 y00 関数値
・
・
・
x09 y00 関数値
(空行)
x00 y01 関数値
x01 y01 関数値
x02 y01 関数値
・
・
・
x09 y01 関数値
(空行)
・
・
・
x09 y09 関数値
である。
* 2次元データ出力ルーチン [#y1cbe462]
* 2次元データ出力ルーチン [#a2717789]
thermal_diffusion.f90による2次元データ出力ルーチン
temperature__output_2d_profile
は、正方形上(x,y平面上)に分布する温度をすべて書き出すものである。
中身を見てみよう。
subroutine temperature__output_2d_profile
real(DP), dimension(0:MESH_SIZE+1, &
0:MESH_SIZE+1) :: prof
integer :: counter = 0 ! saved
integer :: ierr ! use for MPI
integer :: jstart_, jend_
character(len=4) :: serial_num ! put on file name
character(len=*), parameter :: base = "../data/temp.2d."
integer :: i, j
call set_jstart_and_jend(jstart_,jend_)
write(serial_num,'(i4.4)') counter
prof(:,:) = parallel__set_prof_2d(jstart_,jend_,temp(:,jstart_:jend_))
if ( myrank==0 ) then
open(10,file=base//serial_num)
do j = 0 , MESH_SIZE+1
do i = 0 , MESH_SIZE+1
write(10,*) i, j, prof(i,j)
end do
write(10,*)' ' ! gnuplot requires a blank line here.
end do
close(10)
end if
counter = counter + 1
end subroutine temperature__output_2d_profile
* &color(#0000ff){【演習】}; [#ibe877dc]
heat2_sendrecv_check.f90をmpif90コマンドでコンパイルし、
* &color(#0000ff){【演習】}; [#n213fe1f]
- thermal_diffusion.f90をmpif90コマンドでコンパイルし、
- ジョブスクリプトthermal_diffusion.jsで並列計算せよ。
- 連番つきファイルtemp.2d.????が出力されるはずである。
その中身は以下のようになっているはず。確認せよ。
55 35 0.1165598588705999
56 35 9.9624877672293416E-002
57 35 8.1734108631726782E-002
58 35 6.2857224006520482E-002
59 35 4.2963409431420671E-002
60 35 2.2021479795155254E-002
61 35 0.000000000000000
0 36 0.000000000000000
1 36 2.1867122785152873E-002
2 36 4.2655284590767971E-002
3 36 6.2396502500601705E-002
4 36 8.1122529495226178E-002
・
・
・
57 36 8.1122529495226178E-002
58 36 6.2396502500601705E-002
59 36 4.2655284590767971E-002
60 36 2.1867122785152873E-002
61 36 0.000000000000000
0 37 0.000000000000000
1 37 2.1680615643577435E-002
2 37 4.2282992534786040E-002
3 37 6.1839860798781864E-002
4 37 8.0383668447763873E-002
5 37 9.7946446090882752E-002
6 37 0.1145596782417825
・
・
・
--
* gnuplotによる2次元等高線の表示 [#o6645045]
静止画による説明
* &color(#0000ff){【演習】アニメーション}; [#n213fe1f]
* gnuplotによる2次元カラー表示 [#n1e01e1c]
静止画による説明
* &color(#0000ff){【演習】アニメーション}; [#n213fe1f]
* gnuplotによるsurface表示 [#v677383d]
静止画による説明
* &color(#0000ff){【演習】アニメーション}; [#n213fe1f]
#ref()
* 熱源分布が一様でない場合の平衡温度分布 [#w71b98ed]
ソースコードの変更。 thermal_diffusion2.f90
* 宿題 [#g714ae01]
* レポート課題 01 [#u26817b8]
thermal_diffusion02.f90で求めたチェッカーボード型熱源分布の平衡解(最終状態解)を可視化せよ。
温度の最大値と最小値も記せ。
上記 thermal_diffusion.f90コードを理解しておくこと。(レポート提出必要なし。)
* 授業アンケート [#k7c29103]
* 授業アンケート [#qa65e3f2]
今回の演習内容はどうでしたか?(どれか一つ、一度だけ押してください。)
#vote(簡単すぎた[0], 難しすぎた[0], ちょうどよかった[0])
* 2次元領域分割による並列化 [#x20338f4]
* 質問、コメントなど自由にどうぞ [#ve482de9]
* 質問、コメントなど自由にどうぞ [#k16ca111]
「お名前」欄は空欄で可。
#pcomment
------------------------------
as of &_now; (&counter;)