uniform_oneDimensionalDiscretisation.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) 2025-2026 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::oneDimensionalDiscretisations::uniform
26 
27 Description
28  Uniform coordinate spacing. The i-th coordinate is given by:
29 
30  \f[
31  x_i^q = x_{\textrm{min}}^q + \frac{i}{n - 1} \\
32  \left( x_{\textrm{max}}^q - x_{\textrm{min}}^q \right)
33  \f]
34 
35 Usage
36  Example specification:
37  \verbatim
38  {
39  type uniform;
40 
41  // First and last coordinates
42  min 0.01;
43  max 0.51;
44 
45  // Optional moment/power of the coordinate to be spaced uniformly.
46  // Defaults to one.
47  q 1;
48  }
49  \endverbatim
50 
51 SourceFiles
52  oneDimensionalDiscretisation.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef uniform_oneDimensionalDiscretisation_H
57 #define uniform_oneDimensionalDiscretisation_H
58 
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 namespace oneDimensionalDiscretisations
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class uniform Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 class uniform
73 :
75 {
76 private:
77 
78  // Private Static Member Functions
79 
80  //- Generate the coordinates
82  (
83  const dimensionSet& dims,
84  const label n,
85  const dictionary& dict
86  );
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("uniform");
93 
94 
95  // Constructors
96 
97  //- Construct from a dictionary
98  uniform
99  (
100  const word& name,
101  const dimensionSet& dims,
102  const label n,
103  const dictionary& dict
104  );
105 };
106 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 } // End namespace oneDimensionalDiscretisations
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #endif
116 
117 // ************************************************************************* //
label n
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Dimension set for the base types.
Definition: dimensionSet.H:125
Base class for ways in which to generate coordinates in one-dimensional space. Used to space the repr...
const scalarField & coordinates() const
Return the coordinates.
Uniform coordinate spacing. The i-th coordinate is given by:
TypeName("uniform")
Runtime type information.
uniform(const word &name, const dimensionSet &dims, const label n, const dictionary &dict)
Construct from a dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
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
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dictionary dict