Reaction diffusion equation with Schnakenberg kinetics in 2 dim space
Parallel-computed by MPI using two nodes

SetDirectory["/Users/takasu/"]

Single node

データの読み込み. ファイルにはx方向に 51個, y方向に 51個のデータを書き出す場合。

size = 51*51;

datau = ReadList["RD-2dim-schnakenberg-u-single-node",{Real,Real, Real}];
datau = Partition[datau,size];

datav = ReadList["RD-2dim-schnakenberg-v-single-node",{Real,Real, Real}];
datav = Partition[datav,size];

Length[datau]
Length[datav]

ListPlot3D[Last[datau],PlotRange->All,BoxRatios->{3,3,1},Axes->True,AxesLabel->{"x", "y", "u"}]

ListPlot3D[Last[datav],PlotRange->All,BoxRatios->{3,3,1},Axes->True,AxesLabel->{"x", "y", "u"}]

ListContourPlot[Last[datau],PlotRange->All,BoxRatios->{3,3,1},Axes->True]

ListPlot3D[Last[datav],PlotRange->All,BoxRatios->{3,3,1},Axes->True,AxesLabel->{"x", "y", "v"}]

ListContourPlot[Last[datav],PlotRange->All,BoxRatios->{3,3,1},Axes->True]

時間変化 u

glistu={};
Do[
PrintTemporary[i];
g=ListContourPlot[datau[[i]],PlotRange->{0,2},BoxRatios->{3,3,1},Axes->True];
AppendTo[glistu,g];
Print[g],{i,1,Length[datau],10}
]

ListAnimate[glistu]

最後の状態 v

2

MPI with two nodes

データの読み込み. ファイルにはx方向に 26個, y方向に 51 個のデータを書き出す場合。

size1 = 26;
size2 = 51;
size = size1*size2;

datau0 = ReadList["RD-2dim-schnakenberg-u-rank0",{Real,Real, Real}];
datau0 = Partition[datau0,size];

datau1 = ReadList["RD-2dim-schnakenberg-u-rank1",{Real,Real,Real}];
datau1 = Partition[datau1,size];

datav0 = ReadList["RD-2dim-schnakenberg-v-rank0",{Real,Real, Real}];
datav0 = Partition[datav0,size];

datav1 = ReadList["RD-2dim-schnakenberg-v-rank1",{Real,Real,Real}];
datav1 = Partition[datav1,size];

Length[datau0]
Length[datav0]

描画

ListPlot3D[Last[datau0],PlotRange->All,BoxRatios->{3,1.5,1},Axes->True,AxesLabel->{"x", "y", "u"}]

ListPlot3D[Last[datau1],PlotRange->All,BoxRatios->{3,1.5,1},Axes->True,AxesLabel->{"x", "y", "u"}]

ListPlot3D[Join[Last[datau0],Last[datau1]],PlotRange->All,BoxRatios->{3,3,1},Axes->True,AxesLabel->{"x", "y", "u"}]

ListContourPlot[Join[Last[datau0],Last[datau1]],PlotRange->All,BoxRatios->{3,3,1},Axes->True]

ListContourPlot[Join[Last[datav0],Last[datav1]],PlotRange->All,BoxRatios->{3,3,1},Axes->True]

Do[
Print[
ListContourPlot[Join[datau0[[i]],datau1[[i]]],PlotRange->All,BoxRatios->{3,3,1},Axes->True]
],{i,1,100,10}
]

1