Loading...
Searching...
No Matches
fixedValueFvPatchField.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) 2023-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
31// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32
33template<class Type>
35(
36 const fvPatch& p,
39:
40 fvPatchField<Type>(p, iF)
41{}
42
43
44template<class Type>
46(
47 const fvPatch& p,
49 const Type& value
51:
52 fvPatchField<Type>(p, iF, value)
53{}
54
55
56template<class Type>
58(
59 const fvPatch& p,
61 const dictionary& dict,
64:
65 fvPatchField<Type>(p, iF, dict, requireValue)
66{}
67
68
69template<class Type>
71(
73 const fvPatch& p,
75 const fvPatchFieldMapper& mapper
76)
77:
78 fvPatchField<Type>(ptf, p, iF, mapper)
79{
80 if (notNull(iF) && mapper.hasUnmapped())
81 {
82 WarningInFunction
83 << "On field " << iF.name() << " patch " << p.name()
84 << " patchField " << this->type()
85 << " : mapper does not map all values." << nl
86 << " To avoid this warning fully specify the mapping in derived"
87 << " patch fields." << endl;
88 }
89}
90
91
92template<class Type>
94(
96 const fvPatch& p,
98 const Type& value
100:
101 fvPatchField<Type>(pfld, p, iF, value)
102{}
103
104
105template<class Type>
107(
110)
111:
112 fvPatchField<Type>(pfld, iF)
114
115
116// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
117
118template<class Type>
121(
122 const tmp<scalarField>&
123) const
124{
125 // No contribution from internal values
126 return tmp<Field<Type>>::New(this->size(), Foam::zero{});
127}
128
129
130template<class Type>
133(
134 const tmp<scalarField>&
135) const
137 return *this;
138}
139
140
141template<class Type>
145 return -pTraits<Type>::one*this->patch().deltaCoeffs();
146}
147
148
149template<class Type>
152{
153 return this->patch().deltaCoeffs()*(*this);
154}
155
156
157template<class Type>
159{
162}
163
164
165// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual bool hasUnmapped() const =0
Any unmapped values?
readOption
Enumeration defining read preferences.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
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
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write includes "value" entry.
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 > > 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.
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 void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
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
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
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.
bool notNull(const T *ptr) noexcept
True if ptr is not a pointer (of type T) to the nullObject.
Definition nullObject.H:267
dictionary dict