initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / basic / coupled / coupledFvPatchField.H
blob5198b7be3303325776250424791d5270dc6cec7b
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::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         );
90         //- Construct by mapping the given coupledFvPatchField onto a new patch
91         coupledFvPatchField
92         (
93             const coupledFvPatchField<Type>&,
94             const fvPatch&,
95             const DimensionedField<Type, volMesh>&,
96             const fvPatchFieldMapper&
97         );
99         //- Construct as copy
100         coupledFvPatchField
101         (
102             const coupledFvPatchField<Type>&
103         );
105         //- Construct and return a clone
106         virtual tmp<fvPatchField<Type> > clone() const = 0;
108         //- Construct as copy setting internal field reference
109         coupledFvPatchField
110         (
111             const coupledFvPatchField<Type>&,
112             const DimensionedField<Type, volMesh>&
113         );
115         //- Construct and return a clone
116         virtual tmp<fvPatchField<Type> > clone
117         (
118             const DimensionedField<Type, volMesh>&
119         ) const = 0;
122     // Member functions
124         // Access
126             //- Return true if this patch field is derived from
127             //  coupledFvPatchField<Type>.
128             virtual bool coupled() const
129             {
130                 return true;
131             }
133             //- Return neighbour field of internal field
134             virtual tmp<Field<Type> > patchNeighbourField() const = 0;
137         // Evaluation functions
139             //- Return patch-normal gradient
140             virtual tmp<Field<Type> > snGrad() const;
142             //- Initialise the evaluation of the patch field
143             virtual void initEvaluate
144             (
145                 const Pstream::commsTypes commsType
146             );
148             //- Evaluate the patch field
149             virtual void evaluate
150             (
151                 const Pstream::commsTypes commsType
152             );
154             //- Return the matrix diagonal coefficients corresponding to the
155             //  evaluation of the value of this patchField with given weights
156             virtual tmp<Field<Type> > valueInternalCoeffs
157             (
158                 const tmp<scalarField>&
159             ) const;
161             //- Return the matrix source coefficients corresponding to the
162             //  evaluation of the value of this patchField with given weights
163             virtual tmp<Field<Type> > valueBoundaryCoeffs
164             (
165                 const tmp<scalarField>&
166             ) const;
168             //- Return the matrix diagonal coefficients corresponding to the
169             //  evaluation of the gradient of this patchField
170             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
172             //- Return the matrix source coefficients corresponding to the
173             //  evaluation of the gradient of this patchField
174             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
177         // Coupled interface functionality
179             //- Update result field based on interface functionality
180             virtual void updateInterfaceMatrix
181             (
182                 const scalarField& psiInternal,
183                 scalarField& result,
184                 const lduMatrix&,
185                 const scalarField& coeffs,
186                 const direction,
187                 const Pstream::commsTypes commsType
188             ) const = 0;
190         //- Write
191         virtual void write(Ostream&) const;
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 #ifdef NoRepository
202 #   include "coupledFvPatchField.C"
203 #endif
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 #endif
209 // ************************************************************************* //