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  Original code Copyright (C) 2010-2018 Bernhard Gschaider
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::exprValuePointPatchField
29 
30 Description
31  A fixed value point boundary condition with expressions.
32 
33 Usage
34  \table
35  Property | Description | Required | Default
36  value | fixed value | yes |
37  valueExpr | expression for fixed value | yes |
38  \endtable
39 
40 SourceFiles
41  exprValuePointPatchField.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef exprValuePointPatchField_H
46 #define exprValuePointPatchField_H
47 
48 #include "valuePointPatchField.H"
49 #include "patchExprFieldBase.H"
50 #include "patchExprDriver.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class exprValuePointPatchField Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class Type>
62 class exprValuePointPatchField
63 :
64  public valuePointPatchField<Type>,
65  public expressions::patchExprFieldBase
66 {
67 protected:
68 
69  // Protected Data
70 
71  //- The expression driver
72  expressions::patchExpr::parseDriver driver_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("exprValue");
79 
80 
81  // Constructors
82 
83  //- Construct from patch and internal field
85  (
86  const pointPatch&,
88  );
89 
90  //- Construct from patch, internal field and dictionary
92  (
93  const pointPatch&,
95  const dictionary&
96  );
97 
98  //- Construct by mapping given patchField<Type> onto a new patch
100  (
102  const pointPatch&,
104  const pointPatchFieldMapper&
105  );
106 
107  //- Construct as copy setting internal field reference
109  (
112  );
113 
114  //- Construct as copy
116  (
118  );
119 
120 
121  //- Construct and return a clone
122  virtual autoPtr<pointPatchField<Type> > clone() const
123  {
125  (
127  (
128  *this
129  )
130  );
131  }
132 
133 
134  //- Construct and return a clone setting internal field reference
136  (
138  ) const
139  {
141  (
143  (
144  *this,
145  iF
146  )
147  );
148  }
149 
150 
151  // Member Functions
152 
153  //- Update the patch field
154  virtual void updateCoeffs();
155 
156  //- Write
157  virtual void write(Ostream& os) const;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #ifdef NoRepository
168 # include "exprValuePointPatchField.C"
169 #endif
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
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 values,...
Definition: patchExprFieldBase.H:88
Foam::exprValuePointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: exprValuePointPatchField.H:136
Foam::exprValuePointPatchField::write
virtual void write(Ostream &os) const
Write.
Definition: exprValuePointPatchField.C:209
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:86
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:51
Foam::exprValuePointPatchField::updateCoeffs
virtual void updateCoeffs()
Update the patch field.
Definition: exprValuePointPatchField.C:172
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:76