* Produce the volume or surface mesh of a torus. The axis of the torus is
* the $y$-axis while the plane of the torus is the $x$-$z$ plane.
*
- * If @p dim is 3, the mesh will be the volume of the torus. By default,
- * the boundary faces will have manifold id 0 and you should attach a
- * TorusManifold to it. The cells will have manifold id 1 and you should
- * attach a SphericalManifold to it.
- *
- * If @p dim is 2, the mesh will describe the surface of the torus. All
- * cells and faces will have manifold id 0 and you should attach a
- * TorusManifold to it.
+ * If @p dim is 3, the mesh will be the volume of the torus and this
+ * function attaches a TorusManifold to all boundary cells and faces (which
+ * are marked with a manifold id of 0).
+ *
+ * If @p dim is 2, the mesh will describe the surface of the torus and this
+ * function attaches a TorusManifold to all cells and faces (which are
+ * marked with a manifold id of 0).
*
* @param tria The triangulation to be filled.
*
tria.create_triangulation_compatibility (vertices, cells, SubCellData());
tria.set_all_manifold_ids(0);
+ tria.set_manifold(0, TorusManifold<2>(R, r));
}
template <>
// set manifolds as documented
tria.set_all_manifold_ids(1);
tria.set_all_manifold_ids_on_boundary(0);
+ tria.set_manifold(0, TorusManifold<3>(R, r));
}
initlog();
- TorusManifold<dim> boundary (1.5, .5);
Triangulation<dim, spacedim> tria;
- tria.set_manifold (0, boundary);
-
GridGenerator::torus (tria, 1.5, .5);
tria.refine_global(2);
return 0;
}
-
parallel::distributed::Triangulation<dim,spacedim> tr(MPI_COMM_WORLD);
GridGenerator::torus(tr, 1, 0.2);
+ tr.reset_all_manifolds();
tr.begin_active()->set_refine_flag();
tr.execute_coarsening_and_refinement ();
Triangulation<dim, spacedim> triangulation;
GridGenerator::torus(triangulation, 1.0, 0.4);
-
- static const SphericalManifold<3> desc_sphere;
- static const TorusManifold<3> desc_torus(1.0, 0.4);
- triangulation.set_manifold (0, desc_torus);
- triangulation.set_manifold (1, desc_sphere);
+ triangulation.set_manifold (1, SphericalManifold<3>());
triangulation.begin_active()->set_refine_flag();
triangulation.execute_coarsening_and_refinement ();
+ const TorusManifold<3> desc_torus(1.0, 0.4);
unsigned int c = 0;
for (Triangulation<dim, spacedim>::active_vertex_iterator v = triangulation.begin_active_vertex();
v != triangulation.end_vertex();
parallel::distributed::Triangulation<dim,spacedim> tr(MPI_COMM_WORLD);
GridGenerator::torus(tr, 1, 0.2);
+ tr.reset_all_manifolds();
tr.refine_global();
tr.begin_active()->set_refine_flag();