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 
105 inline Foam::label Foam::AMIInterpolation::comm() const
106 {
107  return comm_;
108 }
109 
110 
111 inline Foam::label Foam::AMIInterpolation::comm(const label newComm)
112 {
113  const label oldComm(comm_);
114  comm_ = newComm;
115  return oldComm;
116 }
117 
120 {
121  return srcMagSf_;
122 }
123 
126 {
127  return srcMagSf_;
128 }
129 
132 {
133  return srcAddress_;
134 }
135 
138 {
139  return srcAddress_;
140 }
141 
144 {
145  return srcWeights_;
146 }
147 
150 {
151  return srcWeights_;
152 }
153 
156 {
157  return srcWeightsSum_;
158 }
159 
162 {
163  return srcWeightsSum_;
164 }
165 
168 {
169  return srcCentroids_;
170 }
171 
174 {
175  return srcCentroids_;
176 }
177 
178 
180 {
181  return *srcMapPtr_;
182 }
183 
184 
185 inline const Foam::mapDistribute*
187 {
188  return srcMapPtr_.get();
189 }
190 
193 {
194  return tgtMagSf_;
195 }
196 
199 {
200  return tgtMagSf_;
201 }
202 
205 {
206  return tgtAddress_;
207 }
208 
211 {
212  return tgtAddress_;
213 }
214 
217 {
218  return tgtWeights_;
219 }
220 
223 {
224  return tgtWeights_;
225 }
226 
229 {
230  return tgtWeightsSum_;
231 }
232 
235 {
236  return tgtWeightsSum_;
237 }
238 
239 
241 {
242  return *tgtMapPtr_;
243 }
244 
245 
246 inline const Foam::mapDistribute*
248 {
249  return tgtMapPtr_.get();
250 }
251 
252 
253 // ************************************************************************* //
const pointListList & srcCentroids() const
Return const access to source patch face centroids.
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:598
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: Scalar.H:258
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;.
label comm() const
Communicator to use for parallel operations.