+ const char n_cells_docstring[] =
+ "Return the number of cells. \n";
+
+
+
const char dim_docstring[] =
"Return the dimension of the Triangulation \n";
+ const char cells_docstring[] =
+ "Return the list of cell accessors of the Triangulation. \n";
+
+
+
const char write_docstring[] =
"Write the mesh to the output file according to the given data format. \n"
"The possible formats are: \n"
&TriangulationWrapper::n_active_cells,
n_active_cells_docstring,
boost::python::args("self"))
+ .def("n_cells",
+ &TriangulationWrapper::n_cells,
+ n_cells_docstring,
+ boost::python::args("self"))
.def("minimal_cell_diameter",
&TriangulationWrapper::minimal_cell_diameter,
minimal_cell_diameter_docstring,
&TriangulationWrapper::active_cells,
active_cells_docstring,
boost::python::args("self"))
+ .def("cells",
+ &TriangulationWrapper::cells,
+ cells_docstring,
+ boost::python::args("self"))
.def("write",
&TriangulationWrapper::write,
write_docstring,
+ template <int dim, int spacedim>
+ boost::python::list
+ cells(TriangulationWrapper &triangulation_wrapper)
+ {
+ Triangulation<dim, spacedim> *tria =
+ static_cast<Triangulation<dim, spacedim> *>(
+ triangulation_wrapper.get_triangulation());
+ boost::python::list cells_list;
+ for (auto &cell : tria->cell_iterators())
+ cells_list.append(CellAccessorWrapper(triangulation_wrapper,
+ cell->level(),
+ cell->index()));
+
+ return cells_list;
+ }
+
+
+
template <int dim, int spacedim>
double
maximal_cell_diameter(const void *triangulation)
+ unsigned int
+ TriangulationWrapper::n_cells() const
+ {
+ if ((dim == 2) && (spacedim == 2))
+ return (*static_cast<Triangulation<2, 2> *>(triangulation)).n_cells();
+ else if ((dim == 2) && (spacedim == 3))
+ return (*static_cast<Triangulation<2, 3> *>(triangulation)).n_cells();
+ else
+ return (*static_cast<Triangulation<3, 3> *>(triangulation)).n_cells();
+ }
+
+
+
void
TriangulationWrapper::create_triangulation(
const boost::python::list &vertices,
+ boost::python::list
+ TriangulationWrapper::cells()
+ {
+ if ((dim == 2) && (spacedim == 2))
+ return internal::cells<2, 2>(*this);
+ else if ((dim == 2) && (spacedim == 3))
+ return internal::cells<2, 3>(*this);
+ else
+ return internal::cells<3, 3>(*this);
+ }
+
+
+
void
TriangulationWrapper::set_manifold(const int number,
ManifoldWrapper &manifold)