Fix tutorials: coupled/conjugateHeatFoam/conjugateCavity: fix Allrun file
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / constraint / cyclicGgi / cyclicGgiFvPatchField.H
blobbdd2db62ca9f30d21782323bc728ed6cd7827137
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     cyclicGgiFvPatchField
28 Description
29     Non-matching cyclic generalized grid interface patch field.
31 Author
32     Martin Beaudoin, Hydro-Quebec, (2008)
34 Contributor:
35     Hrvoje Jasak, Wikki Ltd.
37 SourceFiles
38     cyclicGgiFvPatchField.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef cyclicGgiFvPatchField_H
43 #define cyclicGgiFvPatchField_H
45 #include "coupledFvPatchField.H"
46 #include "ggiLduInterfaceField.H"
47 #include "cyclicGgiFvPatch.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 /*---------------------------------------------------------------------------*\
55                       Class cyclicGgiFvPatchField Declaration
56 \*---------------------------------------------------------------------------*/
58 template<class Type>
59 class cyclicGgiFvPatchField
61     public ggiLduInterfaceField,
62     public coupledFvPatchField<Type>
64     // Private data
66         //- Local reference cast into the cyclicGgi patch
67         const cyclicGgiFvPatch& cyclicGgiPatch_;
70 public:
72     //- Runtime type information
73     TypeName(cyclicGgiFvPatch::typeName_());
76     // Constructors
78         //- Construct from patch and internal field
79         cyclicGgiFvPatchField
80         (
81             const fvPatch&,
82             const DimensionedField<Type, volMesh>&
83         );
85         //- Construct from patch, internal field and dictionary
86         cyclicGgiFvPatchField
87         (
88             const fvPatch&,
89             const DimensionedField<Type, volMesh>&,
90             const dictionary&
91         );
93         //- Construct by mapping given cyclicGgiFvPatchField onto a new patch
94         cyclicGgiFvPatchField
95         (
96             const cyclicGgiFvPatchField<Type>&,
97             const fvPatch&,
98             const DimensionedField<Type, volMesh>&,
99             const fvPatchFieldMapper&
100         );
102         //- Construct as copy setting internal field reference
103         cyclicGgiFvPatchField
104         (
105             const cyclicGgiFvPatchField<Type>&,
106             const DimensionedField<Type, volMesh>&
107         );
109         //- Construct and return a clone
110         virtual tmp<fvPatchField<Type> > clone() const
111         {
112             return tmp<fvPatchField<Type> >
113             (
114                 new cyclicGgiFvPatchField<Type>(*this)
115             );
116         }
118         //- Construct and return a clone setting internal field reference
119         virtual tmp<fvPatchField<Type> > clone
120         (
121             const DimensionedField<Type, volMesh>& iF
122         ) const
123         {
124             return tmp<fvPatchField<Type> >
125             (
126                 new cyclicGgiFvPatchField<Type>(*this, iF)
127             );
128         }
131     // Member functions
133         // Evaluation functions
135             //- Return neighbour field given internal cell data
136             //  This is a dummy function: returning patch values 
137             //  due to scheduling issues in parallel communication.
138             //  See processofFvPatchField for details HJ, 11/May/2009
139             virtual tmp<Field<Type> > patchNeighbourField() const;
141             //- Initialise the evaluation of the patch field
142             virtual void initEvaluate(const Pstream::commsTypes commsType);
144             //- Evaluate the patch field
145             virtual void evaluate
146             (
147                 const Pstream::commsTypes commsType
148             );
150             //- Initialise neighbour matrix update
151             virtual void initInterfaceMatrixUpdate
152             (
153                 const scalarField& psiInternal,
154                 scalarField& result,
155                 const lduMatrix& m,
156                 const scalarField& coeffs,
157                 const direction cmpt,
158                 const Pstream::commsTypes commsType
159             ) const;
161             //- Update result field based on interface functionality
162             virtual void updateInterfaceMatrix
163             (
164                 const scalarField& psiInternal,
165                 scalarField& result,
166                 const lduMatrix&,
167                 const scalarField& coeffs,
168                 const direction cmpt,
169                 const Pstream::commsTypes commsType
170             ) const;
173         //- GGI coupled interface functions
175             //- Does the patch field perform the transfromation
176             virtual bool doTransform() const
177             {
178                 return 
179                     !(cyclicGgiPatch_.parallel() || pTraits<Type>::rank == 0);
180             }
182             //- Return face transformation tensor
183             virtual const tensorField& forwardT() const
184             {
185                 return cyclicGgiPatch_.forwardT();
186             }
188             //- Return neighbour-cell transformation tensor
189             virtual const tensorField& reverseT() const
190             {
191                 return cyclicGgiPatch_.reverseT();
192             }
194             //- Return rank of component for transform
195             virtual int rank() const
196             {
197                 return pTraits<Type>::rank;
198             }
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 #ifdef NoRepository
209 #   include "cyclicGgiFvPatchField.C"
210 #endif
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 #endif
216 // ************************************************************************* //