Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / finiteVolume / interpolation / surfaceInterpolation / schemes / weighted / weighted.H
blobcf518a94c881378e42e0eecc79879018cb6ac571
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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::weighted
28 Description
29     Interpolation scheme class using weights looked-up from the objectRegistry.
31 SourceFiles
32     weighted.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef weighted_H
37 #define weighted_H
39 #include "surfaceInterpolationScheme.H"
40 #include "volFields.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                            Class weighted Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class Type>
52 class weighted
54     public surfaceInterpolationScheme<Type>
56     // Private member data
58         const surfaceScalarField& weights_;
61     // Private Member Functions
63         //- Disallow default bitwise assignment
64         void operator=(const weighted&);
67 public:
69     //- Runtime type information
70     TypeName("weighted");
73     // Constructors
75         //- Construct from weights
76         weighted(const surfaceScalarField& weights)
77         :
78             surfaceInterpolationScheme<Type>(weights.mesh()),
79             weights_(weights)
80         {}
82         //- Construct from Istream
83         weighted(const fvMesh& mesh, Istream& is)
84         :
85             surfaceInterpolationScheme<Type>(mesh),
86             weights_
87             (
88                 this->mesh().objectRegistry::
89                 lookupObject<const surfaceScalarField>(word(is))
90             )
91         {}
93         //- Construct from faceFlux and Istream
94         weighted
95         (
96             const fvMesh& mesh,
97             const surfaceScalarField&,
98             Istream& is
99         )
100         :
101             surfaceInterpolationScheme<Type>(mesh),
102             weights_
103             (
104                 this->mesh().objectRegistry::
105                 lookupObject<const surfaceScalarField>
106                 (
107                     word(is)
108                 )
109             )
110         {}
113     // Member Functions
115         //- Return the interpolation weighting factors
116         tmp<surfaceScalarField> weights
117         (
118             const GeometricField<Type, fvPatchField, volMesh>&
119         ) const
120         {
121             return weights_;
122         }
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace Foam
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 #endif
134 // ************************************************************************* //