Boundary.h 4.81 KB
Newer Older
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
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \file Boundary.h */

#ifndef AMDIS_BOUNDARY_H
#define AMDIS_BOUNDARY_H

#include "Global.h"
#include "MemoryManager.h"
#include <map>

namespace AMDiS {

  template<typename T> class WorldVector;

33
  /// Contains boundary constants
34
  typedef enum {
35
36
37
38
    INTERIOR = 0,   /**< interior => no boundary (b = 0) */
    DIRICHLET = 1,  /**< dirichlet boundary (b > 0) */
    NEUMANN = -1,   /**< neumann boundary  (-100 < b < 0) */
    ROBIN = -100    /**< robin boundary (b <= -100) */
39
40
  } BoundaryConstants;

41
  /// Type specifier for the different boundary types 
42
43
  typedef signed int BoundaryType;

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
  // /** \ingroup Triangulation 
  //  * \brief
  //  * Holds information about the type of boundary associated to an edge/face,
  //  * and how new vertices are projected to the boundary in the case of curved
  //  * boundaries.
  // 
  // class Boundary
  // {
  // public:
  //   MEMORY_MANAGED(Boundary);

  //   /** \brief
  //    * constructor
  //   
  //   Boundary(BoundaryType type=0) { 
  //     bound = type; 
  //   };

  //   /** \brief
  //    * copy constructor
  //   
  //   Boundary(const Boundary& old) { bound = old.getBound(); };

  //   /** \brief
  //    * destructor
  //   
  //   virtual ~Boundary() {};

  //   /** \brief
  //    * assignment operator
  //   
  //   Boundary& operator=(const Boundary& old) { 
  //     if (this!=&old) bound = old.getBound(); 
  //     return *this; 
  //   };

  //   /** \brief
  //    * Returns
  //    * -true: if a new vertex should be projected to a curved boundary
  //    * -false: otherwise 
  //   
  //   virtual bool interpolateBoundary() { return false; };

  //   /** \brief
  //    * Projection to the curved boundary
  //    
  //   virtual void interpolateBoundary(WorldVector<double>& ) {};

  //   /** \brief
  //    * Returns \ref bound
  //   
  //   inline const BoundaryType getBound() const { return bound; };

  //   /** \brief
  //    * Returns
  //    * -true: is \ref bound is INTERIOR
  //    * -false: otherwise
  //   
  //   inline const bool isInterior() const {return  (bound == INTERIOR);};

  //   /** \brief
  //    * Returns
  //    * -true: is \ref bound is DIRICHLET
  //    * -false: otherwise
  //   
  //   inline const bool isDirichlet() const {return  (bound == DIRICHLET);};

  //   /** \brief
  //    * Returns
  //    * -true: is \ref bound is NEUMANN
  //    * -false: otherwise
  //   
  //   inline const bool isNeumann() const {return  (bound == NEUMANN);};

  //   /** \brief
  //    * Returns
  //    * -true: is \ref bound is ROBIN
  //    * -false: otherwise
  //   
  //   inline const bool isRobin() const {return  (bound == ROBIN);};

  //   /** \brief
  //    * Returns the new value of \ref bound with respect to its old value and
  //    * the value of bound_.
  //   
  //   BoundaryType newVal(const BoundaryType bound_);

  //   /** \brief
  //    * Returns the Boundary with given type from \ref boundaryMap.
  //   
  //   static Boundary* getBoundary(BoundaryType type);

  //   /** \brief
  //    * Adds Boundary b to \ref boundaryMap.
  //    
  //   //static void addBoundary(Boundary *b);

  // protected:
  //   /** \brief
  //    * type of this boundary
  //   
  //   BoundaryType bound;

  // protected:
  //   /** \brief
  //    * stl map of all existing boundaries.
  //   
  //   static ::std::map<BoundaryType, Boundary*> boundaryMap;
  // };

154
155
156
157
  BoundaryType newBound(BoundaryType oldBound, BoundaryType newBound);

}

158
#endif  // _Boundary_H_