From: hartmann Date: Wed, 6 Jul 2005 16:44:03 +0000 (+0000) Subject: Check for positive volumes right at the beginning of the 3d create_triangulation X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c300927fb20e70cf9dfb41d81c9b9285184b299;p=dealii-svn.git Check for positive volumes right at the beginning of the 3d create_triangulation git-svn-id: https://svn.dealii.org/trunk@11082 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 12d406f838..e6d34d7f42 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -697,6 +698,20 @@ Triangulation<3>::create_triangulation (const std::vector > &v, vertices = v; vertices_used = std::vector (v.size(), true); + // check that all cells have + // positive volume. if not call the + // invert_all_cells_of_negative_grid + // and reorder_cells function of + // GridReordering before creating + // the triangulation + for (unsigned int cell_no=0; cell_no::create_triangulation (const std::vector > &v, quad->line(l)->set_boundary_indicator (0); // Check that all cells have - // positive volume - Triangulation::active_cell_iterator cell=begin_active(), - endc=end(); - for (unsigned int c=0; cell!=endc; ++cell, ++c) - AssertThrow(cell->measure()>0, ExcCellHasNegativeMeasure(c)); + // positive volume. As the input + // CellData already passed this + // test we don't really expect + // negative measures here + for (active_cell_iterator cell=begin_active(); cell!=end(); ++cell) + Assert(cell->measure()>0, ExcInternalError()); /////////////////////////////////////// // now set boundary indicators