zeroGradientFvPatchField.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 
30 #include "fvPatchFieldMapper.H"
31 
32 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
33 
34 template<class Type>
36 (
37  const fvPatch& p,
39 )
40 :
41  fvPatchField<Type>(p, iF)
42 {}
43 
44 
45 template<class Type>
47 (
48  const fvPatch& p,
50  const dictionary& dict
51 )
52 :
53  fvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
54 {
55  fvPatchField<Type>::extrapolateInternal(); // Zero-gradient patch values
56 }
57 
58 
59 template<class Type>
61 (
63  const fvPatch& p,
65  const fvPatchFieldMapper& mapper
66 )
67 :
68  fvPatchField<Type>(ptf, p, iF, mapper)
69 {}
70 
71 
72 template<class Type>
74 (
75  const zeroGradientFvPatchField& zgpf
76 )
77 :
78  fvPatchField<Type>(zgpf)
79 {}
80 
81 
82 template<class Type>
84 (
85  const zeroGradientFvPatchField& zgpf,
86  const DimensionedField<Type, volMesh>& iF
87 )
88 :
89  fvPatchField<Type>(zgpf, iF)
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
95 template<class Type>
97 {
98  if (!this->updated())
99  {
100  this->updateCoeffs();
101  }
102 
103  fvPatchField<Type>::extrapolateInternal(); // Zero-gradient patch values
105 }
106 
107 
108 template<class Type>
111 (
112  const tmp<scalarField>&
113 ) const
114 {
115  return tmp<Field<Type>>
116  (
117  new Field<Type>(this->size(), pTraits<Type>::one)
118  );
119 }
120 
121 
122 template<class Type>
125 (
126  const tmp<scalarField>&
127 ) const
128 {
129  return tmp<Field<Type>>
130  (
131  new Field<Type>(this->size(), Zero)
132  );
133 }
134 
135 
136 template<class Type>
139 {
140  return tmp<Field<Type>>
141  (
142  new Field<Type>(this->size(), Zero)
143  );
144 }
145 
146 
147 template<class Type>
150 {
151  return tmp<Field<Type>>
152  (
153  new Field<Type>(this->size(), Zero)
154  );
155 }
156 
157 
158 // ************************************************************************* //
dictionary dict
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
commsTypes
Communications types.
Definition: UPstream.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
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 > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Generic templated field type.
Definition: Field.H:62
A FieldMapper for finite-volume patch fields.
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
zeroGradientFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
This boundary condition applies a zero-gradient condition from the patch internal field onto the patc...
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127