Loading...
Searching...
No Matches
PatchToPatchInterpolation.C
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) 2022 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
30
31// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
33namespace Foam
34{
35
36// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
37
38template<class FromPatch, class ToPatch>
39const labelList&
40PatchToPatchInterpolation<FromPatch, ToPatch>::pointAddr() const
41{
42 if (!pointAddressingPtr_)
43 {
44 calcPointAddressing();
45 }
46
47 return *pointAddressingPtr_;
48}
49
50
51template<class FromPatch, class ToPatch>
53PatchToPatchInterpolation<FromPatch, ToPatch>::pointWeights() const
54{
55 if (!pointWeightsPtr_)
56 {
57 calcPointAddressing();
58 }
59
60 return *pointWeightsPtr_;
61}
62
63
64template<class FromPatch, class ToPatch>
65const labelList&
66PatchToPatchInterpolation<FromPatch, ToPatch>::faceAddr() const
67{
68 if (!faceAddressingPtr_)
69 {
70 calcFaceAddressing();
71 }
72
73 return *faceAddressingPtr_;
74}
75
76
77template<class FromPatch, class ToPatch>
79PatchToPatchInterpolation<FromPatch, ToPatch>::faceWeights() const
80{
81 if (!faceWeightsPtr_)
82 {
83 calcFaceAddressing();
84 }
85
86 return *faceWeightsPtr_;
87}
88
89
90template<class FromPatch, class ToPatch>
91void PatchToPatchInterpolation<FromPatch, ToPatch>::clearOut()
92{
93 pointAddressingPtr_.reset(nullptr);
94 pointWeightsPtr_.reset(nullptr);
95 pointDistancePtr_.reset(nullptr);
96 faceAddressingPtr_.reset(nullptr);
97 faceWeightsPtr_.reset(nullptr);
98 faceDistancePtr_.reset(nullptr);
99}
100
101
102// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
103
104template<class FromPatch, class ToPatch>
105PatchToPatchInterpolation<FromPatch, ToPatch>::PatchToPatchInterpolation
106(
107 const FromPatch& fromPatch,
108 const ToPatch& toPatch,
111)
112:
113 fromPatch_(fromPatch),
114 toPatch_(toPatch),
115 alg_(alg),
116 dir_(dir)
117{}
118
119
120// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
121
122template<class FromPatch, class ToPatch>
124{
125 clearOut();
126}
128
129// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
130
131template<class FromPatch, class ToPatch>
132const scalarField&
133PatchToPatchInterpolation<FromPatch, ToPatch>
134::pointDistanceToIntersection() const
135{
136 if (!pointDistancePtr_)
137 {
138 calcPointAddressing();
139 }
140
141 return *pointDistancePtr_;
142}
143
144
145template<class FromPatch, class ToPatch>
146const scalarField&
149{
150 if (!faceDistancePtr_)
151 {
152 calcFaceAddressing();
154
155 return *faceDistancePtr_;
156}
157
158
159template<class FromPatch, class ToPatch>
161{
162 clearOut();
163
164 return true;
165}
166
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170} // End namespace Foam
171
172// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173
176
177// ************************************************************************* //
Patch to patch interpolation functions.
A field of fields is a PtrList of fields with reference counting.
Definition FieldField.H:77
Interpolation class dealing with transfer of data between two primitivePatches.
bool movePoints()
Correct weighting factors for moving mesh.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< scalar > scalarField
Specialisation of Field<T> for scalar.