User Tools

Site Tools


programming:transform_spectral_coeff_to_physical_data_points

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
programming:transform_spectral_coeff_to_physical_data_points [2010/08/28 10:46]
emmanuel
programming:transform_spectral_coeff_to_physical_data_points [2010/08/28 16:06]
emmanuel
Line 10: Line 10:
 Dear Prof. Gibson, 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.) +We can determine ​the physical values ​from the spectral coefficients ​by evaluating the expansion sum (eqn 20 in the user's manual.)  
-Starting from an object Flowfield u, have compared the results of the expansion ​with the value given by the method u.makephysical(). I do not obtain ​the same results. ​+wanted to compared the physical values computed by this sum with the values returned ​by the method u.makephysical(). ​This method use the FFTW algorithm and  
 +I was expecting no difference. The fact is that, I do not obtained ​the same results. 
 + 
 I have attached part of the code I am using. Do you think that something is incorrect ? I have attached part of the code I am using. Do you think that something is incorrect ?
  
 As the width of the channel is [a,b] = [-1.0,1.0], I haven'​t normalized the Chebyshev polynomials. As the width of the channel is [a,b] = [-1.0,1.0], I haven'​t normalized the Chebyshev polynomials.
 +
 +Example of results displayed :
 +  0.00258953 ​     // u computing Fourier series
 +  0.00604268 ​     // return of u.makePhysical (FFTW)
 +
 +
 Regards, Regards,
 Emmanuel Emmanuel
Line 28: Line 36:
   //display gridpoint coordinates x,y,z   //display gridpoint coordinates x,y,z
   std::cout << u.x(nx) << ' ' << u.y(ny) << ' ' << u.z(nz) << endl ;   std::cout << u.x(nx) << ' ' << u.y(ny) << ' ' << u.z(nz) << endl ;
 +  ​
   //compute physical value using expansion sum and display   //compute physical value using expansion sum and display
    ​u.makeSpectral();​    ​u.makeSpectral();​
Line 37: Line 45:
           std::cout << 2.0 * sum_u.real()<<​ endl ;           std::cout << 2.0 * sum_u.real()<<​ endl ;
        
-   //display physical value  from makePhysical() ​  +    ​//display physical value  from makePhysical() ​  
     u.makePhysical();​     u.makePhysical();​
-    std::cout << u(nx,​ny,​nz,​0) ​    ​<< ​ endl ;+    std::cout << u(nx,​ny,​nz,​0) ​ << ​ endl ;
   ​   ​
     std::cin >> pause;      std::cin >> pause;
     }     }
  
- 
-Example of results displayed : 
- 
-0 -0.995185 0   // x,y,z 
-0.00258953 ​     // u computing Fourier series 
-0.00604268 ​     // return of u.makePhysical 
  
  
programming/transform_spectral_coeff_to_physical_data_points.txt · Last modified: 2010/08/28 16:08 by emmanuel