cyclicAMIPolyPatchTemplates.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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
27 
28 template<class Type>
30 (
31  const Field<Type>& fld,
32  const UList<Type>& defaultValues
33 ) const
34 {
35  if (owner())
36  {
37  return AMI().interpolateToSource(fld, defaultValues);
38  }
39  else
40  {
41  return neighbPatch().AMI().interpolateToTarget(fld, defaultValues);
42  }
43 }
44 
45 
46 template<class Type>
48 (
49  const tmp<Field<Type>>& tFld,
50  const UList<Type>& defaultValues
51 ) const
52 {
53  return interpolate(tFld(), defaultValues);
54 }
55 
56 
57 template<class Type, class CombineOp>
59 (
60  const UList<Type>& fld,
61  const CombineOp& cop,
62  List<Type>& result,
63  const UList<Type>& defaultValues
64 ) const
65 {
66  if (owner())
67  {
68  AMI().interpolateToSource
69  (
70  fld,
71  cop,
72  result,
73  defaultValues
74  );
75  }
76  else
77  {
78  neighbPatch().AMI().interpolateToTarget
79  (
80  fld,
81  cop,
82  result,
83  defaultValues
84  );
85  }
86 }
87 
88 
89 // ************************************************************************* //
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Pre-declare SubField and related Field type.
Definition: Field.H:57
tmp< Field< Type > > interpolate(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >()) const
Interpolate field.
A class for managing temporary objects.
Definition: PtrList.H:54