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 "faceList.H"
43 #include "Field.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward Declarations
51 template<class Patch> class PrimitivePatchInterpolation;
52 
53 /*---------------------------------------------------------------------------*\
54  Class PrimitivePatchInterpolation Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class Patch>
59 {
60  // Private data
61 
62  //- Reference to patch
63  const Patch& patch_;
64 
65 
66  // Demand-driven data
67 
68  //- Face-to-point weights
69  mutable std::unique_ptr<scalarListList> faceToPointWeightsPtr_;
70 
71  //- Face-to-edge weights
72  mutable std::unique_ptr<scalarList> faceToEdgeWeightsPtr_;
73 
74 
75  // Private Member Functions
76 
77  //- No copy construct
79  (
81  ) = delete;
82 
83  //- No copy assignment
84  void operator=(const PrimitivePatchInterpolation&) = delete;
85 
86 
87  //- Face-to-point weights
88  const scalarListList& faceToPointWeights() const;
89 
90  //- Make face-to-point weights
91  void makeFaceToPointWeights() const;
92 
93  //- Face-to-edge weights
94  const scalarList& faceToEdgeWeights() const;
95 
96  //- Make face-to-edge weights
97  void makeFaceToEdgeWeights() const;
98 
99  //- Clear weights
100  void clearWeights();
101 
102 
103 public:
104 
105  // Constructors
106 
107  //- Construct from PrimitivePatch
108  PrimitivePatchInterpolation(const Patch& p);
109 
110 
111  //- Destructor
112  ~PrimitivePatchInterpolation() = default;
113 
114 
115  // Member Functions
116 
117  //- Interpolate from faces to points
118  template<class Type>
120  (
121  const Field<Type>& ff
122  ) const;
123 
124  template<class Type>
126  (
127  const tmp<Field<Type>>& tff
128  ) const;
129 
130  //- Interpolate from points to faces
131  template<class Type>
133  (
134  const Field<Type>& pf
135  ) const;
136 
137  template<class Type>
139  (
140  const tmp<Field<Type>>& tpf
141  ) const;
142 
143  //- Interpolate from faces to edges
144  template<class Type>
146  (
147  const Field<Type>& ff
148  ) const;
149 
150  template<class Type>
152  (
153  const tmp<Field<Type>>& tff
154  ) const;
155 
156  //- Do what is necessary if the mesh has moved
157  bool movePoints();
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #ifdef NoRepository
169 #endif
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
tmp< Field< Type > > pointToFaceInterpolate(const Field< Type > &pf) const
Interpolate from points to faces.
tmp< Field< Type > > faceToEdgeInterpolate(const Field< Type > &ff) const
Interpolate from faces to edges.
Generic templated field type.
Definition: Field.H:62
bool movePoints()
Do what is necessary if the mesh has moved.
tmp< Field< Type > > faceToPointInterpolate(const Field< Type > &ff) const
Interpolate from faces to points.
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
~PrimitivePatchInterpolation()=default
Destructor.
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)
Namespace for OpenFOAM.