1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-6 H. Jasak All rights reserved
7 -------------------------------------------------------------------------------
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
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
29 Generalized grid interface patch field.
32 Hrvoje Jasak, Wikki Ltd. All rights reserved
37 \*---------------------------------------------------------------------------*/
39 #ifndef ggiFvPatchField_H
40 #define ggiFvPatchField_H
42 #include "coupledFvPatchField.H"
43 #include "ggiLduInterfaceField.H"
44 #include "ggiFvPatch.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class ggiFvPatchField Declaration
53 \*---------------------------------------------------------------------------*/
58 public ggiLduInterfaceField,
59 public coupledFvPatchField<Type>
63 //- Local reference cast into the ggi patch
64 const ggiFvPatch& ggiPatch_;
69 //- Runtime type information
70 TypeName(ggiFvPatch::typeName_());
75 //- Construct from patch and internal field
79 const DimensionedField<Type, volMesh>&
82 //- Construct from patch, internal field and dictionary
86 const DimensionedField<Type, volMesh>&,
90 //- Construct by mapping given ggiFvPatchField onto a new patch
93 const ggiFvPatchField<Type>&,
95 const DimensionedField<Type, volMesh>&,
96 const fvPatchFieldMapper&
99 //- Construct as copy setting internal field reference
102 const ggiFvPatchField<Type>&,
103 const DimensionedField<Type, volMesh>&
106 //- Construct and return a clone
107 virtual tmp<fvPatchField<Type> > clone() const
109 return tmp<fvPatchField<Type> >
111 new ggiFvPatchField<Type>(*this)
115 //- Construct and return a clone setting internal field reference
116 virtual tmp<fvPatchField<Type> > clone
118 const DimensionedField<Type, volMesh>& iF
121 return tmp<fvPatchField<Type> >
123 new ggiFvPatchField<Type>(*this, iF)
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
141 const Pstream::commsTypes commsType
144 //- Initialise neighbour matrix update
145 virtual void initInterfaceMatrixUpdate
147 const scalarField& psiInternal,
150 const scalarField& coeffs,
151 const direction cmpt,
152 const Pstream::commsTypes commsType
155 //- Update result field based on interface functionality
156 virtual void updateInterfaceMatrix
158 const scalarField& psiInternal,
161 const scalarField& coeffs,
162 const direction cmpt,
163 const Pstream::commsTypes commsType
167 // GGI coupled interface functions
169 //- Does the patch field perform the transfromation
170 virtual bool doTransform() const
172 return !(ggiPatch_.parallel() || pTraits<Type>::rank == 0);
175 //- Return face transformation tensor
176 virtual const tensorField& forwardT() const
178 return ggiPatch_.forwardT();
181 //- Return neighbour-cell transformation tensor
182 virtual const tensorField& reverseT() const
184 return ggiPatch_.reverseT();
187 //- Return rank of component for transform
188 virtual int rank() const
190 return pTraits<Type>::rank;
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 # include "ggiFvPatchField.C"
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //