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
00204
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
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