fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / constraint / ggi / ggiFvPatchField.H
blob32be042a82d874f1d188b7b95366945641dac146
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-6 H. Jasak All rights reserved
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     ggiFvPatchField
28 Description
29     Generalized grid interface patch field.
31 Author
32     Hrvoje Jasak, Wikki Ltd.  All rights reserved
34 SourceFiles
35     ggiFvPatchField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef ggiFvPatchField_H
40 #define ggiFvPatchField_H
42 #include "coupledFvPatchField.H"
43 #include "ggiLduInterfaceField.H"
44 #include "ggiFvPatch.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                       Class ggiFvPatchField Declaration
53 \*---------------------------------------------------------------------------*/
55 template<class Type>
56 class ggiFvPatchField
58     public ggiLduInterfaceField,
59     public coupledFvPatchField<Type>
61     // Private data
63         //- Local reference cast into the ggi patch
64         const ggiFvPatch& ggiPatch_;
67 public:
69     //- Runtime type information
70     TypeName(ggiFvPatch::typeName_());
73     // Constructors
75         //- Construct from patch and internal field
76         ggiFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&
80         );
82         //- Construct from patch, internal field and dictionary
83         ggiFvPatchField
84         (
85             const fvPatch&,
86             const DimensionedField<Type, volMesh>&,
87             const dictionary&
88         );
90         //- Construct by mapping given ggiFvPatchField onto a new patch
91         ggiFvPatchField
92         (
93             const ggiFvPatchField<Type>&,
94             const fvPatch&,
95             const DimensionedField<Type, volMesh>&,
96             const fvPatchFieldMapper&
97         );
99         //- Construct as copy setting internal field reference
100         ggiFvPatchField
101         (
102             const ggiFvPatchField<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 ggiFvPatchField<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 ggiFvPatchField<Type>(*this, iF)
124             );
125         }
128     // Member functions
130         // Evaluation functions
132             //- Return neighbour field given internal cell data
133             virtual tmp<Field<Type> > patchNeighbourField() const;
135             //- Initialise the evaluation of the patch field
136             virtual void initEvaluate(const Pstream::commsTypes commsType);
138             //- Evaluate the patch field
139             virtual void evaluate
140             (
141                 const Pstream::commsTypes commsType
142             );
144             //- Initialise neighbour matrix update
145             virtual void initInterfaceMatrixUpdate
146             (
147                 const scalarField& psiInternal,
148                 scalarField& result,
149                 const lduMatrix& m,
150                 const scalarField& coeffs,
151                 const direction cmpt,
152                 const Pstream::commsTypes commsType
153             ) const;
155             //- Update result field based on interface functionality
156             virtual void updateInterfaceMatrix
157             (
158                 const scalarField& psiInternal,
159                 scalarField& result,
160                 const lduMatrix&,
161                 const scalarField& coeffs,
162                 const direction cmpt,
163                 const Pstream::commsTypes commsType
164             ) const;
167         // GGI coupled interface functions
169             //- Does the patch field perform the transfromation
170             virtual bool doTransform() const
171             {
172                 return !(ggiPatch_.parallel() || pTraits<Type>::rank == 0);
173             }
175             //- Return face transformation tensor
176             virtual const tensorField& forwardT() const
177             {
178                 return ggiPatch_.forwardT();
179             }
181             //- Return neighbour-cell transformation tensor
182             virtual const tensorField& reverseT() const
183             {
184                 return ggiPatch_.reverseT();
185             }
187             //- Return rank of component for transform
188             virtual int rank() const
189             {
190                 return pTraits<Type>::rank;
191             }
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 #ifdef NoRepository
202 #   include "ggiFvPatchField.C"
203 #endif
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 #endif
209 // ************************************************************************* //