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 
00039 // Constants:
00040 
00041 // Minimum acceptable ratio of tagged cells to total cells for 
00042 // the Berger-Rigoutsos algorithm in \func{makeBoxes}.
00043 // Used as default for \var{FillRatio} optional argument.
00044 #ifndef _BR_MIN_BOX_FILL_RATIO_
00045 #define _BR_MIN_BOX_FILL_RATIO_ ( 0.75 )
00046 #endif
00047 
00048 
00050 class BRMeshRefine : public MeshRefine
00110 {
00111 public:
00113   BRMeshRefine();
00114   
00116   BRMeshRefine(
00117                const Box& a_baseDomain,
00119                const Vector<int>& a_refRatios,
00121                const Real a_fillRatio,
00123                const int a_blockFactor,
00125                const int a_bufferSize,
00127                const int a_maxSize);
00128 
00130   BRMeshRefine(
00131                const ProblemDomain& a_baseDomain,
00133                const Vector<int>& a_refRatios,
00135                const Real a_fillRatio,
00137                const int a_blockFactor,
00139                const int a_bufferSize,
00141                const int a_maxSize);
00142   
00143 
00145   virtual ~BRMeshRefine();
00146   
00148   void define(
00149               const Box& a_baseDomain,
00151               const Vector<int>& a_refRatios,
00153               const Real a_fillRatio,
00155               const int a_blockFactor,
00157               const int a_bufferSize,
00159               const int a_maxSize);
00160 
00161 
00163   void define(
00164               const ProblemDomain& a_baseDomain,
00166               const Vector<int>& a_refRatios,
00168               const Real a_fillRatio,
00170               const int a_blockFactor,
00172               const int a_bufferSize,
00174               const int a_maxSize);
00175   
00176 
00178 
00185   void 
00186   makeBoxes(
00187             Vector<Box>&      a_mesh,        
00189             const IntVectSet& a_tags,        
00191             const IntVectSet& a_pnd,         
00193             const ProblemDomain& a_domain,
00195             const int         a_maxSize) const;
00196   
00197 
00198 protected:
00199   
00201   void
00202   splitBox(Vector<Box> & a_boxes ,const int a_boxindex,
00203            const int a_dimension ,const int a_maxboxsize ) const;
00204   
00206    Vector<int>
00207   makeTrace( const IntVectSet& a_Ivs ,int a_dir ) const;
00208   
00210    int
00211   findSplit( const Vector<int>& a_trace ) const;
00212   
00214    int
00215   findMaxInflectionPoint( const Vector<int>& a_trace ,int& a_maxVal ) const;
00216   
00218    void
00219   splitTags( const IntVectSet& a_tags,
00220              const int a_split_dir ,const int a_split_indx,
00221              IntVectSet& a_tags_lo ,IntVectSet& a_tags_hi ) const;
00222   
00224   void 
00225   breakBoxes(Vector<Box>& a_vboxin,  const int& a_maxSize, 
00226              const int& a_idir) const;
00227   
00229    int
00230   maxloc( const int* a_V ,const int a_Size ) const;
00231 
00232 
00233 };
00234 
00236 
00246 extern void domainSplit(const ProblemDomain& a_domain, Vector<Box>& a_vbox, 
00247                         int a_maxSize, int a_blockfactor=1);
00248 
00250 
00260 extern void domainSplit(const Box& a_domain, Vector<Box>& a_vbox, 
00261                         int a_maxSize, int a_blockfactor=1);
00262 
00263 #endif

Generated on Thu Aug 29 11:05:44 2002 for Chombo&INS by doxygen1.2.16