dimensionSets.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) 2011-2022 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 Global
25  dimensionSets
26 
27 Description
28  Useful dimension sets
29 
30 SourceFiles
31  dimensionSets.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 
36 #ifndef dimensionSets_H
37 #define dimensionSets_H
38 
39 #include "scalarMatrices.H"
40 #include "dimensionedScalarFwd.H"
41 #include "PtrList.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 extern const dimensionSet dimless;
51 
52 extern const dimensionSet dimMass;
53 extern const dimensionSet dimLength;
54 extern const dimensionSet dimTime;
55 extern const dimensionSet dimTemperature;
56 extern const dimensionSet dimMoles;
57 extern const dimensionSet dimCurrent;
58 extern const dimensionSet dimLuminousIntensity;
59 
60 extern const dimensionSet dimArea;
61 extern const dimensionSet dimVolume;
62 extern const dimensionSet dimVol;
63 
64 extern const dimensionSet dimVelocity;
65 extern const dimensionSet dimAcceleration;
66 
67 extern const dimensionSet dimDensity;
68 extern const dimensionSet dimForce;
69 extern const dimensionSet dimEnergy;
70 extern const dimensionSet dimPower;
71 
72 extern const dimensionSet dimPressure;
73 extern const dimensionSet dimCompressibility;
74 extern const dimensionSet dimGasConstant;
75 extern const dimensionSet dimSpecificHeatCapacity;
76 extern const dimensionSet dimViscosity;
77 extern const dimensionSet dimDynamicViscosity;
78 
79 extern const dimensionSet dimFlux;
81 
82 
83 class dimensionSets
84 {
85  // Private Data
86 
87  //- Set of dimensions
89 
90  //- LU decomposition of dimensions
91  scalarSquareMatrix conversion_;
92 
93  //- See above
94  labelList conversionPivots_;
95 
96  //- Is LU decomposition valid
97  bool valid_;
98 
99 
100 public:
101 
102  // Constructors
103 
104  //- Construct from all units and set of units to use for inversion
106  (
108  const wordList& unitNames
109  );
110 
111 
112  // Member Functions
113 
114  //- Return the units
115  const PtrList<dimensionedScalar>& units() const
116  {
117  return units_;
118  }
119 
120  //- Is there a valid inverse of the selected unit
121  bool valid() const
122  {
123  return valid_;
124  }
125 
126  //- (if valid) obtain set of coefficients of unitNames
127  void coefficients(scalarField&) const;
128 };
129 
130 
131 //- Top level dictionary
133 
134 //- Set of all dimensions
136 
137 //- Set of units
138 const dimensionSets& writeUnitSet();
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
const dimensionSet dimViscosity
const dimensionSet dimLuminousIntensity
const dimensionSet dimCompressibility
const dimensionSet dimArea
const dimensionSet dimPower
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const dimensionSet dimPressure
const dimensionSet dimless
dimensionSets(const HashTable< dimensionedScalar > &, const wordList &unitNames)
Construct from all units and set of units to use for inversion.
const dimensionSet dimLength
const HashTable< dimensionedScalar > & unitSet()
Set of all dimensions.
Definition: dimensionSets.C:63
const dimensionSet dimTime
Dimension set for the base types.
Definition: dimensionSet.H:121
const dimensionSet dimSpecificHeatCapacity
const dimensionSet dimCurrent
const dimensionSet dimAcceleration
const PtrList< dimensionedScalar > & units() const
Return the units.
const dimensionSet dimVol
const dimensionSet dimFlux
const dimensionSet dimDensity
const dimensionSet dimDynamicViscosity
const dimensionSet dimForce
An STL-conforming hash table.
Definition: HashTable.H:61
dictionary & dimensionSystems()
Top level dictionary.
Definition: dimensionSets.C:45
const dimensionSet dimVelocity
const dimensionSet dimEnergy
const dimensionSet dimMass
const dimensionSet dimMassFlux
const dimensionSet dimMoles
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
const dimensionSet dimVolume
const dimensionSets & writeUnitSet()
Set of units.
void coefficients(scalarField &) const
(if valid) obtain set of coefficients of unitNames
const dimensionSet dimGasConstant
const dimensionSet dimTemperature
Namespace for OpenFOAM.
bool valid() const
Is there a valid inverse of the selected unit.