coupledFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::coupledFvPatchField
26 
27 Group
28  grpCoupledBoundaryConditions
29 
30 Description
31  Abstract base class for coupled patches.
32 
33 SourceFiles
34  coupledFvPatchField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef coupledFvPatchField_H
39 #define coupledFvPatchField_H
40 
41 #include "LduInterfaceField.H"
42 #include "fvPatchField.H"
43 #include "coupledFvPatch.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class coupledFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
56 :
57  public LduInterfaceField<Type>,
58  public fvPatchField<Type>
59 {
60 
61 public:
62 
63  //- Runtime type information
64  TypeName(coupledFvPatch::typeName_());
65 
66 
67  // Constructors
68 
69  //- Construct from patch and internal field
71  (
72  const fvPatch&,
74  );
75 
76  //- Construct from patch and internal field and patch field
78  (
79  const fvPatch&,
81  const Field<Type>&
82  );
83 
84  //- Construct from patch, internal field and dictionary
86  (
87  const fvPatch&,
89  const dictionary&
90  );
91 
92  //- Construct by mapping the given coupledFvPatchField onto a new patch
94  (
96  const fvPatch&,
98  const fvPatchFieldMapper&
99  );
100 
101  //- Construct as copy
103  (
105  );
106 
107  //- Construct and return a clone
108  virtual tmp<fvPatchField<Type> > clone() const = 0;
109 
110  //- Construct as copy setting internal field reference
112  (
115  );
116 
117  //- Construct and return a clone
118  virtual tmp<fvPatchField<Type> > clone
119  (
121  ) const = 0;
122 
123 
124  // Member functions
125 
126  // Access
127 
128  //- Return true if this patch field is derived from
129  // coupledFvPatchField<Type>.
130  virtual bool coupled() const
131  {
132  return true;
133  }
134 
135  //- Return neighbour field of internal field
136  virtual tmp<Field<Type> > patchNeighbourField() const = 0;
137 
138 
139  // Evaluation functions
140 
141  //- Return patch-normal gradient
142  virtual tmp<Field<Type> > snGrad
143  (
144  const scalarField& deltaCoeffs
145  ) const;
146 
147  //- Return patch-normal gradient
148  virtual tmp<Field<Type> > snGrad() const
149  {
151  (
152  type() + "::coupledFvPatchField<Type>::snGrad()"
153  );
154  return *this;
155  }
156 
157  //- Initialise the evaluation of the patch field
158  virtual void initEvaluate
159  (
160  const Pstream::commsTypes commsType
161  );
162 
163  //- Evaluate the patch field
164  virtual void evaluate
165  (
166  const Pstream::commsTypes commsType
167  );
168 
169  //- Return the matrix diagonal coefficients corresponding to the
170  // evaluation of the value of this patchField with given weights
172  (
173  const tmp<scalarField>&
174  ) const;
175 
176  //- Return the matrix source coefficients corresponding to the
177  // evaluation of the value of this patchField with given weights
179  (
180  const tmp<scalarField>&
181  ) const;
182 
183  //- Return the matrix diagonal coefficients corresponding to the
184  // evaluation of the gradient of this patchField
186  (
187  const scalarField& deltaCoeffs
188  ) const;
189 
190  //- Return the matrix diagonal coefficients corresponding to the
191  // evaluation of the gradient of this patchField
192  virtual tmp<Field<Type> > gradientInternalCoeffs() const;
193 
194  //- Return the matrix source coefficients corresponding to the
195  // evaluation of the gradient of this patchField
197  (
198  const scalarField& deltaCoeffs
199  ) const;
200 
201  //- Return the matrix source coefficients corresponding to the
202  // evaluation of the gradient of this patchField
203  virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
204 
205 
206  // Coupled interface functionality
207 
208  //- Update result field based on interface functionality
209  virtual void updateInterfaceMatrix
210  (
211  scalarField& result,
212  const scalarField& psiInternal,
213  const scalarField& coeffs,
214  const direction,
215  const Pstream::commsTypes commsType
216  ) const = 0;
217 
218  //- Update result field based on interface functionality
219  virtual void updateInterfaceMatrix
220  (
221  Field<Type>&,
222  const Field<Type>&,
223  const scalarField&,
224  const Pstream::commsTypes commsType
225  ) const = 0;
226 
227 
228  //- Write
229  virtual void write(Ostream&) const;
230 };
231 
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #ifdef NoRepository
240 # include "coupledFvPatchField.C"
241 #endif
242 
243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 
245 #endif
246 
247 // ************************************************************************* //
unsigned char direction
Definition: direction.H:43
virtual bool coupled() const
Return true if this patch field is derived from.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
virtual tmp< Field< Type > > patchNeighbourField() const =0
Return neighbour field of internal field.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Foam::fvPatchFieldMapper.
virtual void write(Ostream &) const
Write.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
Abstract base class for coupled patches.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
commsTypes
Types of communications.
Definition: UPstream.H:64
TypeName(coupledFvPatch::typeName_())
Runtime type information.
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Pre-declare SubField and related Field type.
Definition: Field.H:57
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:589
virtual void updateInterfaceMatrix(scalarField &result, const scalarField &psiInternal, const scalarField &coeffs, const direction, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality.
coupledFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual tmp< fvPatchField< Type > > clone() const =0
Construct and return a clone.
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:356
A class for managing temporary objects.
Definition: PtrList.H:118