PrimitivePatchInterpolation.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 Class
25  Foam::PrimitivePatchInterpolation
26 
27 Description
28  Interpolation class within a primitive patch. Allows interpolation from
29  points to faces and vice versa
30 
31 SourceFiles
32  PrimitivePatchInterpolation.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef PrimitivePatchInterpolation_H
37 #define PrimitivePatchInterpolation_H
38 
39 #include "scalarList.H"
40 #include "Field.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class PrimitivePatchInterpolation Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Patch>
53 {
54  // Private Data
55 
56  //- Reference to patch
57  const Patch& patch_;
58 
59 
60  // Demand-driven data
61 
62  //- Face-to-point weights
63  mutable scalarListList* faceToPointWeightsPtr_;
64 
65  //- Face-to-edge weights
66  mutable scalarList* faceToEdgeWeightsPtr_;
67 
68 
69  // Private Member Functions
70 
71  //- Face-to-point weights
72  const scalarListList& faceToPointWeights() const;
73 
74  //- Make face-to-point weights
75  void makeFaceToPointWeights() const;
76 
77  //- Face-to-edge weights
78  const scalarList& faceToEdgeWeights() const;
79 
80  //- Make face-to-edge weights
81  void makeFaceToEdgeWeights() const;
82 
83  //- Clear weights
84  void clearWeights();
85 
86 
87 public:
88 
89  // Constructors
90 
91  //- Construct from PrimitivePatch
92  PrimitivePatchInterpolation(const Patch& p);
93 
94  //- Disallow default bitwise copy construction
96  (
98  ) = delete;
99 
100 
101  //- Destructor
103 
104 
105  // Member Functions
106 
107  //- Interpolate from faces to points
108  template<class Type>
110  (
111  const Field<Type>& ff
112  ) const;
113 
114  template<class Type>
116  (
117  const tmp<Field<Type>>& tff
118  ) const;
119 
120  //- Interpolate from points to faces
121  template<class Type>
123  (
124  const Field<Type>& pf
125  ) const;
126 
127  template<class Type>
129  (
130  const tmp<Field<Type>>& tpf
131  ) const;
132 
133  //- Interpolate from faces to edges
134  template<class Type>
136  (
137  const Field<Type>& ff
138  ) const;
139 
140  template<class Type>
142  (
143  const tmp<Field<Type>>& tff
144  ) const;
145 
146  //- Do what is necessary if the mesh has moved
147  bool movePoints();
148 
149 
150  // Member Operators
151 
152  //- Disallow default bitwise assignment
153  void operator=(const PrimitivePatchInterpolation&) = delete;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
tmp< Field< Type > > faceToEdgeInterpolate(const Field< Type > &ff) const
Interpolate from faces to edges.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
void operator=(const PrimitivePatchInterpolation &)=delete
Disallow default bitwise assignment.
tmp< Field< Type > > pointToFaceInterpolate(const Field< Type > &pf) const
Interpolate from points to faces.
PrimitivePatchInterpolation(const Patch &p)
Construct from PrimitivePatch.
Pre-declare SubField and related Field type.
Definition: Field.H:56
bool movePoints()
Do what is necessary if the mesh has moved.
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)
Namespace for OpenFOAM.
tmp< Field< Type > > faceToPointInterpolate(const Field< Type > &ff) const
Interpolate from faces to points.