Fluid structure interaction suite
grid_generator.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 parsed_tools_grid_generator_h
17 #define parsed_tools_grid_generator_h
18 
19 #include <deal.II/base/logstream.h>
21 
24 
26 
28 #include <deal.II/grid/tria.h>
29 
30 namespace ParsedTools
31 {
174  template <int dim, int spacedim = dim>
175  class GridGenerator : public dealii::ParameterAcceptor
176  {
177  public:
184  GridGenerator(const std::string &prm_section_path = "",
185  const std::string &grid_generator_function = "hyper_cube",
186  const std::string &grid_generator_arguments = "0: 1: false",
187  const std::string &output_file_name = "",
188  const bool transform_to_simplex_grid = false,
189  const unsigned int initial_grid_refinement = 0);
190 
207  void
208  generate(dealii::Triangulation<dim, spacedim> &tria) const;
209 
220  void
221  write(const dealii::Triangulation<dim, spacedim> &tria,
222  const std::string &filename = "") const;
223 
224  private:
236 
243 
245  std::string output_file_name;
246 
249 
252  };
253 } // namespace ParsedTools
254 
255 #endif
void generate(Triangulation< dim, spacedim > &tria) const
Fill a triangulation according to the parsed parameters.
std::string output_file_name
Name of the output file.
void write(const Triangulation< dim, spacedim > &tria, const std::string &filename="") const
Write the given Triangulation to the output file specified in Output file name, or in the optional fi...
std::string grid_generator_arguments
Arguments to the grid generator function.
GridGenerator(const std::string &prm_section_path="", const std::string &grid_generator_function="hyper_cube", const std::string &grid_generator_arguments="0: 1: false", const std::string &output_file_name="", const bool transform_to_simplex_grid=false, const unsigned int initial_grid_refinement=0)
Constructor.
bool transform_to_simplex_grid
Transform quad and hex grids to simplex grids.
unsigned int initial_grid_refinement
Initial global refinement of the grid.
std::string grid_generator_function
Name of the grid to generate.
We collect in this namespace some wrappers around commonly used deal.II classes, derived from the Par...