1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 Non-matching cyclic generalized grid interface patch field.
32 Martin Beaudoin, Hydro-Quebec, (2008)
35 Hrvoje Jasak, Wikki Ltd.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 /*---------------------------------------------------------------------------*\
55 Class cyclicGgiFvPatchField Declaration
56 \*---------------------------------------------------------------------------*/
59 class cyclicGgiFvPatchField
61 public ggiLduInterfaceField,
62 public coupledFvPatchField<Type>
66 //- Local reference cast into the cyclicGgi patch
67 const cyclicGgiFvPatch& cyclicGgiPatch_;
72 //- Runtime type information
73 TypeName(cyclicGgiFvPatch::typeName_());
78 //- Construct from patch and internal field
82 const DimensionedField<Type, volMesh>&
85 //- Construct from patch, internal field and dictionary
89 const DimensionedField<Type, volMesh>&,
93 //- Construct by mapping given cyclicGgiFvPatchField onto a new patch
96 const cyclicGgiFvPatchField<Type>&,
98 const DimensionedField<Type, volMesh>&,
99 const fvPatchFieldMapper&
102 //- Construct as copy setting internal field reference
103 cyclicGgiFvPatchField
105 const cyclicGgiFvPatchField<Type>&,
106 const DimensionedField<Type, volMesh>&
109 //- Construct and return a clone
110 virtual tmp<fvPatchField<Type> > clone() const
112 return tmp<fvPatchField<Type> >
114 new cyclicGgiFvPatchField<Type>(*this)
118 //- Construct and return a clone setting internal field reference
119 virtual tmp<fvPatchField<Type> > clone
121 const DimensionedField<Type, volMesh>& iF
124 return tmp<fvPatchField<Type> >
126 new cyclicGgiFvPatchField<Type>(*this, iF)
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
147 const Pstream::commsTypes commsType
150 //- Initialise neighbour matrix update
151 virtual void initInterfaceMatrixUpdate
153 const scalarField& psiInternal,
156 const scalarField& coeffs,
157 const direction cmpt,
158 const Pstream::commsTypes commsType
161 //- Update result field based on interface functionality
162 virtual void updateInterfaceMatrix
164 const scalarField& psiInternal,
167 const scalarField& coeffs,
168 const direction cmpt,
169 const Pstream::commsTypes commsType
173 //- GGI coupled interface functions
175 //- Does the patch field perform the transfromation
176 virtual bool doTransform() const
179 !(cyclicGgiPatch_.parallel() || pTraits<Type>::rank == 0);
182 //- Return face transformation tensor
183 virtual const tensorField& forwardT() const
185 return cyclicGgiPatch_.forwardT();
188 //- Return neighbour-cell transformation tensor
189 virtual const tensorField& reverseT() const
191 return cyclicGgiPatch_.reverseT();
194 //- Return rank of component for transform
195 virtual int rank() const
197 return pTraits<Type>::rank;
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 # include "cyclicGgiFvPatchField.C"
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 // ************************************************************************* //