ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / parallel / decompose / decompositionMethods / structuredDecomp / topoDistanceData.H
blobdc18cb46006207f703f11d054235e44ee569d9a2
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::topoDistanceData
27 Description
28     For use with FaceCellWave. Determines topological distance to starting faces
30 SourceFiles
31     topoDistanceDataI.H
32     topoDistanceData.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef topoDistanceData_H
37 #define topoDistanceData_H
39 #include "point.H"
40 #include "tensor.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 class polyPatch;
48 class polyMesh;
50 /*---------------------------------------------------------------------------*\
51                            Class topoDistanceData Declaration
52 \*---------------------------------------------------------------------------*/
54 class topoDistanceData
56     // Private data
58         //- Starting data
59         label data_;
61         //- Distance
62         label distance_;
65 public:
67     // Constructors
69         //- Construct null
70         inline topoDistanceData();
72         //- Construct from count
73         inline topoDistanceData
74         (
75             const label data,
76             const label distance
77         );
80     // Member Functions
82         // Access
85             inline label data() const
86             {
87                 return data_;
88             }
89             inline label distance() const
90             {
91                 return distance_;
92             }
95         // Needed by FaceCellWave
97             //- Check whether origin has been changed at all or
98             //  still contains original (invalid) value.
99             template<class TrackingData>
100             inline bool valid(TrackingData& td) const;
102             //- Check for identical geometrical data. Used for cyclics checking.
103             template<class TrackingData>
104             inline bool sameGeometry
105             (
106                 const polyMesh&,
107                 const topoDistanceData&,
108                 const scalar,
109                 TrackingData& td
110             ) const;
112             //- Convert any absolute coordinates into relative to (patch)face
113             //  centre
114             template<class TrackingData>
115             inline void leaveDomain
116             (
117                 const polyMesh&,
118                 const polyPatch&,
119                 const label patchFaceI,
120                 const point& faceCentre,
121                 TrackingData& td
122             );
124             //- Reverse of leaveDomain
125             template<class TrackingData>
126             inline void enterDomain
127             (
128                 const polyMesh&,
129                 const polyPatch&,
130                 const label patchFaceI,
131                 const point& faceCentre,
132                 TrackingData& td
133             );
135             //- Apply rotation matrix to any coordinates
136             template<class TrackingData>
137             inline void transform
138             (
139                 const polyMesh&,
140                 const tensor&,
141                 TrackingData& td
142             );
144             //- Influence of neighbouring face.
145             template<class TrackingData>
146             inline bool updateCell
147             (
148                 const polyMesh&,
149                 const label thisCellI,
150                 const label neighbourFaceI,
151                 const topoDistanceData& neighbourInfo,
152                 const scalar tol,
153                 TrackingData& td
154             );
156             //- Influence of neighbouring cell.
157             template<class TrackingData>
158             inline bool updateFace
159             (
160                 const polyMesh&,
161                 const label thisFaceI,
162                 const label neighbourCellI,
163                 const topoDistanceData& neighbourInfo,
164                 const scalar tol,
165                 TrackingData& td
166             );
168             //- Influence of different value on same face.
169             template<class TrackingData>
170             inline bool updateFace
171             (
172                 const polyMesh&,
173                 const label thisFaceI,
174                 const topoDistanceData& neighbourInfo,
175                 const scalar tol,
176                 TrackingData& td
177             );
179             //- Same (like operator==)
180             template<class TrackingData>
181             inline bool equal(const topoDistanceData&, TrackingData& td) const;
183     // Member Operators
185         // Needed for List IO
186         inline bool operator==(const topoDistanceData&) const;
188         inline bool operator!=(const topoDistanceData&) const;
191     // IOstream Operators
193         friend Ostream& operator<<(Ostream&, const topoDistanceData&);
194         friend Istream& operator>>(Istream&, topoDistanceData&);
198 //- Data associated with topoDistanceData type are contiguous
199 template<>
200 inline bool contiguous<topoDistanceData>()
202     return true;
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 } // End namespace Foam
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 #include "topoDistanceDataI.H"
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 #endif
218 // ************************************************************************* //