1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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/>.
25 Foam::patchEdgeFaceInfo
33 \*---------------------------------------------------------------------------*/
35 #ifndef patchEdgeFaceInfo_H
36 #define patchEdgeFaceInfo_H
43 #include "primitivePatch.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of classes
54 /*---------------------------------------------------------------------------*\
55 Class patchEdgeFaceInfo Declaration
56 \*---------------------------------------------------------------------------*/
58 class patchEdgeFaceInfo
62 //- position of nearest wall center
65 //- normal distance (squared) from point to origin
69 // Private Member Functions
71 //- Evaluate distance to point. Update distSqr, origin from whomever
72 // is nearer pt. Return true if w2 is closer to point,
74 template<class TrackingData>
78 const patchEdgeFaceInfo& w2,
83 //- Combine current with w2. Update distSqr, origin if w2 has smaller
84 // quantities and returns true.
85 template<class TrackingData>
88 const patchEdgeFaceInfo& w2,
99 inline patchEdgeFaceInfo();
101 //- Construct from origin, distance
102 inline patchEdgeFaceInfo(const point&, const scalar);
104 //- Construct as copy
105 inline patchEdgeFaceInfo(const patchEdgeFaceInfo&);
112 inline const point& origin() const;
114 inline scalar distSqr() const;
117 // Needed by meshWave
119 //- Check whether origin has been changed at all or
120 // still contains original (invalid) value.
121 template<class TrackingData>
122 inline bool valid(TrackingData& td) const;
124 //- Apply rotation matrix
125 template<class TrackingData>
126 inline void transform
128 const polyMesh& mesh,
129 const primitivePatch& patch,
130 const tensor& rotTensor,
135 //- Influence of face on edge
136 template<class TrackingData>
137 inline bool updateEdge
139 const polyMesh& mesh,
140 const primitivePatch& patch,
143 const patchEdgeFaceInfo& faceInfo,
148 //- New information for edge (from e.g. coupled edge)
149 template<class TrackingData>
150 inline bool updateEdge
152 const polyMesh& mesh,
153 const primitivePatch& patch,
154 const patchEdgeFaceInfo& edgeInfo,
155 const bool sameOrientation,
160 //- Influence of edge on face.
161 template<class TrackingData>
162 inline bool updateFace
164 const polyMesh& mesh,
165 const primitivePatch& patch,
168 const patchEdgeFaceInfo& edgeInfo,
173 //- Same (like operator==)
174 template<class TrackingData>
175 inline bool equal(const patchEdgeFaceInfo&, TrackingData& td) const;
180 // Needed for List IO
181 inline bool operator==(const patchEdgeFaceInfo&) const;
182 inline bool operator!=(const patchEdgeFaceInfo&) const;
185 // IOstream Operators
187 friend Ostream& operator<<(Ostream&, const patchEdgeFaceInfo&);
188 friend Istream& operator>>(Istream&, patchEdgeFaceInfo&);
192 //- Data associated with patchEdgeFaceInfo type are contiguous
194 inline bool contiguous<patchEdgeFaceInfo>()
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 } // End namespace Foam
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 #include "patchEdgeFaceInfoI.H"
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 // ************************************************************************* //