From 99793a755d790faed46a46ac28ef8be8a2935086 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 18 Aug 2021 16:20:53 -0600 Subject: [PATCH] Make TriaAccessor::set_*_boundary() const. --- include/deal.II/grid/tria_accessor.h | 4 ++-- include/deal.II/grid/tria_accessor.templates.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index 7e4a7b2432..c1e11bb7ac 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -2707,7 +2707,7 @@ public: * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ void - set_boundary_id(const types::boundary_id); + set_boundary_id(const types::boundary_id) const; /** * Set the manifold indicator of this vertex. This does nothing so far since @@ -2730,7 +2730,7 @@ public: * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ void - set_all_boundary_ids(const types::boundary_id); + set_all_boundary_ids(const types::boundary_id) const; /** * Set the manifold indicator of this object and all of its lower- diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index f2d9f45c0d..6558059da9 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -3092,11 +3092,12 @@ TriaAccessor<0, 1, spacedim>::isotropic_child_index(const unsigned int) template inline void -TriaAccessor<0, 1, spacedim>::set_boundary_id(const types::boundary_id b) +TriaAccessor<0, 1, spacedim>::set_boundary_id(const types::boundary_id b) const { Assert(tria->vertex_to_boundary_id_map_1d->find(this->vertex_index()) != tria->vertex_to_boundary_id_map_1d->end(), - ExcInternalError()); + ExcMessage("You can't set the boundary_id of a face of a cell that is " + "not actually at the boundary.")); (*tria->vertex_to_boundary_id_map_1d)[this->vertex_index()] = b; } @@ -3114,7 +3115,8 @@ TriaAccessor<0, 1, spacedim>::set_manifold_id(const types::manifold_id b) template inline void -TriaAccessor<0, 1, spacedim>::set_all_boundary_ids(const types::boundary_id b) +TriaAccessor<0, 1, spacedim>::set_all_boundary_ids( + const types::boundary_id b) const { set_boundary_id(b); } -- 2.39.5