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
6
namespace
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*/
20
class
chi_diffusion::Boundary
21
{
22
public
:
23
BoundaryType
type_
;
24
25
explicit
26
Boundary
(
BoundaryType
in_bndry_type) :
type_
(in_bndry_type) {}
27
};
28
29
//###################################################################
30
/**Reflecting boundary condition.*/
31
class
chi_diffusion::BoundaryReflecting
:
public
chi_diffusion::Boundary
32
{
33
public
:
34
BoundaryReflecting
() :
Boundary
(
BoundaryType
::Reflecting) {}
35
};
36
37
//###################################################################
38
/**Dirichlet boundary.*/
39
class
chi_diffusion::BoundaryDirichlet
:
public
chi_diffusion::Boundary
40
{
41
public
:
42
double
boundary_value
=0.0;
43
44
public
:
45
BoundaryDirichlet
() :
Boundary
(
BoundaryType
::Dirichlet) {}
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[
58
a \phi + b D \hat{n}\cdot \nabla \phi = f
59
\f]
60
61
When \f$ a=0\f$ the boundary condition is equivalent to a <B>Neumann</B>
62
boundary condition.
63
64
\f[
65
b D\hat{n}\cdot \nabla \phi = f
66
\f]
67
68
When \f$ a=\frac{1}{4} \f$, \f$ b=\frac{1}{2} \f$
69
and \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
*/
76
class
chi_diffusion::BoundaryRobin
:
public
chi_diffusion::Boundary
77
{
78
public
:
79
double
a
=0.25;
80
double
b
=0.5;
81
double
f
=0.0;
82
public
:
83
BoundaryRobin
(
double
a_value,
double
b_value,
double
f_value) :
84
Boundary
(
BoundaryType
::Robin)
85
{
86
a
= a_value;
87
b
= b_value;
88
f
= f_value;
89
}
90
91
};
92
93
94
#endif
//CHI_DIFFUSION_BOUNDARY_H
chi_diffusion::BoundaryDirichlet
Definition:
chi_diffusion_bndry.h:40
chi_diffusion::BoundaryDirichlet::boundary_value
double boundary_value
Definition:
chi_diffusion_bndry.h:42
chi_diffusion::BoundaryDirichlet::BoundaryDirichlet
BoundaryDirichlet(double in_bndry_value)
Definition:
chi_diffusion_bndry.h:47
chi_diffusion::BoundaryDirichlet::BoundaryDirichlet
BoundaryDirichlet()
Definition:
chi_diffusion_bndry.h:45
chi_diffusion::Boundary
Definition:
chi_diffusion_bndry.h:21
chi_diffusion::Boundary::Boundary
Boundary(BoundaryType in_bndry_type)
Definition:
chi_diffusion_bndry.h:26
chi_diffusion::Boundary::type_
BoundaryType type_
Definition:
chi_diffusion_bndry.h:23
chi_diffusion::BoundaryReflecting
Definition:
chi_diffusion_bndry.h:32
chi_diffusion::BoundaryReflecting::BoundaryReflecting
BoundaryReflecting()
Definition:
chi_diffusion_bndry.h:34
chi_diffusion::BoundaryRobin
Definition:
chi_diffusion_bndry.h:77
chi_diffusion::BoundaryRobin::b
double b
Definition:
chi_diffusion_bndry.h:80
chi_diffusion::BoundaryRobin::a
double a
Definition:
chi_diffusion_bndry.h:79
chi_diffusion::BoundaryRobin::BoundaryRobin
BoundaryRobin(double a_value, double b_value, double f_value)
Definition:
chi_diffusion_bndry.h:83
chi_diffusion::BoundaryRobin::f
double f
Definition:
chi_diffusion_bndry.h:81
chi_diffusion
Definition:
chi_diffusion_bndry.h:7
chi_diffusion::BoundaryType
BoundaryType
Definition:
chi_diffusion_bndry.h:9
modules
DiffusionSolver
Boundaries
chi_diffusion_bndry.h
Generated by
1.9.3