ExaDG
Loading...
Searching...
No Matches
verify_boundary_conditions.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2021 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_FUNCTIONALITIES_VERIFY_BOUNDARY_CONDITIONS_H_
23#define INCLUDE_FUNCTIONALITIES_VERIFY_BOUNDARY_CONDITIONS_H_
24
25// ExaDG
26#include <exadg/grid/grid.h>
27
28namespace ExaDG
29{
30template<int dim, typename BoundaryDescriptor>
31void
32verify_boundary_conditions(BoundaryDescriptor const & boundary_descriptor, Grid<dim> const & grid)
33{
34 // fill set with periodic boundary ids
35 std::set<dealii::types::boundary_id> periodic_boundary_ids;
36 for(auto periodic_pair : grid.periodic_face_pairs)
37 {
38 AssertThrow(periodic_pair.cell[0]->level() == 0,
39 dealii::ExcMessage("Received periodic face pair on non-zero level"));
40
41 periodic_boundary_ids.insert(
42 periodic_pair.cell[0]->face(periodic_pair.face_idx[0])->boundary_id());
43 periodic_boundary_ids.insert(
44 periodic_pair.cell[1]->face(periodic_pair.face_idx[1])->boundary_id());
45 }
46
47 // Make sure that each boundary face has exactly one boundary type
48 for(auto cell : *grid.triangulation)
49 {
50 for(unsigned int const f : cell.face_indices())
51 {
52 if(cell.at_boundary(f))
53 {
54 dealii::types::boundary_id const boundary_id = cell.face(f)->boundary_id();
55 boundary_descriptor.verify_boundary_conditions(boundary_id, periodic_boundary_ids);
56 }
57 }
58 }
59}
60
61} // namespace ExaDG
62
63
64#endif /* INCLUDE_FUNCTIONALITIES_VERIFY_BOUNDARY_CONDITIONS_H_ */
Definition driver.cpp:33