Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PiecewiseLinearFillPatch.H

Go to the documentation of this file.
00001 /* _______              __
00002   / ___/ /  ___  __ _  / /  ___
00003  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004  \___/_//_/\___/_/_/_/_.__/\___/ 
00005 */
00006 //
00007 // This software is copyright (C) by the Lawrence Berkeley
00008 // National Laboratory.  Permission is granted to reproduce
00009 // this software for non-commercial purposes provided that
00010 // this notice is left intact.
00011 // 
00012 // It is acknowledged that the U.S. Government has rights to
00013 // this software under Contract DE-AC03-765F00098 between
00014 // the U.S.  Department of Energy and the University of
00015 // California.
00016 //
00017 // This software is provided as a professional and academic
00018 // contribution for joint exchange. Thus it is experimental,
00019 // is provided ``as is'', with no warranties of any kind
00020 // whatsoever, no support, no promise of updates, or printed
00021 // documentation. By using this software, you acknowledge
00022 // that the Lawrence Berkeley National Laboratory and
00023 // Regents of the University of California shall have no
00024 // liability with respect to the infringement of other
00025 // copyrights by any part of this software.
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   // debugging utilities
00298   void
00299   printIntVectSets() const;
00300 
00301 
00302 protected:
00303   // copy coarse data to coarsened fine work array and interpolate to
00304   // fine time level
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   // fill the fine interpolation sites piecewise-constantly
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   // compute slopes in specified direction
00326   void
00327   computeSlopes(int a_src_comp,
00328                 int a_num_comp);
00329 
00330 
00331   // increment the fine interpolation sites with linear term for the
00332   // specified coordinate direction
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   // the radius of the interpolation stencil.  e.g. a stencil using
00344   // (i-1,j), (i,j) and (i+1,j) has a radius of 1.
00345   static const int s_stencil_radius;
00346   // refinement ratio
00347   int m_ref_ratio;
00348   // number of layers of fine ghost cells to fill by interpolation.
00349   int m_interp_radius;
00350   // work array for coarse data in grids shaped like the fine level.
00351   LevelData<FArrayBox> m_coarsened_fine_data;
00352   // work array for slopes
00353   LevelData<FArrayBox> m_slopes[3];
00354   // problem domain on the coarse level.
00355   ProblemDomain m_crse_problem_domain;
00356   // per-grid fine locations that you interpolate to.
00357   LayoutData<IntVectSet> m_fine_interp;
00358   // per-grid coarse locations that you interpolate from, by type of
00359   // interpolation in the specified coordinate direction.
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

Generated on Thu Aug 29 11:05:45 2002 for Chombo&INS by doxygen1.2.16