fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / basic / coupled / coupledFvPatchField.H
blob6bb778d45a09e6e0bb494cfe52a6d6cdd86daf8c
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::coupledFvPatchField
28 Description
29     Foam::coupledFvPatchField
31 SourceFiles
32     coupledFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef coupledFvPatchField_H
37 #define coupledFvPatchField_H
39 #include "BlockLduInterfaceField.H"
40 #include "CoeffField.H"
41 #include "fvPatchField.H"
42 #include "coupledFvPatch.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                            Class coupledFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class Type>
54 class coupledFvPatchField
56     public BlockLduInterfaceField<Type>,
57     public fvPatchField<Type>
60 public:
62     //- Runtime type information
63     TypeName(coupledFvPatch::typeName_());
66     // Constructors
68         //- Construct from patch and internal field
69         coupledFvPatchField
70         (
71             const fvPatch&,
72             const DimensionedField<Type, volMesh>&
73         );
75         //- Construct from patch and internal field and patch field
76         coupledFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&,
80             const Field<Type>&
81         );
83         //- Construct from patch, internal field and dictionary
84         coupledFvPatchField
85         (
86             const fvPatch&,
87             const DimensionedField<Type, volMesh>&,
88             const dictionary&,
89             const bool valueRequired = false
90         );
92         //- Construct by mapping the given coupledFvPatchField onto a new patch
93         coupledFvPatchField
94         (
95             const coupledFvPatchField<Type>&,
96             const fvPatch&,
97             const DimensionedField<Type, volMesh>&,
98             const fvPatchFieldMapper&
99         );
101         //- Construct as copy
102         coupledFvPatchField
103         (
104             const coupledFvPatchField<Type>&
105         );
107         //- Construct and return a clone
108         virtual tmp<fvPatchField<Type> > clone() const = 0;
110         //- Construct as copy setting internal field reference
111         coupledFvPatchField
112         (
113             const coupledFvPatchField<Type>&,
114             const DimensionedField<Type, volMesh>&
115         );
117         //- Construct and return a clone
118         virtual tmp<fvPatchField<Type> > clone
119         (
120             const DimensionedField<Type, volMesh>&
121         ) const = 0;
124     // Member functions
126         // Access
128             //- Return true if this patch field is derived from
129             //  coupledFvPatchField<Type>.
130             virtual bool coupled() const
131             {
132                 return true;
133             }
135             //- Return neighbour field of internal field
136             virtual tmp<Field<Type> > patchNeighbourField() const = 0;
139         // Evaluation functions
141             //- Return patch-normal gradient
142             virtual tmp<Field<Type> > snGrad() const;
144             //- Initialise the evaluation of the patch field
145             virtual void initEvaluate
146             (
147                 const Pstream::commsTypes commsType
148             );
150             //- Evaluate the patch field
151             virtual void evaluate
152             (
153                 const Pstream::commsTypes commsType
154             );
156             //- Return the matrix diagonal coefficients corresponding to the
157             //  evaluation of the value of this patchField with given weights
158             virtual tmp<Field<Type> > valueInternalCoeffs
159             (
160                 const tmp<scalarField>&
161             ) const;
163             //- Return the matrix source coefficients corresponding to the
164             //  evaluation of the value of this patchField with given weights
165             virtual tmp<Field<Type> > valueBoundaryCoeffs
166             (
167                 const tmp<scalarField>&
168             ) const;
170             //- Return the matrix diagonal coefficients corresponding to the
171             //  evaluation of the gradient of this patchField
172             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
174             //- Return the matrix source coefficients corresponding to the
175             //  evaluation of the gradient of this patchField
176             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
179         // Coupled interface functionality
181             //- Update result field based on interface functionality
182             virtual void updateInterfaceMatrix
183             (
184                 const scalarField& psiInternal,
185                 scalarField& result,
186                 const lduMatrix&,
187                 const scalarField& coeffs,
188                 const direction,
189                 const Pstream::commsTypes commsType
190             ) const = 0;
192         // Block coupled interface functionality
194             //- Initialise neighbour matrix update
195             virtual void initInterfaceMatrixUpdate
196             (
197                 const Field<Type>&,
198                 Field<Type>&,
199                 const BlockLduMatrix<Type>&,
200                 const CoeffField<Type>&,
201                 const Pstream::commsTypes commsType
202             ) const
203             {}
205             //- Update result field based on interface functionality
206             virtual void updateInterfaceMatrix
207             (
208                 const Field<Type>&,
209                 Field<Type>&,
210                 const BlockLduMatrix<Type>&,
211                 const CoeffField<Type>&,
212                 const Pstream::commsTypes commsType
213             ) const
214             {
215                 notImplemented("coupledFvPatchField<Type>::updateInterfaceMatrix for block matrices")
216             }
217             
218         //- Write
219         virtual void write(Ostream&) const;
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 } // End namespace Foam
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 #ifdef NoRepository
230 #   include "coupledFvPatchField.C"
231 #endif
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 #endif
237 // ************************************************************************* //