Loading...
Searching...
No Matches
uniformFixedValueFvPatchField.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) 2018-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
27Class
28 Foam::uniformFixedValueFvPatchField
29
30Group
31 grpGenericBoundaryConditions
32
33Description
34 This boundary condition provides a uniform fixed value condition.
35
36Usage
37 \table
38 Property | Description | Required | Default
39 uniformValue | uniform value | yes |
40 value | initial field value | optional |
41 \endtable
42
43 Example of the boundary condition specification:
44 \verbatim
45 <patchName>
46 {
47 type uniformFixedValue;
48 uniformValue constant 0.2;
49 }
50 \endverbatim
51
52Note
53 The uniformValue entry is a PatchFunction1 type,
54 able to describe time and spatial varying functions.
55 The example above gives the usage for supplying a constant value.
56
57 The \c value entry (optional) is used for the initial values.
58 Otherwise the \c uniformValue is evaluated.
59 In some cases (eg, coded or expression entries with references to other
60 fields) this can be problematic and the \c value entry will be needed.
61
62See also
63 Foam::Function1Types
64 Foam::fixedValueFvPatchField
65
66SourceFiles
67 uniformFixedValueFvPatchField.C
68
69\*---------------------------------------------------------------------------*/
70
71#ifndef Foam_uniformFixedValueFvPatchField_H
72#define Foam_uniformFixedValueFvPatchField_H
73
75#include "PatchFunction1.H"
76
77// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78
79namespace Foam
80{
81
82/*---------------------------------------------------------------------------*\
83 Class uniformFixedValueFvPatchField Declaration
84\*---------------------------------------------------------------------------*/
85
86template<class Type>
88:
89 public fixedValueFvPatchField<Type>
90{
91 // Private Data
92
93 //- Function providing the value
94 autoPtr<PatchFunction1<Type>> refValueFunc_;
95
96
97public:
98
99 //- Runtime type information
100 TypeName("uniformFixedValue");
101
102
103 // Constructors
104
105 //- Construct from patch and internal field
107 (
108 const fvPatch&,
110 );
111
112 //- Construct from patch and internal field and patch field
115 const fvPatch&,
117 const Field<Type>& fld
118 );
119
120 //- Construct from patch, internal field and dictionary
122 (
123 const fvPatch&,
125 const dictionary&
126 );
127
128 //- Construct by mapping onto a new patch
130 (
132 const fvPatch&,
134 const fvPatchFieldMapper&
135 );
136
137 //- Construct as copy
139 (
141 );
142
143 //- Construct as copy setting internal field reference
145 (
148 );
149
150 //- Return a clone
151 virtual tmp<fvPatchField<Type>> clone() const
152 {
153 return fvPatchField<Type>::Clone(*this);
154 }
155
156 //- Clone with an internal field reference
158 (
160 ) const
161 {
162 return fvPatchField<Type>::Clone(*this, iF);
163 }
164
165
166 // Member Functions
167
168 // Mapping functions
169
170 //- Map (and resize as needed) from self given a mapping object
171 virtual void autoMap
172 (
173 const fvPatchFieldMapper&
174 );
175
176 //- Reverse map the given fvPatchField onto this fvPatchField
177 virtual void rmap
178 (
180 const labelList&
181 );
182
183
184 //- Update the coefficients associated with the patch field
185 virtual void updateCoeffs();
186
187 //- Write
188 virtual void write(Ostream& os) const;
189};
190
191
192// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193
194} // End namespace Foam
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198#ifdef NoRepository
200#endif
201
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204#endif
205
206// ************************************************************************* //
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
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
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
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
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
This boundary condition provides a uniform fixed value condition.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("uniformFixedValue")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
uniformFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68