00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef NODEBC_H
00035 #define NODEBC_H
00036
00037 #include "ProblemDomain.H"
00038 #include "NodeFArrayBox.H"
00039 #include "REAL.H"
00040 #include "SPACE.H"
00041 #include "Tuple.H"
00042 #include "Interval.H"
00043 #include "Vector.H"
00044 #include "LoHiSide.H"
00045
00047
00056 class FaceNodeBC
00057 {
00058 public:
00059 friend class DomainNodeBC;
00060
00062
00064
00066 FaceNodeBC():m_components(-1,-1){};
00067
00069
00071 FaceNodeBC(int a_dir, Side::LoHiSide a_sd);
00072
00074 FaceNodeBC(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00075
00077
00079 virtual ~FaceNodeBC(){;}
00080
00081 protected:
00082
00084
00086
00089 virtual FaceNodeBC* new_boxBC() const = 0;
00090
00092
00094 void
00095 define(int a_dir, Side::LoHiSide a_sd);
00096
00098 void
00099 define(int a_dir, Side::LoHiSide a_sd, const Interval& a_comps);
00100
00102
00104
00106 virtual void
00107 applyInhomogeneousBCs(FArrayBox& a_state,
00108 const ProblemDomain& a_domain,
00109 Real a_dx) const;
00110
00111 virtual void
00112 applyInhomogeneousBCs(FArrayBox& a_state,
00113 const Box& a_domain,
00114 Real a_dx) const;
00115
00117
00119 virtual void
00120 applyHomogeneousBCs(FArrayBox& a_state,
00121 const ProblemDomain& domain,
00122 Real a_dx) const;
00123 virtual void
00124 applyHomogeneousBCs(FArrayBox& a_state,
00125 const Box& domain,
00126 Real a_dx) const;
00127
00129 virtual void
00130 applyEitherBCs(FArrayBox& a_state,
00131 const ProblemDomain& domain,
00132 Real a_dx,
00133 bool a_homogeneous) const;
00134
00135 virtual void
00136 applyEitherBCs(FArrayBox& a_state,
00137 const Box& domain,
00138 Real a_dx,
00139 bool a_homogeneous) const;
00140
00142
00145 virtual void
00146 fillBCValues(FArrayBox& a_neumfac,
00147 FArrayBox& a_dircfac,
00148 FArrayBox& a_inhmval,
00149 Real a_dx,
00150 const ProblemDomain& domain) const = 0;
00151
00152 virtual void
00153 fillBCValues(FArrayBox& a_neumfac,
00154 FArrayBox& a_dircfac,
00155 FArrayBox& a_inhmval,
00156 Real a_dx,
00157 const Box& domain) const = 0;
00158
00160
00162 virtual void
00163 applyBCs(const Box& a_bcbox,
00164 FArrayBox& a_state,
00165 const FArrayBox& a_neumfac,
00166 const FArrayBox& a_dircfac,
00167 const FArrayBox& a_inhmval,
00168 Real a_dx) const;
00169
00170 Side::LoHiSide m_side;
00171 int m_direction;
00172 Interval m_components;
00173
00174 private:
00175 FaceNodeBC(const FaceNodeBC&):m_components(-1,-1) {;}
00176 virtual void operator=(const FaceNodeBC&){;}
00177 };
00178
00179
00181
00191 class DomainNodeBC
00192 {
00193 public:
00194
00196
00198 DomainNodeBC();
00199
00201 ~DomainNodeBC();
00202
00204
00206
00209 const FaceNodeBC&
00210 operator() (int direction, Side::LoHiSide side) const;
00211
00213
00215
00217 void
00218 setFaceNodeBC(const FaceNodeBC& a_bc);
00219
00221
00228 void
00229 applyHomogeneousBCs(NodeFArrayBox& a_state,
00230 const ProblemDomain& a_domain,
00231 Real a_dx) const;
00232
00233 void
00234 applyHomogeneousBCs(NodeFArrayBox& a_state,
00235 const Box& a_domain,
00236 Real a_dx) const;
00237
00239
00246 void
00247 applyInhomogeneousBCs(NodeFArrayBox& a_state,
00248 const ProblemDomain& a_domain,
00249 Real a_dx) const;
00250
00251 void
00252 applyInhomogeneousBCs(NodeFArrayBox& a_state,
00253 const Box& a_domain,
00254 Real a_dx) const;
00255
00257 DomainNodeBC& operator=(const DomainNodeBC&);
00258
00260 DomainNodeBC(const DomainNodeBC&);
00261
00262 protected:
00263
00265 bool isBCDefined(const int a_dir, const Side::LoHiSide a_side) const;
00266
00267 void resetFaceNodeBC(const int a_dir, const Side::LoHiSide a_side);
00268
00269 Tuple<FaceNodeBC*, SpaceDim> m_loBC;
00270 Tuple<FaceNodeBC*, SpaceDim> m_hiBC;
00271
00272 private:
00273 };
00274
00275 #endif