Fix tutorials: coupled/conjugateHeatFoam/conjugateCavity: fix Allrun file
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / constraint / overlapGgi / overlapGgiFvPatchField.H
blob7f2a9000e8c2736520b6a8303d2b8b4e743e4fbd
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     overlapGgiFvPatchField
28 Description
29     Partial overlap generalized grid interface patch field.
31 Author
32     Hrvoje Jasak, Wikki Ltd.  All rights reserved.
34 SourceFiles
35     overlapGgiFvPatchField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef overlapGgiFvPatchField_H
40 #define overlapGgiFvPatchField_H
42 #include "coupledFvPatchField.H"
43 #include "overlapGgiLduInterfaceField.H"
44 #include "overlapGgiFvPatch.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                     Class overlapGgiFvPatchField Declaration
53 \*---------------------------------------------------------------------------*/
55 template<class Type>
56 class overlapGgiFvPatchField
58     public overlapGgiLduInterfaceField,
59     public coupledFvPatchField<Type>
61     // Private data
63         //- Local reference cast into the overlapGgi patch
64         const overlapGgiFvPatch& overlapGgiPatch_;
67 public:
69     //- Runtime type information
70     TypeName(overlapGgiFvPatch::typeName_());
73     // Constructors
75         //- Construct from patch and internal field
76         overlapGgiFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&
80         );
82         //- Construct from patch, internal field and dictionary
83         overlapGgiFvPatchField
84         (
85             const fvPatch&,
86             const DimensionedField<Type, volMesh>&,
87             const dictionary&
88         );
90         //- Construct by mapping given overlapGgiFvPatchField onto a new patch
91         overlapGgiFvPatchField
92         (
93             const overlapGgiFvPatchField<Type>&,
94             const fvPatch&,
95             const DimensionedField<Type, volMesh>&,
96             const fvPatchFieldMapper&
97         );
99         //- Construct as copy setting internal field reference
100         overlapGgiFvPatchField
101         (
102             const overlapGgiFvPatchField<Type>&,
103             const DimensionedField<Type, volMesh>&
104         );
106         //- Construct and return a clone
107         virtual tmp<fvPatchField<Type> > clone() const
108         {
109             return tmp<fvPatchField<Type> >
110             (
111                 new overlapGgiFvPatchField<Type>(*this)
112             );
113         }
115         //- Construct and return a clone setting internal field reference
116         virtual tmp<fvPatchField<Type> > clone
117         (
118             const DimensionedField<Type, volMesh>& iF
119         ) const
120         {
121             return tmp<fvPatchField<Type> >
122             (
123                 new overlapGgiFvPatchField<Type>(*this, iF)
124             );
125         }
128     // Member functions
130         // Evaluation functions
132             //- Return neighbour field given internal cell data
133             //  This is a dummy function: returning patch values 
134             //  due to scheduling issues in parallel communication.
135             //  See processofFvPatchField for details HJ, 11/May/2009
136             virtual tmp<Field<Type> > patchNeighbourField() const;
138             //- Initialise the evaluation of the patch field
139             virtual void initEvaluate(const Pstream::commsTypes commsType);
141             //- Evaluate the patch field
142             virtual void evaluate
143             (
144                 const Pstream::commsTypes commsType
145             );
147             //- Initialise neighbour matrix update
148             virtual void initInterfaceMatrixUpdate
149             (
150                 const scalarField& psiInternal,
151                 scalarField& result,
152                 const lduMatrix& m,
153                 const scalarField& coeffs,
154                 const direction cmpt,
155                 const Pstream::commsTypes commsType
156             ) const;
158             //- Update result field based on interface functionality
159             virtual void updateInterfaceMatrix
160             (
161                 const scalarField& psiInternal,
162                 scalarField& result,
163                 const lduMatrix&,
164                 const scalarField& coeffs,
165                 const direction cmpt,
166                 const Pstream::commsTypes commsType
167             ) const;
170         //- GGI coupled interface functions
172             //- Does the patch field perform the transfromation
173             virtual bool doTransform() const
174             {
175                 return false;
176             }
178             //- Return face transformation tensor
179             virtual const tensorField& forwardT() const
180             {
181                 return overlapGgiPatch_.forwardT();
182             }
184             //- Return neighbour-cell transformation tensor
185             virtual const tensorField& reverseT() const
186             {
187                 return overlapGgiPatch_.reverseT();
188             }
190             //- Return rank of component for transform
191             virtual int rank() const
192             {
193                 return pTraits<Type>::rank;
194             }
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 } // End namespace Foam
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 #ifdef NoRepository
205 #   include "overlapGgiFvPatchField.C"
206 #endif
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 #endif
212 // ************************************************************************* //