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

BRMeshRefine.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 _BR_MESH_REFINE_H_
00028 #define _BR_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 "MeshRefine.H"
00038 #include <list>
00039 
00040 // Constants:
00041 
00042 // Minimum acceptable ratio of tagged cells to total cells for 
00043 // the Berger-Rigoutsos algorithm in \func{makeBoxes}.
00044 // Used as default for \var{FillRatio} optional argument.
00045 #ifndef _BR_MIN_BOX_FILL_RATIO_
00046 #define _BR_MIN_BOX_FILL_RATIO_ ( 0.75 )
00047 #endif
00048 
00049 
00051 class BRMeshRefine : public MeshRefine
00111 {
00112 public:
00114   BRMeshRefine();
00115   
00117   BRMeshRefine(
00118                const Box& a_baseDomain,
00120                const Vector<int>& a_refRatios,
00122                const Real a_fillRatio,
00124                const int a_blockFactor,
00126                const int a_bufferSize,
00128                const int a_maxSize);
00129 
00131   BRMeshRefine(
00132                const ProblemDomain& a_baseDomain,
00134                const Vector<int>& a_refRatios,
00136                const Real a_fillRatio,
00138                const int a_blockFactor,
00140                const int a_bufferSize,
00142                const int a_maxSize);
00143   
00144 
00146   virtual ~BRMeshRefine();
00147   
00149   void define(
00150               const Box& a_baseDomain,
00152               const Vector<int>& a_refRatios,
00154               const Real a_fillRatio,
00156               const int a_blockFactor,
00158               const int a_bufferSize,
00160               const int a_maxSize);
00161 
00162 
00164   void define(
00165               const ProblemDomain& a_baseDomain,
00167               const Vector<int>& a_refRatios,
00169               const Real a_fillRatio,
00171               const int a_blockFactor,
00173               const int a_bufferSize,
00175               const int a_maxSize);
00176   
00177 
00179 
00186   void 
00187   makeBoxes(
00188             Vector<Box>&      a_mesh,        
00190             const IntVectSet& a_tags,        
00192             const IntVectSet& a_pnd,         
00194             const ProblemDomain& a_domain,
00196             const int         a_maxSize) const;
00197   
00198 
00199 protected:
00200   void 
00201   makeBoxes(
00202             std::list<Box>&      a_mesh,        
00204             const IntVectSet& a_tags,        
00206             const IntVectSet& a_pnd,         
00208             const ProblemDomain& a_domain,
00210             const int         a_maxSize,
00212                         const int         a_depth
00213                         ) const;
00215   void
00216   splitBox(std::list<Box> & a_boxes ,
00217                    const std::list<Box>::iterator& a_boxindex,
00218            const int a_dimension ,const int a_maxboxsize ) const;
00219   
00221    Vector<int>
00222   makeTrace( const IntVectSet& a_Ivs ,int a_dir ) const;
00223   
00225   void
00226   makeTraces( const IntVectSet& a_Ivs ,Vector<int>* a_traces ) const;
00228    int
00229   findSplit( const Vector<int>& a_trace ) const;
00230   
00232    int
00233   findMaxInflectionPoint( const Vector<int>& a_trace ,int& a_maxVal ) const;
00234   
00236    void
00237   splitTags( const IntVectSet& a_tags,
00238              const int a_split_dir ,const int a_split_indx,
00239              IntVectSet& a_tags_lo ,IntVectSet& a_tags_hi ) const;
00240   
00242   void 
00243   breakBoxes(Vector<Box>& a_vboxin,  const int& a_maxSize, 
00244              const int& a_idir) const;
00245   
00247    int
00248   maxloc( const int* a_V ,const int a_Size ) const;
00249 
00250 
00251 };
00252 
00254 
00264 extern void domainSplit(const ProblemDomain& a_domain, Vector<Box>& a_vbox, 
00265                         int a_maxSize, int a_blockfactor=1);
00266 
00268 
00278 extern void domainSplit(const Box& a_domain, Vector<Box>& a_vbox, 
00279                         int a_maxSize, int a_blockfactor=1);
00280 
00281 #endif

Generated on Wed Apr 16 14:26:49 2003 for Chombo by doxygen1.2.16