Loading...
Searching...
No Matches
zeroValueFaePatchField.H
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) 2023-2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::zeroValueFaePatchField
28
29Description
30 Specifies a zero fixed value boundary condition.
31
32Usage
33 Example of the boundary condition specification:
34 \verbatim
35 <patchName>
36 {
37 type zeroValue;
38 }
39 \endverbatim
40
41SourceFiles
42 zeroValueFaePatchField.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef Foam_zeroValueFaePatchField_H
47#define Foam_zeroValueFaePatchField_H
48
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class zeroValueFaePatchField Declaration
58\*---------------------------------------------------------------------------*/
59
60template<class Type>
62:
63 public fixedValueFaePatchField<Type>
64{
65 //- The parent boundary condition type
66 typedef fixedValueFaePatchField<Type> parent_bctype;
67
68public:
69
70 //- Runtime type information
71 TypeName("zeroValue");
72
73
74 // Constructors
75
76 //- Construct from patch and internal field
78 (
79 const faPatch& p,
81 );
82
83 //- Construct from patch, internal field and dictionary
85 (
86 const faPatch& p,
88 const dictionary& dict
89 );
90
91 //- Copy construct onto a new patch (no mapping needed)
92 //- onto a new patch
94 (
96 const faPatch& p,
99 );
100
101 //- Copy construct with internal field reference
103 (
106 );
107
108 //- Copy construct
110 :
111 zeroValueFaePatchField<Type>(pfld, pfld.internalField())
112 {}
113
114
115 //- Return clone
116 virtual tmp<faePatchField<Type>> clone() const
117 {
119 }
120
121 //- Clone with an internal field reference
123 (
125 ) const
126 {
127 return faePatchField<Type>::Clone(*this, iF);
128 }
129
130
131 //- Destructor
132 virtual ~zeroValueFaePatchField() = default;
133
134
135 // Member Functions
136
137 //- True: this patch field fixes a value.
138 virtual bool fixesValue() const { return true; }
139
140 //- False: this patch field is not altered by assignment.
141 virtual bool assignable() const { return false; }
142
143 //- Write (without "value" entry)
144 virtual void write(Ostream& os) const;
145
146
147 // Member Operators
148
149 // Disable assignment operators
150 virtual void operator=(const UList<Type>&) {}
151
152 virtual void operator=(const faePatchField<Type>&) {}
153 virtual void operator+=(const faePatchField<Type>&) {}
154 virtual void operator-=(const faePatchField<Type>&) {}
155 virtual void operator*=(const faePatchField<scalar>&) {}
156 virtual void operator/=(const faePatchField<scalar>&) {}
157
158 virtual void operator+=(const Field<Type>&) {}
159 virtual void operator-=(const Field<Type>&) {}
161 virtual void operator*=(const Field<scalar>&) {}
162 virtual void operator/=(const Field<scalar>&) {}
163
164 virtual void operator=(const Type&) {}
165 virtual void operator+=(const Type&) {}
166 virtual void operator-=(const Type&) {}
167 virtual void operator*=(const scalar) {}
168 virtual void operator/=(const scalar) {}
169
170
171 // Disable forced assignment operators
172 virtual void operator==(const faePatchField<Type>&) {}
173 virtual void operator==(const Field<Type>&) {}
174 virtual void operator==(const Type&) {}
176 // Prevent automatic comparison rewriting (c++20)
177 bool operator!=(const faePatchField<Type>&) const = delete;
178 bool operator!=(const Field<Type>&) const = delete;
179 bool operator!=(const Type&) const = delete;
181
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185} // End namespace Foam
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189#ifdef NoRepository
190 #include "zeroValueFaePatchField.C"
191#endif
192
193// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195#endif
196
197// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
constexpr Field() noexcept
Default construct.
Definition FieldI.H:24
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-area patch fields.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
faePatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cove...
const DimensionedField< Type, edgeMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
faePatchField(const faPatch &, const DimensionedField< Type, edgeMesh > &)
Construct from patch and internal field.
static tmp< faePatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fixedValueFaePatchField(const faPatch &, const DimensionedField< Type, edgeMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition tmp.H:75
virtual void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual void operator-=(const faePatchField< Type > &)
TypeName("zeroValue")
Runtime type information.
virtual void operator==(const Type &)
virtual void operator+=(const Field< Type > &)
virtual void operator=(const Type &)
bool operator!=(const faePatchField< Type > &) const =delete
virtual void operator*=(const Field< scalar > &)
virtual tmp< faePatchField< Type > > clone(const DimensionedField< Type, edgeMesh > &iF) const
Clone with an internal field reference.
virtual ~zeroValueFaePatchField()=default
Destructor.
virtual void operator*=(const faePatchField< scalar > &)
virtual void operator==(const faePatchField< Type > &)
virtual void operator/=(const scalar)
virtual void operator=(const UList< Type > &)
virtual void operator==(const Field< Type > &)
virtual tmp< faePatchField< Type > > clone() const
Return clone.
virtual void operator=(const faePatchField< Type > &)
virtual void operator-=(const Type &)
bool operator!=(const Field< Type > &) const =delete
bool operator!=(const Type &) const =delete
virtual void operator+=(const faePatchField< Type > &)
virtual void operator/=(const faePatchField< scalar > &)
zeroValueFaePatchField(const zeroValueFaePatchField< Type > &pfld)
Copy construct.
virtual bool assignable() const
False: this patch field is not altered by assignment.
zeroValueFaePatchField(const faPatch &p, const DimensionedField< Type, edgeMesh > &iF)
Construct from patch and internal field.
virtual void operator*=(const scalar)
virtual void operator-=(const Field< Type > &)
virtual void operator+=(const Type &)
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68