00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _MESH_REFINE_H_
00028 #define _MESH_REFINE_H_
00029
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
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
00273
00274
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
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