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-2016 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
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  return *this;
152  }
153 
154  //- Initialise the evaluation of the patch field
155  virtual void initEvaluate
156  (
157  const Pstream::commsTypes commsType
158  );
159 
160  //- Evaluate the patch field
161  virtual void evaluate
162  (
163  const Pstream::commsTypes commsType
164  );
165 
166  //- Return the matrix diagonal coefficients corresponding to the
167  // evaluation of the value of this patchField with given weights
169  (
170  const tmp<scalarField>&
171  ) const;
172 
173  //- Return the matrix source coefficients corresponding to the
174  // evaluation of the value of this patchField with given weights
176  (
177  const tmp<scalarField>&
178  ) const;
179 
180  //- Return the matrix diagonal coefficients corresponding to the
181  // evaluation of the gradient of this patchField
183  (
184  const scalarField& deltaCoeffs
185  ) const;
186 
187  //- Return the matrix diagonal coefficients corresponding to the
188  // evaluation of the gradient of this patchField
189  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
190 
191  //- Return the matrix source coefficients corresponding to the
192  // evaluation of the gradient of this patchField
194  (
195  const scalarField& deltaCoeffs
196  ) const;
197 
198  //- Return the matrix source coefficients corresponding to the
199  // evaluation of the gradient of this patchField
200  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
201 
202 
203  // Coupled interface functionality
204 
205  //- Update result field based on interface functionality
206  virtual void updateInterfaceMatrix
207  (
208  scalarField& result,
209  const scalarField& psiInternal,
210  const scalarField& coeffs,
211  const direction,
212  const Pstream::commsTypes commsType
213  ) const = 0;
214 
215  //- Update result field based on interface functionality
216  virtual void updateInterfaceMatrix
217  (
218  Field<Type>&,
219  const Field<Type>&,
220  const scalarField&,
221  const Pstream::commsTypes commsType
222  ) const = 0;
223 
224 
225  //- Write
226  virtual void write(Ostream&) const;
227 };
228 
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 } // End namespace Foam
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #ifdef NoRepository
237  #include "coupledFvPatchField.C"
238 #endif
239 
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 
242 #endif
243 
244 // ************************************************************************* //
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.
virtual tmp< fvPatchField< Type > > clone() const =0
Construct and return a clone.
uint8_t direction
Definition: direction.H:46
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
virtual bool coupled() const
Return true if this patch field is derived from.
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::fvPatchFieldMapper.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
virtual void write(Ostream &) const
Write.
virtual tmp< Field< Type > > patchNeighbourField() const =0
Return neighbour field of internal field.
Abstract base class for coupled patches.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
TypeName(coupledFvPatch::typeName_())
Runtime type information.
coupledFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:54
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
Namespace for OpenFOAM.