BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / meshTools / PatchEdgeFaceWave / patchEdgeFaceInfo.H
blobf02120d7d9a5655da97acfbf706956d9f44e8afd
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Class
25     Foam::patchEdgeFaceInfo
27 Description
29 SourceFiles
30     patchEdgeFaceInfoI.H
31     patchEdgeFaceInfo.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef patchEdgeFaceInfo_H
36 #define patchEdgeFaceInfo_H
38 #include "point.H"
39 #include "label.H"
40 #include "scalar.H"
41 #include "tensor.H"
42 #include "pTraits.H"
43 #include "primitivePatch.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 // Forward declaration of classes
51 class polyPatch;
52 class polyMesh;
54 /*---------------------------------------------------------------------------*\
55                            Class patchEdgeFaceInfo Declaration
56 \*---------------------------------------------------------------------------*/
58 class patchEdgeFaceInfo
60     // Private data
62         //- position of nearest wall center
63         point origin_;
65         //- normal distance (squared) from point to origin
66         scalar distSqr_;
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,
73         //  false otherwise.
74         template<class TrackingData>
75         inline bool update
76         (
77             const point&,
78             const patchEdgeFaceInfo& w2,
79             const scalar tol,
80             TrackingData& td
81         );
83         //- Combine current with w2. Update distSqr, origin if w2 has smaller
84         //  quantities and returns true.
85         template<class TrackingData>
86         inline bool update
87         (
88             const patchEdgeFaceInfo& w2,
89             const scalar tol,
90             TrackingData& td
91         );
94 public:
96     // Constructors
98         //- Construct null
99         inline patchEdgeFaceInfo();
101         //- Construct from origin, distance
102         inline patchEdgeFaceInfo(const point&, const scalar);
104         //- Construct as copy
105         inline patchEdgeFaceInfo(const patchEdgeFaceInfo&);
108     // Member Functions
110         // Access
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
127             (
128                 const polyMesh& mesh,
129                 const primitivePatch& patch,
130                 const tensor& rotTensor,
131                 const scalar tol,
132                 TrackingData& td
133             );
135             //- Influence of face on edge
136             template<class TrackingData>
137             inline bool updateEdge
138             (
139                 const polyMesh& mesh,
140                 const primitivePatch& patch,
141                 const label edgeI,
142                 const label faceI,
143                 const patchEdgeFaceInfo& faceInfo,
144                 const scalar tol,
145                 TrackingData& td
146             );
148             //- New information for edge (from e.g. coupled edge)
149             template<class TrackingData>
150             inline bool updateEdge
151             (
152                 const polyMesh& mesh,
153                 const primitivePatch& patch,
154                 const patchEdgeFaceInfo& edgeInfo,
155                 const bool sameOrientation,
156                 const scalar tol,
157                 TrackingData& td
158             );
160             //- Influence of edge on face.
161             template<class TrackingData>
162             inline bool updateFace
163             (
164                 const polyMesh& mesh,
165                 const primitivePatch& patch,
166                 const label faceI,
167                 const label edgeI,
168                 const patchEdgeFaceInfo& edgeInfo,
169                 const scalar tol,
170                 TrackingData& td
171             );
173             //- Same (like operator==)
174             template<class TrackingData>
175             inline bool equal(const patchEdgeFaceInfo&, TrackingData& td) const;
178     // Member Operators
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
193 template<>
194 inline bool contiguous<patchEdgeFaceInfo>()
196     return true;
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 } // End namespace Foam
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 #include "patchEdgeFaceInfoI.H"
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 #endif
212 // ************************************************************************* //