User Tools

Site Tools


programming:transform_spectral_coeff_to_physical_data_points

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

<- [[:programming]] ====== transform spectral coeff to physical data points ====== //emmanuel germaine, 2010-08-28 10:14 // ~~DISCUSSION~~ Dear Prof. Gibson, I would like to transform the spectral coefficients in physical values by evaluating the expansion sum (eqn 20 in the user's manual.) Starting form an object Flowfield u, I have compared the results of the expansion with the value given by the method makephysical(). I do not obtain the same results. I have attached part of the code I am using. Do you think that something is incorrect ? Regards, Emmanuel { double pi =3.1415926 ; Complex I(0.0,1.0); Complex sum_u(0.0,0.0); int pause; nx = 5; ny = 5; nz = 5; //display gridpoint coordiantes x,y,z std::cout << u.x(nx) << ' ' << u.y(ny) << ' ' << u.z(nz) << endl ; //compute physical value using expansion sum and display u.makeSpectral(); for(int mz=0;mz<u.Mz();++mz) for(int my=0;my<u.My();++my) for(int mx=0;mx<u.Mx();++mx) sum_u += u.cmplx(mx,my,mz,0) * chebyshev(my,u.y(ny)) * exp(2.0 * pi * I*((u.kx(mx) * u.x(nx) /u.Lx()) + (u.kz(mz) * u.z(nz) / u.Lz()))) ; std::cout << 2.0 * sum_u.real()<< endl ; //display physical value from makePhysical() u.makePhysical(); std::cout << u(nx,ny,nz,0) << endl ; std::cin >> pause; }

programming/transform_spectral_coeff_to_physical_data_points.1283016970.txt.gz · Last modified: 2010/08/28 10:36 by emmanuel