ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / OpenFOAM / interpolations / primitivePatchInterpolation / PrimitivePatchInterpolation.H
blobee61e2e42ee8603ae01eab464a20654cabc8ecf0
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.
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.
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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::PrimitivePatchInterpolation
27 Description
28     Interpolation class within a primitive patch. Allows interpolation from
29     points to faces and vice versa
31 SourceFiles
32     PrimitivePatchInterpolation.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef PrimitivePatchInterpolation_H
37 #define PrimitivePatchInterpolation_H
39 #include "scalarList.H"
40 #include "Field.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                   Class PrimitivePatchInterpolation Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class Patch>
52 class PrimitivePatchInterpolation
54     // Private data
56         //- Reference to patch
57         const Patch& patch_;
60     // Demand-driven data
62         //- Face-to-point weights
63         mutable scalarListList* faceToPointWeightsPtr_;
65         //- Face-to-edge weights
66         mutable scalarList* faceToEdgeWeightsPtr_;
69     // Private Member Functions
71         //- Disallow default bitwise copy construct
72         PrimitivePatchInterpolation(const PrimitivePatchInterpolation&);
74         //- Disallow default bitwise assignment
75         void operator=(const PrimitivePatchInterpolation&);
78         //- Face-to-point weights
79         const scalarListList& faceToPointWeights() const;
81         //- Make face-to-point weights
82         void makeFaceToPointWeights() const;
84         //- Face-to-edge weights
85         const scalarList& faceToEdgeWeights() const;
87         //- Make face-to-edge weights
88         void makeFaceToEdgeWeights() const;
90         //- Clear weights
91         void clearWeights();
94 public:
96     // Constructors
98         //- Construct from PrimitivePatch
99         PrimitivePatchInterpolation(const Patch& p);
102     //- Destructor
103     ~PrimitivePatchInterpolation();
106     // Member Functions
108         //- Interpolate from faces to points
109         template<class Type>
110         tmp<Field<Type> > faceToPointInterpolate
111         (
112             const Field<Type>& ff
113         ) const;
115         template<class Type>
116         tmp<Field<Type> > faceToPointInterpolate
117         (
118             const tmp<Field<Type> >& tff
119         ) const;
121         //- Interpolate from points to faces
122         template<class Type>
123         tmp<Field<Type> > pointToFaceInterpolate
124         (
125             const Field<Type>& pf
126         ) const;
128         template<class Type>
129         tmp<Field<Type> > pointToFaceInterpolate
130         (
131             const tmp<Field<Type> >& tpf
132         ) const;
134         //- Interpolate from faces to edges
135         template<class Type>
136         tmp<Field<Type> > faceToEdgeInterpolate
137         (
138             const Field<Type>& ff
139         ) const;
141         template<class Type>
142         tmp<Field<Type> > faceToEdgeInterpolate
143         (
144             const tmp<Field<Type> >& tff
145         ) const;
147         //- Do what is neccessary if the mesh has moved
148         bool movePoints();
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 #ifdef NoRepository
159 #   include "PrimitivePatchInterpolation.C"
160 #endif
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #endif
166 // ************************************************************************* //