Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

PiecewiseLinearFillPatchFace.H

Go to the documentation of this file.
00001 /*  _______              __
00002   / ___/ /  ___  __ _  / /  ___
00003  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004  \___/_//_/\___/_/_/_/_.__/\___/ 
00005 */
00006 /*
00007 
00008 ** This software is copyright (C) by the Lawrence Berkeley National
00009 ** Laboratory.  Permission is granted to reproduce this software for
00010 ** non-commercial purposes provided that this notice is left intact.
00011 **  
00012 ** It is acknowledged that the U.S. Government has rights to this
00013 ** software under Contract DE-AC03-765F00098 between the U.S.  Department
00014 ** of Energy and the University of California.
00015 **  
00016 ** This software is provided as a professional and academic contribution
00017 ** for joint exchange. Thus it is experimental, is provided ``as is'',
00018 ** with no warranties of any kind whatsoever, no support, no promise of
00019 ** updates, or printed documentation. By using this software, you
00020 ** acknowledge that the Lawrence Berkeley National Laboratory and Regents
00021 ** of the University of California shall have no liability with respect
00022 ** to the infringement of other copyrights by any part of this software.
00023 */
00024 #ifndef _PIECEWISE_LINEAR_FILL_PATCH_FACE_H_
00025 #define _PIECEWISE_LINEAR_FILL_PATCH_FACE_H_
00026 
00027 #include <iostream>
00028 #include <fstream>
00029 #include "REAL.H"
00030 #include "Box.H"
00031 #include "FArrayBox.H"
00032 #include "FluxBox.H"
00033 #include "LevelData.H"
00034 #include "IntVectSet.H"
00035 #include "ProblemDomain.H"
00036 
00038 
00053 class PiecewiseLinearFillPatchFace
00054 {
00055 public:
00057 
00060   PiecewiseLinearFillPatchFace();
00061 
00063 
00066   ~PiecewiseLinearFillPatchFace();
00067   
00069 
00080   PiecewiseLinearFillPatchFace(const DisjointBoxLayout& a_fine_domain,
00081                                const DisjointBoxLayout& a_coarse_domain, 
00082                                int a_num_comps,
00083                                const Box& a_crse_problem_domain,
00084                                int a_ref_ratio,
00085                                int a_interp_radius
00086                                );
00087 
00088 
00090 
00101   PiecewiseLinearFillPatchFace(const DisjointBoxLayout& a_fine_domain,
00102                                const DisjointBoxLayout& a_coarse_domain, 
00103                                int a_num_comps,
00104                                const ProblemDomain& a_crse_problem_domain,
00105                                int a_ref_ratio,
00106                                int a_interp_radius
00107                                );
00108   
00110 
00126   void
00127   define(const DisjointBoxLayout& a_fine_domain,
00128          const DisjointBoxLayout& a_coarse_domain, 
00129          int a_num_comps,
00130          const Box& a_crse_problem_domain,
00131          int a_ref_ratio,
00132          int a_interp_radius
00133          );
00134 
00135 
00137 
00153   void
00154   define(const DisjointBoxLayout& a_fine_domain,
00155          const DisjointBoxLayout& a_coarse_domain, 
00156          int a_num_comps,
00157          const ProblemDomain& a_crse_problem_domain,
00158          int a_ref_ratio,
00159          int a_interp_radius
00160          );
00161   
00163 
00170   bool 
00171   isDefined() const;
00172   
00174 
00203   void
00204   fillInterp(LevelData<FluxBox>& a_fine_data,
00205              const LevelData<FluxBox>& a_old_coarse_data,
00206              const LevelData<FluxBox>& a_new_coarse_data,
00207              Real a_time_interp_coef,
00208              int a_src_comp,
00209              int a_dest_comp,
00210              int a_num_comp
00211              );
00212   
00213   // debugging utilities
00214   void
00215   printIntVectSets() const;
00216 
00217 
00218 protected:
00219   // copy coarse data to coarsened fine work array and interpolate to
00220   // fine time level
00221   void
00222   timeInterp(const LevelData<FluxBox>& a_old_coarse_data,
00223              const LevelData<FluxBox>& a_new_coarse_data,
00224              Real a_time_interp_coef,
00225              int a_src_comp,
00226              int a_dest_comp,
00227              int a_num_comp
00228              );
00229   
00230   
00231   // fill the fine interpolation sites piecewise-constantly
00232   void
00233   fillConstantInterp(LevelData<FluxBox>& a_fine_data,
00234                      int a_src_comp,
00235                      int a_dest_comp,
00236                      int a_num_comp
00237                      ) 
00238     const;
00239   
00240   
00241   // compute slopes in specified direction
00242   void
00243   computeSlopes(int a_dir,
00244                 int a_src_comp,
00245                 int a_num_comp);
00246   
00247 
00248   // increment the fine interpolation sites with linear term for the
00249   // specified coordinate direction
00250   void
00251   incrementLinearInterpTangential(LevelData<FluxBox>& a_fine_data,
00252                                   int a_dir,
00253                                   int a_src_comp,
00254                                   int a_dest_comp,
00255                                   int a_num_comp)
00256     const;
00257 
00258 
00259   // now do the fine interpolation normal to the face directions
00260   void 
00261   incrementLinearInterpNormal(LevelData<FluxBox>& a_fine_data,
00262                               int a_src_comp,
00263                               int a_dest_comp,
00264                               int a_num_comp)
00265     const;
00266   
00267 
00268 
00269 
00270 protected:
00271   bool m_is_defined;
00272   // the radius of the interpolation stencil.  e.g. a stencil using
00273   // (i-1,j), (i,j) and (i+1,j) has a radius of 1.
00274   static const int s_stencil_radius;
00275   // refinement ratio
00276   int m_ref_ratio;
00277   // number of layers of fine ghost cells to fill by interpolation.
00278   int m_interp_radius;
00279   // work array for coarse data in grids shaped like the fine level.
00280   LevelData<FluxBox> m_coarsened_fine_data;
00281   // work array for slopes
00282   LevelData<FluxBox> m_slopes;
00283   // problem domain on the coarse level.
00284   ProblemDomain m_crse_problem_domain;
00285   // per-grid fine locations that you interpolate to.
00286   LayoutData<IntVectSet> m_fine_interp[SpaceDim];
00287   // per-grid coarse locations that you interpolate from, by type of
00288   // interpolation in the specified coordinate direction.
00289   // note that there are two subscripts here -- first one 
00290   // refers to direction of slopes, second to direction of face
00291   LayoutData<IntVectSet> m_coarse_centered_interp[SpaceDim][SpaceDim];
00292   LayoutData<IntVectSet> m_coarse_lo_interp[SpaceDim][SpaceDim];
00293   LayoutData<IntVectSet> m_coarse_hi_interp[SpaceDim][SpaceDim];
00294 };
00295 
00296 #endif
00297 
00298 
00299 

Generated on Wed Oct 5 13:52:09 2005 for Chombo&AMRSelfGravity by  doxygen 1.4.1