[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.6.4 Flow & Dens sample
C++ code
mglData a(50,40), b(50,40), d(a); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); d.Modify("sqrt(v^2+w^2)",a,b); gr->Box(); gr->Flow(a,b,"br"); gr->Dens(d,"BbcyrR");
MGL code
new a 50 40 new b 50 40 modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))' modify b '0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))' copy d a modify d 'sqrt(v^2+w^2)' a b box flow a b 'br' dens d 'BbcyrR'
Pure C code
HMDT a, b, d; a = mgl_create_data_size(50,40,1); b = mgl_create_data_size(50,40,1); d = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); mgl_data_modify(d,"sqrt(v^2+w^2)",a,b); mgl_box(gr,1); mgl_flow_2d(gr,a,b,"br",5,1,0.); mgl_dens(gr,d,"BbcyrR",-1.); mgl_delete_data(a); mgl_delete_data(b); mgl_delete_data(d);
Fortran code
integer a,b,d, mgl_create_data_size a = mgl_create_data_size(50,40,1); b = mgl_create_data_size(50,40,1); d = mgl_create_data_size(50,40,1); call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); call mgl_data_modify(d,"sqrt(v^2+w^2)",a,b); call mgl_box(gr,1) call mgl_flow_2d(gr,a,b,'br',5,1,0.) call mgl_dens(gr,d,'BbcyrR',-1.); call mgl_delete_data(a) call mgl_delete_data(b) call mgl_delete_data(d)
Python
a, b= mglData(50,40), mglData(50,40); d = mglData(a) a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); d.Modify("sqrt(v^2+w^2)",a,b); gr.Box(); gr.Flow(a,b,"br"); gr.Dens(d,"BbcyrR");