1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::processorFvPatchField
28 Foam::processorFvPatchField
31 processorFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef processorFvPatchField_H
36 #define processorFvPatchField_H
38 #include "coupledFvPatchField.H"
39 #include "processorLduInterfaceField.H"
40 #include "processorFvPatch.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class processorFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
52 class processorFvPatchField
54 public processorLduInterfaceField,
55 public coupledFvPatchField<Type>
59 //- Local reference cast into the processor patch
60 const processorFvPatch& procPatch_;
65 //- Runtime type information
66 TypeName(processorFvPatch::typeName_());
71 //- Construct from patch and internal field
75 const DimensionedField<Type, volMesh>&
78 //- Construct from patch and internal field and patch field
82 const DimensionedField<Type, volMesh>&,
86 //- Construct from patch, internal field and dictionary
90 const DimensionedField<Type, volMesh>&,
94 //- Construct by mapping given processorFvPatchField onto a new patch
97 const processorFvPatchField<Type>&,
99 const DimensionedField<Type, volMesh>&,
100 const fvPatchFieldMapper&
103 //- Construct as copy
104 processorFvPatchField(const processorFvPatchField<Type>&);
106 //- Construct and return a clone
107 virtual tmp<fvPatchField<Type> > clone() const
109 return tmp<fvPatchField<Type> >
111 new processorFvPatchField<Type>(*this)
115 //- Construct as copy setting internal field reference
116 processorFvPatchField
118 const processorFvPatchField<Type>&,
119 const DimensionedField<Type, volMesh>&
122 //- Construct and return a clone setting internal field reference
123 virtual tmp<fvPatchField<Type> > clone
125 const DimensionedField<Type, volMesh>& iF
128 return tmp<fvPatchField<Type> >
130 new processorFvPatchField<Type>(*this, iF)
136 ~processorFvPatchField();
143 //- Return true if running parallel
144 virtual bool coupled() const
146 if (Pstream::parRun())
156 //- Return neighbour field given internal field
157 tmp<Field<Type> > patchNeighbourField() const;
160 // Evaluation functions
162 //- Initialise the evaluation of the patch field
163 virtual void initEvaluate(const Pstream::commsTypes commsType);
165 //- Evaluate the patch field
166 virtual void evaluate(const Pstream::commsTypes commsType);
168 //- Return patch-normal gradient
169 virtual tmp<Field<Type> > snGrad() const;
171 //- Initialise neighbour matrix update
172 virtual void initInterfaceMatrixUpdate
174 const scalarField& psiInternal,
177 const scalarField& coeffs,
178 const direction cmpt,
179 const Pstream::commsTypes commsType
182 //- Update result field based on interface functionality
183 virtual void updateInterfaceMatrix
185 const scalarField& psiInternal,
188 const scalarField& coeffs,
189 const direction cmpt,
190 const Pstream::commsTypes commsType
193 //- Processor coupled interface functions
195 //- Return processor number
196 virtual int myProcNo() const
198 return procPatch_.myProcNo();
201 //- Return neigbour processor number
202 virtual int neighbProcNo() const
204 return procPatch_.neighbProcNo();
207 //- Does the patch field perform the transfromation
208 virtual bool doTransform() const
210 return !(procPatch_.parallel() || pTraits<Type>::rank == 0);
213 //- Return face transformation tensor
214 virtual const tensorField& forwardT() const
216 return procPatch_.forwardT();
219 //- Return rank of component for transform
220 virtual int rank() const
222 return pTraits<Type>::rank;
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 } // End namespace Foam
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 # include "processorFvPatchField.C"
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 // ************************************************************************* //