]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make TriaAccessor::set_*_boundary() const.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 18 Aug 2021 22:20:53 +0000 (16:20 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 18 Aug 2021 23:21:14 +0000 (17:21 -0600)
include/deal.II/grid/tria_accessor.h
include/deal.II/grid/tria_accessor.templates.h

index 7e4a7b2432ce3704561864b7d7ea0312264b33df..c1e11bb7aca1fe2d21eea8818db03235039054f1 100644 (file)
@@ -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-
index f2d9f45c0d1735b2fbdbbee03fc804a982868d6c..6558059da9e06adc888167e802e86224381ae7a9 100644 (file)
@@ -3092,11 +3092,12 @@ TriaAccessor<0, 1, spacedim>::isotropic_child_index(const unsigned int)
 
 template <int spacedim>
 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 <int spacedim>
 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);
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.