fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / finiteArea / fields / faPatchFields / basic / calculated / calculatedFaPatchField.H
blob7e5141f45ef7db0dd8c71762c2b05e037efa50a3
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     calculatedFaPatchField
28 Description
30 SourceFiles
31     calculatedFaPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef calculatedFaPatchField_H
36 #define calculatedFaPatchField_H
38 #include "faPatchField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                       Class calculatedFaPatch Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class calculatedFaPatchField
52     public faPatchField<Type>
55 public:
57     //- Runtime type information
58     TypeName("calculated");
61     // Constructors
63         //- Construct from patch and internal field
64         calculatedFaPatchField
65         (
66             const faPatch&,
67             const DimensionedField<Type, areaMesh>&
68         );
70         //- Construct from patch, internal field and dictionary
71         calculatedFaPatchField
72         (
73             const faPatch&,
74             const DimensionedField<Type, areaMesh>&,
75             const dictionary&
76         );
78         //- Construct by mapping given patchField<Type> onto a new patch
79         calculatedFaPatchField
80         (
81             const calculatedFaPatchField<Type>&,
82             const faPatch&,
83             const DimensionedField<Type, areaMesh>&,
84             const faPatchFieldMapper&
85         );
87         //- Construct as copy
88         calculatedFaPatchField
89         (
90             const calculatedFaPatchField<Type>&
91         );
93         //- Construct and return a clone
94         virtual tmp<faPatchField<Type> > clone() const
95         {
96             return tmp<faPatchField<Type> >
97             (
98                 new calculatedFaPatchField<Type>(*this)
99             );
100         }
102         //- Construct as copy setting internal field reference
103         calculatedFaPatchField
104         (
105             const calculatedFaPatchField<Type>&,
106             const DimensionedField<Type, areaMesh>&
107         );
109         //- Construct and return a clone setting internal field reference
110         virtual tmp<faPatchField<Type> > clone
111         (
112             const DimensionedField<Type, areaMesh>& iF
113         ) const
114         {
115             return tmp<faPatchField<Type> >
116             (
117                 new calculatedFaPatchField<Type>(*this, iF)
118             );
119         }
122     // Member functions
124         // Access
126             //- Return true if this patch field fixes a value.
127             //  Needed to check if a level has to be specified while solving
128             //  Poissons equations.
129             virtual bool fixesValue() const
130             {
131                 return true;
132             }
135         // Evaluation functions
137             //- Return the matrix diagonal coefficients corresponding to the
138             //  evaluation of the value of this patchField with given weights
139             virtual tmp<Field<Type> > valueInternalCoeffs
140             (
141                 const tmp<scalarField>&
142             ) const;
144             //- Return the matrix source coefficients corresponding to the
145             //  evaluation of the value of this patchField with given weights
146             virtual tmp<Field<Type> > valueBoundaryCoeffs
147             (
148                 const tmp<scalarField>&
149             ) const;
151             //- Return the matrix diagonal coefficients corresponding to the
152             //  evaluation of the gradient of this patchField
153             tmp<Field<Type> > gradientInternalCoeffs() const;
155             //- Return the matrix source coefficients corresponding to the
156             //  evaluation of the gradient of this patchField
157             tmp<Field<Type> > gradientBoundaryCoeffs() const;
160         //- Write
161         virtual void write(Ostream&) const;
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #ifdef NoRepository
172 #   include "calculatedFaPatchField.C"
173 #endif
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
179 // ************************************************************************* //