meshToMeshData.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::meshToMeshData
28
29Description
30 Transfers refinement levels such that slow transition between levels is
31 maintained. Used in FaceCellWave.
32
33SourceFiles
34 meshToMeshDataI.H
35 meshToMeshData.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef meshToMeshData_H
40#define meshToMeshData_H
41
42#include "point.H"
43#include "tensor.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
51class polyPatch;
52class polyMesh;
53class meshToMeshData;
54
55Istream& operator>>(Istream&, meshToMeshData&);
56Ostream& operator<<(Ostream&, const meshToMeshData&);
57
58
59/*---------------------------------------------------------------------------*\
60 Class meshToMeshData Declaration
61\*---------------------------------------------------------------------------*/
64{
65 // Private Data
66
67 //- Corresponding cell in tgtMesh
68 label tgtCelli_;
69
70
71public:
72
73 // Public Classes
74
75 //- Class used to pass non-cell data to the update function
76 class trackData
77 {
78 public:
80 const polyMesh& tgtMesh_;
82 trackData(const polyMesh& tgtMesh)
83 :
84 tgtMesh_(tgtMesh)
85 {}
86 };
87
88
89 // Constructors
90
91 //- Default construct
92 inline meshToMeshData();
93
94 //- Construct from target cell
95 inline meshToMeshData(const label tgtCelli);
96
97
98 // Member Functions
99
100 // Access
102 label tgtCell() const
103 {
104 return tgtCelli_;
106 label& tgtCell()
107 {
108 return tgtCelli_;
109 }
110
111
112 // Needed by FaceCellWave
113
114 //- Changed or contains original (invalid) value
115 template<class TrackingData>
116 inline bool valid(TrackingData&) const;
117
118 //- Check for identical geometrical data (eg, cyclics checking)
119 template<class TrackingData>
120 inline bool sameGeometry
121 (
122 const polyMesh&,
123 const meshToMeshData&,
124 const scalar,
125 TrackingData&
126 ) const;
127
128 //- Convert absolute coordinates into relative
129 //- to (patch)face centre
130 template<class TrackingData>
131 inline void leaveDomain
132 (
133 const polyMesh&,
134 const polyPatch&,
135 const label patchFacei,
136 const point& faceCentre,
137 TrackingData&
138 );
139
140 //- Reverse of leaveDomain
141 template<class TrackingData>
142 inline void enterDomain
143 (
144 const polyMesh&,
145 const polyPatch&,
146 const label patchFacei,
147 const point& faceCentre,
148 TrackingData&
149 );
150
151 //- Apply rotation matrix to any coordinates
152 template<class TrackingData>
153 inline void transform
154 (
155 const polyMesh&,
156 const tensor&,
157 TrackingData&
158 );
159
160 //- Influence of neighbouring face.
161 template<class TrackingData>
162 inline bool updateCell
163 (
164 const polyMesh&,
165 const label thisCelli,
166 const label neighbourFacei,
167 const meshToMeshData& neighbourInfo,
168 const scalar tol,
169 TrackingData&
170 );
171
172 //- Influence of neighbouring cell.
173 template<class TrackingData>
174 inline bool updateFace
175 (
176 const polyMesh&,
177 const label thisFacei,
178 const label neighbourCelli,
179 const meshToMeshData& neighbourInfo,
180 const scalar tol,
181 TrackingData&
182 );
183
184 //- Influence of different value on same face.
185 template<class TrackingData>
186 inline bool updateFace
187 (
188 const polyMesh&,
189 const label thisFacei,
190 const meshToMeshData& neighbourInfo,
191 const scalar tol,
192 TrackingData&
193 );
194
195 //- Test for equality, with TrackingData
196 template<class TrackingData>
197 inline bool equal
198 (
199 const meshToMeshData&,
200 TrackingData&
201 ) const;
202
203
204 // Member Operators
205
206 //- Test for equality
207 inline bool operator==(const meshToMeshData&) const;
208
209 //- Test for inequality
210 inline bool operator!=(const meshToMeshData&) const;
211
212
213 // IOstream Operators
217};
218
219
220// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
221
222//- Contiguous data for meshToMeshData
223template<> struct is_contiguous<meshToMeshData> : std::true_type {};
224
225//- Contiguous label data for meshToMeshData
226template<> struct is_contiguous_label<meshToMeshData> : std::true_type {};
227
228
229// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230
231} // End namespace Foam
232
233// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234
235#include "meshToMeshDataI.H"
236
237// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238
239#endif
240
241// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Class used to pass non-cell data to the update function.
trackData(const polyMesh &tgtMesh)
Transfers refinement levels such that slow transition between levels is maintained....
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const meshToMeshData &neighbourInfo, const scalar tol, TrackingData &)
Influence of neighbouring face.
friend Ostream & operator<<(Ostream &, const meshToMeshData &)
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const meshToMeshData &neighbourInfo, const scalar tol, TrackingData &)
Influence of neighbouring cell.
friend Istream & operator>>(Istream &, meshToMeshData &)
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
bool equal(const meshToMeshData &, TrackingData &) const
Test for equality, with TrackingData.
bool operator!=(const meshToMeshData &) const
Test for inequality.
meshToMeshData()
Default construct.
bool valid(TrackingData &) const
Changed or contains original (invalid) value.
bool operator==(const meshToMeshData &) const
Test for equality.
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
Reverse of leaveDomain.
label tgtCell() const
void transform(const polyMesh &, const tensor &, TrackingData &)
Apply rotation matrix to any coordinates.
bool sameGeometry(const polyMesh &, const meshToMeshData &, const scalar, TrackingData &) const
Check for identical geometrical data (eg, cyclics checking)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
Tensor of scalars, i.e. Tensor<scalar>.
Namespace for OpenFOAM.
vector point
Point is a vector.
Definition: point.H:43
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:86
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78