// Location: // // http://people.sc.fsu.edu/~jburkardt/freefem_src/commandline_test/commandline_test.edp // // Discussion: // // This example simply illustrates how FreeFem++ can read commandline input. // // Licensing: // // This code is distributed under the MIT license. // // Modified: // // 24 May 2020 // // Author: // // John Chrispell, Jason Howell. // Modifications by John Burkardt. // // Reference: // // John Chrispell, Jason Howell, // Finite Element Approximation of Partial Differential Equations // Using FreeFem++, or, How I Learned to Stop Worrying and Love // Numerical Analysis. // // Frederic Hecht, // New development in FreeFem++, // Journal of Numerical Mathematics, // Volume 20, Number 3-4, 2012, pages 251-265. // cout << "\n"; cout << "commandline_test:\n"; cout << " FreeFem++ version.\n"; cout << " Read values of nx, ny from the user.\n"; // // Set some parameters. // real d = 2.0; real xx; real yy; // // Speak to the user: // cout << "Enter the number of X and Y data points desired: " << endl; // // Listen to the user input. // int nx; int ny; cin >> nx >> ny; // // Report the values. // cout << "Using nx = " << nx << " and ny = " << ny << "\n"; // // F: a function. // func f = sin ( d * pi * x ) * cos ( ( d + 1.0 ) * pi * y ); // // Print a table of F(X,Y). // for ( int j = 0; j < ny; j++ ) { yy = real ( j ) / real ( ny - 1 ); for ( int i = 0; i < nx; i++ ) { xx = real ( i ) / real ( nx - 1 ); cout << f ( xx, yy ) << " "; } cout << endl; } // // Terminate. // cout << "\n"; cout << "commandline_test:\n"; cout << " Normal end of execution.\n"; exit ( 0 );