deal2lkit: A ToolKit library for Deal.II
parsed_grid_generator.h
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 //
3 // Copyright (C) 2015 by the deal2lkit authors
4 //
5 // This file is part of the deal2lkit library.
6 //
7 // The deal2lkit library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal2lkit distribution.
13 //
14 //-----------------------------------------------------------
15 
16 #ifndef _d2k_parsed_grid_generator_h
17 #define _d2k_parsed_grid_generator_h
18 
19 #include <deal2lkit/config.h>
20 #include <deal2lkit/utilities.h>
21 
22 #include <deal.II/base/config.h>
24 #include <deal.II/grid/tria.h>
28 
30 
31 using namespace dealii;
32 
33 D2K_NAMESPACE_OPEN
34 
35 struct PGGHelper;
36 
144 template<int dim, int spacedim=dim>
146 {
147 public:
170  ParsedGridGenerator (const std::string section_name="",
171  const std::string grid_type="rectangle",
172  const std::string input_grid_file="",
173  const std::string opt_point_1="",
174  const std::string opt_point_2="",
175  const std::string opt_colorize="false",
176  const std::string opt_double_1="1.0",
177  const std::string opt_double_2="0.5",
178  const std::string opt_double_3="1.5",
179  const std::string opt_int_1="1",
180  const std::string opt_int_2="2",
181  const std::string opt_vec_of_int="",
182  const std::string mesh_smoothing="none",
183  const std::string output_grid_file="",
184  const std::string opt_manifold_descriptors="");
185 
186 
190  static std::string get_grid_names();
191 
195  virtual void declare_parameters(ParameterHandler &prm);
196 
204 
309  void create(Triangulation<dim, spacedim> &tria);
310 
311 #ifdef DEAL_II_WITH_MPI
312 #ifdef DEAL_II_WITH_P4EST
313 
319  parallel::distributed::Triangulation<dim, spacedim> *distributed(MPI_Comm mpi_communicator);
320 #endif
321 #endif
322 
334  void write(const Triangulation<dim, spacedim> &tria,
335  const std::string &filename="") const;
336 
337 private:
343  get_smoothing();
344 
386  void parse_manifold_descriptors(const std::string &str_manifold_descriptors);
387 
394  std::string mesh_smoothing;
395 
399  std::string grid_name;
400 
408 
416 
420  std::map<types::manifold_id, shared_ptr<Manifold<dim,spacedim> > > manifold_descriptors;
421 
426 
431 
436 
441 
446 
450  unsigned int un_int_option_one;
451 
455  unsigned int un_int_option_two;
456 
461  bool colorize;
462 
476 
483 
490 
494  std::vector<unsigned int> un_int_vec_option_one;
495 
499  std::string input_grid_file_name;
500 
505 
506  // strings for prm
507  std::string str_point_1;
508  std::string str_point_2;
509  std::string str_colorize;
510  std::string str_double_1;
511  std::string str_double_2;
512  std::string str_double_3;
513  std::string str_un_int_1;
514  std::string str_un_int_2;
515  std::string str_vec_int;
516 
520  friend struct PGGHelper;
521 };
522 
523 D2K_NAMESPACE_CLOSE
524 
525 #endif
A parameter acceptor base class.
bool colorize
For all the internally generated meshes that support it, turn on colorizing.
unsigned int un_int_option_two
Optional int argument.
std::string grid_name
The grid to generate.
std::string output_grid_file_name
Output grid file name.
bool create_default_manifolds
Create default manifold descriptors.
bool copy_material_to_manifold_ids
Copy material ids to manifold ids.
std::string default_manifold_descriptors
Default Manifold descriptors.
std::string mesh_smoothing
Mesh smoothing to apply to the newly created Triangulation.
std::string optional_manifold_descriptors
Optional Manifold descriptors.
Parsed grid generator.
Parsed Grid Generator Helper.
double double_option_three
Optional double argument.
unsigned int un_int_option_one
Optional int argument.
double double_option_two
Optional double argument.
std::string input_grid_file_name
Input grid file name.
double double_option_one
Optional double argument.
Point< spacedim > point_option_one
Optional Point argument.
Point< spacedim > point_option_two
Optional Point argument.
std::map< types::manifold_id, shared_ptr< Manifold< dim, spacedim > > > manifold_descriptors
A map of Manifold associated to the given manifold_ids.
std::vector< unsigned int > un_int_vec_option_one
Optional vector of integers.
bool copy_boundary_to_manifold_ids
Copy boundary ids to manifold ids.