exprValuePointPatchField.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) 2019-2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::exprValuePointPatchField
28 
29 Description
30  A fixed value point boundary condition with expressions.
31 
32 Usage
33  \table
34  Property | Description | Required | Default
35  valueExpr | expression for uniformValue | yes |
36  value | initial field value | optional |
37  \endtable
38 
39  The \c value entry (optional) is used for the initial values.
40  Otherwise uses zero-gradient values.
41 
42 SourceFiles
43  exprValuePointPatchField.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef Foam_exprValuePointPatchField_H
48 #define Foam_exprValuePointPatchField_H
49 
50 #include "valuePointPatchField.H"
51 #include "patchExprFieldBase.H"
52 #include "patchExprDriver.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class exprValuePointPatchField Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class Type>
64 class exprValuePointPatchField
65 :
66  public valuePointPatchField<Type>,
67  public expressions::patchExprFieldBase
68 {
69  //- The parent boundary condition type
70  typedef valuePointPatchField<Type> parent_bctype;
71 
72 
73 protected:
74 
75  // Protected Data
76 
77  //- Dictionary contents for the boundary condition
79 
80  //- The expression driver
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("exprValue");
88 
89 
90  // Constructors
91 
92  //- Construct from patch and internal field
94  (
95  const pointPatch&,
97  );
98 
99  //- Construct from patch, internal field and dictionary
101  (
102  const pointPatch&,
104  const dictionary&
105  );
106 
107  //- Construct by mapping onto a new patch
109  (
111  const pointPatch&,
113  const pointPatchFieldMapper&
114  );
115 
116  //- Construct as copy setting internal field reference
118  (
121  );
122 
123  //- Construct as copy
125  (
127  );
128 
129 
130  //- Construct and return a clone
131  virtual autoPtr<pointPatchField<Type>> clone() const
132  {
134  (
136  (
137  *this
138  )
139  );
140  }
141 
142  //- Construct and return a clone setting internal field reference
144  (
146  ) const
147  {
149  (
151  (
152  *this,
153  iF
154  )
155  );
156  }
157 
158 
159  // Member Functions
160 
161  //- Update the patch field
162  virtual void updateCoeffs();
163 
164  //- Write
165  virtual void write(Ostream& os) const;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #ifdef NoRepository
177 #endif
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
virtual void updateCoeffs()
Update the patch field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("exprValue")
Runtime type information.
Foam::pointPatchFieldMapper.
Driver for patch expressions.
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
A fixed value point boundary condition with expressions.
exprValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
expressions::patchExpr::parseDriver driver_
The expression driver.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void write(Ostream &os) const
Write.
OBJstream os(runTime.globalPath()/outputName)
dictionary dict_
Dictionary contents for the boundary condition.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:61
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Namespace for OpenFOAM.