AMIInterpolationI.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
30 {
31  if (!tsrcPatch0_.valid())
32  {
34  << "tsrcPatch0Ptr_ not set"
35  << abort(FatalError);
36  }
37 
38  return tsrcPatch0_();
39 }
40 
41 
43 {
44 
45  if (!ttgtPatch0_.valid())
46  {
48  << "ttgtPatch0Ptr_ not set"
49  << abort(FatalError);
50  }
51 
52  return ttgtPatch0_();
53 }
54 
55 
57 {
58  return upToDate_;
59 }
60 
61 
63 {
64  return upToDate_;
65 }
66 
67 
69 {
70  return singlePatchProc_ == -1;
71 }
72 
73 
75 {
76  return requireMatch_;
77 }
78 
79 
80 inline bool Foam::AMIInterpolation::setRequireMatch(const bool flag)
81 {
82  requireMatch_ = flag;
83  return requireMatch_;
84 }
85 
86 
88 {
89  return requireMatch_ && !applyLowWeightCorrection();
90 }
91 
92 
94 {
95  return reverseTarget_;
96 }
97 
98 
100 {
101  return lowWeightCorrection_;
102 }
103 
104 
106 {
107  return lowWeightCorrection_ > 0;
108 }
109 
110 
111 inline Foam::label Foam::AMIInterpolation::singlePatchProc() const
112 {
113  return singlePatchProc_;
114 }
115 
116 
118 {
119  return srcMagSf_;
120 }
121 
122 
124 {
125  return srcMagSf_;
126 }
127 
128 
130 {
131  return srcAddress_;
132 }
133 
134 
136 {
137  return srcAddress_;
138 }
139 
140 
142 {
143  return srcWeights_;
144 }
145 
146 
148 {
149  return srcWeights_;
150 }
151 
152 
154 {
155  return srcWeightsSum_;
156 }
157 
158 
160 {
161  return srcWeightsSum_;
162 }
163 
164 
166 {
167  return srcCentroids_;
168 }
169 
170 
172 {
173  return srcCentroids_;
174 }
175 
176 
178 {
179  return *srcMapPtr_;
180 }
181 
182 
184 {
185  return tgtMagSf_;
186 }
187 
188 
190 {
191  return tgtMagSf_;
192 }
193 
194 
196 {
197  return tgtAddress_;
198 }
199 
200 
202 {
203  return tgtAddress_;
204 }
205 
206 
208 {
209  return tgtWeights_;
210 }
211 
212 
214 {
215  return tgtWeights_;
216 }
217 
218 
220 {
221  return tgtWeightsSum_;
222 }
223 
224 
226 {
227  return tgtWeightsSum_;
228 }
229 
230 
232 {
233  return *tgtMapPtr_;
234 }
235 
236 // ************************************************************************* //
Foam::AMIInterpolation::upToDate
bool upToDate() const
Access to the up-to-date flag.
Definition: AMIInterpolationI.H:56
Foam::AMIInterpolation::srcCentroids
const pointListList & srcCentroids() const
Return const access to source patch face centroids.
Definition: AMIInterpolationI.H:165
Foam::AMIInterpolation::tgtWeightsSum
const scalarField & tgtWeightsSum() const
Definition: AMIInterpolationI.H:219
Foam::AMIInterpolation::distributed
bool distributed() const
Access to the distributed flag.
Definition: AMIInterpolationI.H:68
Foam::AMIInterpolation::tsrcPatch0_
refPtr< primitivePatch > tsrcPatch0_
Source patch using manipulated input points.
Definition: AMIInterpolation.H:133
Foam::AMIInterpolation::srcWeightsSum
const scalarField & srcWeightsSum() const
Definition: AMIInterpolationI.H:153
Foam::AMIInterpolation::setRequireMatch
bool setRequireMatch(const bool flag)
Access to the requireMatch flag.
Definition: AMIInterpolationI.H:80
Foam::AMIInterpolation::tgtAddress
const labelListList & tgtAddress() const
Return const access to target patch addressing.
Definition: AMIInterpolationI.H:195
Foam::AMIInterpolation::tgtWeights
const scalarListList & tgtWeights() const
Return const access to target patch weights.
Definition: AMIInterpolationI.H:207
Foam::AMIInterpolation::tgtMap
const mapDistribute & tgtMap() const
Definition: AMIInterpolationI.H:231
Foam::Field< scalar >
Foam::AMIInterpolation::srcPatch0
const primitivePatch & srcPatch0() const
Return the orginal src patch with optionally updated points.
Definition: AMIInterpolationI.H:29
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:163
Foam::AMIInterpolation::requireMatch
bool requireMatch() const
Access to the requireMatch flag.
Definition: AMIInterpolationI.H:74
Foam::AMIInterpolation::singlePatchProc
label singlePatchProc() const
Definition: AMIInterpolationI.H:111
Foam::FatalError
error FatalError
Foam::AMIInterpolation::tgtPatch0
const primitivePatch & tgtPatch0() const
Return the orginal tgt patch with optionally updated points.
Definition: AMIInterpolationI.H:42
Foam::AMIInterpolation::mustMatchFaces
bool mustMatchFaces() const
Return true if requireMatch and lowWeightCorrectionin active.
Definition: AMIInterpolationI.H:87
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
Foam::AMIInterpolation::srcMagSf
const List< scalar > & srcMagSf() const
Return const access to source patch face areas.
Definition: AMIInterpolationI.H:117
Foam::AMIInterpolation::lowWeightCorrection
scalar lowWeightCorrection() const
Threshold weight below which interpolation is deactivated.
Definition: AMIInterpolationI.H:99
Foam::AMIInterpolation::srcMap
const mapDistribute & srcMap() const
Definition: AMIInterpolationI.H:177
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::AMIInterpolation::applyLowWeightCorrection
bool applyLowWeightCorrection() const
Return true if employing a 'lowWeightCorrection'.
Definition: AMIInterpolationI.H:105
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::AMIInterpolation::reverseTarget
bool reverseTarget() const
Access to the reverseTarget flag.
Definition: AMIInterpolationI.H:93
Foam::AMIInterpolation::tgtMagSf
const List< scalar > & tgtMagSf() const
Return const access to target patch face areas.
Definition: AMIInterpolationI.H:183
Foam::AMIInterpolation::srcAddress
const labelListList & srcAddress() const
Return const access to source patch addressing.
Definition: AMIInterpolationI.H:129
Foam::AMIInterpolation::srcWeights
const scalarListList & srcWeights() const
Return const access to source patch weights.
Definition: AMIInterpolationI.H:141
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79