Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
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\*---------------------------------------------------------------------------*/
30#include "fvPatchFieldMapper.H"
31
32// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
33
34template<class Type>
36(
37 const fvPatch& p,
40:
41 fvPatchField<Type>(p, iF)
42{}
43
44
45template<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
59template<class Type>
61(
63 const fvPatch& p,
65 const fvPatchFieldMapper& mapper
66)
67:
68 fvPatchField<Type>(ptf, p, iF, mapper)
69{}
70
71
72template<class Type>
74(
75 const zeroGradientFvPatchField& zgpf
76)
77:
78 fvPatchField<Type>(zgpf)
79{}
80
81
82template<class Type>
84(
85 const zeroGradientFvPatchField& zgpf,
87)
88:
89 fvPatchField<Type>(zgpf, iF)
90{}
91
92
93// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94
95template<class Type>
97{
98 if (!this->updated())
99 {
100 this->updateCoeffs();
101 }
102
103 fvPatchField<Type>::extrapolateInternal(); // Zero-gradient patch values
105}
106
107
108template<class Type>
111(
112 const tmp<scalarField>&
113) const
116}
117
118
119template<class Type>
122(
123 const tmp<scalarField>&
124) const
126 return tmp<Field<Type>>::New(this->size(), Foam::zero{});
127}
128
129
130template<class Type>
134 return tmp<Field<Type>>::New(this->size(), Foam::zero{});
135}
136
137
138template<class Type>
141{
142 return tmp<Field<Type>>::New(this->size(), Foam::zero{});
143}
144
145
146// ************************************************************************* //
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
commsTypes
Communications types.
Definition UPstream.H:81
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
bool updated() const noexcept
True if the boundary condition has already been updated.
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 updateCoeffs()
Update the coefficients associated with the patch field.
void extrapolateInternal()
Assign the patch field from the internal field.
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
This boundary condition applies a zero-gradient condition from the patch internal field onto the patc...
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the evaluation of the value of this patchFie...
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...
zeroGradientFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
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.
dictionary dict