1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 pointVolInterpolation.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef pointVolInterpolation_H
37 #define pointVolInterpolation_H
39 #include "primitiveFieldsFwd.H"
40 #include "primitivePatchInterpolation.H"
41 #include "volFieldsFwd.H"
42 #include "pointFieldsFwd.H"
43 #include "scalarList.H"
45 #include "className.H"
46 #include "FieldFields.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 /*---------------------------------------------------------------------------*\
57 Class pointVolInterpolation Declaration
58 \*---------------------------------------------------------------------------*/
60 class pointVolInterpolation
64 const pointMesh& pointMesh_;
65 const fvMesh& fvMesh_;
67 //- Interpolation scheme weighting factor array.
68 mutable FieldField<Field, scalar>* volWeightsPtr_;
70 //- Primitive patch interpolators
71 mutable PtrList<primitivePatchInterpolation>* patchInterpolatorsPtr_;
74 // Private member functions
76 //- Return patch interpolators
77 const PtrList<primitivePatchInterpolation>& patchInterpolators() const;
79 //- Construct point weighting factors
80 void makeWeights() const;
83 void clearAddressing() const;
86 void clearGeom() const;
91 const pointMesh& pMesh() const
96 const fvMesh& vMesh() const
104 // Declare name of the class and it's debug switch
105 ClassName("pointVolInterpolation");
110 //- Constructor given pointMesh and fvMesh.
111 pointVolInterpolation(const pointMesh&, const fvMesh&);
116 ~pointVolInterpolation();
123 //- Return reference to weights arrays.
124 // This also constructs the weighting factors if neccessary.
125 const FieldField<Field, scalar>& volWeights() const;
130 //- Update mesh topology using the morph engine
131 void updateTopology();
133 //- Correct weighting factors for moving mesh.
137 // Interpolation functions
139 //- Interpolate from pointField to volField
140 // using inverse distance weighting
144 const GeometricField<Type, pointPatchField, pointMesh>&,
145 GeometricField<Type, fvPatchField, volMesh>&
148 //- Interpolate pointField returning volField
149 // using inverse distance weighting
151 tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
153 const GeometricField<Type, pointPatchField, pointMesh>&
156 //- Interpolate tmp<pointField> returning volField
157 // using inverse distance weighting
159 tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
161 const tmp<GeometricField<Type, pointPatchField, pointMesh> >&
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 # include "pointVolInterpolate.C"
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 // ************************************************************************* //