-- FreeFem++ v4.6 (Thu Apr 2 15:47:38 CEST 2020 - git v4.6) Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // Location: 2 : // 3 : // http://people.sc.fsu.edu/~jburkardt/freefem_src/commandline_test/commandline_test.edp 4 : // 5 : // Discussion: 6 : // 7 : // This example simply illustrates how FreeFem++ can read commandline input. 8 : // 9 : // Licensing: 10 : // 11 : // This code is distributed under the GNU LGPL license. 12 : // 13 : // Modified: 14 : // 15 : // 26 January 2015 16 : // 17 : // Reference: 18 : // 19 : // John Chrispell, Jason Howell, 20 : // Finite Element Approximation of Partial Differential Equations 21 : // Using FreeFem++, or, How I Learned to Stop Worrying and Love 22 : // Numerical Analysis. 23 : // 24 : // Frederic Hecht, 25 : // New development in FreeFem++, 26 : // Journal of Numerical Mathematics, 27 : // Volume 20, Number 3-4, 2012, pages 251-265. 28 : // 29 : // 30 : // Set some parameters. 31 : // 32 : real d = 2.0; 33 : real xx; 34 : real yy; 35 : // 36 : // Speak to the user: 37 : // 38 : cout << "Enter the number of X and Y data points desired: ... : " << endl; 39 : // 40 : // Listen to the user input. 41 : // 42 : int nx; 43 : int ny; 44 : cin >> nx >> ny; 45 : // 46 : // Report the values. 47 : // 48 : cout << "Using nx = " << nx << " and ny = " << ny << "\n"; 49 : // 50 : // Declare F, a function. 51 : // 52 : func f = sin ( d * pi * x ) * cos ( ( d + 1.0 ) * pi * y ); 53 : // 54 : // Print a table of F(X,Y). 55 : // 56 : for ( int j = 0; j < ny; j++ ) 57 : { 58 : yy = real ( j ) / real ( ny - 1 ); 59 : for ( int i = 0; i < nx; i++ ) 60 : { 61 : xx = real ( i ) / real ( nx - 1 ); 62 : cout << f ( xx, yy ) << " "; 63 : } 64 : cout << endl; 65 : } 66 : sizestack + 1024 =1128 ( 104 ) Enter the number of X and Y data points desired: Using nx = 5 and ny = 4 0 1 1.22465e-16 -1 -2.44929e-16 -0 -1 -1.22465e-16 1 2.44929e-16 0 1 1.22465e-16 -1 -2.44929e-16 -0 -1 -1.22465e-16 1 2.44929e-16 times: compile 0.004127s, execution 0.000181s, mpirank:0 CodeAlloc : nb ptr 3499, size :468864 mpirank: 0 Ok: Normal End