From f135df4f3e98579a2b812ad02d44442f1b0ec440 Mon Sep 17 00:00:00 2001 From: Patrick Behne Date: Wed, 9 Apr 2025 12:18:40 -0600 Subject: [PATCH] Added option to meshtool to apply variational smoother. Ref #4082 --- src/apps/meshtool.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/apps/meshtool.C b/src/apps/meshtool.C index 06ebb245db1..658eac1066b 100644 --- a/src/apps/meshtool.C +++ b/src/apps/meshtool.C @@ -47,6 +47,7 @@ #include "libmesh/string_to_enum.h" #include "libmesh/enum_elem_quality.h" #include "libmesh/getpot.h" +#include using namespace libMesh; @@ -62,6 +63,7 @@ int main (int argc, char ** argv) LibMeshInit init(argc, argv); unsigned int n_subdomains = 1; + bool vsmooth = false; unsigned int n_rsteps = 0; Real simplex_refine = 0.; double dist_fact = 0.; @@ -142,6 +144,10 @@ int main (int argc, char ** argv) n_subdomains = cast_int(tmp); } + // Whether to apply variational smoother + if (command_line.search(1, "-V")) + vsmooth = true; + // Should we call all_tri()? if (command_line.search(1, "-t")) triangulate = true; @@ -513,6 +519,12 @@ int main (int argc, char ** argv) if (n_subdomains > 1) mesh.partition(n_subdomains); + // Possibly smooth the mesh + if (vsmooth) + { + VariationalMeshSmoother vsmoother(mesh); + vsmoother.smooth(); + } // Possibly write the mesh if (output_names.size()) @@ -589,6 +601,7 @@ void usage(const std::string & prog_name) << " -D Randomly move interior nodes by D*hmin\n" << " -h Print help menu\n" << " -p Partition into subdomains\n" + << " -V Apply the variational mesh smoother\n" #ifdef LIBMESH_ENABLE_AMR << " -r Uniformly refine times\n" #endif