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 | Copyright (C) 2011 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  //- Disallow default bitwise copy construct
73 
74  //- Disallow default bitwise assignment
75  void operator=(const PrimitivePatchInterpolation&);
76 
77 
78  //- Face-to-point weights
79  const scalarListList& faceToPointWeights() const;
80 
81  //- Make face-to-point weights
82  void makeFaceToPointWeights() const;
83 
84  //- Face-to-edge weights
85  const scalarList& faceToEdgeWeights() const;
86 
87  //- Make face-to-edge weights
88  void makeFaceToEdgeWeights() const;
89 
90  //- Clear weights
91  void clearWeights();
92 
93 
94 public:
95 
96  // Constructors
97 
98  //- Construct from PrimitivePatch
99  PrimitivePatchInterpolation(const Patch& p);
100 
101 
102  //- Destructor
104 
105 
106  // Member Functions
107 
108  //- Interpolate from faces to points
109  template<class Type>
111  (
112  const Field<Type>& ff
113  ) const;
114 
115  template<class Type>
117  (
118  const tmp<Field<Type> >& tff
119  ) const;
120 
121  //- Interpolate from points to faces
122  template<class Type>
124  (
125  const Field<Type>& pf
126  ) const;
127 
128  template<class Type>
130  (
131  const tmp<Field<Type> >& tpf
132  ) const;
133 
134  //- Interpolate from faces to edges
135  template<class Type>
137  (
138  const Field<Type>& ff
139  ) const;
140 
141  template<class Type>
143  (
144  const tmp<Field<Type> >& tff
145  ) const;
146 
147  //- Do what is neccessary if the mesh has moved
148  bool movePoints();
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #ifdef NoRepository
160 #endif
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
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.
Namespace for OpenFOAM.
volScalarField & p
Definition: createFields.H:51
tmp< Field< Type > > faceToPointInterpolate(const Field< Type > &ff) const
Interpolate from faces to points.
Pre-declare SubField and related Field type.
Definition: Field.H:57
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)
tmp< Field< Type > > pointToFaceInterpolate(const Field< Type > &pf) const
Interpolate from points to faces.
bool movePoints()
Do what is neccessary if the mesh has moved.
A class for managing temporary objects.
Definition: PtrList.H:118