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

NodeMaskAverage.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 // petermc, Tue, Nov 28, 2000
00029 // rewritten to call NodeMaskAverage2, petermc, 2 Aug 2001
00030 
00031 #ifndef NODEMASKAVERAGE_H
00032 #define NODEMASKAVERAGE_H
00033 
00034 #include "REAL.H"
00035 #include "NodeFArrayBox.H"
00036 #include "LevelData.H"
00037 #include "ProblemDomain.H"
00038 #include "DisjointBoxLayout.H"
00039 #include "NodeMaskAverage2.H"
00040 
00042 
00043 class NodeMaskAverage
00050 {
00051 public:
00052 
00054 
00056 
00058   NodeMaskAverage();
00059 
00061 
00064   NodeMaskAverage(const DisjointBoxLayout& a_gridsFine,
00065                   const DisjointBoxLayout& a_gridsCoarse,
00066                   int                      a_numcomps,
00067                   int                      a_refRatio,
00068                   const ProblemDomain&     a_domainFine,
00069                   Real                     a_dx);
00070 
00071   NodeMaskAverage(const DisjointBoxLayout& a_gridsFine,
00072                   const DisjointBoxLayout& a_gridsCoarse,
00073                   int                      a_numcomps,
00074                   int                      a_refRatio,
00075                   const Box&               a_domainFine,
00076                   Real                     a_dx);
00077   
00079 
00082   NodeMaskAverage(const DisjointBoxLayout& a_gridsCoarse,
00083                   int                      a_numcomps,
00084                   int                      a_refRatio,
00085                   const ProblemDomain&     a_domainFine,
00086                   Real                     a_dx);
00087   
00088   NodeMaskAverage(const DisjointBoxLayout& a_gridsCoarse,
00089                   int                      a_numcomps,
00090                   int                      a_refRatio,
00091                   const Box&               a_domainFine,
00092                   Real                     a_dx);
00093   
00095 
00097   ~NodeMaskAverage();
00098 
00100 
00113   void define(const DisjointBoxLayout& a_gridsFine,
00114               const DisjointBoxLayout& a_gridsCoarse,
00115               int                      a_numcomps,
00116               int                      a_refRatio,
00117               const ProblemDomain&     a_domainFine,
00118               Real                     a_dx);
00119 
00120   void define(const DisjointBoxLayout& a_gridsFine,
00121               const DisjointBoxLayout& a_gridsCoarse,
00122               int                      a_numcomps,
00123               int                      a_refRatio,
00124               const Box&               a_domainFine,
00125               Real                     a_dx);
00126 
00128 
00141   void define(const DisjointBoxLayout& a_gridsCoarse,
00142               int                      a_numcomps,
00143               int                      a_refRatio,
00144               const ProblemDomain&     a_domainFine,
00145               Real                     a_dx);
00146 
00147   void define(const DisjointBoxLayout& a_gridsCoarse,
00148               int                      a_numcomps,
00149               int                      a_refRatio,
00150               const Box&               a_domainFine,
00151               Real                     a_dx);
00152 
00154 
00156 
00159   bool isDefined() const;
00160   
00161 
00163 
00165 
00185   //     this method would like to be const, but the work array is changed.
00186   //     this suggests that the work array should not be persistent.
00187   void averageToCoarse(LevelData<NodeFArrayBox>& a_coarse,
00188                        LevelData<NodeFArrayBox>& a_fine);
00189 
00190 protected:
00191   //delete internal memory and set pointers to null
00192   void clearMemory();
00193 
00194   bool is_defined;
00195 
00196   // the refinement ratio
00197   int m_refRatio;
00198 
00199   // the number of coarsenings to be done:  this is log2(m_refRatio).
00200   int m_coarsenings;
00201 
00202   // data at intermediate coarsening levels.  length m_coarsenings-1.
00203   Vector< LevelData<NodeFArrayBox>* > m_inter;
00204 
00205   // vector of averaging objects.  length m_coarsenings.
00206   // m_avg2[i] averages refined versions of the SAME grids if i > 1,
00207   // and in general DIFFERENT grids if i == 0.
00208   Vector<NodeMaskAverage2*> m_avg2;
00209 };
00210 
00211 #endif

Generated on Tue Apr 15 18:31:55 2003 for AMRNodeElliptic by doxygen1.2.16