fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / derived / fixedMeanValue / fixedMeanValueFvPatchField.H
blob2f9cb5eb029e0ff8456344e8e0daea2de6313c3b
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     fixedMeanValueFvPatchField
28 Description
30 SourceFiles
31     fixedMeanValueFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef fixedMeanValueFvPatchField_H
36 #define fixedMeanValueFvPatchField_H
38 #include "fixedValueFvPatchFields.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                Class fixedMeanValueFvPatchField Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class fixedMeanValueFvPatchField
52     public fixedValueFvPatchField<Type>
54     // Private data
56         //- Mean value
57         Type meanValue_;
59         //- Current time index
60         label curTimeIndex_;
63 public:
65     //- Runtime type information
66     TypeName("fixedMeanValue");
69     // Constructors
71         //- Construct from patch and internal field
72         fixedMeanValueFvPatchField
73         (
74             const fvPatch&,
75             const DimensionedField<Type, volMesh>&
76         );
78         //- Construct from patch, internal field and dictionary
79         fixedMeanValueFvPatchField
80         (
81             const fvPatch&,
82             const DimensionedField<Type, volMesh>&,
83             const dictionary&
84         );
86         //- Construct by mapping given fixedMeanValueFvPatchField
87         //  onto a new patch
88         fixedMeanValueFvPatchField
89         (
90             const fixedMeanValueFvPatchField<Type>&,
91             const fvPatch&,
92             const DimensionedField<Type, volMesh>&,
93             const fvPatchFieldMapper&
94         );
96         //- Construct and return a clone
97         virtual tmp<fvPatchField<Type> > clone() const
98         {
99             return tmp<fvPatchField<Type> >
100             (
101                 new fixedMeanValueFvPatchField<Type>(*this)
102             );
103         }
105         //- Construct as copy setting internal field reference
106         fixedMeanValueFvPatchField
107         (
108             const fixedMeanValueFvPatchField<Type>&,
109             const DimensionedField<Type, volMesh>&
110         );
112         //- Construct and return a clone setting internal field reference
113         virtual tmp<fvPatchField<Type> > clone
114         (
115             const DimensionedField<Type, volMesh>& iF
116         ) const
117         {
118             return tmp<fvPatchField<Type> >
119             (
120                 new fixedMeanValueFvPatchField<Type>(*this, iF)
121             );
122         }
125     // Member functions
127         // Access
129             //- Return the ref value
130             const Type& meanValue() const
131             {
132                 return meanValue_;
133             }
135             //- Return reference to the ref value to allow adjustment
136             Type& meanValue()
137             {
138                 return meanValue_;
139             }
142         // Mapping functions
144             //- Map (and resize as needed) from self given a mapping object
145             virtual void autoMap
146             (
147                 const fvPatchFieldMapper&
148             );
150             //- Reverse map the given fvPatchField onto this fvPatchField
151             virtual void rmap
152             (
153                 const fvPatchField<Type>&,
154                 const labelList&
155             );
158         // Evaluation functions
160             //- Update the coefficients associated with the patch field
161             virtual void updateCoeffs();
164         //- Write
165         virtual void write(Ostream&) const;
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #ifdef NoRepository
176 #   include "fixedMeanValueFvPatchField.C"
177 #endif
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 #endif
183 // ************************************************************************* //