initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / uniformFixedValue / uniformFixedValueFvPatchField.H
blob37150fa1f959aeda6aa9b7d5993fc58ae1921fe5
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::uniformFixedValueFvPatchField
28 Description
29     Foam::uniformFixedValueFvPatchField
31 SourceFiles
32     uniformFixedValueFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef uniformFixedValueFvPatchField_H
37 #define uniformFixedValueFvPatchField_H
39 #include "Random.H"
40 #include "fixedValueFvPatchFields.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                      Class uniformFixedValueFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class Type>
52 class uniformFixedValueFvPatchField
54     public fixedValueFvPatchField<Type>
56     // Private data
58         Type uniformValue_;
61 public:
63     //- Runtime type information
64     TypeName("uniformFixedValue");
67     // Constructors
69         //- Construct from patch and internal field
70         uniformFixedValueFvPatchField
71         (
72             const fvPatch&,
73             const DimensionedField<Type, volMesh>&
74         );
76         //- Construct from patch, internal field and dictionary
77         uniformFixedValueFvPatchField
78         (
79             const fvPatch&,
80             const DimensionedField<Type, volMesh>&,
81             const dictionary&
82         );
84         //- Construct by mapping given uniformFixedValueFvPatchField
85         //  onto a new patch
86         uniformFixedValueFvPatchField
87         (
88             const uniformFixedValueFvPatchField<Type>&,
89             const fvPatch&,
90             const DimensionedField<Type, volMesh>&,
91             const fvPatchFieldMapper&
92         );
94         //- Construct as copy
95         uniformFixedValueFvPatchField
96         (
97             const uniformFixedValueFvPatchField<Type>&
98         );
100         //- Construct and return a clone
101         virtual tmp<fvPatchField<Type> > clone() const
102         {
103             return tmp<fvPatchField<Type> >
104             (
105                 new uniformFixedValueFvPatchField<Type>(*this)
106             );
107         }
109         //- Construct as copy setting internal field reference
110         uniformFixedValueFvPatchField
111         (
112             const uniformFixedValueFvPatchField<Type>&,
113             const DimensionedField<Type, volMesh>&
114         );
116         //- Construct and return a clone setting internal field reference
117         virtual tmp<fvPatchField<Type> > clone
118         (
119             const DimensionedField<Type, volMesh>& iF
120         ) const
121         {
122             return tmp<fvPatchField<Type> >
123             (
124                 new uniformFixedValueFvPatchField<Type>(*this, iF)
125             );
126         }
129     // Member functions
131         // Access
133             //- Return the fluctuation scale
134             const Type& uniformValue() const
135             {
136                 return uniformValue_;
137             }
139             //- Return reference to the fluctuation scale to allow adjustment
140             Type& uniformValue()
141             {
142                 return uniformValue_;
143             }
146         // Mapping functions
148             //- Map (and resize as needed) from self given a mapping object
149             virtual void autoMap
150             (
151                 const fvPatchFieldMapper&
152             );
155         //- Write
156         virtual void write(Ostream&) const;
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #ifdef NoRepository
167 #   include "uniformFixedValueFvPatchField.C"
168 #endif
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 #endif
174 // ************************************************************************* //