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 #ifndef _PIECEWISE_LINEAR_FILL_PATCH_H_
00029 #define _PIECEWISE_LINEAR_FILL_PATCH_H_
00030
00031 #include <iostream>
00032 #include <fstream>
00033 #include "REAL.H"
00034 #include "Box.H"
00035 #include "FArrayBox.H"
00036 #include "LevelData.H"
00037 #include "IntVectSet.H"
00038 #include "ProblemDomain.H"
00039
00041
00141 class PiecewiseLinearFillPatch
00142 {
00143 public:
00145
00148 PiecewiseLinearFillPatch();
00149
00151
00154 ~PiecewiseLinearFillPatch();
00155
00157
00168 PiecewiseLinearFillPatch(const DisjointBoxLayout& a_fine_domain,
00169 const DisjointBoxLayout& a_coarse_domain,
00170 int a_num_comps,
00171 const Box& a_crse_problem_domain,
00172 int a_ref_ratio,
00173 int a_interp_radius
00174 );
00175
00176
00178
00189 PiecewiseLinearFillPatch(const DisjointBoxLayout& a_fine_domain,
00190 const DisjointBoxLayout& a_coarse_domain,
00191 int a_num_comps,
00192 const ProblemDomain& a_crse_problem_domain,
00193 int a_ref_ratio,
00194 int a_interp_radius
00195 );
00196
00198
00214 void
00215 define(const DisjointBoxLayout& a_fine_domain,
00216 const DisjointBoxLayout& a_coarse_domain,
00217 int a_num_comps,
00218 const Box& a_crse_problem_domain,
00219 int a_ref_ratio,
00220 int a_interp_radius
00221 );
00222
00223
00225
00241 void
00242 define(const DisjointBoxLayout& a_fine_domain,
00243 const DisjointBoxLayout& a_coarse_domain,
00244 int a_num_comps,
00245 const ProblemDomain& a_crse_problem_domain,
00246 int a_ref_ratio,
00247 int a_interp_radius
00248 );
00249
00251
00258 bool
00259 isDefined() const;
00260
00262
00287 void
00288 fillInterp(LevelData<FArrayBox>& a_fine_data,
00289 const LevelData<FArrayBox>& a_old_coarse_data,
00290 const LevelData<FArrayBox>& a_new_coarse_data,
00291 Real a_time_interp_coef,
00292 int a_src_comp,
00293 int a_dest_comp,
00294 int a_num_comp
00295 );
00296
00297
00298 void
00299 printIntVectSets() const;
00300
00301
00302 protected:
00303
00304
00305 void
00306 timeInterp(const LevelData<FArrayBox>& a_old_coarse_data,
00307 const LevelData<FArrayBox>& a_new_coarse_data,
00308 Real a_time_interp_coef,
00309 int a_src_comp,
00310 int a_dest_comp,
00311 int a_num_comp
00312 );
00313
00314
00315
00316 void
00317 fillConstantInterp(LevelData<FArrayBox>& a_fine_data,
00318 int a_src_comp,
00319 int a_dest_comp,
00320 int a_num_comp
00321 )
00322 const;
00323
00324
00325
00326 void
00327 computeSlopes(int a_src_comp,
00328 int a_num_comp);
00329
00330
00331
00332
00333 void
00334 incrementLinearInterp(LevelData<FArrayBox>& a_fine_data,
00335 int a_src_comp,
00336 int a_dest_comp,
00337 int a_num_comp)
00338 const;
00339
00340
00341 protected:
00342 bool m_is_defined;
00343
00344
00345 static const int s_stencil_radius;
00346
00347 int m_ref_ratio;
00348
00349 int m_interp_radius;
00350
00351 LevelData<FArrayBox> m_coarsened_fine_data;
00352
00353 LevelData<FArrayBox> m_slopes[3];
00354
00355 ProblemDomain m_crse_problem_domain;
00356
00357 LayoutData<IntVectSet> m_fine_interp;
00358
00359
00360 LayoutData<IntVectSet> m_coarse_centered_interp[SpaceDim];
00361 LayoutData<IntVectSet> m_coarse_lo_interp[SpaceDim];
00362 LayoutData<IntVectSet> m_coarse_hi_interp[SpaceDim];
00363 };
00364
00365 #endif