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-2020 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  //- Disallow copy without setting internal field reference
102 
103  //- Copy constructor setting internal field reference
105  (
108  );
109 
110  //- Construct and return a clone
112  (
114  ) const = 0;
115 
116 
117  // Member Functions
118 
119  // Access
120 
121  //- Return true if this patch field is derived from
122  // coupledFvPatchField<Type>.
123  virtual bool coupled() const
124  {
125  return true;
126  }
127 
128  //- Return neighbour field of internal field
129  virtual tmp<Field<Type>> patchNeighbourField() const = 0;
130 
131 
132  // Evaluation functions
133 
134  //- Return patch-normal gradient
135  virtual tmp<Field<Type>> snGrad
136  (
137  const scalarField& deltaCoeffs
138  ) const;
139 
140  //- Return patch-normal gradient
141  virtual tmp<Field<Type>> snGrad() const
142  {
144  return *this;
145  }
146 
147  //- Initialise the evaluation of the patch field
148  virtual void initEvaluate
149  (
150  const Pstream::commsTypes commsType
151  );
152 
153  //- Evaluate the patch field
154  virtual void evaluate
155  (
156  const Pstream::commsTypes commsType
157  );
158 
159  //- Return the matrix diagonal coefficients corresponding to the
160  // evaluation of the value of this patchField with given weights
162  (
163  const tmp<scalarField>&
164  ) const;
165 
166  //- Return the matrix source 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 diagonal coefficients corresponding to the
174  // evaluation of the gradient of this patchField
176  (
177  const scalarField& deltaCoeffs
178  ) const;
179 
180  //- Return the matrix diagonal coefficients corresponding to the
181  // evaluation of the gradient of this patchField
182  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
183 
184  //- Return the matrix source coefficients corresponding to the
185  // evaluation of the gradient of this patchField
187  (
188  const scalarField& deltaCoeffs
189  ) const;
190 
191  //- Return the matrix source coefficients corresponding to the
192  // evaluation of the gradient of this patchField
193  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
194 
195 
196  // Coupled interface functionality
197 
198  //- Update result field based on interface functionality
199  virtual void updateInterfaceMatrix
200  (
201  scalarField& result,
202  const scalarField& psiInternal,
203  const scalarField& coeffs,
204  const direction,
205  const Pstream::commsTypes commsType
206  ) const = 0;
207 
208  //- Update result field based on interface functionality
209  virtual void updateInterfaceMatrix
210  (
211  Field<Type>&,
212  const Field<Type>&,
213  const scalarField&,
214  const Pstream::commsTypes commsType
215  ) const = 0;
216 
217 
218  //- Write
219  virtual void write(Ostream&) const;
220 };
221 
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 } // End namespace Foam
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 #ifdef NoRepository
230  #include "coupledFvPatchField.C"
231 #endif
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #endif
236 
237 // ************************************************************************* //
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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
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:62
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:370
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
Namespace for OpenFOAM.