diff --git a/example/geometry/t8_example_geometries.cxx b/example/geometry/t8_example_geometries.cxx index 7736d72aab..dc8384ac57 100644 --- a/example/geometry/t8_example_geometries.cxx +++ b/example/geometry/t8_example_geometries.cxx @@ -81,8 +81,8 @@ typedef enum { struct t8_geometry_sincos: public t8_geometry { public: - /* Basic constructor that sets the dimension and the name. */ - t8_geometry_sincos (): t8_geometry (2, "t8_sincos_geometry") + /* Basic constructor that sets the name. */ + t8_geometry_sincos (): t8_geometry ("t8_sincos_geometry") { } @@ -93,7 +93,7 @@ struct t8_geometry_sincos: public t8_geometry * models the rectangle [0,2] x [0,1]. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -175,8 +175,8 @@ struct t8_geometry_sincos: public t8_geometry struct t8_geometry_moebius: public t8_geometry_with_vertices { public: - /* Basic constructor that sets the dimension and the name. */ - t8_geometry_moebius (): t8_geometry_with_vertices (2, "t8_moebius_geometry") + /* Basic constructor that sets the name. */ + t8_geometry_moebius (): t8_geometry_with_vertices ("t8_moebius_geometry") { } @@ -184,7 +184,7 @@ struct t8_geometry_moebius: public t8_geometry_with_vertices * Maps points in \f$ [0,1]^2 \f$ to the moebius band. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -256,8 +256,8 @@ struct t8_geometry_moebius: public t8_geometry_with_vertices struct t8_geometry_cylinder: public t8_geometry { public: - /* Basic constructor that sets the dimension and the name. */ - t8_geometry_cylinder (): t8_geometry (2, "t8_cylinder_geometry") + /* Basic constructor that sets the name. */ + t8_geometry_cylinder (): t8_geometry ("t8_cylinder_geometry") { } @@ -265,7 +265,7 @@ struct t8_geometry_cylinder: public t8_geometry * Map a reference point in the unit square to a cylinder. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -343,8 +343,8 @@ struct t8_geometry_cylinder: public t8_geometry struct t8_geometry_circle: public t8_geometry_with_vertices { public: - /* Basic constructor that sets the dimension and the name. */ - t8_geometry_circle (): t8_geometry_with_vertices (2, "t8_circle_geometry") + /* Basic constructor that sets the name. */ + t8_geometry_circle (): t8_geometry_with_vertices ("t8_circle_geometry") { } @@ -352,7 +352,7 @@ struct t8_geometry_circle: public t8_geometry_with_vertices * Map a reference point in the unit square to a circle. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -431,8 +431,8 @@ struct t8_geometry_circle: public t8_geometry_with_vertices struct t8_geometry_moving: public t8_geometry { public: - /* Basic constructor that sets the dimension the name and the time pointer. */ - t8_geometry_moving (const double *time): t8_geometry (2, "t8_moving_geometry"), ptime (time) + /* Basic constructor that sets the name and the time pointer. */ + t8_geometry_moving (const double *time): t8_geometry ("t8_moving_geometry"), ptime (time) { } @@ -440,7 +440,7 @@ struct t8_geometry_moving: public t8_geometry * Map a reference point in the unit square to a square distorted with time. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -535,15 +535,15 @@ struct t8_geometry_moving: public t8_geometry struct t8_geometry_cube_zdistorted: public t8_geometry { public: - /* Basic constructor that sets the dimension and the name. */ - t8_geometry_cube_zdistorted (): t8_geometry (3, "t8_cube_zdistorted_geometry") + /* Basic constructor that sets the name. */ + t8_geometry_cube_zdistorted (): t8_geometry ("t8_cube_zdistorted_geometry") { } /** * Map a reference point in the unit cube to a cube distorted in the z axis. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -748,7 +748,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) break; case T8_GEOM_ANALYTIC_QUAD_TO_SPHERE: t8_global_productionf ("Wrapping a quad around a sphere.\n"); - t8_cmesh_register_geometry (cmesh, 3, "geom_quad_to_sphere", quad_to_sphere_callback, nullptr, + t8_cmesh_register_geometry (cmesh, "geom_quad_to_sphere", quad_to_sphere_callback, nullptr, nullptr, nullptr, nullptr, nullptr); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_QUAD); t8_cmesh_set_join (cmesh, 0, 0, 1, 0, 0); @@ -776,7 +776,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) shape = BRepBuilderAPI_MakeEdge (cad_curve).Edge (); /* Create a cad geometry. */ - t8_cmesh_register_geometry (cmesh, 2, shape); + t8_cmesh_register_geometry (cmesh, shape); /* The arrays indicate which face/edge carries a geometry. * 0 means no geometry and any other number indicates the position of the geometry @@ -840,7 +840,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) shape = BRepAlgoAPI_Fuse (shape, BRepBuilderAPI_MakeEdge (cad_curve1).Edge ()); /* Create a cad geometry. */ - t8_cmesh_register_geometry (cmesh, 3, shape); + t8_cmesh_register_geometry (cmesh, shape); /* The arrays indicate which face/edge carries a geometry. * 0 means no geometry and any other number indicates the position of the geometry @@ -941,7 +941,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) int edges[24] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* Create cad geometry. */ - t8_cmesh_register_geometry (cmesh, 3, shape); + t8_cmesh_register_geometry (cmesh, shape); /* Create tree 0 */ t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_HEX); @@ -1038,7 +1038,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type) int edges[24] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* Create a cad geometry. */ - t8_cmesh_register_geometry (cmesh, 3, shape); + t8_cmesh_register_geometry (cmesh, shape); /* Create corresponding trees and parameters. * Here we create num trees by a coordinate transformation from cylinder to cartesian coordinates. */ diff --git a/src/t8_cmesh/t8_cmesh_cad.cxx b/src/t8_cmesh/t8_cmesh_cad.cxx index 10b91311c5..5eba00cf4d 100644 --- a/src/t8_cmesh/t8_cmesh_cad.cxx +++ b/src/t8_cmesh/t8_cmesh_cad.cxx @@ -81,14 +81,14 @@ t8_cmesh_new_hollow_cylinder (sc_MPI_Comm comm, int num_tangential_trees, int nu shape = BRepBuilderAPI_MakeFace (cylinder_outer, 1e-6).Face (); shape = BRepAlgoAPI_Fuse (shape, BRepBuilderAPI_MakeFace (cylinder_inner, 1e-6).Face ()); - t8_cmesh_register_geometry (cmesh, 3, shape, "cad surface"); + t8_cmesh_register_geometry (cmesh, shape, "cad surface"); #else /* !T8_WITH_OCC */ SC_ABORTF ("OCC not linked"); #endif /* T8_WITH_OCC */ } else { - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); } #if T8_WITH_OCC diff --git a/src/t8_cmesh/t8_cmesh_examples.cxx b/src/t8_cmesh/t8_cmesh_examples.cxx index 2ffce804ea..22dc75ea90 100644 --- a/src/t8_cmesh/t8_cmesh_examples.cxx +++ b/src/t8_cmesh/t8_cmesh_examples.cxx @@ -119,7 +119,7 @@ t8_cmesh_new_from_p4est_ext (void *conn, int dim, sc_MPI_Comm comm, int set_part /* basic setup */ t8_cmesh_init (&cmesh); /* We use the linear geometry */ - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); /* Add each tree to cmesh and get vertex information for each tree */ for (ltree = 0; ltree < _T8_CMESH_P48_CONN (num_trees); ltree++) { /* loop over each tree */ t8_cmesh_set_tree_class (cmesh, ltree + offset, dim == 2 ? T8_ECLASS_QUAD : T8_ECLASS_HEX); @@ -212,7 +212,7 @@ t8_cmesh_new_vertex (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 0); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_VERTEX); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 1); t8_cmesh_commit (cmesh, comm); @@ -232,7 +232,7 @@ t8_cmesh_new_line (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 1); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_LINE); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 2); t8_cmesh_commit (cmesh, comm); @@ -253,7 +253,7 @@ t8_cmesh_new_tri (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_TRIANGLE); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 3); t8_cmesh_commit (cmesh, comm); @@ -275,7 +275,7 @@ t8_cmesh_new_tet (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_TET); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 4); t8_cmesh_commit (cmesh, comm); @@ -297,7 +297,7 @@ t8_cmesh_new_quad (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_QUAD); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 4); t8_cmesh_commit (cmesh, comm); @@ -323,7 +323,7 @@ t8_cmesh_new_hex (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_HEX); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 8); t8_cmesh_commit (cmesh, comm); @@ -346,7 +346,7 @@ t8_cmesh_new_pyramid_deformed (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_PYRAMID); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 5); t8_cmesh_commit (cmesh, comm); @@ -369,7 +369,7 @@ t8_cmesh_new_pyramid (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_PYRAMID); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 5); t8_cmesh_commit (cmesh, comm); @@ -393,7 +393,7 @@ t8_cmesh_new_prism (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_PRISM); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 6); t8_cmesh_commit (cmesh, comm); @@ -490,7 +490,7 @@ t8_cmesh_new_hypercube_hybrid (sc_MPI_Comm comm, int do_partition, int periodic) } /* We use standard linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); /************************************/ /* The tetrahedra */ @@ -678,7 +678,6 @@ t8_cmesh_new_hypercube (t8_eclass_t eclass, sc_MPI_Comm comm, int do_bcast, int }; /* clang-format on */ - const int dim = t8_eclass_to_dimension[eclass]; SC_CHECK_ABORT (eclass != T8_ECLASS_PYRAMID || !periodic, "The pyramid cube mesh cannot be periodic.\n"); if (do_partition) { @@ -841,7 +840,7 @@ t8_cmesh_new_hypercube (t8_eclass_t eclass, sc_MPI_Comm comm, int do_bcast, int /* Use linear geometry */ /* We need to set the geometry after broadcasting, since we * cannot bcast the geometries. */ - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); /* Check whether the cmesh will be partitioned */ if (do_partition) { @@ -1290,10 +1289,10 @@ t8_cmesh_new_hypercube_pad_ext (const t8_eclass_t eclass, sc_MPI_Comm comm, cons t8_cmesh_init (&cmesh); if (use_axis_aligned) { - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); } else { - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); } /* Number of trees inside each polygon of given eclass. */ @@ -1624,7 +1623,7 @@ t8_cmesh_new_disjoint_bricks (t8_gloidx_t num_x, t8_gloidx_t num_y, t8_gloidx_t /* Create empty cmesh. */ t8_cmesh_init (&cmesh); - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); t8_cmesh_commit (cmesh, comm); } @@ -1646,7 +1645,7 @@ t8_cmesh_new_periodic_line_more_trees (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 1); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_LINE); t8_cmesh_set_tree_class (cmesh, 1, T8_ECLASS_LINE); @@ -1679,7 +1678,7 @@ t8_cmesh_new_periodic_tri (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_TRIANGLE); t8_cmesh_set_tree_class (cmesh, 1, T8_ECLASS_TRIANGLE); @@ -1737,7 +1736,7 @@ t8_cmesh_new_periodic_hybrid (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_TRIANGLE); t8_cmesh_set_tree_class (cmesh, 1, T8_ECLASS_TRIANGLE); @@ -1794,7 +1793,7 @@ t8_cmesh_new_periodic (sc_MPI_Comm comm, int dim) T8_ASSERT (dim == 1 || dim == 2 || dim == 3); t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); switch (dim) { case 1: @@ -1864,7 +1863,7 @@ t8_cmesh_new_line_zigzag (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 1); + t8_cmesh_register_geometry (cmesh); for (i = 0; i < 3; i++) { t8_cmesh_set_tree_class (cmesh, i, T8_ECLASS_LINE); @@ -1917,7 +1916,7 @@ t8_cmesh_new_prism_cake (sc_MPI_Comm comm, int num_of_prisms) } t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); for (i = 0; i < num_of_prisms; i++) { t8_cmesh_set_tree_class (cmesh, i, T8_ECLASS_PRISM); @@ -1952,7 +1951,7 @@ t8_cmesh_new_prism_deformed (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_PRISM); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 6); t8_cmesh_commit (cmesh, comm); @@ -2023,7 +2022,7 @@ t8_cmesh_new_prism_cake_funny_oriented (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); for (i = 0; i < 6; i++) { t8_cmesh_set_tree_class (cmesh, i, T8_ECLASS_PRISM); @@ -2124,7 +2123,7 @@ t8_cmesh_new_prism_geometry (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); for (i = 0; i < 8; i++) { t8_cmesh_set_tree_class (cmesh, i, T8_ECLASS_PRISM); @@ -2172,7 +2171,7 @@ t8_cmesh_new_tet_orientation_test (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); /* A tet has 4 faces and each face connection has 3 possible orientations, * we thus have (4+3+2+1)*3 = 30 possible face-to-face combinations. @@ -2249,7 +2248,7 @@ t8_cmesh_new_hybrid_gate (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_TET); t8_cmesh_set_tree_class (cmesh, 1, T8_ECLASS_TET); t8_cmesh_set_tree_class (cmesh, 2, T8_ECLASS_PRISM); @@ -2373,7 +2372,7 @@ t8_cmesh_new_hybrid_gate_deformed (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Use linear geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_TET); t8_cmesh_set_tree_class (cmesh, 1, T8_ECLASS_TET); t8_cmesh_set_tree_class (cmesh, 2, T8_ECLASS_PRISM); @@ -2529,7 +2528,7 @@ t8_cmesh_new_full_hybrid (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_HEX); t8_cmesh_set_tree_class (cmesh, 1, T8_ECLASS_PYRAMID); @@ -2641,7 +2640,6 @@ t8_cmesh_new_pyramid_cake (sc_MPI_Comm comm, int num_of_pyra) double *vertices = T8_ALLOC (double, num_of_pyra * 5 * 3); t8_cmesh_t cmesh; const double degrees = 360. / num_of_pyra; - int dim = t8_eclass_to_dimension[T8_ECLASS_PYRAMID]; int mpirank, mpiret; mpiret = sc_MPI_Comm_rank (comm, &mpirank); SC_CHECK_MPI (mpiret); @@ -2673,7 +2671,7 @@ t8_cmesh_new_pyramid_cake (sc_MPI_Comm comm, int num_of_pyra) t8_cmesh_set_join (cmesh, current_pyra, (current_pyra == (num_of_pyra - 1) ? 0 : current_pyra + 1), 0, 1, 0); t8_cmesh_set_tree_vertices (cmesh, current_pyra, vertices + current_pyra * 15, 5); } - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); t8_cmesh_commit (cmesh, comm); T8_FREE (vertices); @@ -2701,7 +2699,6 @@ t8_cmesh_new_long_brick_pyramid (sc_MPI_Comm comm, int num_cubes) }; /* clang-format on */ - int dim = t8_eclass_to_dimension[T8_ECLASS_PYRAMID]; mpiret = sc_MPI_Comm_rank (comm, &mpirank); SC_CHECK_MPI (mpiret); T8_ASSERT (num_cubes > 0); @@ -2757,7 +2754,7 @@ t8_cmesh_new_long_brick_pyramid (sc_MPI_Comm comm, int num_cubes) vertices_coords[current_pyra_in_current_cube * 3 + 1] += 1; } } - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); t8_cmesh_commit (cmesh, comm); return cmesh; } @@ -2769,7 +2766,7 @@ t8_cmesh_new_row_of_cubes (t8_locidx_t num_trees, const int set_attributes, cons t8_cmesh_t cmesh; t8_cmesh_init (&cmesh); - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); /* clang-format off */ /* Vertices of first cube in row. */ diff --git a/src/t8_cmesh/t8_cmesh_examples.h b/src/t8_cmesh/t8_cmesh_examples.h index 0a4c80f51b..c5937e347e 100644 --- a/src/t8_cmesh/t8_cmesh_examples.h +++ b/src/t8_cmesh/t8_cmesh_examples.h @@ -65,7 +65,7 @@ t8_cmesh_new_from_p8est (p8est_connectivity_t *conn, sc_MPI_Comm comm, int do_pa * this function is merely for debugging and to show the possibility. * \param [in] comm mpi communicator to be used with the new cmesh. * \param [in] do_partition Flag whether the cmesh should be partitioned or not. - * \param [in] dimension An empty cmesh requires a dimension nevertheless. 0 <= \a dimension <= 3. + * \param [in] dimension An empty cmesh requires a dimension nevertheless. 0 <= tree dimension <= 3. * \return A committed t8_cmesh structure that has no trees. */ t8_cmesh_t diff --git a/src/t8_cmesh/t8_cmesh_readmshfile.cxx b/src/t8_cmesh/t8_cmesh_readmshfile.cxx index 18479c58d5..a356692de2 100644 --- a/src/t8_cmesh/t8_cmesh_readmshfile.cxx +++ b/src/t8_cmesh/t8_cmesh_readmshfile.cxx @@ -1765,15 +1765,14 @@ T8_EXTERN_C_BEGIN (); * no cad geometry is used. */ static int -t8_cmesh_from_msh_file_register_geometries (t8_cmesh_t cmesh, const int use_cad_geometry, const int dim, - const char *fileprefix, const t8_geometry_c **linear_geometry, - const t8_geometry_c **cad_geometry) +t8_cmesh_from_msh_file_register_geometries (t8_cmesh_t cmesh, const int use_cad_geometry, const char *fileprefix, + const t8_geometry_c **linear_geometry, const t8_geometry_c **cad_geometry) { /* Register linear geometry */ - *linear_geometry = t8_cmesh_register_geometry (cmesh, dim); + *linear_geometry = t8_cmesh_register_geometry (cmesh); if (use_cad_geometry) { #if T8_WITH_OCC - *cad_geometry = t8_cmesh_register_geometry (cmesh, dim, std::string (fileprefix)); + *cad_geometry = t8_cmesh_register_geometry (cmesh, std::string (fileprefix)); #else /* !T8_WITH_OCC */ *cad_geometry = NULL; return 0; @@ -1819,8 +1818,8 @@ t8_cmesh_from_msh_file (const char *fileprefix, const int partition, sc_MPI_Comm t8_cmesh_set_dimension (cmesh, dim); /* Register the geometries for the cmesh. */ - const int registered_geom_success = t8_cmesh_from_msh_file_register_geometries ( - cmesh, use_cad_geometry, dim, fileprefix, &linear_geometry, &cad_geometry); + const int registered_geom_success + = t8_cmesh_from_msh_file_register_geometries (cmesh, use_cad_geometry, fileprefix, &linear_geometry, &cad_geometry); if (!registered_geom_success) { /* Registering failed */ t8_errorf ("cad is not linked. Cannot use cad geometry.\n"); diff --git a/src/t8_cmesh/t8_cmesh_triangle.cxx b/src/t8_cmesh/t8_cmesh_triangle.cxx index 6d66dae5c4..63badde55c 100644 --- a/src/t8_cmesh/t8_cmesh_triangle.cxx +++ b/src/t8_cmesh/t8_cmesh_triangle.cxx @@ -531,7 +531,7 @@ t8_cmesh_from_tetgen_or_triangle_file (char *fileprefix, int partition, sc_MPI_C t8_cmesh_init (&cmesh); /* We will use linear geometry. */ - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); /* read .node file */ snprintf (current_file, BUFSIZ, "%s.node", fileprefix); retval = t8_cmesh_triangle_read_nodes (cmesh, current_file, &vertices, &num_vertices, dim); @@ -658,7 +658,7 @@ t8_cmesh_from_tetgen_or_triangle_file_time (char *fileprefix, int partition, sc_ if (cmesh != NULL) { /* Use linear geometry. * We need to set the geometry after the broadcast. */ - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); if (partition) { first_tree = (mpirank * cmesh->num_trees) / mpisize; last_tree = ((mpirank + 1) * cmesh->num_trees) / mpisize - 1; diff --git a/src/t8_geometry/t8_geometry_base.cxx b/src/t8_geometry/t8_geometry_base.cxx index a5a560d5a4..bb68077fd9 100644 --- a/src/t8_geometry/t8_geometry_base.cxx +++ b/src/t8_geometry/t8_geometry_base.cxx @@ -27,18 +27,6 @@ #include #include -/** Get the dimension of a geometry. - * \param [in] geom A geometry. - * \return The dimension of \a geom. - */ -int -t8_geom_get_dimension (const t8_geometry_c *geom) -{ - T8_ASSERT (geom != NULL); - - return geom->t8_geom_get_dimension (); -} - /** Get the name of a geometry. * \param [in] geom A geometry. * \return The name of \a geom. diff --git a/src/t8_geometry/t8_geometry_base.h b/src/t8_geometry/t8_geometry_base.h index b7c665e51b..5c8f82f181 100644 --- a/src/t8_geometry/t8_geometry_base.h +++ b/src/t8_geometry/t8_geometry_base.h @@ -35,13 +35,6 @@ T8_EXTERN_C_BEGIN (); -/** Get the dimension of a geometry. - * \param [in] geom A geometry. - * \return The dimension of \a geom. - */ -int -t8_geom_get_dimension (const t8_geometry_c *geom); - /** Get the name of a geometry. * \param [in] geom A geometry. * \return The name of \a geom. diff --git a/src/t8_geometry/t8_geometry_base.hxx b/src/t8_geometry/t8_geometry_base.hxx index 01274231c5..aa0c50e702 100644 --- a/src/t8_geometry/t8_geometry_base.hxx +++ b/src/t8_geometry/t8_geometry_base.hxx @@ -47,16 +47,15 @@ T8_EXTERN_C_BEGIN (); struct t8_geometry { public: - /* Basic constructor that sets the dimension, the name, and the name for the attribute. */ - t8_geometry (int dim, std::string name): dimension (dim), name (name), hash (std::hash {}(name)) + /* Basic constructor that sets the name. */ + t8_geometry (std::string name): name (name), hash (std::hash {}(name)) { - T8_ASSERT (0 <= dim && dim <= T8_ECLASS_MAX_DIM); } /* Base constructor with no arguments. We need this since it * is called from derived class constructors. - * Sets dimension and name to invalid values. */ - t8_geometry (): t8_geometry (-1, "Invalid") + * Sets the name to an invalid value. */ + t8_geometry (): t8_geometry ("Invalid") { } @@ -73,7 +72,7 @@ struct t8_geometry * Maps points in the reference space \f$ [0,1]^\mathrm{dim} \to \mathbb{R}^3 \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -86,7 +85,7 @@ struct t8_geometry * Compute the jacobian of the \a t8_geom_evaluate map at a point in the reference space \f$ [0,1]^\mathrm{dim} \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] glreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] jacobian The jacobian at \a ref_coords. Array of size \a num_coords x dimension x 3. Indices \f$ 3 \cdot i\f$ , \f$ 3 \cdot i+1 \f$ , \f$ 3 \cdot i+2 \f$ * correspond to the \f$ i \f$-th column of the jacobian (Entry \f$ 3 \cdot i + j \f$ is \f$ \frac{\partial f_j}{\partial x_i} \f$). @@ -153,16 +152,6 @@ struct t8_geometry t8_geom_check_tree_compatibility () const = 0; - /** - * Get the dimension of this geometry. - * \return The dimension. - */ - inline int - t8_geom_get_dimension () const - { - return dimension; - } - /** * Get the name of this geometry. * \return The name. @@ -188,7 +177,6 @@ struct t8_geometry = 0; protected: - int dimension; /**< The dimension of reference space for which this is a geometry. */ std::string name; /**< The name of this geometry. */ size_t hash; /**< The hash of the name of this geometry. */ t8_gloidx_t active_tree; /**< The tree of which currently vertices are loaded. */ diff --git a/src/t8_geometry/t8_geometry_handler.cxx b/src/t8_geometry/t8_geometry_handler.cxx index 57900be091..130cc54fea 100644 --- a/src/t8_geometry/t8_geometry_handler.cxx +++ b/src/t8_geometry/t8_geometry_handler.cxx @@ -36,7 +36,7 @@ #include void -t8_geometry_handler::register_geometry (t8_geometry_c *geom) +t8_geometry_handler::register_geometry (t8_geometry *geom) { std::unique_ptr geom_ptr = std::unique_ptr (std::move (geom)); add_geometry (std::move (geom_ptr)); diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.cxx index 24dc718566..eca52eb353 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.cxx @@ -22,12 +22,12 @@ #include -t8_geometry_analytic::t8_geometry_analytic (int dim, std::string name, t8_geom_analytic_fn analytical, +t8_geometry_analytic::t8_geometry_analytic (std::string name, t8_geom_analytic_fn analytical, t8_geom_analytic_jacobian_fn jacobian_in, t8_geom_load_tree_data_fn load_tree_data_in, t8_geom_tree_negative_volume_fn tree_negative_volume_in, t8_geom_tree_compatible_fn tree_compatible_in, const void *user_data_in) - : t8_geometry (dim, name + "_" + std::to_string (dim)) + : t8_geometry (name) { analytical_function = analytical; jacobian = jacobian_in; @@ -37,8 +37,7 @@ t8_geometry_analytic::t8_geometry_analytic (int dim, std::string name, t8_geom_a user_data = user_data_in; } -t8_geometry_analytic::t8_geometry_analytic (int dim, std::string name) - : t8_geometry (dim, name + "_" + std::to_string (dim)) +t8_geometry_analytic::t8_geometry_analytic (std::string name): t8_geometry (name) { analytical_function = NULL; jacobian = NULL; @@ -113,12 +112,12 @@ t8_geometry_analytic_destroy (t8_geometry_c **geom) } t8_geometry_c * -t8_geometry_analytic_new (int dim, const char *name, t8_geom_analytic_fn analytical, - t8_geom_analytic_jacobian_fn jacobian, t8_geom_load_tree_data_fn load_tree_data, +t8_geometry_analytic_new (const char *name, t8_geom_analytic_fn analytical, t8_geom_analytic_jacobian_fn jacobian, + t8_geom_load_tree_data_fn load_tree_data, t8_geom_tree_negative_volume_fn tree_negative_volume, t8_geom_tree_compatible_fn tree_compatible, const void *user_data) { - t8_geometry_analytic *geom = new t8_geometry_analytic (dim, name, analytical, jacobian, load_tree_data, + t8_geometry_analytic *geom = new t8_geometry_analytic (name, analytical, jacobian, load_tree_data, tree_negative_volume, tree_compatible, user_data); return (t8_geometry_c *) geom; } diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.h b/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.h index 1f723a57a8..8964216246 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.h +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.h @@ -47,7 +47,7 @@ typedef void (*t8_geom_analytic_fn) (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, cons * Definition for the jacobian of an analytic geometry function. * \param [in] cmesh The cmesh. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] jacobian The jacobian at \a ref_coords. Array of size \f$ \mathrm{dim} \cdot 3 \f$ x \a num_coords. Indices \f$ 3 \cdot i\f$ , \f$ 3 \cdot i+1 \f$ , \f$ 3 \cdot i+2 \f$ * correspond to the \f$ i \f$-th column of the jacobian (Entry \f$ 3 \cdot i + j \f$ is \f$ \frac{\partial f_j}{\partial x_i} \f$). @@ -85,10 +85,9 @@ void t8_geometry_analytic_destroy (t8_geometry_c **geom); /** - * Create a new analytic geometry with a given dimension. The geometry + * Create a new analytic geometry. The geometry * is viable with all tree types and uses a user-provided analytic and * jacobian function. The actual mappings are done by these functions. - * \param [in] dim The dimension of this geometry. * \param [in] name The name to give this geometry. * \param [in] analytical The analytical function to use for this geometry. * \param [in] jacobian The jacobian of \a analytical. @@ -99,8 +98,8 @@ t8_geometry_analytic_destroy (t8_geometry_c **geom); * \return A pointer to an allocated geometry struct. */ t8_geometry_c * -t8_geometry_analytic_new (int dim, const char *name, t8_geom_analytic_fn analytical, - t8_geom_analytic_jacobian_fn jacobian, t8_geom_load_tree_data_fn load_tree_data, +t8_geometry_analytic_new (const char *name, t8_geom_analytic_fn analytical, t8_geom_analytic_jacobian_fn jacobian, + t8_geom_load_tree_data_fn load_tree_data, t8_geom_tree_negative_volume_fn tree_negative_volume, t8_geom_tree_compatible_fn tree_compatible, const void *user_data); diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.hxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.hxx index b9ddc1df2c..3ed3701ce5 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.hxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_analytic.hxx @@ -38,10 +38,9 @@ struct t8_geometry_analytic: public t8_geometry { public: /** - * Constructor of the analytic geometry with a given dimension. The geometry + * Constructor of the analytic geometry. The geometry * is viable with all tree types and uses a user-provided analytic and * jacobian function. The actual mappings are done by these functions. - * \param [in] dim The dimension of this geometry. * \param [in] name The name to give this geometry. * \param [in] analytical The analytical function to use for this geometry. * \param [in] jacobian The jacobian of \a analytical. @@ -49,17 +48,16 @@ struct t8_geometry_analytic: public t8_geometry * \param [in] tree_negative_volume_in The function that is used to compute if a trees volume is negative. * \param [in] tree_compatible_in The function that is used to check if a tree is compatible with the geometry. */ - t8_geometry_analytic (int dim, std::string name, t8_geom_analytic_fn analytical, - t8_geom_analytic_jacobian_fn jacobian, t8_geom_load_tree_data_fn load_tree_data, + t8_geometry_analytic (std::string name, t8_geom_analytic_fn analytical, t8_geom_analytic_jacobian_fn jacobian, + t8_geom_load_tree_data_fn load_tree_data, t8_geom_tree_negative_volume_fn tree_negative_volume_in, t8_geom_tree_compatible_fn tree_compatible_in, const void *user_data); /** * Constructor of the analytic geometry for testing purposes. - * \param [in] dim The dimension of this geometry. * \param [in] name The name to give this geometry. */ - t8_geometry_analytic (int dim, std::string name); + t8_geometry_analytic (std::string name); /** The destructor. */ @@ -82,7 +80,7 @@ struct t8_geometry_analytic: public t8_geometry * Maps points in the reference space \f$ [0,1]^\mathrm{dim} \to \mathbb{R}^3 \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -94,7 +92,7 @@ struct t8_geometry_analytic: public t8_geometry * Compute the jacobian of the \a t8_geom_evaluate map at a point in the reference space \f$ [0,1]^\mathrm{dim} \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] jacobian The jacobian at \a ref_coords. Array of size \f$ \mathrm{dim} \cdot 3 \f$ x \a num_coords. Indices \f$ 3 \cdot i\f$ , \f$ 3 \cdot i+1 \f$ , \f$ 3 \cdot i+2 \f$ * correspond to the \f$ i \f$-th column of the jacobian (Entry \f$ 3 \cdot i + j \f$ is \f$ \frac{\partial f_j}{\partial x_i} \f$). diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx index bc982865f1..615e8fe259 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.cxx @@ -50,8 +50,7 @@ const int t8_interpolation_coefficient_tet_edge[6] = { 0, 0, 0, 2, 2, 1 }; * For example: face 0 is described by coordinates z and y. */ const int t8_face_ref_coords_tet[4][2] = { { 2, 1 }, { 0, 1 }, { 0, 1 }, { 0, 2 } }; -t8_geometry_cad::t8_geometry_cad (int dim, std::string fileprefix, std::string name_in) - : t8_geometry_with_vertices (dim, name_in + "_" + std::to_string (dim)) +t8_geometry_cad::t8_geometry_cad (std::string fileprefix, std::string name_in): t8_geometry_with_vertices (name_in) { BRep_Builder builder; std::string current_file (fileprefix); @@ -74,8 +73,8 @@ t8_geometry_cad::t8_geometry_cad (int dim, std::string fileprefix, std::string n TopExp::MapShapesAndUniqueAncestors (cad_shape, TopAbs_EDGE, TopAbs_FACE, cad_shape_edge2face_map); } -t8_geometry_cad::t8_geometry_cad (int dim, const TopoDS_Shape cad_shape, std::string name_in) - : t8_geometry_with_vertices (dim, name_in + "_" + std::to_string (dim)) +t8_geometry_cad::t8_geometry_cad (const TopoDS_Shape cad_shape, std::string name_in) + : t8_geometry_with_vertices (name_in) { if (cad_shape.IsNull ()) { SC_ABORTF ("Shape is null. \n"); @@ -87,7 +86,7 @@ t8_geometry_cad::t8_geometry_cad (int dim, const TopoDS_Shape cad_shape, std::st TopExp::MapShapesAndUniqueAncestors (cad_shape, TopAbs_EDGE, TopAbs_FACE, cad_shape_edge2face_map); } -t8_geometry_cad::t8_geometry_cad (int dim): t8_geometry_with_vertices (dim, "t8_geom_cad_" + std::to_string (dim)) +t8_geometry_cad::t8_geometry_cad (): t8_geometry_with_vertices ("t8_geom_cad") { cad_shape.Nullify (); } @@ -1634,11 +1633,11 @@ t8_geometry_cad::t8_geom_is_surface_closed (int geometry_index, int parameter) c T8_EXTERN_C_BEGIN (); /* Satisfy the C interface from t8_geometry_cad.h. - * Create a new geometry with given dimension. */ + * Create a new geometry. */ t8_geometry_cad_c * -t8_geometry_cad_new (int dimension, const char *fileprefix, const char *name_in) +t8_geometry_cad_new (const char *fileprefix, const char *name_in) { - t8_geometry_cad *geom = new t8_geometry_cad (dimension, fileprefix, name_in); + t8_geometry_cad *geom = new t8_geometry_cad (fileprefix, name_in); return (t8_geometry_cad_c *) geom; } diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.h b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.h index dfa5901362..2779c10705 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.h +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.h @@ -49,16 +49,15 @@ T8_EXTERN_C_BEGIN (); * The vertices are saved via the \ref t8_cmesh_set_tree_vertices function. * Since the internals of this geometry are finely tuned to the .brep file * it is recommended to only use it with the \ref t8_cmesh_readmshfile function. - * \param [in] dim 0 <= \a dimension <= 3. The dimension. + * \param [in] dim 0 <= tree dimension <= 3. The dimension. * \param [in] fileprefix Prefix of a .brep file from which to extract an cad geometry. * \param [in] name The name to give this geometry. * \return A pointer to an allocated t8_geometry_cad struct, as - * if the \ref t8_geometry_cad (int dim, const *char fileprefix, - * const char *name) + * if the \ref t8_geometry_cad (std::string fileprefix, std::string name) * constructor was called. */ t8_geometry_cad_c * -t8_geometry_cad_new (int dim, const char *fileprefix, const char *name_in); +t8_geometry_cad_new (const char *fileprefix, const char *name_in); /** Destroy a cad geometry that was created with \ref t8_geometry_cad_new. * \param [in,out] geom A cad geometry. Set to NULL on output. diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.hxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.hxx index c4b3e0ab6f..915485f835 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.hxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_cad.hxx @@ -50,39 +50,36 @@ struct t8_geometry_cad: public t8_geometry_with_vertices { public: /** - * Constructor of the cad geometry with a given dimension. The geometry + * Constructor of the cad geometry. The geometry * is currently viable with quad/hex and triangle trees. Tets will be supported soon. * The geometry uses as many vertices as the tree type has, as well as * additional geometry information, which is extracted from a .brep file. * The vertices are saved via the \ref t8_cmesh_set_tree_vertices function. * Since the internals of this geometry are finely tuned to the .brep file * it is recommended to only use it with the \ref t8_cmesh_readmshfile function. - * \param [in] dim The dimension of this geometry. * \param [in] fileprefix Prefix of a .brep file from which to extract an cad geometry. * \param [in] name The name to give this geometry. */ - t8_geometry_cad (int dim, std::string fileprefix, std::string name = "t8_geom_cad"); + t8_geometry_cad (std::string fileprefix, std::string name = "t8_geom_cad"); /** - * Constructor of the cad geometry with a given dimension. The geometry + * Constructor of the cad geometry. The geometry * is currently viable with quad/hex and triangle trees. Tets will be supported soon. * The geometry uses as many vertices as the tree type has, as well as * additional geometry information, which is given via the \a cad_shape. * The vertices are saved via the \ref t8_cmesh_set_tree_vertices function. * This constructor can be used in short scripts or in combination with a * mesh generator, to omit the file IO of the - * \ref t8_geometry_cad (int dim, std::string fileprefix, std::string name) constructor. - * \param [in] dim The dimension of this geometry. + * \ref t8_geometry_cad (std::string fileprefix, std::string name) constructor. * \param [in] cad_shape cad shape geometry. * \param [in] name The name to give this geometry. */ - t8_geometry_cad (int dim, const TopoDS_Shape cad_shape, std::string name = "t8_geom_cad"); + t8_geometry_cad (const TopoDS_Shape cad_shape, std::string name = "t8_geom_cad"); /** * Constructor of the cad geometry for testing purposes. Sets an invalid cad_shape. - * \param [in] dim The dimension of this geometry. */ - t8_geometry_cad (int dim); + t8_geometry_cad (); /** The destructor. */ virtual ~t8_geometry_cad () @@ -104,7 +101,7 @@ struct t8_geometry_cad: public t8_geometry_with_vertices * Maps points in the reference space \f$ [0,1]^\mathrm{dim} \to \mathbb{R}^3 \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -116,7 +113,7 @@ struct t8_geometry_cad: public t8_geometry_with_vertices * Compute the jacobian of the \a t8_geom_evaluate map at a point in the reference space \f$ [0,1]^\mathrm{dim} \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] jacobian The jacobian at \a ref_coords. Array of size \a num_coords x dimension x 3. Indices \f$ 3 \cdot i\f$ , \f$ 3 \cdot i+1 \f$ , \f$ 3 \cdot i+2 \f$ * correspond to the \f$ i \f$-th column of the jacobian (Entry \f$ 3 \cdot i + j \f$ is \f$ \frac{\partial f_j}{\partial x_i} \f$). @@ -323,7 +320,7 @@ struct t8_geometry_cad: public t8_geometry_with_vertices * Maps points in the reference space \f$ [0,1]^2 \f$ to \f$ \mathbb{R}^3 \f$. Only for quad trees. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -335,7 +332,7 @@ struct t8_geometry_cad: public t8_geometry_with_vertices * Map a point in the reference space $$[0,1]^3$$ to $$\mathbb R^3$$. Only for tet trees. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords The number of points to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. */ @@ -347,7 +344,7 @@ struct t8_geometry_cad: public t8_geometry_with_vertices * Map a point in the reference space \f$ \f$ [0,1]^3 \f$ \f$ to \f$ \mathbb{R}^3 \f$. Only for hex trees. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -359,7 +356,7 @@ struct t8_geometry_cad: public t8_geometry_with_vertices * Maps points in the reference space \f$ \f$ [0,1]^3 \f$ \f$ to \f$ \mathbb{R}^3 \f$. Only for prism trees. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_examples.hxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_examples.hxx index 07eb2d08a0..34aa2e98c4 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_examples.hxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_examples.hxx @@ -36,7 +36,7 @@ struct t8_geometry_quadrangulated_disk: public t8_geometry_with_vertices { public: /* Basic constructor that sets the dimension and the name. */ - t8_geometry_quadrangulated_disk (): t8_geometry_with_vertices (2, "t8_quadrangulated_disk_") + t8_geometry_quadrangulated_disk (): t8_geometry_with_vertices ("t8_quadrangulated_disk_") { } @@ -44,7 +44,7 @@ struct t8_geometry_quadrangulated_disk: public t8_geometry_with_vertices * Map five quads to a disk. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords The number of points to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. * @@ -110,7 +110,7 @@ struct t8_geometry_triangulated_spherical_surface: public t8_geometry_with_verti { public: /* Basic constructor that sets the dimension and the name. */ - t8_geometry_triangulated_spherical_surface (): t8_geometry_with_vertices (2, "t8_triangulated_spherical_surface_") + t8_geometry_triangulated_spherical_surface (): t8_geometry_with_vertices ("t8_triangulated_spherical_surface_") { } @@ -123,7 +123,7 @@ struct t8_geometry_triangulated_spherical_surface: public t8_geometry_with_verti * Map the faces of an octahedron/icosahedron to a spherical surface. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords The number of points to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. * @@ -169,7 +169,7 @@ struct t8_geometry_tessellated_spherical_surface: public t8_geometry_with_vertic { public: /* Basic constructor that sets the dimension and the name. */ - t8_geometry_tessellated_spherical_surface (): t8_geometry_with_vertices (2, "t8_tessellated_spherical_surface_") + t8_geometry_tessellated_spherical_surface (): t8_geometry_with_vertices ("t8_tessellated_spherical_surface") { } @@ -182,7 +182,7 @@ struct t8_geometry_tessellated_spherical_surface: public t8_geometry_with_vertic * Map the faces of a cube to a spherical surface. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords The number of points to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. * @@ -227,7 +227,7 @@ struct t8_geometry_cubed_spherical_shell: public t8_geometry_with_vertices { public: /* Basic constructor that sets the dimension and the name. */ - t8_geometry_cubed_spherical_shell (): t8_geometry_with_vertices (3, "t8_cubed_spherical_shell_") + t8_geometry_cubed_spherical_shell (): t8_geometry_with_vertices ("t8_cubed_spherical_shell_") { } @@ -240,7 +240,7 @@ struct t8_geometry_cubed_spherical_shell: public t8_geometry_with_vertices * Map the faces of a cube to a spherical surface. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords The number of points to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. * @@ -285,7 +285,7 @@ struct t8_geometry_prismed_spherical_shell: public t8_geometry_with_vertices { public: /* Basic constructor that sets the dimension and the name. */ - t8_geometry_prismed_spherical_shell (): t8_geometry_with_vertices (3, "t8_prismed_spherical_shell") + t8_geometry_prismed_spherical_shell (): t8_geometry_with_vertices ("t8_prismed_spherical_shell") { } @@ -298,7 +298,7 @@ struct t8_geometry_prismed_spherical_shell: public t8_geometry_with_vertices * Map prism arranged as octahedron (or similar) to a spherical shell. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords The number of points to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. * @@ -343,7 +343,7 @@ struct t8_geometry_cubed_sphere: public t8_geometry_with_vertices { public: /* Basic constructor that sets the dimension and the name. */ - t8_geometry_cubed_sphere (): t8_geometry_with_vertices (3, "t8_geometry_cubed_sphere") + t8_geometry_cubed_sphere (): t8_geometry_with_vertices ("t8_geometry_cubed_sphere") { } @@ -356,7 +356,7 @@ struct t8_geometry_cubed_sphere: public t8_geometry_with_vertices * Maps specifically arranged hexahedrons to a sphere. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords The number of points to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. * diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx index c6c69b9859..078f5a6284 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.cxx @@ -32,8 +32,7 @@ #include #include -t8_geometry_lagrange::t8_geometry_lagrange (int dim) - : t8_geometry_with_vertices (dim, "t8_geom_lagrange_" + std::to_string (dim)) +t8_geometry_lagrange::t8_geometry_lagrange (): t8_geometry_with_vertices ("t8_geom_lagrange") { } @@ -291,10 +290,9 @@ t8_lagrange_element::t8_lagrange_element (t8_eclass_t eclass, uint32_t degree, s // if (nodes.size () != parametric_nodes.size ()) // SC_ABORTF ("Provide the 3 coordinates of the nodes.\n"); /* Create a cmesh with a single element */ - int dim = t8_eclass_to_dimension[eclass]; t8_cmesh_init (&cmesh); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_LAGRANGE_POLY_DEGREE_KEY, °ree, sizeof (int), 1); - t8_cmesh_register_geometry (cmesh, dim); + t8_cmesh_register_geometry (cmesh); t8_cmesh_set_tree_class (cmesh, 0, eclass); t8_cmesh_set_tree_vertices (cmesh, 0, nodes.data (), nodes.size ()); t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); @@ -522,11 +520,11 @@ t8_lagrange_element::write () const T8_EXTERN_C_BEGIN (); /* Satisfy the C interface from t8_geometry_lagrange.h. - * Create a new geometry with given dimension. */ + * Create a new geometry. */ t8_geometry_c * -t8_geometry_lagrange_new (int dimension) +t8_geometry_lagrange_new () { - t8_geometry_lagrange *geom = new t8_geometry_lagrange (dimension); + t8_geometry_lagrange *geom = new t8_geometry_lagrange (); return (t8_geometry_c *) geom; } diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.h b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.h index 68e504a2d0..82defbb343 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.h +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.h @@ -39,13 +39,12 @@ T8_EXTERN_C_BEGIN (); * The geometry is compatible with all tree types and uses as many vertices * as the number of Lagrange basis functions used for the mapping. * The vertices are saved via the \ref t8_cmesh_set_tree_vertices function. - * Sets the dimension and the name to "t8_geom_lagrange_{dim}" - * \param [in] dim 0 <= \a dimension <= 3. The dimension. + * Sets the name to "t8_geom_lagrange" * \return A pointer to an allocated t8_geometry_lagrange struct, as - * if the \ref t8_geometry_lagrange (int dim) constructor was called. + * if the \ref t8_geometry_lagrange () constructor was called. */ t8_geometry_c * -t8_geometry_lagrange_new (int dim); +t8_geometry_lagrange_new (); /** Destroy a Lagrange geometry that was created with \ref t8_geometry_lagrange_new. * \param [in,out] geom A Lagrange geometry. Set to NULL on output. diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.hxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.hxx index 0fbe66ef00..c81f8742ec 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.hxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_lagrange.hxx @@ -81,17 +81,8 @@ struct t8_geometry_lagrange: public t8_geometry_with_vertices * is compatible with all tree types and uses as many vertices as the number of Lagrange * basis functions used for the mapping. * The vertices are saved via the \ref t8_cmesh_set_tree_vertices function. - * \param [in] dim 0 <= \a dim <= 3. Element dimension in the parametric space. - * E.g. \a dim = 2 for a \ref T8_ECLASS_QUAD element. */ - t8_geometry_lagrange (int dim); - - /* Base constructor with no arguments. We need this since it - * is called from derived class constructors. - * Sets dimension and name to invalid values. */ - t8_geometry_lagrange (): t8_geometry_with_vertices () - { - } + t8_geometry_lagrange (); virtual ~t8_geometry_lagrange (); @@ -122,7 +113,7 @@ struct t8_geometry_lagrange: public t8_geometry_with_vertices * * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_points entries, specifying points in the reference space. + * \param [in] ref_coords Array of tree dimension x \a num_points entries, specifying points in the reference space. * \param [in] num_points Number of points to map. Currently, only one point is supported. * \param [out] out_coords Coordinates of the mapped points in physical space of \a ref_coords. The length is \a num_points * 3. */ @@ -134,7 +125,7 @@ struct t8_geometry_lagrange: public t8_geometry_with_vertices * Compute the Jacobian of the \a t8_geom_evaluate map at a point in the reference space. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_points entries, specifying points in the reference space. + * \param [in] ref_coords Array of tree dimension x \a num_points entries, specifying points in the reference space. * \param [in] num_points Number of points to map. * \param [out] jacobian The Jacobian at \a ref_coords. Array of size \a num_points x dimension x 3. Indices \f$ 3 \cdot i\f$ , \f$ 3 \cdot i+1 \f$ , \f$ 3 \cdot i+2 \f$ * correspond to the \f$ i \f$-th column of the Jacobian (Entry \f$ 3 \cdot i + j \f$ is \f$ \frac{\partial f_j}{\partial x_i} \f$). @@ -164,7 +155,7 @@ struct t8_geometry_lagrange: public t8_geometry_with_vertices private: /** * Evaluates the basis functions of the current tree type at a point. - * \param [in] ref_point Array of \a dimension entries, specifying the point in the reference space. + * \param [in] ref_point Array of tree dimension entries, specifying the point in the reference space. */ inline std::vector t8_geom_compute_basis (const double *ref_point) const; diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.cxx index b03e54a8f3..c64112da76 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.cxx @@ -26,8 +26,7 @@ #include #include -t8_geometry_linear::t8_geometry_linear (int dim) - : t8_geometry_with_vertices (dim, "t8_geom_linear_" + std::to_string (dim)) +t8_geometry_linear::t8_geometry_linear (): t8_geometry_with_vertices ("t8_geom_linear") { } @@ -242,11 +241,11 @@ t8_geometry_linear::t8_geom_point_batch_inside_element (t8_forest_t forest, t8_l T8_EXTERN_C_BEGIN (); /* Satisfy the C interface from t8_geometry_linear.h. - * Create a new geometry with given dimension. */ + * Create a new geometry. */ t8_geometry_c * -t8_geometry_linear_new (int dimension) +t8_geometry_linear_new () { - t8_geometry_linear *geom = new t8_geometry_linear (dimension); + t8_geometry_linear *geom = new t8_geometry_linear (); return (t8_geometry_c *) geom; } diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.h b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.h index f7da1de826..d91709babc 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.h +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.h @@ -34,16 +34,15 @@ T8_EXTERN_C_BEGIN (); /** - * Create a new linear geometry of a given dimension. + * Create a new linear geometry. * The geometry is only all tree types and as many vertices as the tree type * has. The vertices are saved via the \ref t8_cmesh_set_tree_vertices function. - * Sets the dimension and the name to "t8_geom_linear_{dim}" - * \param [in] dim 0 <= \a dimension <= 3. The dimension. + * Sets the dimension and the name to "t8_geom_linear" * \return A pointer to an allocated t8_geometry_linear struct, as - * if the \ref t8_geometry_linear (int dim) constructor was called. + * if the \ref t8_geometry_linear () constructor was called. */ t8_geometry_c * -t8_geometry_linear_new (int dim); +t8_geometry_linear_new (); /** Destroy a linear geometry that was created with \ref t8_geometry_linear_new. * \param [in,out] geom A linear geometry. Set to NULL on output. diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx index db757e73be..a5a1f16a8a 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx @@ -35,20 +35,12 @@ struct t8_geometry_linear: public t8_geometry_with_vertices { public: /** - * Constructor of the linear geometry with a given dimension. The geometry + * Constructor of the linear geometry. The geometry * is viable with all tree types and uses as many vertices as the tree type has. * The vertices are saved via the \ref t8_cmesh_set_tree_vertices function. - * Sets the dimension and the name to "t8_geom_linear_{dim}" - * \param [in] dim 0 <= \a dimension <= 3. The dimension. + * Sets the dimension and the name to "t8_geom_linear" */ - t8_geometry_linear (int dim); - - /* Base constructor with no arguments. We need this since it - * is called from derived class constructors. - * Sets dimension and name to invalid values. */ - t8_geometry_linear (): t8_geometry_with_vertices () - { - } + t8_geometry_linear (); /** The destructor. * Clears the allocated memory. @@ -69,7 +61,7 @@ struct t8_geometry_linear: public t8_geometry_with_vertices * Maps points in the reference space \f$ [0,1]^\mathrm{dim} \to \mathbb{R}^3 \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -81,7 +73,7 @@ struct t8_geometry_linear: public t8_geometry_with_vertices * Compute the jacobian of the \a t8_geom_evaluate map at a point in the reference space \f$ [0,1]^\mathrm{dim} \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] jacobian The jacobian at \a ref_coords. Array of size \a num_coords x dimension x 3. Indices \f$ 3 \cdot i\f$ , \f$ 3 \cdot i+1 \f$ , \f$ 3 \cdot i+2 \f$ * correspond to the \f$ i \f$-th column of the jacobian (Entry \f$ 3 \cdot i + j \f$ is \f$ \frac{\partial f_j}{\partial x_i} \f$). diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.cxx index 7bc59636e7..394169f390 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.cxx @@ -42,8 +42,8 @@ correct_point_order (const double tree_vertices[6]) } #endif -t8_geometry_linear_axis_aligned::t8_geometry_linear_axis_aligned (int dim) - : t8_geometry_with_vertices (dim, "t8_geom_linear_axis_aligned_" + std::to_string (dim)) +t8_geometry_linear_axis_aligned::t8_geometry_linear_axis_aligned () + : t8_geometry_with_vertices ("t8_geom_linear_axis_aligned") { } @@ -115,9 +115,9 @@ T8_EXTERN_C_BEGIN (); /* Satisfy the C interface from t8_geometry_linear_axis_aligned.h. * Create a new geometry with given dimension. */ t8_geometry_c * -t8_geometry_linear_axis_aligned_new (int dimension) +t8_geometry_linear_axis_aligned_new () { - t8_geometry_linear_axis_aligned *geom = new t8_geometry_linear_axis_aligned (dimension); + t8_geometry_linear_axis_aligned *geom = new t8_geometry_linear_axis_aligned (); return (t8_geometry_c *) geom; } diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.h b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.h index 2e6b16fdd8..fc2c140732 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.h +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.h @@ -39,13 +39,12 @@ T8_EXTERN_C_BEGIN (); * The geometry is only viable for line/quad/hex elements and uses two * vertices (min and max coords) per tree. The vertices are saved via * the \ref t8_cmesh_set_tree_vertices function. - * \param [in] dim 0 <= \a dimension <= 3. The dimension. * \return A pointer to an allocated t8_geometry_linear_axis_aligned - * struct, as if the t8_geometry_linear_axis_aligned - * (int dimension) constructor was called. + * struct, as if the t8_geometry_linear_axis_aligned () + * constructor was called. */ t8_geometry_c * -t8_geometry_linear_axis_aligned_new (int dim); +t8_geometry_linear_axis_aligned_new (); /** Destroy a linear, axis-aligned geometry that was created with * \ref t8_geometry_linear_axis_aligned_new. diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.hxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.hxx index 893663f2c5..729759ca1f 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.hxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.hxx @@ -39,19 +39,10 @@ struct t8_geometry_linear_axis_aligned: public t8_geometry_with_vertices * Constructor of the linear, axis-aligned geometry with a given dimension. * The geometry is only viable for the line/quad/hex tree types and uses two * vertices (min and max coords) per tree. The vertices are saved via - * the \ref t8_cmesh_set_tree_vertices function. Sets the dimension and the - * name to "t8_geom_linear_axis_aligned_{dim}" - * \param [in] dim 0 <= \a dimension <= 3. The dimension. + * the \ref t8_cmesh_set_tree_vertices function. Sets the + * name to "t8_geom_linear_axis_aligned" */ - t8_geometry_linear_axis_aligned (int dim); - - /* Base constructor with no arguments. We need this since it - * is called from derived class constructors. - * Sets dimension and name to invalid values. */ - - t8_geometry_linear_axis_aligned (): t8_geometry_with_vertices () - { - } + t8_geometry_linear_axis_aligned (); /** The destructor. */ @@ -71,7 +62,7 @@ struct t8_geometry_linear_axis_aligned: public t8_geometry_with_vertices * Maps points in the reference space \f$ [0,1]^\mathrm{dim} \to \mathbb{R}^3 \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. */ @@ -83,7 +74,7 @@ struct t8_geometry_linear_axis_aligned: public t8_geometry_with_vertices * Compute the jacobian of the \a t8_geom_evaluate map at a point in the reference space \f$ [0,1]^\mathrm{dim} \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] jacobian The jacobian at \a ref_coords. Array of size \a num_coords x dimension x 3. Indices \f$ 3 \cdot i\f$ , \f$ 3 \cdot i+1 \f$ , \f$ 3 \cdot i+2 \f$ * correspond to the \f$ i \f$-th column of the jacobian (Entry \f$ 3 \cdot i + j \f$ is \f$ \frac{\partial f_j}{\partial x_i} \f$). diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.cxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.cxx index aa77de039a..0ea4c0ac98 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.cxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.cxx @@ -22,7 +22,7 @@ #include -t8_geometry_zero::t8_geometry_zero (int dim): t8_geometry (dim, "t8_geom_zero_" + std::to_string (dim)) +t8_geometry_zero::t8_geometry_zero (): t8_geometry ("t8_geom_zero") { } @@ -47,7 +47,8 @@ t8_geometry_zero::t8_geom_evaluate_jacobian (t8_cmesh_t cmesh, t8_gloidx_t gtree const size_t num_coords, double *jacobian) const { /* Set the jacobian to 0 */ - memset (jacobian, 0, sizeof (double) * 3 * dimension * num_coords); + const int tree_dim = t8_eclass_to_dimension[active_tree_class]; + memset (jacobian, 0, sizeof (double) * 3 * tree_dim * num_coords); } inline void @@ -59,11 +60,11 @@ t8_geometry_zero::t8_geom_load_tree_data (t8_cmesh_t cmesh, t8_gloidx_t gtreeid) T8_EXTERN_C_BEGIN (); /* Satisfy the C interface from t8_geometry_zero.h. - * Create a new geometry with given dimension. */ + * Create a new geometry. */ t8_geometry_c * -t8_geometry_zero_new (int dimension) +t8_geometry_zero_new () { - t8_geometry_zero *geom = new t8_geometry_zero (dimension); + t8_geometry_zero *geom = new t8_geometry_zero (); return (t8_geometry_c *) geom; } diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.h b/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.h index 7822280b44..809ae12ea6 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.h +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.h @@ -24,8 +24,8 @@ * This header provides the C interface to create a zero geometry. */ -#ifndef T8_GEOMETRY_zero_H -#define T8_GEOMETRY_zero_H +#ifndef T8_GEOMETRY_ZERO_H +#define T8_GEOMETRY_ZERO_H #include #include @@ -34,16 +34,15 @@ T8_EXTERN_C_BEGIN (); /** - * Create a new zero geometry of a given dimension. + * Create a new zero geometry. * The geometry is only all tree types and as many vertices as the tree type * has. The vertices are saved via the \ref t8_cmesh_set_tree_vertices function. - * Sets the dimension and the name to "t8_geom_zero_{dim}" - * \param [in] dim 0 <= \a dimension <= 3. The dimension. + * Sets the dimension and the name to "t8_geom_zero_" * \return A pointer to an allocated t8_geometry_zero struct, as - * if the \ref t8_geometry_zero (int dim) constructor was called. + * if the \ref t8_geometry_zero () constructor was called. */ t8_geometry_c * -t8_geometry_zero_new (int dim); +t8_geometry_zero_new (); /** Destroy a zero geometry that was created with \ref t8_geometry_zero_new. * \param [in,out] geom A zero geometry. Set to NULL on output. @@ -53,4 +52,4 @@ t8_geometry_zero_destroy (t8_geometry_c **geom); T8_EXTERN_C_END (); -#endif /* !T8_GEOMETRY_zero_H! */ +#endif /* T8_GEOMETRY_ZERO_H */ diff --git a/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.hxx b/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.hxx index 12c7796ffd..64ff0b1072 100644 --- a/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.hxx +++ b/src/t8_geometry/t8_geometry_implementations/t8_geometry_zero.hxx @@ -37,13 +37,12 @@ struct t8_geometry_zero: public t8_geometry { public: /** - * Constructor of the zero geometry with a given dimension. The geometry + * Constructor of the zero geometry. The geometry * is viable with all tree types. This geometry maps all points to zero and * is meant for debugging purposes. - * Sets the dimension and the name to "t8_geom_zero_{dim}" - * \param [in] dim 0 <= \a dimension <= 3. The dimension. + * Sets the dimension and the name to "t8_geom_zero" */ - t8_geometry_zero (int dimension); + t8_geometry_zero (); /** * Check if the currently active tree has a negative volume @@ -74,7 +73,7 @@ struct t8_geometry_zero: public t8_geometry * Maps points in the reference space \f$ [0,1]^\mathrm{dim} \to \mathbb{R}^3 \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3. * \note All entries in out_coords will be set to 0. @@ -87,7 +86,7 @@ struct t8_geometry_zero: public t8_geometry * Compute the jacobian of the \a t8_geom_evaluate map at a point in the reference space \f$ [0,1]^\mathrm{dim} \f$. * \param [in] cmesh The cmesh in which the point lies. * \param [in] gtreeid The global tree (of the cmesh) in which the reference point is. - * \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. + * \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying points in \f$ [0,1]^\mathrm{dim} \f$. * \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map. * \param [out] jacobian The jacobian at \a ref_coords. Array of size \a num_coords x dimension x 3. Indices \f$ 3 \cdot i\f$ , \f$ 3 \cdot i+1 \f$ , \f$ 3 \cdot i+2 \f$ * correspond to the \f$ i \f$-th column of the jacobian (Entry \f$ 3 \cdot i + j \f$ is \f$ \frac{\partial f_j}{\partial x_i} \f$). @@ -140,4 +139,4 @@ struct t8_geometry_zero: public t8_geometry } }; -#endif /* !T8_GEOMETRY_ZERO_HXX */ +#endif /* T8_GEOMETRY_ZERO_HXX */ diff --git a/src/t8_geometry/t8_geometry_with_vertices.hxx b/src/t8_geometry/t8_geometry_with_vertices.hxx index 57c1c82b93..471d0b4f9c 100644 --- a/src/t8_geometry/t8_geometry_with_vertices.hxx +++ b/src/t8_geometry/t8_geometry_with_vertices.hxx @@ -39,8 +39,8 @@ T8_EXTERN_C_BEGIN (); struct t8_geometry_with_vertices: public t8_geometry { public: - /* Basic constructor that sets the dimension, the name, and the name for the attribute. */ - t8_geometry_with_vertices (int dimension, std::string name): t8_geometry (dimension, name) + /* Basic constructor that sets the name. */ + t8_geometry_with_vertices (std::string name): t8_geometry (name) { active_tree_vertices = NULL; active_tree = -1; @@ -48,8 +48,8 @@ struct t8_geometry_with_vertices: public t8_geometry /* Base constructor with no arguments. We need this since it * is called from derived class constructors. - * Sets dimension and name to invalid values. */ - t8_geometry_with_vertices (): t8_geometry_with_vertices (-1, "Invalid") + * Sets the name to an invalid value. */ + t8_geometry_with_vertices (): t8_geometry_with_vertices ("Invalid") { active_tree_vertices = NULL; active_tree = -1; diff --git a/src/t8_vtk/t8_vtk_reader.cxx b/src/t8_vtk/t8_vtk_reader.cxx index 83d827a0d5..059bcc711e 100644 --- a/src/t8_vtk/t8_vtk_reader.cxx +++ b/src/t8_vtk/t8_vtk_reader.cxx @@ -372,7 +372,7 @@ t8_vtkGrid_to_cmesh (vtkSmartPointer vtkGrid, const int partition, c t8_cmesh_set_dimension (cmesh, dim_buf); /* Set the geometry. */ - t8_cmesh_register_geometry (cmesh, dim_buf); + t8_cmesh_register_geometry (cmesh); /* Global-id of the first local tree */ t8_gloidx_t first_tree = 0; diff --git a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx index 843a6a74d6..6f512a062c 100644 --- a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx +++ b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_cad.cxx @@ -217,13 +217,13 @@ t8_create_cad_hypercube (double *rot_vec, int face, int edge, double *parameters T8_ASSERT (face < 0 || edge < 0); if (face >= 0) { faces[face] = 1; - t8_cmesh_register_geometry (cmesh, 3, t8_create_cad_surface_shape_x_z ()); + t8_cmesh_register_geometry (cmesh, t8_create_cad_surface_shape_x_z ()); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_PARAMETERS_ATTRIBUTE_KEY + face, parameters, 8 * sizeof (double), 0); } else if (edge >= 0) { edges[edge] = 1; - t8_cmesh_register_geometry (cmesh, 3, t8_create_cad_curve_shape ()); + t8_cmesh_register_geometry (cmesh, t8_create_cad_curve_shape ()); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_EDGE_PARAMETERS_ATTRIBUTE_KEY + edge, parameters, 2 * sizeof (double), 0); } @@ -232,7 +232,7 @@ t8_create_cad_hypercube (double *rot_vec, int face, int edge, double *parameters * we have to create a geometry. Hence a cad geometry can only be created * with an actual shape, we just create a geometry with a curve and do not * link the curve to any edge. */ - t8_cmesh_register_geometry (cmesh, 3, t8_create_cad_curve_shape ()); + t8_cmesh_register_geometry (cmesh, t8_create_cad_curve_shape ()); } t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_ATTRIBUTE_KEY, faces, 6 * sizeof (int), 0); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_EDGE_ATTRIBUTE_KEY, edges, 24 * sizeof (int), 0); @@ -424,13 +424,13 @@ t8_create_cad_reference_tet (int face, int edge, double *parameters) T8_ASSERT (face < 0 || edge < 0); if (face >= 0) { faces[face] = 1; - t8_cmesh_register_geometry (cmesh, 3, t8_create_cad_surface_shape_x_z ()); + t8_cmesh_register_geometry (cmesh, t8_create_cad_surface_shape_x_z ()); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_PARAMETERS_ATTRIBUTE_KEY + face, parameters, 6 * sizeof (double), 0); } else if (edge >= 0) { edges[edge] = 1; - t8_cmesh_register_geometry (cmesh, 3, t8_create_cad_curve_shape ()); + t8_cmesh_register_geometry (cmesh, t8_create_cad_curve_shape ()); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_EDGE_PARAMETERS_ATTRIBUTE_KEY + edge, parameters, 2 * sizeof (double), 0); } @@ -439,7 +439,7 @@ t8_create_cad_reference_tet (int face, int edge, double *parameters) * we have to create a geometry. Hence a cad geometry can only be created * with an actual shape, we just create a geometry with a curve and do not * link the curve to any edge. */ - t8_cmesh_register_geometry (cmesh, 3, t8_create_cad_curve_shape ()); + t8_cmesh_register_geometry (cmesh, t8_create_cad_curve_shape ()); } t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_ATTRIBUTE_KEY, faces, 4 * sizeof (int), 0); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_EDGE_ATTRIBUTE_KEY, edges, 12 * sizeof (int), 0); @@ -671,7 +671,7 @@ TEST_P (class_2d_element_cad_curve, t8_check_2d_element_cad_curve) t8_cmesh_init (&cmesh); t8_cmesh_set_tree_class (cmesh, 0, eclass); - t8_cmesh_register_geometry (cmesh, 2, (curvature == 0 ? shape_linear : shape_curved)); + t8_cmesh_register_geometry (cmesh, (curvature == 0 ? shape_linear : shape_curved)); t8_cmesh_set_tree_vertices ( cmesh, 0, (eclass == T8_ECLASS_QUAD ? vertices_quad + orientation : vertices_tri + orientation), num_vertices); @@ -791,7 +791,7 @@ TEST_P (class_2d_element_linear_cad_surface, t8_check_2d_element_linear_cad_surf (eclass == T8_ECLASS_QUAD ? params_quad : params_tri), 2 * num_vertices * sizeof (double), 0); /* Register the geometry */ - t8_cmesh_register_geometry (cmesh, 2, shape); + t8_cmesh_register_geometry (cmesh, shape); /* Commit the cmesh */ t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); @@ -858,7 +858,7 @@ class class_2d_element_curved_cad_surface: public testing::TestWithParam (cmesh, 2, shape); + t8_cmesh_register_geometry (cmesh, shape); } void @@ -965,13 +965,13 @@ t8_create_cad_reference_prism (int face, int edge, double *parameters) if (face >= 0) { faces[face] = 1; t8_cmesh_register_geometry ( - cmesh, 3, (face <= 2 ? t8_create_cad_surface_shape_x_z () : t8_create_cad_surface_shape_x_y ())); + cmesh, (face <= 2 ? t8_create_cad_surface_shape_x_z () : t8_create_cad_surface_shape_x_y ())); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_PARAMETERS_ATTRIBUTE_KEY + face, parameters, 2 * face_vertices * sizeof (double), 0); } else if (edge >= 0) { edges[edge] = 1; - t8_cmesh_register_geometry (cmesh, 3, t8_create_cad_curve_shape ()); + t8_cmesh_register_geometry (cmesh, t8_create_cad_curve_shape ()); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_EDGE_PARAMETERS_ATTRIBUTE_KEY + edge, parameters, 2 * sizeof (double), 0); } @@ -980,7 +980,7 @@ t8_create_cad_reference_prism (int face, int edge, double *parameters) * we have to create a geometry. Hence a cad geometry can only be created * with an actual shape, we just create a geometry with a curve and do not * link the curve to any edge. */ - t8_cmesh_register_geometry (cmesh, 3, t8_create_cad_curve_shape ()); + t8_cmesh_register_geometry (cmesh, t8_create_cad_curve_shape ()); } t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_FACE_ATTRIBUTE_KEY, faces, 5 * sizeof (int), 0); t8_cmesh_set_attribute (cmesh, 0, t8_get_package_id (), T8_CMESH_CAD_EDGE_ATTRIBUTE_KEY, edges, 18 * sizeof (int), 0); diff --git a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx index ce849ef8a9..4c1d69b18a 100644 --- a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx +++ b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_lagrange.cxx @@ -273,7 +273,7 @@ TEST (test_geometry_lagrange, incompatible_geometry) /* Commit the cmesh */ t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); /* Register the t8_geometry_lagrange geometry to this cmesh. */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); /* Should return true since the t8_geometry_lagrange geometry is compatible with quads. */ ASSERT_TRUE (t8_cmesh_validate_geometry (cmesh)); t8_cmesh_destroy (&cmesh); @@ -292,7 +292,7 @@ TEST (test_geometry_lagrange, incompatible_geometry) t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); /* Register the t8_geometry_lagrange to this cmesh. * We register it after committing because it would throw an assertion and we do not have death tests.*/ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); /* Check validity after committing to circumvent the assertion. * Should return false since the t8_geometry_lagrange geometry is not compatible with prisms. */ ASSERT_FALSE (t8_cmesh_validate_geometry (cmesh)); @@ -309,7 +309,7 @@ TEST (test_geometry_lagrange, incompatible_geometry) t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); /* Register the t8_geometry_lagrange to this cmesh. * We register it after committing because it would throw an assertion and we do not have death tests.*/ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); /* Check validity after committing to circumvent the assertion. * Should return false since the maximum polynomial degree is exceeded. */ ASSERT_FALSE (t8_cmesh_validate_geometry (cmesh)); diff --git a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx index 6627dd9141..ee453aadce 100644 --- a/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx +++ b/test/t8_geometry/t8_geometry_implementations/t8_gtest_geometry_linear.cxx @@ -66,17 +66,17 @@ class geometry_test: public testing::TestWithParam> { } switch (geom_int) { case T8_GEOMETRY_TYPE_LINEAR: - geom = new t8_geometry_linear (t8_eclass_to_dimension[eclass]); - t8_cmesh_register_geometry (cmesh, t8_eclass_to_dimension[eclass]); + geom = new t8_geometry_linear (); + t8_cmesh_register_geometry (cmesh); break; case T8_GEOMETRY_TYPE_LINEAR_AXIS_ALIGNED: - geom = new t8_geometry_linear_axis_aligned (t8_eclass_to_dimension[eclass]); + geom = new t8_geometry_linear_axis_aligned (); /* Copy last vertex to the second position*/ vertices[3] = vertices[3 * (num_vertices - 1)]; vertices[4] = vertices[3 * (num_vertices - 1) + 1]; vertices[5] = vertices[3 * (num_vertices - 1) + 2]; - t8_cmesh_register_geometry (cmesh, t8_eclass_to_dimension[eclass]); + t8_cmesh_register_geometry (cmesh); break; default: break; @@ -175,7 +175,7 @@ TEST (test_geometry_linear, incompatible_geometry) /* Commit the cmesh */ t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); /* Register the t8_geometry_linear_axis_aligned geometry to this cmesh. */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); /* Should return true since the t8_geometry_linear_axis_aligned geometry is compatible with quads. */ ASSERT_TRUE (t8_cmesh_validate_geometry (cmesh)); t8_cmesh_destroy (&cmesh); @@ -190,7 +190,7 @@ TEST (test_geometry_linear, incompatible_geometry) t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); /* Register the linear axis aligned geometry to this cmesh. * We register it after committing because it would throw an assertion and do not have death tests.*/ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); /* Check validity after committing to circumvent the assertion. * Should return false since the t8_geometry_linear_axis_aligned geometry is not compatible with triangles. */ ASSERT_FALSE (t8_cmesh_validate_geometry (cmesh)); diff --git a/test/t8_geometry/t8_gtest_geometry_handling.cxx b/test/t8_geometry/t8_gtest_geometry_handling.cxx index 9ccf87c85d..55028a7160 100644 --- a/test/t8_geometry/t8_gtest_geometry_handling.cxx +++ b/test/t8_geometry/t8_gtest_geometry_handling.cxx @@ -54,19 +54,15 @@ TEST (test_geometry, test_geometry_handler_register) t8_debugf ("Testing geometry handler register and get geometry.\n"); /* Throw every implemented geometry at the handler and let it search for it. */ std::vector geometries; - for (int idim = 0; idim <= T8_ECLASS_MAX_DIM; ++idim) { - /* Register the geometries with dimension. */ - geometries.push_back (geom_handler.register_geometry (idim)); - geometries.push_back (geom_handler.register_geometry (idim)); + geometries.push_back (geom_handler.register_geometry ()); + geometries.push_back (geom_handler.register_geometry ()); #if T8_WITH_OCC - geometries.push_back (geom_handler.register_geometry (idim)); + geometries.push_back (geom_handler.register_geometry ()); #endif /* T8_WITH_OCC */ - geometries.push_back (geom_handler.register_geometry (idim, "analytic_geom")); - geometries.push_back (geom_handler.register_geometry (idim)); - geometries.push_back (geom_handler.register_geometry (idim)); - } - /* Register the geometries without dimension. */ + geometries.push_back (geom_handler.register_geometry ("analytic_geom")); + geometries.push_back (geom_handler.register_geometry ()); + geometries.push_back (geom_handler.register_geometry ()); geometries.push_back (geom_handler.register_geometry ()); geometries.push_back (geom_handler.register_geometry ()); geometries.push_back (geom_handler.register_geometry ()); @@ -83,9 +79,6 @@ TEST (test_geometry, test_geometry_handler_register) /* The hash should also be equal. */ ASSERT_EQ (found_geom->t8_geom_get_hash (), geom->t8_geom_get_hash ()) << "Could not find geometry with hash " << geom->t8_geom_get_hash (); - /* Same for the dimension */ - ASSERT_EQ (found_geom->t8_geom_get_dimension (), geom->t8_geom_get_dimension ()) - << "Could not find geometry with dimension " << geom->t8_geom_get_dimension (); } /* Check that we can find the geometries by hash. */ @@ -97,9 +90,6 @@ TEST (test_geometry, test_geometry_handler_register) /* The name should also be equal. */ ASSERT_EQ (found_geom->t8_geom_get_name (), geom->t8_geom_get_name ()) << "Could not find geometry with name " << geom->t8_geom_get_name (); - /* Same for the dimension */ - ASSERT_EQ (found_geom->t8_geom_get_dimension (), geom->t8_geom_get_dimension ()) - << "Could not find geometry with dimension " << geom->t8_geom_get_dimension (); } /* Try to find a different geometry via the name. Must return nullptr. */ @@ -124,8 +114,8 @@ TEST (test_geometry, cmesh_two_trees_and_geometries) t8_cmesh_set_tree_vertices (cmesh, 0, *t8_element_corner_ref_coords[T8_ECLASS_QUAD], 4); t8_cmesh_set_tree_class (cmesh, 1, T8_ECLASS_TRIANGLE); /* Register the linear geometry and zero geometry to this cmesh. */ - auto linear_geom = t8_cmesh_register_geometry (cmesh, 2); - auto zero_geom = t8_cmesh_register_geometry (cmesh, 2); + auto linear_geom = t8_cmesh_register_geometry (cmesh); + auto zero_geom = t8_cmesh_register_geometry (cmesh); /* Set the id geometry for the trees. */ t8_cmesh_set_tree_geometry (cmesh, 0, linear_geom); t8_cmesh_set_tree_geometry (cmesh, 1, zero_geom); @@ -140,9 +130,6 @@ TEST (test_geometry, cmesh_two_trees_and_geometries) /* Name should also be equal. */ ASSERT_EQ (found_geom->t8_geom_get_name (), linear_geom->t8_geom_get_name ()) << "Could not find linear tree geometry at tree 0."; - /* Same for the dimension */ - ASSERT_EQ (found_geom->t8_geom_get_dimension (), linear_geom->t8_geom_get_dimension ()) - << "Could not find linear tree geometry at tree 0."; found_geom = t8_cmesh_get_tree_geometry (cmesh, 1); /* Hash should be equal. */ @@ -151,9 +138,6 @@ TEST (test_geometry, cmesh_two_trees_and_geometries) /* Name should also be equal. */ ASSERT_EQ (found_geom->t8_geom_get_name (), zero_geom->t8_geom_get_name ()) << "Could not find zero tree geometry at tree 0."; - /* Same for the dimension */ - ASSERT_EQ (found_geom->t8_geom_get_dimension (), zero_geom->t8_geom_get_dimension ()) - << "Could not find zero tree geometry at tree 0."; /* clean-up */ t8_cmesh_destroy (&cmesh); @@ -169,7 +153,7 @@ TEST (test_geometry, cmesh_geometry_unique) t8_cmesh_init (&cmesh); t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_QUAD); /* Register the linear_geometry to this cmesh. */ - auto provided_geom = t8_cmesh_register_geometry (cmesh, 2); + auto provided_geom = t8_cmesh_register_geometry (cmesh); /* Commit the cmesh */ t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); diff --git a/test/t8_geometry/t8_gtest_point_inside.cxx b/test/t8_geometry/t8_gtest_point_inside.cxx index da28c40a05..c12f634ac2 100644 --- a/test/t8_geometry/t8_gtest_point_inside.cxx +++ b/test/t8_geometry/t8_gtest_point_inside.cxx @@ -56,7 +56,7 @@ TEST (t8_point_inside, test_point_inside_specific_triangle) t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_TRIANGLE); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 3); /* We use standard linear geometry */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); t8_forest_t forest = t8_forest_new_uniform (cmesh, t8_scheme_new_default_cxx (), 0, 0, sc_MPI_COMM_WORLD); @@ -97,7 +97,7 @@ TEST (t8_point_inside, test_point_inside_specific_quad) t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_QUAD); t8_cmesh_set_tree_vertices (cmesh, 0, vertices, 4); /* We use standard linear geometry */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); t8_cmesh_commit (cmesh, sc_MPI_COMM_WORLD); t8_forest_t forest = t8_forest_new_uniform (cmesh, t8_scheme_new_default_cxx (), 0, 0, sc_MPI_COMM_WORLD); diff --git a/tutorials/general/t8_tutorial_build_cmesh.cxx b/tutorials/general/t8_tutorial_build_cmesh.cxx index 933c2367fd..122636fc49 100644 --- a/tutorials/general/t8_tutorial_build_cmesh.cxx +++ b/tutorials/general/t8_tutorial_build_cmesh.cxx @@ -157,7 +157,7 @@ t8_cmesh_new_periodic_hybrid_2d (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* 3. Definition of the geometry */ - t8_cmesh_register_geometry (cmesh, 2); + t8_cmesh_register_geometry (cmesh); ; /* Use linear geometry */ /* 4. Definition of the classes of the different trees */ @@ -253,7 +253,7 @@ t8_cmesh_new_hybrid_gate_3d (sc_MPI_Comm comm) * t8_cmesh_init (&cmesh); * * // 3. Definition of the geometry - * t8_cmesh_register_geometry (cmesh, 3);; // Use linear geometry + * t8_cmesh_register_geometry (cmesh); // Use linear geometry * * // 4. Definition of the classes of the different trees * t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_TET); @@ -300,7 +300,7 @@ t8_cmesh_new_hybrid_gate_3d (sc_MPI_Comm comm) t8_cmesh_init (&cmesh); /* Definition of the geometry */ - t8_cmesh_register_geometry (cmesh, 3); + t8_cmesh_register_geometry (cmesh); /* Use linear geometry */ /* Defitition of the classes of the different trees */