ExaDG
Loading...
Searching...
No Matches
hyper_rectangle.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2023 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_EXADG_GRID_HYPER_RECTANGLE_H_
23#define INCLUDE_EXADG_GRID_HYPER_RECTANGLE_H_
24
25// deal.II
26#include <deal.II/distributed/tria.h>
27#include <deal.II/grid/grid_generator.h>
28
29// ExaDG
30#include <exadg/grid/grid_data.h>
31
32namespace ExaDG
33{
38template<int dim>
39void
40create_subdivided_hyper_rectangle(dealii::Triangulation<dim> & tria,
41 std::vector<unsigned int> const & repetitions,
42 dealii::Point<dim> const & p1,
43 dealii::Point<dim> const & p2,
44 ElementType const & element_type,
45 bool const colorize = false)
46{
47 if(element_type == ElementType::Hypercube)
48 {
49 dealii::GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2, colorize);
50 }
51 else if(element_type == ElementType::Simplex)
52 {
53 dealii::GridGenerator::subdivided_hyper_rectangle_with_simplices(
54 tria, repetitions, p1, p2, colorize);
55 }
56 else
57 {
58 AssertThrow(false,
59 dealii::ExcMessage("The function create_subdivided_hyper_rectangle() currently "
60 "supports ElementType::Hypercube and ElementType::Simplex."));
61 }
62}
63} // namespace ExaDG
64
65
66#endif /* INCLUDE_EXADG_GRID_HYPER_RECTANGLE_H_ */
Definition driver.cpp:33
void create_subdivided_hyper_rectangle(dealii::Triangulation< dim > &tria, std::vector< unsigned int > const &repetitions, dealii::Point< dim > const &p1, dealii::Point< dim > const &p2, ElementType const &element_type, bool const colorize=false)
Definition hyper_rectangle.h:40