functionalFixedValueFvPatchField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class Type>
33 (
34  const fvPatch& p,
36  const dictionary& dict
37 )
38 :
40  (
41  p,
42  iF,
43  dict,
44  false
45  ),
46  dimensionedValue_
47  (
48  iF.name(),
49  "value",
50  p,
51  iF.dimensions(),
52  *this,
53  dict
54  )
55 {}
56 
57 
58 template<class Type>
60 (
62  const fvPatch& p,
64  const fieldMapper& mapper
65 )
66 :
67  fixedValueFvPatchField<Type>(ptf, p, iF, mapper, true),
68  dimensionedValue_
69  (
70  ptf.dimensionedValue_,
71  p,
72  *this
73  )
74 {}
75 
76 
77 template<class Type>
79 (
82 )
83 :
84  fixedValueFvPatchField<Type>(ptf, iF),
85  dimensionedValue_
86  (
87  ptf.dimensionedValue_,
88  *this
89  )
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
95 template<class Type>
97 (
98  const fvPatchField<Type>& ptf,
99  const fieldMapper& mapper
100 )
101 {
102  if (mapper.direct())
103  {
105  }
106  else
107  {
108  this->setSize(this->patch().size());
109  }
110 
111  dimensionedValue_.map(!mapper.direct());
112 }
113 
114 
115 template<class Type>
117 (
118  const fvPatchField<Type>& ptf
119 )
120 {
121  this->setSize(this->patch().size());
122  dimensionedValue_.reset();
123 }
124 
125 
126 template<class Type>
128 {
129  if (this->updated())
130  {
131  return;
132  }
133 
134  dimensionedValue_.update();
135 
137 }
138 
139 
140 template<class Type>
142 {
144  writeEntry(os, dimensionedValue_);
145 }
146 
147 
148 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
virtual bool direct() const
Is the mapper direct?
Definition: fieldMapper.H:132
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Functional fixed value boundary condition using a run-time selected function to set the value field a...
functionalFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:90
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:235
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:208
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
Definition: fvPatchField.C:191
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:58
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
points setSize(newPointi)
dictionary dict
volScalarField & p