PrimitivePatchInterpolation.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 -------------------------------------------------------------------------------
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 Class
27  Foam::PrimitivePatchInterpolation
28 
29 Description
30  Interpolation class within a primitive patch. Allows interpolation from
31  points to faces and vice versa
32 
33 SourceFiles
34  PrimitivePatchInterpolation.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef PrimitivePatchInterpolation_H
39 #define PrimitivePatchInterpolation_H
40 
41 #include "scalarList.H"
42 #include "Field.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class PrimitivePatchInterpolation Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Patch>
55 {
56  // Private data
57 
58  //- Reference to patch
59  const Patch& patch_;
60 
61 
62  // Demand-driven data
63 
64  //- Face-to-point weights
65  mutable scalarListList* faceToPointWeightsPtr_;
66 
67  //- Face-to-edge weights
68  mutable scalarList* faceToEdgeWeightsPtr_;
69 
70 
71  // Private Member Functions
72 
73  //- No copy construct
75  (
77  ) = delete;
78 
79  //- No copy assignment
80  void operator=(const PrimitivePatchInterpolation&) = delete;
81 
82 
83  //- Face-to-point weights
84  const scalarListList& faceToPointWeights() const;
85 
86  //- Make face-to-point weights
87  void makeFaceToPointWeights() const;
88 
89  //- Face-to-edge weights
90  const scalarList& faceToEdgeWeights() const;
91 
92  //- Make face-to-edge weights
93  void makeFaceToEdgeWeights() const;
94 
95  //- Clear weights
96  void clearWeights();
97 
98 
99 public:
100 
101  // Constructors
102 
103  //- Construct from PrimitivePatch
104  PrimitivePatchInterpolation(const Patch& p);
105 
106 
107  //- Destructor
109 
110 
111  // Member Functions
112 
113  //- Interpolate from faces to points
114  template<class Type>
116  (
117  const Field<Type>& ff
118  ) const;
119 
120  template<class Type>
122  (
123  const tmp<Field<Type>>& tff
124  ) const;
125 
126  //- Interpolate from points to faces
127  template<class Type>
129  (
130  const Field<Type>& pf
131  ) const;
132 
133  template<class Type>
135  (
136  const tmp<Field<Type>>& tpf
137  ) const;
138 
139  //- Interpolate from faces to edges
140  template<class Type>
142  (
143  const Field<Type>& ff
144  ) const;
145 
146  template<class Type>
148  (
149  const tmp<Field<Type>>& tff
150  ) const;
151 
152  //- Do what is necessary if the mesh has moved
153  bool movePoints();
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::PrimitivePatchInterpolation::pointToFaceInterpolate
tmp< Field< Type > > pointToFaceInterpolate(const Field< Type > &pf) const
Interpolate from points to faces.
Definition: PrimitivePatchInterpolation.C:234
Foam::PrimitivePatchInterpolation::movePoints
bool movePoints()
Do what is necessary if the mesh has moved.
Definition: PrimitivePatchInterpolation.C:342
scalarList.H
Foam::Field
Generic templated field type.
Definition: Field.H:63
Field.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PrimitivePatchInterpolation::faceToPointInterpolate
tmp< Field< Type > > faceToPointInterpolate(const Field< Type > &ff) const
Interpolate from faces to points.
Definition: PrimitivePatchInterpolation.C:177
Foam::PrimitivePatchInterpolation::~PrimitivePatchInterpolation
~PrimitivePatchInterpolation()
Destructor.
Definition: PrimitivePatchInterpolation.C:166
Foam::fv::ff
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)
Definition: CrankNicolsonDdtScheme.C:275
Foam::PrimitivePatchInterpolation
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
Definition: PrimitivePatchInterpolation.H:53
PrimitivePatchInterpolation.C
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::PrimitivePatchInterpolation::faceToEdgeInterpolate
tmp< Field< Type > > faceToEdgeInterpolate(const Field< Type > &ff) const
Interpolate from faces to edges.
Definition: PrimitivePatchInterpolation.C:291