patchEdgeFaceRegionI.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) 2012-2016 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "polyMesh.H"
30#include "transform.H"
31
32// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33
34// Update this with w2 if w2 nearer to pt.
35template<class TrackingData>
37(
38 const patchEdgeFaceRegion& w2,
39 const scalar tol,
40 TrackingData& td
41)
42{
43 if (!w2.valid(td))
44 {
46 << "problem." << abort(FatalError);
47 }
48
49 if (w2.region_ == -2 || region_ == -2)
50 {
51 // Blocked edge/face
52 return false;
53 }
54
55 if (!valid(td))
56 {
57 // current not yet set so use any value
58 operator=(w2);
59 return true;
60 }
61 else
62 {
63 if (w2.region_ < region_)
64 {
65 operator=(w2);
66 return true;
67 }
68 else
69 {
70 return false;
71 }
72 }
73}
74
75
76// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
77
79:
80 region_(-1)
81{}
82
83
85(
86 const label regioni
87)
88:
89 region_(regioni)
90{}
91
92
93// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94
95template<class TrackingData>
96inline bool Foam::patchEdgeFaceRegion::valid(TrackingData& td) const
97{
98 return region_ != -1;
99}
100
101
102template<class TrackingData>
104(
105 const polyMesh& mesh,
106 const indirectPrimitivePatch& patch,
107 const tensor& rotTensor,
108 const scalar tol,
109 TrackingData& td
110)
111{}
112
113
114template<class TrackingData>
116(
117 const polyMesh& mesh,
118 const indirectPrimitivePatch& patch,
119 const label edgeI,
120 const label facei,
121 const patchEdgeFaceRegion& faceInfo,
122 const scalar tol,
123 TrackingData& td
124)
125{
126 return update(faceInfo, tol, td);
127}
128
129
130template<class TrackingData>
132(
133 const polyMesh& mesh,
134 const indirectPrimitivePatch& patch,
135 const patchEdgeFaceRegion& edgeInfo,
136 const bool sameOrientation,
137 const scalar tol,
138 TrackingData& td
139)
140{
141 return update(edgeInfo, tol, td);
142}
143
144
145template<class TrackingData>
147(
148 const polyMesh& mesh,
149 const indirectPrimitivePatch& patch,
150 const label facei,
151 const label edgeI,
152 const patchEdgeFaceRegion& edgeInfo,
153 const scalar tol,
154 TrackingData& td
155)
156{
157 return update(edgeInfo, tol, td);
158}
159
160
161template<class TrackingData>
163(
164 const patchEdgeFaceRegion& rhs,
165 TrackingData& td
166) const
167{
168 return operator==(rhs);
169}
170
171
172// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
173
175(
176 const patchEdgeFaceRegion& rhs
177) const
178{
179 return region_ == rhs.region_;
180}
181
182
184(
185 const patchEdgeFaceRegion& rhs
186) const
187{
188 return !(*this == rhs);
189}
190
191
192// ************************************************************************* //
#define w2
Definition: blockCreate.C:35
A list of faces which address into the list of points.
bool valid() const
True if all internal ids are non-negative.
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
virtual bool update()
Update the mesh for both mesh motion and topology change.
Default transformation behaviour.
Transport of region for use in PatchEdgeFaceWave.
bool equal(const patchEdgeFaceRegion &, TrackingData &) const
Test for equality, with TrackingData.
bool updateFace(const polyMesh &mesh, const indirectPrimitivePatch &patch, const label facei, const label edgeI, const patchEdgeFaceRegion &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on face.
patchEdgeFaceRegion()
Default construct.
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
bool updateEdge(const polyMesh &mesh, const indirectPrimitivePatch &patch, const label edgeI, const label facei, const patchEdgeFaceRegion &faceInfo, const scalar tol, TrackingData &td)
Influence of face on edge.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
mesh update()
dynamicFvMesh & mesh
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError
3D tensor transformation operations.