Пример #1
0
    private static void test004()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    TEST004 tests TETRAHEDRON_ORDER10_TO_ORDER4.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    30 July 2009
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int       node_num  = 0;
        int       tet_num   = 0;
        const int tet_order = 10;

        Console.WriteLine("");
        Console.WriteLine("TEST004");
        Console.WriteLine("  TET_MESH_NODE_ORDER determines the order of ");
        Console.WriteLine("  each node in a tet mesh.");
        Console.WriteLine("");
        Console.WriteLine("  The order of a node is the number of tetrahedrons");
        Console.WriteLine("  that use the node as part of their definition.");

        TetMesh.tet_mesh_order10_example_size(ref node_num, ref tet_num);

        Console.WriteLine("");
        Console.WriteLine("  This mesh has tetrahedron order " + tet_order + "");
        Console.WriteLine("  The number of tetrahedrons is   " + tet_num + "");

        double[] node_xyz = new double[3 * node_num];
        int[]    tet_node = new int[tet_order * tet_num];

        TetMesh.tet_mesh_order10_example_set(node_num, tet_num,
                                             ref node_xyz, ref tet_node);

        typeMethods.i4mat_transpose_print(tet_order, tet_num, tet_node,
                                          "  The tet mesh:");

        int[] node_order = TetMesh.tet_mesh_node_order(tet_order, tet_num, tet_node, node_num);

        typeMethods.i4vec_print(node_num, node_order, "  Node orders:");

        Console.WriteLine("");
        Console.WriteLine("  Check that the following are equal:");
        Console.WriteLine("");
        Console.WriteLine("  Number of tetrahedrons * order = " + tet_num * tet_order + "");
        Console.WriteLine("  Sum of node orders             = " + typeMethods.i4vec_sum(node_num, node_order) + "");
    }
Пример #2
0
    private static void test003()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    TEST003 tests TETRAHEDRON_ORDER10_TO_ORDER4.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    22 January 2007
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int       node_num1  = 0;
        int       node_num2  = 0;
        int       tet_num1   = 0;
        int       tet_num2   = 0;
        const int tet_order1 = 10;
        const int tet_order2 = 4;

        Console.WriteLine("");
        Console.WriteLine("TEST003");
        Console.WriteLine("  For an order 10 tet mesh,");
        Console.WriteLine("  TETRAHEDRON_ORDER10_TO_ORDER4");
        Console.WriteLine("  makes a linear (order 4) tet mesh by using");
        Console.WriteLine("  the existing nodes, and replacing each");
        Console.WriteLine("  quadratic tetrahedron by 8 linear tetrahedrons.");

        TetMesh.tet_mesh_order10_example_size(ref node_num1, ref tet_num1);

        double[] node_xyz  = new double[3 * node_num1];
        int[]    tet_node1 = new int[tet_order1 * tet_num1];

        TetMesh.tet_mesh_order10_example_set(node_num1, tet_num1,
                                             ref node_xyz, ref tet_node1);

        typeMethods.i4mat_transpose_print_some(tet_order1, tet_num1, tet_node1,
                                               1, 1, tet_order1, 5, "  First 5 quadratic tetrahedrons:");

        TetMesh.tet_mesh_order10_to_order4_size(node_num1, tet_num1,
                                                ref node_num2, ref tet_num2);

        Console.WriteLine("");
        Console.WriteLine("  Quadratic mesh size is       " + tet_num1 + "");
        Console.WriteLine("  Linearized mesh size will be " + tet_num2 + "");

        int[] tet_node2 = new int[tet_order2 * tet_num2];

        TetMesh.tet_mesh_order10_to_order4_compute(tet_num1, tet_node1,
                                                   tet_num2, ref tet_node2);

        typeMethods.i4mat_transpose_print_some(tet_order2, tet_num2, tet_node2,
                                               1, 1, tet_order2, 5, "  First 5 linear tetrahedrons:");
    }