Loading...
Searching...
No Matches
transformFvPatchField.C
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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 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
27\*---------------------------------------------------------------------------*/
28
30#include "IOstreams.H"
31#include "transformField.H"
32
33// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
34
35template<class Type>
37(
38 const fvPatch& p,
41:
42 fvPatchField<Type>(p, iF)
43{}
44
45
46template<class Type>
48(
50 const fvPatch& p,
52 const fvPatchFieldMapper& mapper
54:
55 fvPatchField<Type>(ptf, p, iF, mapper)
56{}
57
58
59template<class Type>
61(
62 const fvPatch& p,
64 const dictionary& dict
66:
67 fvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
68{}
69
70
71template<class Type>
73(
76:
77 fvPatchField<Type>(ptf)
78{}
79
80
81template<class Type>
83(
86)
87:
88 fvPatchField<Type>(ptf, iF)
89{}
90
91
92// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
93
94template<class Type>
97(
98 const tmp<scalarField>&
99) const
100{
102 {
103 // Rotational-invariant type
104 return tmp<Field<Type>>::New(this->size(), pTraits<Type>::one);
105 }
106 else
107 {
109 }
110}
111
112
113template<class Type>
116(
117 const tmp<scalarField>&
118) const
119{
120 return
121 *this
123 (
124 valueInternalCoeffs(this->patch().weights()),
126 );
127}
128
129
130template<class Type>
133{
135 {
136 // Rotational-invariant type
137 return tmp<Field<Type>>::New(this->size(), Foam::zero{});
138 }
139 else
140 {
141 return -this->patch().deltaCoeffs()*snGradTransformDiag();
142 }
143}
144
145
146template<class Type>
149{
150 return
151 snGrad()
153}
154
155
156// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
157
158template<class Type>
160(
161 const fvPatchField<Type>& ptf
162)
163{
164 this->evaluate();
165}
166
167
168// ************************************************************************* //
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
void size(const label n)
Definition UList.H:118
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const fvPatch & patch() const noexcept
Return the patch.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field, sets updated() to false.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
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
Intermediate layer (not used directly as a user boundary condition). The "value" entry is NO_READ,...
transformFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< Field< Type > > snGradTransformDiag() const =0
Return face-gradient transform diagonal.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > snGrad() const =0
Return gradient at boundary.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
volScalarField & p
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
constexpr bool is_rotational_vectorspace_v
The is_rotational_vectorspace value of Type.
Definition pTraits.H:251
dictionary dict
Spatial transformation functions for primitive fields.