Loading...
Searching...
No Matches
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
57
59/*---------------------------------------------------------------------------*\
60 Class meshToMeshData Declaration
61\*---------------------------------------------------------------------------*/
62
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
101
102 label tgtCell() const
103 {
104 return tgtCelli_;
106 label& tgtCell()
107 {
108 return tgtCelli_;
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 //- Interpolate between two values (lerp). Returns true if
204 //- causes changes. Not sure if needs to be specialised between
205 //- face and cell and what index is needed...
206 template<class TrackingData>
207 inline bool interpolate
208 (
209 const polyMesh&,
210 const point& pt,
211 const label i0,
212 const meshToMeshData& f0,
213 const label i1,
214 const meshToMeshData& f1,
215 const scalar weight,
216 const scalar tol,
217 TrackingData& td
218 );
219
220
221 // Member Operators
222
223 //- Test for equality
224 inline bool operator==(const meshToMeshData&) const;
225
226 //- Test for inequality
227 inline bool operator!=(const meshToMeshData&) const;
228
229
230 // IOstream Operators
231
232 friend Ostream& operator<<(Ostream&, const meshToMeshData&);
234};
235
236
237// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
238
239//- Contiguous data for meshToMeshData
240template<> struct is_contiguous<meshToMeshData> : std::true_type {};
241
242//- Contiguous label data for meshToMeshData
243template<> struct is_contiguous_label<meshToMeshData> : std::true_type {};
244
245
246// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247
248} // End namespace Foam
249
250// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251
252#include "meshToMeshDataI.H"
253
254// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255
256#endif
257
258// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
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 &)
Convert absolute coordinates into relative to (patch)face centre.
bool equal(const meshToMeshData &, TrackingData &) const
Test for equality, with TrackingData.
bool interpolate(const polyMesh &, const point &pt, const label i0, const meshToMeshData &f0, const label i1, const meshToMeshData &f1, const scalar weight, const scalar tol, TrackingData &td)
Interpolate between two values (lerp). Returns true if causes changes. Not sure if needs to be specia...
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.
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:79
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
Namespace for OpenFOAM.
Tensor< scalar > tensor
Definition symmTensor.H:57
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
vector point
Point is a vector.
Definition point.H:37
A template class to specify if a data type is composed solely of Foam::label elements.
Definition contiguous.H:82
A template class to specify that a data type can be considered as being contiguous in memory.
Definition contiguous.H:70