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

NodeMaskAverage2.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 #ifndef NODEMASKAVERAGE2_H
00030 #define NODEMASKAVERAGE2_H
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 NodeMaskAverage2
00048 {
00049 public:
00050 
00052 
00054 
00056   NodeMaskAverage2();
00057 
00059 
00062   NodeMaskAverage2(const DisjointBoxLayout& a_gridsFine,
00063                    const DisjointBoxLayout& a_gridsCoarse,
00064                    int a_numcomps,
00065                    const ProblemDomain& a_domainFine,
00066                    Real a_dx);
00067 
00069 
00072   NodeMaskAverage2(const DisjointBoxLayout& a_gridsCoarse,
00073                    int a_numcomps,
00074                    const ProblemDomain& a_domainFine,
00075                    Real a_dx);
00076   
00078 
00080   ~NodeMaskAverage2();
00081 
00083 
00096   void define(const DisjointBoxLayout& a_gridsFine,
00097               const DisjointBoxLayout& a_gridsCoarse,
00098               int a_numcomps,
00099               const ProblemDomain& a_domainFine,
00100               Real a_dx);
00101 
00102 
00104 
00116   void define(const DisjointBoxLayout& a_gridsCoarse,
00117               int a_numcomps,
00118               const ProblemDomain& a_domainFine,
00119               Real a_dx);
00120 
00121 
00123 
00125 
00128   bool isDefined() const;
00129   
00130 
00132 
00134 
00154   //     this method would like to be const, but the work array is changed.
00155   //     this suggests that the work array should not be persistent.
00156   void averageToCoarse(LevelData<NodeFArrayBox>& a_coarse,
00157                        LevelData<NodeFArrayBox>& a_fine);
00158 
00159 protected:
00160 
00161   void getWeights(const DisjointBoxLayout& a_gridsFine);
00162 
00163   bool is_defined;
00164 
00165   Box m_refbox;
00166 
00167   // mesh spacing
00168   Real m_dx;
00169 
00170   // are the fine grids merely refined versions of the coarse grids?
00171   bool m_sameGrids;
00172 
00173   // coarsened fine grids
00174   DisjointBoxLayout m_coarsenedFineGrids;
00175 
00176   // work array for the coarsening of the fine data, of the same "shape"
00177   // as the fine data -- used iff !m_sameGrids
00178   LevelData<NodeFArrayBox> m_coarsenedFine;
00179 
00180   // interior boundary nodes of coarsened fine grids, distributed
00181   // among coarse grids -- used iff !m_sameGrids
00182   LayoutData< Vector<IntVectSet> > m_IVSV;
00183 
00184   // interior boundary nodes of coarsened fine grids
00185   LayoutData< Vector<IntVectSet> > m_IVSVsame;
00186 
00187   // weights for averaging from fine grids to coarsened fine grids
00188   LevelData<NodeFArrayBox> m_weights;
00189 
00190   //
00191   BoxLayoutData< BaseFab<int> > m_mask;
00192 
00193   void clearMemory();
00194 };
00195 
00196 #endif

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