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-2023 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_)
32  {
34  << "tsrcPatch0Ptr_ not set"
36  }
37 
38  return tsrcPatch0_();
39 }
40 
41 
43 {
44 
45  if (!ttgtPatch0_)
46  {
48  << "ttgtPatch0Ptr_ not set"
50  }
51 
52  return ttgtPatch0_();
53 }
54 
55 
57 {
58  return (singlePatchProc_ == -1);
59 }
60 
61 
63 {
64  return requireMatch_;
65 }
66 
67 
69 {
70  requireMatch_ = flag;
71  return requireMatch_;
72 }
73 
74 
76 {
77  return requireMatch_ && !applyLowWeightCorrection();
78 }
79 
80 
82 {
83  return reverseTarget_;
84 }
85 
86 
87 inline Foam::scalar Foam::AMIInterpolation::lowWeightCorrection() const
88 {
89  return lowWeightCorrection_;
90 }
91 
92 
94 {
95  return lowWeightCorrection_ > 0;
96 }
97 
98 
99 inline Foam::label Foam::AMIInterpolation::singlePatchProc() const noexcept
100 {
101  return singlePatchProc_;
102 }
103 
104 
105 inline Foam::label Foam::AMIInterpolation::comm() const noexcept
106 {
107  if (const auto* ptr = geomComm_.get())
108  {
109  return ptr->comm();
110  }
111  else
112  {
113  return comm_;
114  }
115 }
116 
117 
118 inline Foam::label Foam::AMIInterpolation::comm(label communicator) noexcept
119 {
120  label old(comm_);
121  comm_ = communicator;
122  return old;
123 }
124 
127 {
128  return srcMagSf_;
129 }
130 
133 {
134  return srcMagSf_;
135 }
136 
139 {
140  return srcAddress_;
141 }
142 
145 {
146  return srcAddress_;
147 }
148 
151 {
152  return srcWeights_;
153 }
154 
157 {
158  return srcWeights_;
159 }
160 
163 {
164  return srcWeightsSum_;
165 }
166 
169 {
170  return srcWeightsSum_;
171 }
172 
175 {
176  return srcCentroids_;
177 }
178 
181 {
182  return srcCentroids_;
183 }
184 
185 
187 {
188  return *srcMapPtr_;
189 }
190 
191 
192 inline const Foam::mapDistribute*
194 {
195  return srcMapPtr_.get();
196 }
197 
200 {
201  return tgtMagSf_;
202 }
203 
206 {
207  return tgtMagSf_;
208 }
209 
212 {
213  return tgtAddress_;
214 }
215 
218 {
219  return tgtAddress_;
220 }
221 
224 {
225  return tgtWeights_;
226 }
227 
230 {
231  return tgtWeights_;
232 }
233 
236 {
237  return tgtWeightsSum_;
238 }
239 
242 {
243  return tgtWeightsSum_;
244 }
245 
246 
248 {
249  return *tgtMapPtr_;
250 }
251 
252 
253 inline const Foam::mapDistribute*
255 {
256  return tgtMapPtr_.get();
257 }
258 
259 
260 // ************************************************************************* //
const pointListList & srcCentroids() const
Return const access to source patch face centroids.
label comm() const noexcept
Communicator (local or otherwise) for parallel operations.
refPtr< primitivePatch > tsrcPatch0_
Source patch using manipulated input points.
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
const scalarListList & tgtWeights() const
Return const access to target patch weights.
bool mustMatchFaces() const
Return true if requireMatch and but not lowWeightCorrection.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:600
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
const mapDistribute & srcMap() const
Source map - valid only if singlePatchProc = -1 This gets source data into a form to be consumed by t...
const labelListList & tgtAddress() const
Return const access to target patch addressing.
bool requireMatch() const noexcept
Return the requireMatch flag.
label singlePatchProc() const noexcept
The processor holding all faces (both sides), or -1 if distributed.
bool distributed() const noexcept
Distributed across processors (singlePatchProc == -1)
A list of faces which address into the list of points.
const primitivePatch & tgtPatch0() const
Return the orginal tgt patch with optionally updated points.
const List< scalar > & tgtMagSf() const
Return const access to target patch face areas.
const mapDistribute * hasTgtMap() const noexcept
Pointer to the target map (if distributed). Can be checked as a bool.
const primitivePatch & srcPatch0() const
Return the orginal src patch with optionally updated points.
const scalarField & tgtWeightsSum() const
Return const access to normalisation factor of target patch weights (i.e. the sum before normalisatio...
errorManip< error > abort(error &err)
Definition: errorManip.H:139
const direction noexcept
Definition: scalarImpl.H:255
const mapDistribute * hasSrcMap() const noexcept
Pointer to the source map (if distributed). Can be checked as a bool.
const scalarListList & srcWeights() const
Return const access to source patch weights.
bool setRequireMatch(bool flag) noexcept
Set the require match flag, return the new value.
bool reverseTarget() const noexcept
Access to the reverseTarget flag.
const List< scalar > & srcMagSf() const
Return const access to source patch face areas.
const scalarField & srcWeightsSum() const
Return const access to normalisation factor of source patch weights (i.e. the sum before normalisatio...
Class containing processor-to-processor mapping information.
const mapDistribute & tgtMap() const
Target map - valid only if singlePatchProc=-1. This gets target data into a form to be consumed by sr...
scalar lowWeightCorrection() const
Threshold weight below which interpolation is deactivated.
const labelListList & srcAddress() const
Return const access to source patch addressing.
bool applyLowWeightCorrection() const
Return true if employing a &#39;lowWeightCorrection&#39;.