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 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 coupledFaPatchField_H
42#define 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{
63
64public:
65
66 //- Runtime type information
67 TypeName(coupledFaPatch::typeName_());
68
69
70 // Constructors
71
72 //- Construct from patch and internal field
74 (
75 const faPatch&,
77 );
78
79 //- Construct from patch and internal field and patch field
81 (
82 const faPatch&,
84 const Field<Type>&
85 );
86
87 //- Construct from patch, internal field and dictionary
89 (
90 const faPatch&,
92 const dictionary&
93 );
94
95 //- Construct by mapping the given coupledFaPatchField onto a new patch
97 (
99 const faPatch&,
101 const faPatchFieldMapper&
102 );
103
104 //- Construct as copy
106 (
108 );
109
110 //- Construct and return a clone
111 virtual tmp<faPatchField<Type>> clone() const = 0;
112
113 //- Construct as copy setting internal field reference
115 (
118 );
119
120 //- Construct and return a clone
122 (
124 ) const = 0;
125
126
127 // Member functions
128
129 // Access
130
131 //- Return true if this patch field is derived from
132 // coupledFaPatchField<Type>.
133 virtual bool coupled() const
134 {
135 return true;
136 }
137
138 //- Return neighbour field of internal field
139 virtual tmp<Field<Type>> patchNeighbourField() const = 0;
140
141
142 // Evaluation functions
143
144 //- Return patch-normal gradient
145 virtual tmp<Field<Type>> snGrad() const;
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 //- Return the matrix source coefficients corresponding to the
178 // evaluation of the gradient of this patchField
180
181
182 // Coupled interface functionality
183
184 //- Transform given patch component field
185 virtual void transformCoupleField
186 (
188 const direction cmpt
189 ) const = 0;
190
191 //- Update result field based on interface functionality
192 virtual void updateInterfaceMatrix
193 (
194 solveScalarField& result,
195 const bool add,
196 const lduAddressing& lduAddr,
197 const label patchId,
198 const solveScalarField& psiInternal,
199 const scalarField& coeffs,
200 const direction,
201 const Pstream::commsTypes commsType
202 ) const = 0;
203
204 //- Update result field based on interface functionality
205 virtual void updateInterfaceMatrix
206 (
207 Field<Type>& result,
208 const bool add,
209 const lduAddressing& lduAddr,
210 const label patchId,
211 const Field<Type>&,
212 const scalarField& coeffs,
213 const Pstream::commsTypes commsType
214 ) const = 0;
215
216 //- Write
217 virtual void write(Ostream&) const;
218};
219
220
221// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222
223} // End namespace Foam
224
225// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226
227#ifdef NoRepository
228 #include "coupledFaPatchField.C"
229#endif
230
231// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232
233#endif
234
235// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
commsTypes
Types of communications.
Definition: UPstream.H:67
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
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 void transformCoupleField(solveScalarField &f, const direction cmpt) const =0
Transform given patch component field.
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.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
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
Construct and return a clone.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-area patch fields.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: faPatchField.H:82
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:78
The class contains the addressing required by the lduMatrix: upper, lower and losort.
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
A class for managing temporary objects.
Definition: tmp.H:65
label patchId(-1)
Namespace for OpenFOAM.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
uint8_t direction
Definition: direction.H:56
runTime write()
labelList f(nPoints)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73