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-2022 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 
56 inline bool Foam::AMIInterpolation::upToDate() const
57 {
58  return upToDate_;
59 }
60 
61 
63 {
64  return upToDate_;
65 }
66 
67 
68 inline bool Foam::AMIInterpolation::distributed() const
69 {
70  return singlePatchProc_ == -1;
71 }
72 
73 
74 inline bool Foam::AMIInterpolation::requireMatch() const
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 
93 inline bool Foam::AMIInterpolation::reverseTarget() const
94 {
95  return reverseTarget_;
96 }
97 
98 
99 inline Foam::scalar Foam::AMIInterpolation::lowWeightCorrection() const
100 {
101  return lowWeightCorrection_;
102 }
103 
106 {
107  return lowWeightCorrection_ > 0;
108 }
109 
111 inline Foam::label Foam::AMIInterpolation::singlePatchProc() const
112 {
113  return singlePatchProc_;
114 }
115 
118 {
119  return srcMagSf_;
120 }
121 
124 {
125  return srcMagSf_;
126 }
127 
130 {
131  return srcAddress_;
132 }
133 
136 {
137  return srcAddress_;
138 }
139 
142 {
143  return srcWeights_;
144 }
145 
148 {
149  return srcWeights_;
150 }
151 
154 {
155  return srcWeightsSum_;
156 }
157 
160 {
161  return srcWeightsSum_;
162 }
163 
166 {
167  return srcCentroids_;
168 }
169 
172 {
173  return srcCentroids_;
174 }
175 
178 {
179  return *srcMapPtr_;
180 }
181 
184 {
185  return tgtMagSf_;
186 }
187 
190 {
191  return tgtMagSf_;
192 }
193 
196 {
197  return tgtAddress_;
198 }
199 
202 {
203  return tgtAddress_;
204 }
205 
208 {
209  return tgtWeights_;
210 }
211 
214 {
215  return tgtWeights_;
216 }
217 
220 {
221  return tgtWeightsSum_;
222 }
223 
226 {
227  return tgtWeightsSum_;
228 }
229 
230 
232 {
233  return *tgtMapPtr_;
234 }
235 
236 // ************************************************************************* //
const pointListList & srcCentroids() const
Return const access to source patch face centroids.
refPtr< primitivePatch > tsrcPatch0_
Source patch using manipulated input points.
label singlePatchProc() const
Set to -1, or the processor holding all faces (both sides) of the AMI.
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 lowWeightCorrectionin active.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:578
bool setRequireMatch(const bool flag)
Access to the requireMatch flag.
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 pointer - valid only if singlePatchProc = -1 This gets source data into a form to be consu...
const labelListList & tgtAddress() const
Return const access to target patch addressing.
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 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 scalarListList & srcWeights() const
Return const access to source patch weights.
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...
bool requireMatch() const
Access to the requireMatch flag.
Class containing processor-to-processor mapping information.
bool upToDate() const
Access to the up-to-date flag.
bool distributed() const
Access to the distributed flag.
const mapDistribute & tgtMap() const
Target map pointer - valid only if singlePatchProc=-1. This gets target data into a form to be consum...
scalar lowWeightCorrection() const
Threshold weight below which interpolation is deactivated.
bool reverseTarget() const
Access to the reverseTarget flag.
const labelListList & srcAddress() const
Return const access to source patch addressing.
bool applyLowWeightCorrection() const
Return true if employing a &#39;lowWeightCorrection&#39;.