initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / fields / pointPatchFields / derived / uniformFixedValue / uniformFixedValuePointPatchField.H
blob6e49e7ce811bcf947a8b33d41c26ccc48fd29891
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::uniformFixedValuePointPatchField
28 Description
29     Foam::uniformFixedValuePointPatchField
31 SourceFiles
32     uniformFixedValuePointPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef uniformFixedValuePointPatchField_H
37 #define uniformFixedValuePointPatchField_H
39 #include "fixedValuePointPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47           Class uniformFixedValuePointPatchField Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class uniformFixedValuePointPatchField
53     public fixedValuePointPatchField<Type>
55     // Private data
57         Type uniformValue_;
60 public:
62     //- Runtime type information
63     TypeName("uniformFixedValue");
66     // Constructors
68         //- Construct from patch and internal field
69         uniformFixedValuePointPatchField
70         (
71             const pointPatch&,
72             const DimensionedField<Type, pointMesh>&
73         );
75         //- Construct from patch, internal field and dictionary
76         uniformFixedValuePointPatchField
77         (
78             const pointPatch&,
79             const DimensionedField<Type, pointMesh>&,
80             const dictionary&
81         );
83         //- Construct by mapping given patchField<Type> onto a new patch
84         uniformFixedValuePointPatchField
85         (
86             const uniformFixedValuePointPatchField<Type>&,
87             const pointPatch&,
88             const DimensionedField<Type, pointMesh>&,
89             const pointPatchFieldMapper&
90         );
92         //- Construct as copy
93         uniformFixedValuePointPatchField
94         (
95             const uniformFixedValuePointPatchField<Type>&
96         );
98         //- Construct and return a clone
99         virtual autoPtr<pointPatchField<Type> > clone() const
100         {
101             return autoPtr<pointPatchField<Type> >
102             (
103                 new uniformFixedValuePointPatchField<Type>
104                 (
105                     *this
106                 )
107             );
108         }
110         //- Construct as copy setting internal field reference
111         uniformFixedValuePointPatchField
112         (
113             const uniformFixedValuePointPatchField<Type>&,
114             const DimensionedField<Type, pointMesh>&
115         );
118         //- Construct and return a clone setting internal field reference
119         virtual autoPtr<pointPatchField<Type> > clone
120         (
121             const DimensionedField<Type, pointMesh>& iF
122         ) const
123         {
124             return autoPtr<pointPatchField<Type> >
125             (
126                 new uniformFixedValuePointPatchField<Type>
127                 (
128                     *this,
129                     iF
130                 )
131             );
132         }
135     // Member functions
137         // Access
139             //- Return the fluctuation scale
140             const Type& uniformValue() const
141             {
142                 return uniformValue_;
143             }
145             //- Return reference to the fluctuation scale to allow adjustment
146             Type& uniformValue()
147             {
148                 return uniformValue_;
149             }
152         //- Write
153         virtual void write(Ostream&) const;
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 } // End namespace Foam
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 #ifdef NoRepository
164 #    include "uniformFixedValuePointPatchField.C"
165 #endif
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #endif
171 // ************************************************************************* //