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

NodeCoarseAverage.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 // petermc, Tue, Nov 28, 2000
00028 #ifndef NODECOARSEAVERAGE_H
00029 #define NODECOARSEAVERAGE_H
00030 
00031 
00032 #include "REAL.H"
00033 #include "BaseFab.H"
00034 #include "NodeFArrayBox.H"
00035 #include "LevelData.H"
00036 #include "DisjointBoxLayout.H"
00037 
00039 
00040 class NodeCoarseAverage
00047 {
00048 public:
00049 
00051 
00053 
00055   NodeCoarseAverage();
00056 
00058 
00061   NodeCoarseAverage(const DisjointBoxLayout& a_gridsFine,
00062                     const DisjointBoxLayout& a_gridsCoarse,
00063                     int                      a_numcomps,
00064                     int                      a_refRatio,
00065                     const ProblemDomain&     a_domainFine);
00066 
00067   NodeCoarseAverage(const DisjointBoxLayout& a_gridsFine,
00068                     const DisjointBoxLayout& a_gridsCoarse,
00069                     int                      a_numcomps,
00070                     int                      a_refRatio,
00071                     const Box&               a_domainFine);
00072 
00074 
00077   NodeCoarseAverage(const DisjointBoxLayout& a_gridsCoarse,
00078                     int                      a_numcomps,
00079                     int                      a_refRatio,
00080                     const ProblemDomain&     a_domainFine);
00081   
00082   NodeCoarseAverage(const DisjointBoxLayout& a_gridsCoarse,
00083                     int                      a_numcomps,
00084                     int                      a_refRatio,
00085                     const Box&               a_domainFine);
00086 
00088 
00090   ~NodeCoarseAverage();
00091 
00093 
00105   void define(const DisjointBoxLayout& a_gridsFine,
00106               const DisjointBoxLayout& a_gridsCoarse,
00107               int                      a_numcomps,
00108               int                      a_refRatio,
00109               const ProblemDomain&     a_domainFine);
00110 
00111   void define(const DisjointBoxLayout& a_gridsFine,
00112               const DisjointBoxLayout& a_gridsCoarse,
00113               int                      a_numcomps,
00114               int                      a_refRatio,
00115               const Box&               a_domainFine);
00116 
00118 
00130   void define(const DisjointBoxLayout& a_gridsCoarse,
00131               int                      a_numcomps,
00132               int                      a_refRatio,
00133               const ProblemDomain&     a_domainFine);
00134 
00135   void define(const DisjointBoxLayout& a_gridsCoarse,
00136               int                      a_numcomps,
00137               int                      a_refRatio,
00138               const Box&               a_domainFine);
00139 
00141 
00143 
00146   bool isDefined() const;
00147   
00148 
00150 
00152 
00172   //     this method would like to be const, but the work array is changed.
00173   //     this suggests that the work array should not be persistent.
00174   void averageToCoarse(LevelData<NodeFArrayBox>& a_coarse,
00175                        LevelData<NodeFArrayBox>& a_fine);
00176 
00177 protected:
00178 
00179   bool is_defined;
00180 
00181   // the refinement ratio
00182   int m_refRatio;
00183 
00184   // the number of components
00185   int m_numcomps;
00186 
00187   ProblemDomain m_domainCoarse;
00188 
00189   FArrayBox m_weights;
00190 
00191   // are the fine grids merely refined versions of the coarse grids?
00192   bool m_sameGrids;
00193 
00194   DisjointBoxLayout m_coarsenedGrids;
00195 
00196   // work array for the coarsening of the fine data, of the same "shape"
00197   // as the fine data.
00198   LevelData<NodeFArrayBox> m_coarsenedFine;
00199 
00200   // interior boundary nodes of coarsened fine grids, 
00201   // distributed among coarse grids.
00202   LayoutData< Vector<IntVectSet> > m_IVSV;
00203 
00204   // interior boundary nodes of coarsened fine grids,
00205   // distributed among the same grids.
00206   LayoutData< Vector<IntVectSet> > m_IVSVsame;
00207 
00208 };
00209 
00210 #endif

Generated on Tue Apr 15 18:34:51 2003 for AMRNodeElliptic by doxygen1.2.16