1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Smoothed delta which takes a given simple geometric delta and applies
29 smoothing to it such that the ratio of deltas between two cells is no
30 larger than a specified amount, typically 1.15.
35 \*---------------------------------------------------------------------------*/
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class smoothDelta Declaration
49 \*---------------------------------------------------------------------------*/
57 //- Public member class used by mesh-wave to propagate the delta-ratio
62 // Private Member Functions
64 //- Update. Gets information from neighbouring face/cell and
65 // uses this to update itself (if nessecary) and return true.
66 template<class TrackingData>
83 //- Construct from origin, yStar, distance
84 inline deltaData(const scalar delta);
97 // Needed by FaceCellWave
99 //- Check whether origin has been changed at all or
100 // still contains original (invalid) value.
101 template<class TrackingData>
102 inline bool valid(TrackingData& td) const;
104 //- Check for identical geometrical data.
105 // Used for cyclics checking.
106 template<class TrackingData>
107 inline bool sameGeometry
115 //- Convert any absolute coordinates into relative to
116 // (patch)face centre
117 template<class TrackingData>
118 inline void leaveDomain
122 const label patchFaceI,
123 const point& faceCentre,
127 //- Reverse of leaveDomain
128 template<class TrackingData>
129 inline void enterDomain
133 const label patchFaceI,
134 const point& faceCentre,
138 //- Apply rotation matrix to any coordinates
139 template<class TrackingData>
140 inline void transform
147 //- Influence of neighbouring face.
148 template<class TrackingData>
149 inline bool updateCell
152 const label thisCellI,
153 const label neighbourFaceI,
154 const deltaData& neighbourInfo,
159 //- Influence of neighbouring cell.
160 template<class TrackingData>
161 inline bool updateFace
164 const label thisFaceI,
165 const label neighbourCellI,
166 const deltaData& neighbourInfo,
171 //- Influence of different value on same face.
172 template<class TrackingData>
173 inline bool updateFace
176 const label thisFaceI,
177 const deltaData& neighbourInfo,
182 //- Same (like operator==)
183 template<class TrackingData>
184 inline bool equal(const deltaData&, TrackingData& td) const;
188 // Needed for List IO
189 inline bool operator==(const deltaData&) const;
191 inline bool operator!=(const deltaData&) const;
193 // IOstream Operators
195 friend Ostream& operator<<
198 const deltaData& wDist
201 return os << wDist.delta_;
204 friend Istream& operator>>(Istream& is, deltaData& wDist)
206 return is >> wDist.delta_;
215 autoPtr<LESdelta> geometricDelta_;
216 scalar maxDeltaRatio_;
219 // Private Member Functions
221 //- Disallow default bitwise copy construct and assignment
222 smoothDelta(const smoothDelta&);
223 void operator=(const smoothDelta&);
225 // Calculate the delta values
231 const polyMesh& mesh,
232 const volScalarField& delta,
233 DynamicList<label>& changedFaces,
234 DynamicList<deltaData>& changedFacesInfo
240 //- Runtime type information
246 //- Construct from name, mesh and IOdictionary
256 virtual ~smoothDelta()
262 //- Read the LESdelta dictionary
263 virtual void read(const dictionary&);
266 virtual void correct();
270 //- Data associated with deltaData type are contiguous
272 inline bool contiguous<smoothDelta::deltaData>()
278 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
280 } // End namespace Foam
282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
284 #include "smoothDeltaDeltaDataI.H"
286 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
290 // ************************************************************************* //