Loading...
Searching...
No Matches
coupledFaPatchField.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016-2017 Wikki Ltd
9 Copyright (C) 2019-2025 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::coupledFaPatchField
29
30Description
31
32Author
33 Zeljko Tukovic, FMENA
34 Hrvoje Jasak, Wikki Ltd.
35
36SourceFiles
37 coupledFaPatchField.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef Foam_coupledFaPatchField_H
42#define Foam_coupledFaPatchField_H
43
44#include "lduInterfaceField.H"
45#include "faPatchField.H"
46#include "coupledFaPatch.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class coupledFaPatchField Declaration
55\*---------------------------------------------------------------------------*/
56
57template<class Type>
59:
60 public lduInterfaceField,
61 public faPatchField<Type>
62{
63public:
64
65 //- Runtime type information
66 TypeName(coupledFaPatch::typeName_());
67
68
69 // Constructors
70
71 //- Construct from patch and internal field
73 (
74 const faPatch&,
76 );
77
78 //- Construct from patch and internal field and patch field
80 (
81 const faPatch&,
83 const Field<Type>&
84 );
85
86 //- Construct from patch, internal field and dictionary
88 (
89 const faPatch&,
91 const dictionary& dict,
94 );
95
96 //- Construct by mapping the given coupledFaPatchField onto a new patch
98 (
100 const faPatch&,
102 const faPatchFieldMapper&
103 );
104
105 //- Construct as copy
107 (
109 );
110
111 //- Construct as copy setting internal field reference
113 (
116 );
117
118 //- Return clone
119 virtual tmp<faPatchField<Type>> clone() const = 0;
120
121 //- Construct and return a clone
123 (
125 ) const = 0;
126
127
128 // Member Functions
129
130 // Access
131
132 //- Return true if this patch field is derived from
133 // coupledFaPatchField<Type>.
134 virtual bool coupled() const
136 return true;
137 }
138
139 //- Return neighbour field of internal field
140 virtual tmp<Field<Type>> patchNeighbourField() const = 0;
141
142 //- Retrieve neighbour coupled field
143 virtual void patchNeighbourField(UList<Type>&) const = 0;
144
145
146 // Evaluation functions
147
148 //- Return patch-normal gradient
149 virtual tmp<Field<Type>> snGrad() const;
151 //- Retrieve patch-normal gradient
152 virtual void snGrad(UList<Type>& result) const;
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 //- Initialise the evaluation of the patch field after a local
167 // operation
168 virtual void initEvaluateLocal
169 (
170 const Pstream::commsTypes commsType =
172 )
173 {
174 initEvaluate(commsType);
175 }
176
177 //- Evaluate the patch field after a local operation (e.g. *=)
178 virtual void evaluateLocal
179 (
180 const Pstream::commsTypes commsType =
182 )
183 {
184 evaluate(commsType);
185 }
186
187 //- Return the matrix diagonal coefficients corresponding to the
188 // evaluation of the value of this patchField with given weights
189 virtual tmp<Field<Type>> valueInternalCoeffs
190 (
191 const tmp<scalarField>&
192 ) const;
193
194 //- Return the matrix source coefficients corresponding to the
195 // evaluation of the value of this patchField with given weights
196 virtual tmp<Field<Type>> valueBoundaryCoeffs
197 (
198 const tmp<scalarField>&
199 ) const;
200
201 //- Return the matrix diagonal coefficients corresponding to the
202 // evaluation of the gradient of this patchField
204
205 //- Return the matrix source coefficients corresponding to the
206 // evaluation of the gradient of this patchField
208
209
210 // Coupled interface functionality
212 //- Update result field based on interface functionality
213 virtual void updateInterfaceMatrix
214 (
215 solveScalarField& result,
216 const bool add,
217 const lduAddressing& lduAddr,
218 const label patchId,
219 const solveScalarField& psiInternal,
220 const scalarField& coeffs,
221 const direction,
222 const Pstream::commsTypes commsType
223 ) const = 0;
224
225 //- Update result field based on interface functionality
226 virtual void updateInterfaceMatrix
227 (
228 Field<Type>& result,
229 const bool add,
230 const lduAddressing& lduAddr,
231 const label patchId,
232 const Field<Type>&,
233 const scalarField& coeffs,
234 const Pstream::commsTypes commsType
235 ) const = 0;
236
237
238 // Other
239
240 //- Write
241 virtual void write(Ostream&) const;
242};
243
244
245// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246
247} // End namespace Foam
248
249// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250
251#ifdef NoRepository
252 #include "coupledFaPatchField.C"
253#endif
254
255// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256
257#endif
258
259// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
commsTypes
Communications types.
Definition UPstream.H:81
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
Definition UPstream.H:82
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality.
virtual tmp< faPatchField< Type > > clone(const DimensionedField< Type, areaMesh > &) const =0
Construct and return a clone.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual bool coupled() const
Return true if this patch field is derived from.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
coupledFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual void initEvaluateLocal(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Initialise the evaluation of the patch field after a local.
virtual void evaluateLocal(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field after a local operation (e.g. *=).
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual void updateInterfaceMatrix(Field< Type > &result, const bool add, const lduAddressing &lduAddr, const label patchId, const Field< Type > &, const scalarField &coeffs, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
TypeName(coupledFaPatch::typeName_())
Runtime type information.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
virtual tmp< Field< Type > > patchNeighbourField() const =0
Return neighbour field of internal field.
virtual tmp< faPatchField< Type > > clone() const =0
Return clone.
virtual void patchNeighbourField(UList< Type > &) const =0
Retrieve neighbour coupled field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-area patch fields.
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
The class contains the addressing required by the lduMatrix: upper, lower and losort.
lduInterfaceField(const lduInterfaceField &)=delete
No copy construct.
A class for managing temporary objects.
Definition tmp.H:75
label patchId(-1)
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
Field< solveScalar > solveScalarField
uint8_t direction
Definition direction.H:49
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68