Loading...
Searching...
No Matches
fixedValuePointPatchField.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2023-2025 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
27Class
28 Foam::fixedValuePointPatchField
29
30Description
31 A FixedValue boundary condition for pointField.
32
33 The "value" entry is normally MUST_READ.
34
35SourceFiles
36 fixedValuePointPatchField.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef Foam_fixedValuePointPatchField_H
41#define Foam_fixedValuePointPatchField_H
42
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class fixedValuePointPatchField Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class Type>
56:
57 public valuePointPatchField<Type>
58{
59 //- The parent boundary condition type
60 typedef valuePointPatchField<Type> parent_bctype;
61
62public:
63
64 //- Runtime type information
65 TypeName("fixedValue");
66
67
68 // Constructors
69
70 //- Construct from patch and internal field
72 (
73 const pointPatch&,
75 );
76
77 //- Construct from patch, internal field and value
79 (
80 const pointPatch&,
82 const Type& value
83 );
84
85 //- Construct from patch, internal field and dictionary
87 (
88 const pointPatch&,
90 const dictionary&,
92 );
93
94 //- Compatibility. Prefer with readOption
96 (
97 const pointPatch& p,
99 const dictionary& dict,
100 const bool needValue
101 )
104 (
105 p, iF, dict,
106 (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
107 )
108 {}
109
110 //- Construct by mapping given patch field onto a new patch
112 (
114 const pointPatch&,
117 );
118
119 //- Copy construct onto patch with internal field reference
120 //- and specified value
122 (
124 const pointPatch& p,
126 const Type& value
127 );
128
129 //- Copy construct with internal field reference
131 (
134 );
135
136 //- Copy construct
138 :
139 fixedValuePointPatchField<Type>(pfld, pfld.internalField())
140 {}
141
142
143 //- Return a clone
144 virtual autoPtr<pointPatchField<Type>> clone() const
145 {
146 return pointPatchField<Type>::Clone(*this);
147 }
148
149 //- Construct and return a clone setting internal field reference
150 virtual autoPtr<pointPatchField<Type>> clone
151 (
153 ) const
154 {
155 return pointPatchField<Type>::Clone(*this, iF);
156 }
157
158
159 // Member Functions
160
161 //- True: this patch field fixes a value.
162 virtual bool fixesValue() const { return true; }
163
164 //- False: this patch field is not altered by assignment.
165 virtual bool assignable() const { return false; }
166
167
168 // Member Operators
170 // Disable assignment operators
171 virtual void operator=(const Field<Type>&) {}
172 virtual void operator=(const Type&) {}
173};
174
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178} // End namespace Foam
179
180// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182#ifdef NoRepository
184#endif
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188#endif
189
190// ************************************************************************* //
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
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FixedValue boundary condition for pointField.
virtual bool fixesValue() const
True: this patch field fixes a value.
fixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
TypeName("fixedValue")
Runtime type information.
virtual autoPtr< pointPatchField< Type > > clone(const DimensionedField< Type, pointMesh > &iF) const
Construct and return a clone setting internal field reference.
fixedValuePointPatchField(const fixedValuePointPatchField< Type > &pfld)
Copy construct.
fixedValuePointPatchField(const pointPatch &p, const DimensionedField< Type, pointMesh > &iF, const dictionary &dict, const bool needValue)
Compatibility. Prefer with readOption.
virtual bool assignable() const
False: this patch field is not altered by assignment.
virtual autoPtr< pointPatchField< Type > > clone() const
Return a clone.
virtual void operator=(const Field< Type > &)
Foam::pointPatchFieldMapper.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
const DimensionedField< Type, pointMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
Basic pointPatch represents a set of points from the mesh.
Definition pointPatch.H:67
valuePointPatchField(const valuePointPatchField &)=default
Copy construct.
volScalarField & p
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68