00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _MESHREFINE_H_
00012 #define _MESHREFINE_H_
00013
00014 #include <climits>
00015
00016 #include "Vector.H"
00017 #include "Box.H"
00018 #include "IntVectSet.H"
00019 #include "REAL.H"
00020 #include "ProblemDomain.H"
00021 #include "NamespaceHeader.H"
00022
00023
00024
00026 class MeshRefine
00085 {
00086 public:
00088 MeshRefine();
00089
00091 MeshRefine(
00092 const Box& a_baseDomain,
00094 const Vector<int>& a_refRatios,
00096 const Real a_fillRatio,
00098 const int a_blockFactor,
00100 const int a_bufferSize,
00102 const int a_maxSize);
00103
00105 MeshRefine(
00106 const ProblemDomain& a_baseDomain,
00108 const Vector<int>& a_refRatios,
00110 const Real a_fillRatio,
00112 const int a_blockFactor,
00114 const int a_bufferSize,
00116 const int a_maxSize);
00117
00119 virtual ~MeshRefine();
00120
00122 void define(
00123 const Box& a_baseDomain,
00125 const Vector<int>& a_refRatios,
00127 const Real a_fillRatio,
00129 const int a_blockFactor,
00131 const int a_bufferSize,
00133 const int a_maxSize);
00134
00136 void define(
00137 const ProblemDomain& a_baseDomain,
00139 const Vector<int>& a_refRatios,
00141 const Real a_fillRatio,
00143 const int a_blockFactor,
00145 const int a_bufferSize,
00147 const int a_maxSize);
00148
00150
00154 virtual int regrid(
00155 Vector<Vector<Box> >& a_newmeshes,
00157 const IntVectSet& a_tags,
00159 const int a_baseLevel,
00161 const int a_topLevel,
00163 const Vector<Vector<Box> >& a_oldMeshes);
00164
00166
00171 virtual int regrid(
00172 Vector<Vector<Box> >& a_newmeshes,
00174 Vector<IntVectSet>& a_tags,
00176 const int a_baseLevel,
00178 const int a_topLevel,
00180 const Vector<Vector<Box> >& a_oldMeshes);
00181
00182
00183
00185 const Vector<int>& refRatios() const;
00186
00188 Real fillRatio() const;
00189
00191 int blockFactor() const;
00192
00194 int bufferSize() const;
00195
00197 int maxSize() const;
00198
00200 void refRatios(const Vector<int>& a_nRefVect);
00201
00203 void fillRatio(const Real a_fill_ratio);
00204
00206 void blockFactor(const int a_block_factor);
00207
00209 void bufferSize(const int a_buffer_size);
00210
00212 void maxSize(const int a_max_size);
00213
00215 bool isDefined() const;
00216
00218 void granularity(int a_granularity);
00219
00221
00228 virtual void
00229 makeBoxes(
00230 Vector<Box>& a_mesh,
00232 const IntVectSet& a_tags,
00234 const IntVectSet& a_pnd,
00236 const ProblemDomain& a_domain,
00238 const int a_maxSize,
00239 const int a_totalBufferSize) const = 0;
00240
00241
00242 void setPNDMode(int a_mode);
00243 protected:
00244
00246
00250 virtual void
00251 computeLocalBlockFactors();
00252
00253 bool properlyNested(const Box& a_box,
00254 const ProblemDomain& a_domain,
00255 const IntVectSet& a_pnd,
00256 int a_totalBuffer) const;
00257
00259
00264 virtual void
00265 makePNDs(
00266 Vector<IntVectSet>& a_pnds,
00267 Vector<int>& a_totalBufferSize,
00269 const int a_baseLevel,
00271 const int a_topLevel,
00273 const Vector<ProblemDomain>& a_domains,
00275 const IntVectSet& a_baseMesh,
00277 const Vector<int>& a_bufferSize ) const;
00278
00279 virtual void
00280 makePNDs(
00281 Vector<IntVectSet>& a_pnds,
00282 Vector<int>& a_totalBufferSize,
00284 const int a_baseLevel,
00286 const int a_topLevel,
00288 const Vector<ProblemDomain>& a_domains,
00290 const Vector<Box>& a_baseMesh,
00292 const Vector<int>& a_bufferSize ) const;
00293
00294
00295
00296
00297 bool m_isDefined;
00298
00299 Vector<ProblemDomain> m_vectDomains;
00300
00301 Vector<IntVectSet> m_pnds;
00302 int m_lastBase;
00303 int m_lastTop;
00304 int m_lastBuffer;
00305
00306 Vector<int> m_nRefVect;
00307
00308 Real m_fillRatio;
00309
00310 int m_blockFactor;
00311
00312 Vector<int> m_level_blockfactors;
00313
00314 int m_bufferSize;
00315
00316 int m_maxSize;
00317
00318 int m_granularity;
00319
00320 int m_PNDMode;
00321
00322 };
00323
00324 #include "NamespaceFooter.H"
00325 #endif