4747#include "libmesh/string_to_enum.h"
4848#include "libmesh/enum_elem_quality.h"
4949#include "libmesh/getpot.h"
50+ #include <libmesh/mesh_smoother_vsmoother.h>
5051
5152using namespace libMesh ;
5253
@@ -62,6 +63,7 @@ int main (int argc, char ** argv)
6263 LibMeshInit init (argc , argv );
6364
6465 unsigned int n_subdomains = 1 ;
66+ bool vsmooth = false;
6567 unsigned int n_rsteps = 0 ;
6668 Real simplex_refine = 0. ;
6769 double dist_fact = 0. ;
@@ -142,6 +144,10 @@ int main (int argc, char ** argv)
142144 n_subdomains = cast_int < unsigned int > (tmp );
143145 }
144146
147+ // Whether to apply variational smoother
148+ if (command_line .search (1 , "-V" ))
149+ vsmooth = true;
150+
145151 // Should we call all_tri()?
146152 if (command_line .search (1 , "-t" ))
147153 triangulate = true;
@@ -513,6 +519,12 @@ int main (int argc, char ** argv)
513519 if (n_subdomains > 1 )
514520 mesh .partition (n_subdomains );
515521
522+ // Possibly smooth the mesh
523+ if (vsmooth )
524+ {
525+ VariationalMeshSmoother vsmoother (mesh );
526+ vsmoother .smooth ();
527+ }
516528
517529 // Possibly write the mesh
518530 if (output_names .size ())
@@ -589,6 +601,7 @@ void usage(const std::string & prog_name)
589601 << " -D <factor> Randomly move interior nodes by D*hmin\n"
590602 << " -h Print help menu\n"
591603 << " -p <count> Partition into <count> subdomains\n"
604+ << " -V Apply the variational mesh smoother\n"
592605#ifdef LIBMESH_ENABLE_AMR
593606 << " -r <count> Uniformly refine <count> times\n"
594607#endif
0 commit comments