From 8249ae80fa7724198c39680ec50070f5e74d0e40 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 4 Apr 2016 12:55:50 -0400 Subject: [PATCH] confusing set_all_manifold* errors if empty The error messages for set_all_manifold_ids* are confusing if the mesh is empty: An error occurred in line <10760> of file in function dealii::Triangulation::raw_quad_iterator dealii::Triangulation::begin_raw_quad(unsigned int) const [with int dim = 2, int spacedim = 2, dealii::Triangulation::raw_quad_iterator = dealii::TriaRawIterator >] The violated condition was: level void Triangulation::set_all_manifold_ids (const types::manifold_id m_number) { + Assert(n_cells()>0, + ExcMessage("Error: set_all_manifold_ids() can not be called on an empty Triangulation.")); + typename Triangulation::active_cell_iterator cell=this->begin_active(), endc=this->end(); @@ -9035,6 +9038,9 @@ template void Triangulation::set_all_manifold_ids_on_boundary (const types::manifold_id m_number) { + Assert(n_cells()>0, + ExcMessage("Error: set_all_manifold_ids_on_boundary() can not be called on an empty Triangulation.")); + typename Triangulation::active_cell_iterator cell=this->begin_active(), endc=this->end(); @@ -9050,6 +9056,9 @@ void Triangulation::set_all_manifold_ids_on_boundary (const types::boundary_id b_id, const types::manifold_id m_number) { + Assert(n_cells()>0, + ExcMessage("Error: set_all_manifold_ids_on_boundary() can not be called on an empty Triangulation.")); + bool boundary_found = false; typename Triangulation::active_cell_iterator cell=this->begin_active(), endc=this->end(); -- 2.39.5