includeFvConstraintEntry.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2023-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::functionEntries::includeFvConstraintEntry
26 
27 Description
28  Specify a fvConstraint dictionary file to include, expects the
29  fvConstraint name to follow with option arguments (without quotes).
30 
31  Searches for fvConstraint dictionary file in user/group/shipped
32  directories allowing for version-specific and version-independent files
33  using the following hierarchy:
34  - \b user settings:
35  - ~/.OpenFOAM/<VERSION>/caseDicts/fvConstraints
36  - ~/.OpenFOAM/caseDicts/fvConstraints
37  - \b group (site) settings (when $WM_PROJECT_SITE is set):
38  - $WM_PROJECT_SITE/<VERSION>/etc/caseDicts/fvConstraints
39  - $WM_PROJECT_SITE/etc/caseDicts/fvConstraints
40  - \b group (site) settings (when $WM_PROJECT_SITE is not set):
41  - $WM_PROJECT_INST_DIR/site/<VERSION>/etc/caseDicts/fvConstraints
42  - $WM_PROJECT_INST_DIR/site/etc/caseDicts/fvConstraints
43  - \b other (shipped) settings:
44  - $WM_PROJECT_DIR/etc/caseDicts/fvConstraints
45 
46  The optional field arguments included in the name are inserted in 'field' or
47  'fields' entries in the fvConstraint dictionary and included in the name
48  of the fvConstraint entry to avoid conflict.
49 
50  Examples:
51  \verbatim
52  #includeConstraint limitPressure(minFactor=0.1, maxFactor=2)
53  #includeConstraint limitTemperature(min=101, max=1000)
54  \endverbatim
55  or for a multiphase case:
56  \verbatim
57  #includeConstraint limitLowPressure(min=1e4)
58  #includeConstraint limitTemperature(phase=steam, min=270, max=2000)
59  #includeConstraint limitTemperature(phase=water, min=270, max=2000)
60  \endverbatim
61 
62  Other dictionary entries may also be specified using named arguments.
63 
64 See also
65  Foam::includeFvModelEntry
66  Foam::includeFuncEntry
67 
68 SourceFiles
69  includeFvConstraintEntry.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef includeFvConstraintEntry_H
74 #define includeFvConstraintEntry_H
75 
76 #include "includeFuncEntry.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 namespace functionEntries
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class includeFvConstraintEntry Declaration
87 \*---------------------------------------------------------------------------*/
88 
90 :
91  public includeFuncEntry
92 {
93 
94 public:
95 
96  //- Runtime type information
97  FunctionTypeName("#includeConstraint");
98 
99 
100  // Constructors
101 
102  //- Construct from line number, dictionary and Istream
104  (
105  const label lineNumber,
106  const dictionary& parentDict,
107  Istream& is
108  );
109 
110  //- Copy construct
112 
113  //- Clone
114  virtual autoPtr<entry> clone(const dictionary&) const
115  {
116  return autoPtr<entry>(new includeFvConstraintEntry(*this));
117  }
118 
119 
120  // Static Data Members
121 
122  //- Default relative path to the directory structure
123  // containing the fvConstraint dictionary files
125 
126 
127  // Member Functions
128 
129  //- Expand the functionEntry into the contextDict
130  virtual bool execute(dictionary& contextDict, Istream&);
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace functionEntries
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
label lineNumber() const
Return current stream line number.
Definition: IOstream.H:450
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
virtual autoPtr< entry > clone() const
Construct on freestore as copy.
Definition: entry.C:56
A class for handling file names.
Definition: fileName.H:82
Specify a functionObject dictionary file to include, expects the functionObject name to follow with o...
Specify a fvConstraint dictionary file to include, expects the fvConstraint name to follow with optio...
FunctionTypeName("#includeConstraint")
Runtime type information.
includeFvConstraintEntry(const label lineNumber, const dictionary &parentDict, Istream &is)
Construct from line number, dictionary and Istream.
static fileName fvConstraintDictPath
Default relative path to the directory structure.
virtual bool execute(dictionary &contextDict, Istream &)
Expand the functionEntry into the contextDict.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59