All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
coupledFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 Description
28  Abstract base class for coupled patches.
29 
30 SourceFiles
31  coupledFvPatchField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef coupledFvPatchField_H
36 #define coupledFvPatchField_H
37 
38 #include "LduInterfaceField.H"
39 #include "fvPatchField.H"
40 #include "coupledFvPatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class coupledFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
53 :
54  public LduInterfaceField<Type>,
55  public fvPatchField<Type>
56 {
57 
58 public:
59 
60  //- Runtime type information
61  TypeName(coupledFvPatch::typeName_());
62 
63 
64  // Constructors
65 
66  //- Construct from patch and internal field
68  (
69  const fvPatch&,
71  );
72 
73  //- Construct from patch and internal field and patch field
75  (
76  const fvPatch&,
78  const Field<Type>&
79  );
80 
81  //- Construct from patch, internal field and dictionary
83  (
84  const fvPatch&,
86  const dictionary&,
87  const bool valueRequired=true
88  );
89 
90  //- Construct by mapping the given coupledFvPatchField onto a new patch
92  (
94  const fvPatch&,
96  const fvPatchFieldMapper&,
97  const bool mappingRequired=true
98  );
99 
100  //- Copy constructor
102  (
104  );
105 
106  //- Construct and return a clone
107  virtual tmp<fvPatchField<Type>> clone() const = 0;
108 
109  //- Copy constructor setting internal field reference
111  (
114  );
115 
116  //- Construct and return a clone
118  (
120  ) const = 0;
121 
122 
123  // Member Functions
124 
125  // Access
126 
127  //- Return true if this patch field is derived from
128  // coupledFvPatchField<Type>.
129  virtual bool coupled() const
130  {
131  return true;
132  }
133 
134  //- Return neighbour field of internal field
135  virtual tmp<Field<Type>> patchNeighbourField() const = 0;
136 
137 
138  // Evaluation functions
139 
140  //- Return patch-normal gradient
141  virtual tmp<Field<Type>> snGrad
142  (
143  const scalarField& deltaCoeffs
144  ) const;
145 
146  //- Return patch-normal gradient
147  virtual tmp<Field<Type>> snGrad() const
148  {
150  return *this;
151  }
152 
153  //- Initialise the evaluation of the patch field
154  virtual void initEvaluate
155  (
156  const Pstream::commsTypes commsType
157  );
158 
159  //- Evaluate the patch field
160  virtual void evaluate
161  (
162  const Pstream::commsTypes commsType
163  );
164 
165  //- Return the matrix diagonal coefficients corresponding to the
166  // evaluation of the value of this patchField with given weights
168  (
169  const tmp<scalarField>&
170  ) const;
171 
172  //- Return the matrix source coefficients corresponding to the
173  // evaluation of the value of this patchField with given weights
175  (
176  const tmp<scalarField>&
177  ) const;
178 
179  //- Return the matrix diagonal coefficients corresponding to the
180  // evaluation of the gradient of this patchField
182  (
183  const scalarField& deltaCoeffs
184  ) const;
185 
186  //- Return the matrix diagonal coefficients corresponding to the
187  // evaluation of the gradient of this patchField
188  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
189 
190  //- Return the matrix source coefficients corresponding to the
191  // evaluation of the gradient of this patchField
193  (
194  const scalarField& deltaCoeffs
195  ) const;
196 
197  //- Return the matrix source coefficients corresponding to the
198  // evaluation of the gradient of this patchField
199  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
200 
201 
202  // Coupled interface functionality
203 
204  //- Update result field based on interface functionality
205  virtual void updateInterfaceMatrix
206  (
207  scalarField& result,
208  const scalarField& psiInternal,
209  const scalarField& coeffs,
210  const direction,
211  const Pstream::commsTypes commsType
212  ) const = 0;
213 
214  //- Update result field based on interface functionality
215  virtual void updateInterfaceMatrix
216  (
217  Field<Type>&,
218  const Field<Type>&,
219  const scalarField&,
220  const Pstream::commsTypes commsType
221  ) const = 0;
222 
223 
224  //- Write
225  virtual void write(Ostream&) const;
226 };
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 } // End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #ifdef NoRepository
236  #include "coupledFvPatchField.C"
237 #endif
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 #endif
242 
243 // ************************************************************************* //
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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
commsTypes
Types of communications.
Definition: UPstream.H:64
uint8_t direction
Definition: direction.H:45
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:66
virtual bool coupled() const
Return true if this patch field is derived from.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual void write(Ostream &) const
Write.
Pre-declare SubField and related Field type.
Definition: Field.H:56
Foam::fvPatchFieldMapper.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
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:54
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:53
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
Namespace for OpenFOAM.