Loading...
Searching...
No Matches
cyclicFaPatchField.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::cyclicFaPatchField
29
30Description
31 Foam::cyclicFaPatchField
32
33Author
34 Zeljko Tukovic, FMENA
35 Hrvoje Jasak, Wikki Ltd.
36
37SourceFiles
38 cyclicFaPatchField.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef Foam_cyclicFaPatchField_H
43#define Foam_cyclicFaPatchField_H
44
45#include "coupledFaPatchField.H"
47#include "cyclicFaPatch.H"
48#include "areaFaMesh.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class cyclicFaPatchField Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class Type>
61:
62 virtual public cyclicLduInterfaceField,
63 public coupledFaPatchField<Type>
64{
65 // Private Data
66
67 //- Local reference cast into the cyclic patch
68 const cyclicFaPatch& cyclicPatch_;
69
70public:
71
72 //- Runtime type information
73 TypeName(cyclicFaPatch::typeName_());
74
75
76 // Constructors
77
78 //- Construct from patch and internal field
80 (
81 const faPatch&,
83 );
84
85 //- Construct from patch, internal field and dictionary
87 (
88 const faPatch&,
90 const dictionary& dict,
93 );
94
95 //- Construct by mapping given cyclicFaPatchField onto a new patch
97 (
99 const faPatch&,
101 const faPatchFieldMapper&
102 );
103
104 //- Construct as copy
106 (
108 );
109
110 //- Construct as copy setting internal field reference
112 (
115 );
116
117 //- Return clone
118 virtual tmp<faPatchField<Type>> clone() const
119 {
120 return faPatchField<Type>::Clone(*this);
121 }
122
123 //- Clone with an internal field reference
125 (
127 ) const
128 {
129 return faPatchField<Type>::Clone(*this, iF);
130 }
131
132
133 // Member Functions
134
135 // Access
136
137 //- Return local reference cast into the cyclic patch
138 const cyclicFaPatch& cyclicPatch() const noexcept
139 {
140 return cyclicPatch_;
141 }
142
143
144 // Evaluation Functions
145
146 //- Return neighbour coupled given internal cell data
147 virtual tmp<Field<Type>> patchNeighbourField() const;
148
149 //- Retrieve neighbour coupled given internal cell data
150 virtual void patchNeighbourField(UList<Type>& pnf) const;
151
152
153 // Coupled interface functionality
154
155 //- Update result field based on interface functionality
156 virtual void updateInterfaceMatrix
157 (
158 solveScalarField& result,
159 const bool add,
160 const lduAddressing& lduAddr,
161 const label patchId,
162 const solveScalarField& psiInternal,
163 const scalarField& coeffs,
164 const direction cmpt,
165 const Pstream::commsTypes commsType
166 ) const;
167
168 //- Update result field based on interface functionality
169 virtual void updateInterfaceMatrix
170 (
171 Field<Type>& result,
172 const bool add,
173 const lduAddressing& lduAddr,
174 const label patchId,
175 const Field<Type>&,
176 const scalarField& coeffs,
177 const Pstream::commsTypes commsType
178 ) const;
179
180
181 //- Cyclic coupled interface functions
182
183 //- Does the patch field perform the transformation
184 virtual bool doTransform() const
185 {
186 return
187 (
189 && !cyclicPatch_.parallel()
190 );
191 }
192
193 //- Return face transformation tensor
194 virtual const tensorField& forwardT() const
195 {
196 return cyclicPatch_.forwardT();
197 }
198
199 //- Return neighbour-cell transformation tensor
200 virtual const tensorField& reverseT() const
201 {
202 return cyclicPatch_.reverseT();
203 }
204
205 //- Return rank of component for transform
206 virtual int rank() const
207 {
208 return pTraits<Type>::rank;
209 }
210};
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215} // End namespace Foam
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219#ifdef NoRepository
220 #include "cyclicFaPatchField.C"
221#endif
222
223// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224
225#endif
226
227// ************************************************************************* //
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.
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
coupledFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual tmp< faPatchField< Type > > clone() const
Return clone.
virtual bool doTransform() const
Cyclic coupled interface functions.
virtual int rank() const
Return rank of component for transform.
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
TypeName(cyclicFaPatch::typeName_())
Runtime type information.
virtual tmp< faPatchField< Type > > clone(const DimensionedField< Type, areaMesh > &iF) const
Clone with an internal field reference.
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled given internal cell data.
const cyclicFaPatch & cyclicPatch() const noexcept
Return local reference cast into the cyclic patch.
virtual const tensorField & forwardT() const
Return face transformation tensor.
cyclicFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
Cyclic-plane patch.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual const tensorField & forwardT() const
Return face transformation tensor.
cyclicLduInterfaceField()=default
Construct null.
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.
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf)
Clone a patch field with its own internal field reference.
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.
A traits class, which is primarily used for primitives and vector-space.
Definition pTraits.H:64
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
const direction noexcept
Definition scalarImpl.H:265
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
constexpr bool is_rotational_vectorspace_v
The is_rotational_vectorspace value of Type.
Definition pTraits.H:251
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68