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 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
29 #include "fixedValueFvPatchField.H"
30 
31 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 
33 template<class Type>
35 (
36  const fvPatch& p,
38 )
39 :
40  fvPatchField<Type>(p, iF)
41 {}
42 
43 
44 template<class Type>
46 (
47  const fvPatch& p,
49  const Type& value
50 )
51 :
52  fvPatchField<Type>(p, iF, value)
53 {}
54 
55 
56 template<class Type>
58 (
59  const fvPatch& p,
61  const dictionary& dict,
62  IOobjectOption::readOption requireValue
63 )
64 :
65  fvPatchField<Type>(p, iF, dict, requireValue)
66 {}
67 
68 
69 template<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  {
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 
92 template<class Type>
94 (
95  const fixedValueFvPatchField<Type>& ptf
96 )
97 :
98  fvPatchField<Type>(ptf)
99 {}
100 
101 
102 template<class Type>
104 (
105  const fixedValueFvPatchField<Type>& ptf,
107 )
108 :
109  fvPatchField<Type>(ptf, iF)
110 {}
112 
113 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114 
115 template<class Type>
118 (
119  const tmp<scalarField>&
120 ) const
121 {
122  return tmp<Field<Type>>
123  (
124  new Field<Type>(this->size(), Zero)
125  );
126 }
127 
128 
129 template<class Type>
132 (
133  const tmp<scalarField>&
134 ) const
135 {
136  return *this;
137 }
138 
139 
140 template<class Type>
143 {
144  return -pTraits<Type>::one*this->patch().deltaCoeffs();
145 }
146 
147 
148 template<class Type>
151 {
152  return this->patch().deltaCoeffs()*(*this);
153 }
154 
155 
156 template<class Type>
158 {
161 }
162 
163 
164 // ************************************************************************* //
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
dictionary dict
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
type
Types of root.
Definition: Roots.H:52
virtual void write(Ostream &) const
Write.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
A traits class, which is primarily used for primitives and vector-space.
Definition: pTraits.H:75
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Generic templated field type.
Definition: Field.H:62
A FieldMapper for finite-volume patch fields.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual bool hasUnmapped() const =0
Any unmapped values?
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
const std::string patch
OpenFOAM patch number as a std::string.
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
Definition: nullObject.H:246
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127
readOption
Enumeration defining read preferences.