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   
00204   // Access functions
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   
00240   void granularity(int a_granularity);
00241 
00242 
00244 
00251   virtual void 
00252   makeBoxes(
00253             Vector<Box>&      a_mesh,        
00255             const IntVectSet& a_tags,        
00257             const IntVectSet& a_pnd,         
00259             const ProblemDomain& a_domain,
00261             const int         a_maxSize) const = 0;
00262   
00263 
00264 protected:
00265 
00267 
00271   virtual void
00272   computeLocalBlockFactors();
00273   
00274   
00276 
00281   virtual void
00282   makePNDs(
00283            Vector<IntVectSet>& a_pnds,    
00285            const int           a_baseLevel,       
00287            const int           a_topLevel,
00289            const Vector<ProblemDomain>&  a_domains,        
00291            const IntVectSet&   a_baseMesh, 
00293            const Vector<int>&  a_bufferSize ) const;  
00294   
00295 
00296   // local data members
00297 
00298   bool m_isDefined;
00299   
00300   Vector<ProblemDomain> m_vectDomains;
00301 
00302   Vector<int> m_nRefVect;
00303 
00304   Real m_fillRatio;
00305 
00306   int m_blockFactor;
00307   
00308   Vector<int> m_level_blockfactors;
00309   
00310   int m_bufferSize;
00311   
00312   int m_maxSize;
00313 
00314   int m_granularity;
00315   
00316 };
00317 
00318 
00319 #endif

Generated on Wed Jun 2 13:53:34 2004 for Chombo&INSwithParticles by doxygen 1.3.2