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

MeshRefine.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 #ifndef _MESH_REFINE_H_
00028 #define _MESH_REFINE_H_
00029 // Include files:
00030 
00031 #include <climits>
00032 
00033 #include "Vector.H"
00034 #include "Box.H"
00035 #include "IntVectSet.H"
00036 #include "REAL.H"
00037 #include "ProblemDomain.H"
00038 
00039 // Constants:
00040 
00041 
00043 class MeshRefine
00104 {
00105 public:
00107   MeshRefine();
00108   
00110   MeshRefine(
00111                const Box& a_baseDomain,
00113                const Vector<int>& a_refRatios,
00115                const Real a_fillRatio,
00117                const int a_blockFactor,
00119                const int a_bufferSize,
00121                const int a_maxSize);
00122 
00124   MeshRefine(
00125                const ProblemDomain& a_baseDomain,
00127                const Vector<int>& a_refRatios,
00129                const Real a_fillRatio,
00131                const int a_blockFactor,
00133                const int a_bufferSize,
00135                const int a_maxSize);
00136   
00137 
00139   virtual ~MeshRefine();
00140   
00142   void define(
00143               const Box& a_baseDomain,
00145               const Vector<int>& a_refRatios,
00147               const Real a_fillRatio,
00149               const int a_blockFactor,
00151               const int a_bufferSize,
00153               const int a_maxSize);
00154 
00155 
00157   void define(
00158               const ProblemDomain& a_baseDomain,
00160               const Vector<int>& a_refRatios,
00162               const Real a_fillRatio,
00164               const int a_blockFactor,
00166               const int a_bufferSize,
00168               const int a_maxSize);
00169   
00171 
00175   virtual int regrid(
00176                      Vector<Vector<Box> >& a_newmeshes,
00178                      const IntVectSet& a_tags,
00180                      const int a_baseLevel,
00182                      const int a_topLevel,
00184                      const Vector<Vector<Box> >& a_oldMeshes) const;
00185   
00187 
00192   virtual int regrid(
00193                      Vector<Vector<Box> >& a_newmeshes,
00195                      const Vector<IntVectSet>& a_tags,
00197                      const int a_baseLevel,
00199                      const int a_topLevel,
00201                      const Vector<Vector<Box> >& a_oldMeshes) const;
00202   
00203   
00205   
00207   const Vector<int>& refRatios() const;
00208   
00210   Real fillRatio() const;
00211   
00213   int blockFactor() const;
00214   
00216   int bufferSize() const;
00217   
00219   int maxSize() const;
00220   
00222   void refRatios(const Vector<int>& a_nRefVect);
00223   
00225   void fillRatio(const Real a_fill_ratio);
00226   
00228   void blockFactor(const int a_block_factor);
00229   
00231   void bufferSize(const int a_buffer_size);
00232   
00234   void  maxSize(const int a_max_size);
00235   
00237   bool isDefined() const;
00238   
00239   
00241 
00248   virtual void 
00249   makeBoxes(
00250             Vector<Box>&      a_mesh,        
00252             const IntVectSet& a_tags,        
00254             const IntVectSet& a_pnd,         
00256             const ProblemDomain& a_domain,
00258             const int         a_maxSize) const = 0;
00259   
00260 
00261 protected:
00262 
00264 
00268   virtual void
00269   computeLocalBlockFactors();
00270   
00271   
00272   /*@ManMemo: Computes proper nesting domains.  This should only be 
00273     called by refine. it assumes that everything has already been
00274     coarsened by the local blocking factor
00275   */
00276   virtual void
00277   makePNDs(
00278            Vector<IntVectSet>& a_pnds,    
00280            const int           a_baseLevel,       
00282            const int           a_topLevel,
00284            const Vector<ProblemDomain>&  a_domains,        
00286            const IntVectSet&   a_baseMesh, 
00288            const Vector<int>&  a_bufferSize ) const;  
00289   
00290 
00291   // local data members
00292   bool m_isDefined;
00293   
00294   Vector<ProblemDomain> m_vectDomains;
00295 
00296   Vector<int> m_nRefVect;
00297 
00298   Real m_fillRatio;
00299 
00300   int m_blockFactor;
00301   
00302   Vector<int> m_level_blockfactors;
00303   
00304   int m_bufferSize;
00305   
00306   int m_maxSize;
00307   
00308 };
00309 
00310 
00311 #endif

Generated on Wed Apr 16 14:31:05 2003 for EBChombo by doxygen1.2.16