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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 template<class Type>
32 (
33  const Field<Type>& fld,
34  const UList<Type>& defaultValues
35 ) const
36 {
37  if (owner())
38  {
39  return AMI().interpolateToSource(fld, defaultValues);
40  }
41  else
42  {
43  return neighbPatch().AMI().interpolateToTarget(fld, defaultValues);
44  }
45 }
46 
47 
48 template<class Type>
50 (
51  const tmp<Field<Type>>& tFld,
52  const UList<Type>& defaultValues
53 ) const
54 {
55  return interpolate(tFld(), defaultValues);
56 }
57 
58 
59 template<class Type, class CombineOp>
61 (
62  const UList<Type>& fld,
63  const CombineOp& cop,
64  List<Type>& result,
65  const UList<Type>& defaultValues
66 ) const
67 {
68  if (owner())
69  {
70  AMI().interpolateToSource
71  (
72  fld,
73  cop,
74  result,
75  defaultValues
76  );
77  }
78  else
79  {
80  neighbPatch().AMI().interpolateToTarget
81  (
82  fld,
83  cop,
84  result,
85  defaultValues
86  );
87  }
88 }
89 
90 
91 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Field
Generic templated field type.
Definition: Field.H:63
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
Foam::cyclicAMIPolyPatch::interpolate
tmp< Field< Type > > interpolate(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >()) const
Interpolate field.
Foam::List< Type >
Foam::UList< Type >
Foam::fac::interpolate
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.