dynamicRefineFvMesh.H
Go to the documentation of this file.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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef dynamicRefineFvMesh_H
00039 #define dynamicRefineFvMesh_H
00040
00041 #include "dynamicFvMesh.H"
00042 #include "hexRef8.H"
00043 #include "PackedBoolList.H"
00044 #include "Switch.H"
00045
00046
00047
00048 namespace Foam
00049 {
00050
00051
00052
00053
00054
00055 class dynamicRefineFvMesh
00056 :
00057 public dynamicFvMesh
00058 {
00059 protected:
00060
00061
00062 hexRef8 meshCutter_;
00063
00064
00065 Switch dumpLevel_;
00066
00067
00068 List<Pair<word> > correctFluxes_;
00069
00070
00071 label nRefinementIterations_;
00072
00073
00074 PackedBoolList protectedCell_;
00075
00076
00077
00078
00079
00080 static label count(const PackedBoolList&, const unsigned int);
00081
00082
00083
00084 void calculateProtectedCells(PackedBoolList& unrefineableCell) const;
00085
00086
00087 void readDict();
00088
00089
00090
00091 autoPtr<mapPolyMesh> refine(const labelList&);
00092
00093
00094 autoPtr<mapPolyMesh> unrefine(const labelList&);
00095
00096
00097
00098
00099
00100
00101 scalar getRefineLevel
00102 (
00103 const label maxCells,
00104 const label maxRefinement,
00105 const scalar refineLevel,
00106 const scalarField&
00107 ) const;
00108
00109
00110 scalarField maxPointField(const scalarField&) const;
00111
00112
00113 scalarField minCellField(const volScalarField&) const;
00114
00115 scalarField cellToPoint(const scalarField& vFld) const;
00116
00117 scalarField error
00118 (
00119 const scalarField& fld,
00120 const scalar minLevel,
00121 const scalar maxLevel
00122 ) const;
00123
00124
00125 virtual void selectRefineCandidates
00126 (
00127 const scalar lowerRefineLevel,
00128 const scalar upperRefineLevel,
00129 const scalarField& vFld,
00130 PackedBoolList& candidateCell
00131 ) const;
00132
00133
00134 virtual labelList selectRefineCells
00135 (
00136 const label maxCells,
00137 const label maxRefinement,
00138 const PackedBoolList& candidateCell
00139 ) const;
00140
00141
00142 virtual labelList selectUnrefinePoints
00143 (
00144 const scalar unrefineLevel,
00145 const PackedBoolList& markedCell,
00146 const scalarField& pFld
00147 ) const;
00148
00149
00150 void extendMarkedCells(PackedBoolList& markedCell) const;
00151
00152
00153 private:
00154
00155
00156 dynamicRefineFvMesh(const dynamicRefineFvMesh&);
00157
00158
00159 void operator=(const dynamicRefineFvMesh&);
00160
00161 public:
00162
00163
00164 TypeName("dynamicRefineFvMesh");
00165
00166
00167
00168
00169
00170 explicit dynamicRefineFvMesh(const IOobject& io);
00171
00172
00173
00174
00175 virtual ~dynamicRefineFvMesh();
00176
00177
00178
00179
00180
00181 const hexRef8& meshCutter() const
00182 {
00183 return meshCutter_;
00184 }
00185
00186
00187 const PackedBoolList& protectedCell() const
00188 {
00189 return protectedCell_;
00190 }
00191
00192
00193 PackedBoolList& protectedCell()
00194 {
00195 return protectedCell_;
00196 }
00197
00198
00199 virtual bool update();
00200
00201
00202
00203
00204
00205 virtual bool writeObject
00206 (
00207 IOstream::streamFormat fmt,
00208 IOstream::versionNumber ver,
00209 IOstream::compressionType cmp
00210 ) const;
00211
00212 };
00213
00214
00215
00216
00217 }
00218
00219
00220
00221 #endif
00222
00223
Copyright © 2000-2009 OpenCFD Ltd