Fix tutorials: coupled/conjugateHeatFoam/conjugateCavity: fix Allrun file
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / basic / coupled / coupledFvPatchField.H
blob8af5cec2c7c95365df9feea889f4238701c7421b
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 "lduInterfaceField.H"
40 #include "fvPatchField.H"
41 #include "coupledFvPatch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class coupledFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class Type>
53 class coupledFvPatchField
55     public lduInterfaceField,
56     public fvPatchField<Type>
59 public:
61     //- Runtime type information
62     TypeName(coupledFvPatch::typeName_());
65     // Constructors
67         //- Construct from patch and internal field
68         coupledFvPatchField
69         (
70             const fvPatch&,
71             const DimensionedField<Type, volMesh>&
72         );
74         //- Construct from patch and internal field and patch field
75         coupledFvPatchField
76         (
77             const fvPatch&,
78             const DimensionedField<Type, volMesh>&,
79             const Field<Type>&
80         );
82         //- Construct from patch, internal field and dictionary
83         coupledFvPatchField
84         (
85             const fvPatch&,
86             const DimensionedField<Type, volMesh>&,
87             const dictionary&,
88             const bool valueRequired = false
89         );
91         //- Construct by mapping the given coupledFvPatchField onto a new patch
92         coupledFvPatchField
93         (
94             const coupledFvPatchField<Type>&,
95             const fvPatch&,
96             const DimensionedField<Type, volMesh>&,
97             const fvPatchFieldMapper&
98         );
100         //- Construct as copy
101         coupledFvPatchField
102         (
103             const coupledFvPatchField<Type>&
104         );
106         //- Construct and return a clone
107         virtual tmp<fvPatchField<Type> > clone() const = 0;
109         //- Construct as copy setting internal field reference
110         coupledFvPatchField
111         (
112             const coupledFvPatchField<Type>&,
113             const DimensionedField<Type, volMesh>&
114         );
116         //- Construct and return a clone
117         virtual tmp<fvPatchField<Type> > clone
118         (
119             const DimensionedField<Type, volMesh>&
120         ) const = 0;
123     // Member functions
125         // Access
127             //- Return true if this patch field is derived from
128             //  coupledFvPatchField<Type>.
129             virtual bool coupled() const
130             {
131                 return true;
132             }
134             //- Return neighbour field of internal field
135             virtual tmp<Field<Type> > patchNeighbourField() const = 0;
138         // Evaluation functions
140             //- Return patch-normal gradient
141             virtual tmp<Field<Type> > snGrad() const;
143             //- Initialise the evaluation of the patch field
144             virtual void initEvaluate
145             (
146                 const Pstream::commsTypes commsType
147             );
149             //- Evaluate the patch field
150             virtual void evaluate
151             (
152                 const Pstream::commsTypes commsType
153             );
155             //- Return the matrix diagonal coefficients corresponding to the
156             //  evaluation of the value of this patchField with given weights
157             virtual tmp<Field<Type> > valueInternalCoeffs
158             (
159                 const tmp<scalarField>&
160             ) const;
162             //- Return the matrix source coefficients corresponding to the
163             //  evaluation of the value of this patchField with given weights
164             virtual tmp<Field<Type> > valueBoundaryCoeffs
165             (
166                 const tmp<scalarField>&
167             ) const;
169             //- Return the matrix diagonal coefficients corresponding to the
170             //  evaluation of the gradient of this patchField
171             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
173             //- Return the matrix source coefficients corresponding to the
174             //  evaluation of the gradient of this patchField
175             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
178         // Coupled interface functionality
180             //- Update result field based on interface functionality
181             virtual void updateInterfaceMatrix
182             (
183                 const scalarField& psiInternal,
184                 scalarField& result,
185                 const lduMatrix&,
186                 const scalarField& coeffs,
187                 const direction,
188                 const Pstream::commsTypes commsType
189             ) const = 0;
191         //- Write
192         virtual void write(Ostream&) const;
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 } // End namespace Foam
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 #ifdef NoRepository
203 #   include "coupledFvPatchField.C"
204 #endif
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 #endif
210 // ************************************************************************* //