-
Notifications
You must be signed in to change notification settings - Fork 1
/
boundary_conditions.hpp
56 lines (43 loc) · 1.72 KB
/
boundary_conditions.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
boundary_conditions.hpp (Multigrid)
Jess Robertson, 2010-09-16
Interface for boundary conditions classes
*/
#ifndef BOUNDARY_CONDITIONS_HPP_3I5KIZNP
#define BOUNDARY_CONDITIONS_HPP_3I5KIZNP
#include "types.hpp"
#include "multigrid_exceptions.hpp"
#include "utilities.hpp"
namespace mgrid {
// = BoundaryConditions class interface =
class BoundaryConditions {
public:
// Ctors
BoundaryConditions();
virtual ~BoundaryConditions();
BoundaryConditions(const BoundaryConditions& copyFrom);
const BoundaryConditions& operator=(const BoundaryConditions& copyFrom);
// Settors
inline Boundary& get(BoundaryFlag boundaryFlag) {
return boundaries(boundaryFlag);
}
void set(BoundaryFlag boundaryFlag, const Boundary& referent);
void set(BoundaryFlag boundaryFlag, const BoundaryPoint& pt);
inline void resize(const int nx, const int nz) {
boundaries(topBoundary).resize(nx);
boundaries(bottomBoundary).resize(nx);
boundaries(leftBoundary).resize(nz);
boundaries(rightBoundary).resize(nz);
}
// Apply default boundary conditions
void apply_default_conditions(const int nx, const int nz);
// Reference another set of BoundaryConditions
void reference(const BoundaryConditions& referent);
private:
blitz::TinyVector<Boundary, 4> boundaries;
};
// = Some point definitions whch get used a lot
const BoundaryPoint zeroNeumannCondition = { neumann, 0.0 };
const BoundaryPoint zeroDirichletCondition = { dirichlet, 0.0 };
} // end namespace Multigrid
#endif /* end of include guard: BOUNDARY_CONDITIONS_HPP_3I5KIZNP */