From 1c83df44e22c4cb0243c14aff8c836882a19b8de Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 20 Sep 2001 09:31:16 +0000 Subject: [PATCH] The Triangulation class now provides the infrastructure to resolve this TODO: use the vertex list the triangulation exports, rather than building one on our own. git-svn-id: https://svn.dealii.org/trunk@5028 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/grid/grid_out.cc | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/deal.II/deal.II/source/grid/grid_out.cc b/deal.II/deal.II/source/grid/grid_out.cc index 58424c7641..dabc4c5f16 100644 --- a/deal.II/deal.II/source/grid/grid_out.cc +++ b/deal.II/deal.II/source/grid/grid_out.cc @@ -31,25 +31,18 @@ template void GridOut::write_ucd (const Triangulation &tria, std::ostream &out) { -//TODO:[WB] In GridOut::write_ucd, a vector of vertices is built along with -// another vector stating which of these are used. These are actually -// the same arrays as exist already in the triangulation, but I did not -// want to write just another access function. However, someone should -// take a look whether re-building these arrays is a large waste of -// computing time and memory, or whether it is justifiable. - AssertThrow (out, ExcIO()); - typename Triangulation::active_cell_iterator cell=tria.begin_active(); - const typename Triangulation::active_cell_iterator endc=tria.end(); + // get the positions of the + // vertices and whether they are + // used. + const std::vector > &vertices = tria.get_vertices(); + const std::vector &vertex_used = tria.get_used_vertices(); + + const unsigned int n_vertices = tria.n_used_vertices(); - // first loop over all cells to - // find out the vertices which - // are in use. copy them for fast - // output - std::vector > vertices (tria.n_vertices()); - std::vector vertex_used (tria.n_vertices(), false); - unsigned int n_vertices = 0; + typename Triangulation::active_cell_iterator cell=tria.begin_active(); + const typename Triangulation::active_cell_iterator endc=tria.end(); for (cell=tria.begin_active(); cell!=endc; ++cell) for (unsigned int vertex=0; vertex::vertices_per_cell; -- 2.39.5