Chi-Tech
chi_diffusion_bndry.h
Go to the documentation of this file.
1#ifndef CHI_DIFFUSION_BOUNDARY_H
2#define CHI_DIFFUSION_BOUNDARY_H
3
4#include "../chi_diffusion.h"
5
6namespace chi_diffusion
7{
8 enum class BoundaryType : int
9 {
10 Reflecting = 1,
11 Dirichlet = 2,
12 Neumann = 3,
13 Robin = 4,
14 Vacuum = 5
15 };
16}
17
18//###################################################################
19/**Parent class for diffusion boundaries*/
21{
22public:
24
25 explicit
26 Boundary(BoundaryType in_bndry_type) : type_(in_bndry_type) {}
27};
28
29//###################################################################
30/**Reflecting boundary condition.*/
32{
33public:
35};
36
37//###################################################################
38/**Dirichlet boundary.*/
40{
41public:
42 double boundary_value=0.0;
43
44public:
46 explicit
47 BoundaryDirichlet(double in_bndry_value) :
48 Boundary(BoundaryType::Dirichlet),
49 boundary_value(in_bndry_value)
50 {}
51};
52
53//###################################################################
54/**Robin boundary condition. This type of boundary condition doubles
55 * for any boundary condition of the form
56 *
57\f[
58a \phi + b D \hat{n}\cdot \nabla \phi = f
59\f]
60
61When \f$ a=0\f$ the boundary condition is equivalent to a <B>Neumann</B>
62boundary condition.
63
64\f[
65b D\hat{n}\cdot \nabla \phi = f
66\f]
67
68 When \f$ a=\frac{1}{4} \f$, \f$ b=\frac{1}{2} \f$
69and \f$ f=0 \f$ then the boundary condition is equivalent to a
70<B>Vacuum</B> boundary condition.
71
72\f[
73\frac{1}{4}\phi + \frac{1}{2}D\hat{n}\cdot \nabla \phi = 0
74\f]
75 */
77{
78public:
79 double a=0.25;
80 double b=0.5;
81 double f=0.0;
82public:
83 BoundaryRobin(double a_value, double b_value, double f_value) :
85 {
86 a = a_value;
87 b = b_value;
88 f = f_value;
89 }
90
91};
92
93
94#endif //CHI_DIFFUSION_BOUNDARY_H
BoundaryDirichlet(double in_bndry_value)
Boundary(BoundaryType in_bndry_type)
BoundaryRobin(double a_value, double b_value, double f_value)