private static void resid_ethier_test() //****************************************************************************80 // // Purpose: // // RESID_ETHIER_TEST tests RESID_ETHIER. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 29 July 2015 // // Author: // // John Burkardt // { double a = Math.PI / 4.0; double d = Math.PI / 2.0; Console.WriteLine(""); Console.WriteLine("RESID_ETHIER_TEST"); Console.WriteLine(" RESID_ETHIER evaluates the Ethier residual."); Console.WriteLine(" Sample the Navier-Stokes residuals"); Console.WriteLine(" at the initial time T = 0, using a region that is"); Console.WriteLine(" the cube centered at (0,0,0) with 'radius' 1.0,"); Console.WriteLine(" Parameter A = " + a + ""); Console.WriteLine(" Parameter D = " + d + ""); const int n = 1000; double[] pr = new double[n]; double[] ur = new double[n]; double[] vr = new double[n]; double[] wr = new double[n]; const double xyz_lo = -1.0; const double xyz_hi = +1.0; int seed = 123456789; double[] x = UniformRNG.r8vec_uniform_ab_new(n, xyz_lo, xyz_hi, ref seed); double[] y = UniformRNG.r8vec_uniform_ab_new(n, xyz_lo, xyz_hi, ref seed); double[] z = UniformRNG.r8vec_uniform_ab_new(n, xyz_lo, xyz_hi, ref seed); double[] t = typeMethods.r8vec_zeros_new(n); Ethier.resid_ethier(a, d, n, x, y, z, t, ref ur, ref vr, ref wr, ref pr); Console.WriteLine(""); Console.WriteLine(" Minimum Maximum"); Console.WriteLine(""); Console.WriteLine(" Ur: " + " " + typeMethods.r8vec_amin(n, ur).ToString(CultureInfo.InvariantCulture).PadLeft(14) + " " + typeMethods.r8vec_amax(n, ur).ToString(CultureInfo.InvariantCulture).PadLeft(14) + ""); Console.WriteLine(" Vr: " + " " + typeMethods.r8vec_amin(n, vr).ToString(CultureInfo.InvariantCulture).PadLeft(14) + " " + typeMethods.r8vec_amax(n, vr).ToString(CultureInfo.InvariantCulture).PadLeft(14) + ""); Console.WriteLine(" Wr: " + " " + typeMethods.r8vec_amin(n, wr).ToString(CultureInfo.InvariantCulture).PadLeft(14) + " " + typeMethods.r8vec_amax(n, wr).ToString(CultureInfo.InvariantCulture).PadLeft(14) + ""); Console.WriteLine(" Pr: " + " " + typeMethods.r8vec_amin(n, pr).ToString(CultureInfo.InvariantCulture).PadLeft(14) + " " + typeMethods.r8vec_amax(n, pr).ToString(CultureInfo.InvariantCulture).PadLeft(14) + ""); }