Fluid structure interaction suite
mesh_handler.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2022 by Luca Heltai
4 //
5 // This file is part of the FSI-suite platform, based on the deal.II library.
6 //
7 // The FSI-suite platform is free software; you can use it, redistribute it,
8 // and/or modify it under the terms of the GNU Lesser General Public License as
9 // published by the Free Software Foundation; either version 3.0 of the License,
10 // or (at your option) any later version. The full text of the license can be
11 // found in the file LICENSE at the top level of the FSI-suite platform
12 // distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef fsi_mesh_handler_h
17 #define fsi_mesh_handler_h
18 
20 #include "parsed_tools/grid_info.h"
21 
250 template <int dim, int spacedim = dim>
251 class MeshHandler : public dealii::ParameterAcceptor
252 {
253 public:
262  : dealii::ParameterAcceptor("/")
263  , pgg("/")
264  {
265  add_parameter("Verbosity", verbosity);
266  }
267 
290  void
291  run()
292  {
293  using namespace dealii;
296  pgg.generate(tria);
297  pgg.write(tria);
298  ParsedTools::GridInfo info(tria, verbosity);
299  deallog << "=================" << std::endl;
300  deallog << "Used parameters: " << std::endl;
301  deallog << "=================" << std::endl;
303  deallog << "=================" << std::endl;
304  deallog << "Grid information: " << std::endl;
305  deallog << "=================" << std::endl;
306  info.print_info(deallog);
307  }
308 
309 private:
313  unsigned int verbosity = 2;
314 
319 };
320 #endif
unsigned int depth_console(const unsigned int n)
static ParameterHandler prm
void add_parameter(const std::string &entry, ParameterType &parameter, const std::string &documentation="", ParameterHandler &prm_=prm, const Patterns::PatternBase &pattern=*Patterns::Tools::Convert< ParameterType >::to_pattern())
void log_parameters(LogStream &out, const OutputStyle style=DefaultStyle)
Entry point of the FSI-suite programs.
Definition: mesh_handler.h:252
ParsedTools::GridGenerator< dim, spacedim > pgg
The actual ParsedTools::GridGenerator object.
Definition: mesh_handler.h:318
MeshHandler()
Construct a new Mesh Handler object.
Definition: mesh_handler.h:261
unsigned int verbosity
Verbosity to use in the LogStream class.
Definition: mesh_handler.h:313
void run()
Run the actual MeshHandler application.
Definition: mesh_handler.h:291
GridGenerator class.
LogStream deallog
Gather information about a Triangulation.
Definition: grid_info.h:149
void print_info(StreamType &out)
Print all gathered information about the Triangulation.
Definition: grid_info.h:251