initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / interpolations / primitivePatchInterpolation / PrimitivePatchInterpolation.H
blob4a463203391e04f064af7c31d344db92768ef29d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::PrimitivePatchInterpolation
28 Description
29     Interpolation class within a primitive patch. Allows interpolation from
30     points to faces and vice versa
32 SourceFiles
33     PrimitivePatchInterpolation.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef PrimitivePatchInterpolation_H
38 #define PrimitivePatchInterpolation_H
40 #include "scalarList.H"
41 #include "Field.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                   Class PrimitivePatchInterpolation Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class Patch>
53 class PrimitivePatchInterpolation
55     // Private data
57         //- Reference to patch
58         const Patch& patch_;
61     // Demand-driven data
63         //- Face-to-point weights
64         mutable scalarListList* faceToPointWeightsPtr_;
66         //- Face-to-edge weights
67         mutable scalarList* faceToEdgeWeightsPtr_;
70     // Private Member Functions
72         //- Disallow default bitwise copy construct
73         PrimitivePatchInterpolation(const PrimitivePatchInterpolation&);
75         //- Disallow default bitwise assignment
76         void operator=(const PrimitivePatchInterpolation&);
79         //- Face-to-point weights
80         const scalarListList& faceToPointWeights() const;
82         //- Make face-to-point weights
83         void makeFaceToPointWeights() const;
85         //- Face-to-edge weights
86         const scalarList& faceToEdgeWeights() const;
88         //- Make face-to-edge weights
89         void makeFaceToEdgeWeights() const;
91         //- Clear weights
92         void clearWeights();
95 public:
97     // Constructors
99         //- Construct from PrimitivePatch
100         PrimitivePatchInterpolation(const Patch& p);
103     // Destructor
105         ~PrimitivePatchInterpolation();
108     // Member Functions
110         //- Interpolate from faces to points
111         template<class Type>
112         tmp<Field<Type> > faceToPointInterpolate
113         (
114             const Field<Type>& ff
115         ) const;
117         template<class Type>
118         tmp<Field<Type> > faceToPointInterpolate
119         (
120             const tmp<Field<Type> >& tff
121         ) const;
123         //- Interpolate from points to faces
124         template<class Type>
125         tmp<Field<Type> > pointToFaceInterpolate
126         (
127             const Field<Type>& pf
128         ) const;
130         template<class Type>
131         tmp<Field<Type> > pointToFaceInterpolate
132         (
133             const tmp<Field<Type> >& tpf
134         ) const;
136         //- Interpolate from faces to edges
137         template<class Type>
138         tmp<Field<Type> > faceToEdgeInterpolate
139         (
140             const Field<Type>& ff
141         ) const;
143         template<class Type>
144         tmp<Field<Type> > faceToEdgeInterpolate
145         (
146             const tmp<Field<Type> >& tff
147         ) const;
149         //- Do what is neccessary if the mesh has moved
150         bool movePoints();
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 } // End namespace Foam
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 #ifdef NoRepository
161 #   include "PrimitivePatchInterpolation.C"
162 #endif
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #endif
168 // ************************************************************************* //