Пример #1
0
    private static void test03(int degree, int n, string header)

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    TEST03 gets a rule and creates GNUPLOT input files.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU GPL license.
    //
    //  Modified:
    //
    //    11 July 2014
    //
    //  Author:
    //
    //    Original FORTRAN77 version by Hong Xiao, Zydrunas Gimbutas.
    //    C++ version by John Burkardt.
    //
    //  Reference:
    //
    //    Hong Xiao, Zydrunas Gimbutas,
    //    A numerical algorithm for the construction of efficient quadrature
    //    rules in two and higher dimensions,
    //    Computers and Mathematics with Applications,
    //    Volume 59, 2010, pages 663-676.
    //
    //  Parameters:
    //
    //    Input, int DEGREE, the desired total polynomial degree exactness
    //    of the quadrature rule.  0 <= DEGREE <= 15.
    //
    //    Input, int N, the number of nodes to be used by the rule.
    //
    //    Input, string HEADER, an identifier for the filenames.
    //
    {
        Console.WriteLine("");
        Console.WriteLine("TEST03");
        Console.WriteLine("  Get a quadrature rule for the tetrahedron.");
        Console.WriteLine("  Set up GNUPLOT graphics input.");
        Console.WriteLine("  Polynomial exactness degree DEGREE = " + degree + "");
        //
        //  Retrieve a symmetric quadrature rule.
        //
        double[] x = new double[3 * n];
        double[] w = new double[n];

        QuadratureRule.tetrahedron_arbq(degree, n, ref x, ref w);
        //
        //  Create files for input to GNUPLOT.
        //
        QuadratureRule.tetrahedron_arbq_gnuplot(n, x, header);
    }