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-2020 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  value | fixed value | yes |
36  valueExpr | expression for uniformValue | yes |
37  \endtable
38 
39 SourceFiles
40  exprValuePointPatchField.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef exprValuePointPatchField_H
45 #define exprValuePointPatchField_H
46 
47 #include "valuePointPatchField.H"
48 #include "patchExprFieldBase.H"
49 #include "patchExprDriver.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class exprValuePointPatchField Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Type>
61 class exprValuePointPatchField
62 :
63  public valuePointPatchField<Type>,
64  public expressions::patchExprFieldBase
65 {
66 protected:
67 
68  // Protected Data
69 
70  //- The expression driver
71  expressions::patchExpr::parseDriver driver_;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("exprValue");
78 
79 
80  // Constructors
81 
82  //- Construct from patch and internal field
84  (
85  const pointPatch&,
87  );
88 
89  //- Construct from patch, internal field and dictionary
91  (
92  const pointPatch&,
94  const dictionary&
95  );
96 
97  //- Construct by mapping onto a new patch
99  (
101  const pointPatch&,
103  const pointPatchFieldMapper&
104  );
105 
106  //- Construct as copy setting internal field reference
108  (
111  );
112 
113  //- Construct as copy
115  (
117  );
118 
119 
120  //- Construct and return a clone
121  virtual autoPtr<pointPatchField<Type>> clone() const
122  {
124  (
126  (
127  *this
128  )
129  );
130  }
131 
132 
133  //- Construct and return a clone setting internal field reference
135  (
137  ) const
138  {
140  (
142  (
143  *this,
144  iF
145  )
146  );
147  }
148 
149 
150  // Member Functions
151 
152  //- Update the patch field
153  virtual void updateCoeffs();
154 
155  //- Write
156  virtual void write(Ostream& os) const;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167 # include "exprValuePointPatchField.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
Foam::exprValuePointPatchField::TypeName
TypeName("exprValue")
Runtime type information.
patchExprDriver.H
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
exprValuePointPatchField.C
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
patchExprFieldBase.H
valuePointPatchField.H
Foam::expressions::patchExprFieldBase
Base class for managing patches with expressions. The expected input supports value,...
Definition: patchExprFieldBase.H:83
Foam::exprValuePointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: exprValuePointPatchField.H:135
Foam::exprValuePointPatchField::write
virtual void write(Ostream &os) const
Write.
Definition: exprValuePointPatchField.C:220
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::exprValuePointPatchField::driver_
expressions::patchExpr::parseDriver driver_
The expression driver.
Definition: exprValuePointPatchField.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::expressions::patchExpr::parseDriver
Driver for patch expressions.
Definition: patchExprDriver.H:140
Foam::exprValuePointPatchField::exprValuePointPatchField
exprValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: exprValuePointPatchField.C:38
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::valuePointPatchField
Foam::valuePointPatchField.
Definition: valuePointPatchField.H:52
Foam::exprValuePointPatchField::updateCoeffs
virtual void updateCoeffs()
Update the patch field.
Definition: exprValuePointPatchField.C:178
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::exprValuePointPatchField
A fixed value point boundary condition with expressions.
Definition: exprValuePointPatchField.H:75