00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _PIECEWISELINEARFILLPATCH_H_
00012 #define _PIECEWISELINEARFILLPATCH_H_
00013
00014 #include <iostream>
00015 #include <fstream>
00016 #include "REAL.H"
00017 #include "Box.H"
00018 #include "FArrayBox.H"
00019 #include "LevelData.H"
00020 #include "IntVectSet.H"
00021 #include "ProblemDomain.H"
00022 #include "NamespaceHeader.H"
00023
00025
00123 class PiecewiseLinearFillPatch
00124 {
00125 public:
00127
00130 PiecewiseLinearFillPatch();
00131
00133
00136 virtual ~PiecewiseLinearFillPatch();
00137
00139
00150 PiecewiseLinearFillPatch(const DisjointBoxLayout& a_fine_domain,
00151 const DisjointBoxLayout& a_coarse_domain,
00152 int a_num_comps,
00153 const Box& a_crse_problem_domain,
00154 int a_ref_ratio,
00155 int a_interp_radius
00156 );
00157
00159
00170 PiecewiseLinearFillPatch(const DisjointBoxLayout& a_fine_domain,
00171 const DisjointBoxLayout& a_coarse_domain,
00172 int a_num_comps,
00173 const ProblemDomain& a_crse_problem_domain,
00174 int a_ref_ratio,
00175 int a_interp_radius
00176 );
00177
00179
00195 void
00196 define(const DisjointBoxLayout& a_fine_domain,
00197 const DisjointBoxLayout& a_coarse_domain,
00198 int a_num_comps,
00199 const Box& a_crse_problem_domain,
00200 int a_ref_ratio,
00201 int a_interp_radius
00202 );
00203
00205
00221 void
00222 define(const DisjointBoxLayout& a_fine_domain,
00223 const DisjointBoxLayout& a_coarse_domain,
00224 int a_num_comps,
00225 const ProblemDomain& a_crse_problem_domain,
00226 int a_ref_ratio,
00227 int a_interp_radius
00228 );
00229
00231
00238 bool
00239 isDefined() const;
00240
00242
00267 void
00268 fillInterp(LevelData<FArrayBox>& a_fine_data,
00269 const LevelData<FArrayBox>& a_old_coarse_data,
00270 const LevelData<FArrayBox>& a_new_coarse_data,
00271 Real a_time_interp_coef,
00272 int a_src_comp,
00273 int a_dest_comp,
00274 int a_num_comp
00275 );
00276
00277
00278 void
00279 printIntVectSets() const;
00280
00281
00282 protected:
00283
00284
00285 void
00286 timeInterp(const LevelData<FArrayBox>& a_old_coarse_data,
00287 const LevelData<FArrayBox>& a_new_coarse_data,
00288 Real a_time_interp_coef,
00289 int a_src_comp,
00290 int a_dest_comp,
00291 int a_num_comp
00292 );
00293
00294
00295 virtual void
00296 fillConstantInterp(LevelData<FArrayBox>& a_fine_data,
00297 int a_src_comp,
00298 int a_dest_comp,
00299 int a_num_comp
00300 )
00301 const;
00302
00303
00304 virtual void computeSlopes(int a_src_comp,
00305 int a_num_comp);
00306
00307 void computeSimpleSlopesFab(FArrayBox & a_slopeFab,
00308 const int & a_src_comp,
00309 const int & a_num_comp,
00310 const int & a_dir,
00311 const FArrayBox & a_dataFab,
00312 const IntVectSet& a_local_centered_interp,
00313 const IntVectSet& a_local_lo_interp,
00314 const IntVectSet& a_local_hi_interp);
00315
00316 void computeMultiDimSlopes(FArrayBox & a_slopes0,
00317 FArrayBox & a_slopes1,
00318 FArrayBox & a_slopes2,
00319 const FArrayBox& a_dataFab,
00320 const int & a_src_comp,
00321 const int & a_num_comp,
00322 const Box & a_slopeBox);
00323
00324
00325
00326 virtual void
00327 incrementLinearInterp(LevelData<FArrayBox>& a_fine_data,
00328 int a_src_comp,
00329 int a_dest_comp,
00330 int a_num_comp)
00331 const;
00332
00333
00334 protected:
00335 bool m_is_defined;
00336
00337
00338 static const int s_stencil_radius;
00339
00340 int m_ref_ratio;
00341
00342 int m_interp_radius;
00343
00344 LevelData<FArrayBox> m_coarsened_fine_data;
00345
00346 LevelData<FArrayBox> m_slopes[3];
00347
00348 ProblemDomain m_crse_problem_domain;
00349
00350 LayoutData<IntVectSet> m_fine_interp;
00351
00352
00353 LayoutData<IntVectSet> m_coarse_centered_interp[SpaceDim];
00354 LayoutData<IntVectSet> m_coarse_lo_interp[SpaceDim];
00355 LayoutData<IntVectSet> m_coarse_hi_interp[SpaceDim];
00356
00357 Copier m_coarsenCopier;
00358 };
00359
00360 #include "NamespaceFooter.H"
00361 #endif