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.txx
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  typedef exprValuePointPatchField<Type> this_bctype;
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  (
110  const this_bctype&,
111  const pointPatch&,
113  const pointPatchFieldMapper&
114  );
115 
116  //- Construct as copy setting internal field reference
118  (
119  const this_bctype&,
121  );
122 
123  //- No copy without an internal field
124  exprValuePointPatchField(const this_bctype&) = delete;
125 
126  //- Clone with an internal field reference
128  (
130  ) const
131  {
132  return pointPatchField<Type>::Clone(*this, iF);
133  }
134 
135 
136  // Member Functions
137 
138  //- Update the patch field
139  virtual void updateCoeffs();
140 
141  //- Write
142  virtual void write(Ostream& os) const;
143 
144 
145  // Member Operators
146 
147  //- Inherit assignment
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #ifdef NoRepository
159  #include "exprValuePointPatchField.txx"
160 #endif
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
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:130
TypeName("exprValue")
Runtime type information.
Foam::pointPatchFieldMapper.
Driver for patch expressions.
A fixed value point boundary condition with expressions.
friend Ostream & operator(Ostream &, const Field< Type > &)
tmp< Field< Type > > clone() const
Clone.
Definition: FieldI.H:140
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
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
dictionary dict_
Dictionary contents for the boundary condition.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void write(Ostream &os) const
Write.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Namespace for OpenFOAM.