ExaDG
Toggle main menu visibility
Loading...
Searching...
No Matches
include
exadg
convection_diffusion
user_interface
boundary_descriptor.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 EXADG_CONVECTION_DIFFUSION_USER_INTERFACE_BOUNDARY_DESCRIPTOR_H_
23
#define EXADG_CONVECTION_DIFFUSION_USER_INTERFACE_BOUNDARY_DESCRIPTOR_H_
24
25
// C/C++
26
#include <memory>
27
#include <set>
28
29
// deal.II
30
#include <deal.II/base/function.h>
31
#include <deal.II/base/types.h>
32
33
namespace
ExaDG
34
{
35
namespace
ConvDiff
36
{
37
enum class
BoundaryType
38
{
39
Undefined,
40
Dirichlet,
41
Neumann
42
};
43
44
template
<
int
dim>
45
struct
BoundaryDescriptor
46
{
47
std::map<dealii::types::boundary_id, std::shared_ptr<dealii::Function<dim>>> dirichlet_bc;
48
49
std::map<dealii::types::boundary_id, std::shared_ptr<dealii::Function<dim>>> neumann_bc;
50
51
// returns the boundary type
52
inline
DEAL_II_ALWAYS_INLINE
//
53
BoundaryType
54
get_boundary_type(dealii::types::boundary_id
const
& boundary_id)
const
55
{
56
if
(this->dirichlet_bc.find(boundary_id) != this->dirichlet_bc.end())
57
return
BoundaryType::Dirichlet;
58
else
if
(this->neumann_bc.find(boundary_id) != this->neumann_bc.end())
59
return
BoundaryType::Neumann;
60
61
AssertThrow(
false
, dealii::ExcMessage(
"Boundary type of face is invalid or not implemented."
));
62
63
return
BoundaryType::Undefined;
64
}
65
66
inline
DEAL_II_ALWAYS_INLINE
//
67
void
68
verify_boundary_conditions(
69
dealii::types::boundary_id
const
boundary_id,
70
std::set<dealii::types::boundary_id>
const
& periodic_boundary_ids)
const
71
{
72
unsigned
int
counter = 0;
73
if
(dirichlet_bc.find(boundary_id) != dirichlet_bc.end())
74
counter++;
75
76
if
(neumann_bc.find(boundary_id) != neumann_bc.end())
77
counter++;
78
79
if
(periodic_boundary_ids.find(boundary_id) != periodic_boundary_ids.end())
80
counter++;
81
82
AssertThrow(counter == 1,
83
dealii::ExcMessage(
"Boundary face with non-unique boundary type found."
));
84
}
85
};
86
87
}
// namespace ConvDiff
88
}
// namespace ExaDG
89
90
#endif
/* EXADG_CONVECTION_DIFFUSION_USER_INTERFACE_BOUNDARY_DESCRIPTOR_H_ */
ExaDG
Definition
driver.cpp:33
ExaDG::ConvDiff::BoundaryDescriptor
Definition
boundary_descriptor.h:46
Generated by
1.17.0