From 0f8e73113c9cc450b12d0de1eb7205739ba181f9 Mon Sep 17 00:00:00 2001
From: Marc Fehling <mafehling.git@gmail.com>
Date: Mon, 21 Aug 2023 17:35:13 -0600
Subject: [PATCH] Allow set_mesh_smoothing() on non-empty triangulations.

---
 doc/news/changes/minor/20230822Fehling | 4 ++++
 include/deal.II/grid/tria.h            | 3 +--
 source/grid/tria.cc                    | 2 --
 3 files changed, 5 insertions(+), 4 deletions(-)
 create mode 100644 doc/news/changes/minor/20230822Fehling

diff --git a/doc/news/changes/minor/20230822Fehling b/doc/news/changes/minor/20230822Fehling
new file mode 100644
index 0000000000..68fe48e16a
--- /dev/null
+++ b/doc/news/changes/minor/20230822Fehling
@@ -0,0 +1,4 @@
+Changed: You can now set MeshSmoothing flags in non-empty triangulations
+with Triangulation::set_mesh_smoothing().
+<br>
+(Marc Fehling, 2023/08/22)
diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h
index 5dac93b8a2..548a120d85 100644
--- a/include/deal.II/grid/tria.h
+++ b/include/deal.II/grid/tria.h
@@ -1849,8 +1849,7 @@ public:
 
   /**
    * Set the mesh smoothing to @p mesh_smoothing. This overrides the
-   * MeshSmoothing given to the constructor. It is allowed to call this
-   * function only if the triangulation is empty.
+   * MeshSmoothing given to the constructor.
    */
   virtual void
   set_mesh_smoothing(const MeshSmoothing mesh_smoothing);
diff --git a/source/grid/tria.cc b/source/grid/tria.cc
index 83218e3631..4e1d7c0595 100644
--- a/source/grid/tria.cc
+++ b/source/grid/tria.cc
@@ -12259,8 +12259,6 @@ DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
 void Triangulation<dim, spacedim>::set_mesh_smoothing(
   const MeshSmoothing mesh_smoothing)
 {
-  Assert(n_levels() == 0,
-         ExcTriangulationNotEmpty(vertices.size(), levels.size()));
   smooth_grid = mesh_smoothing;
 }
 
-- 
2.39.5