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-2023 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 dimMomentum;
66 extern const dimensionSet dimAcceleration;
67 
68 extern const dimensionSet dimDensity;
69 extern const dimensionSet dimForce;
70 extern const dimensionSet dimEnergy;
71 extern const dimensionSet dimPower;
72 
73 extern const dimensionSet dimPressure;
74 extern const dimensionSet dimCompressibility;
75 extern const dimensionSet dimGasConstant;
76 extern const dimensionSet dimSpecificHeatCapacity;
77 extern const dimensionSet dimViscosity;
78 extern const dimensionSet dimDynamicViscosity;
79 
80 extern const dimensionSet dimFlux;
82 
83 
84 class dimensionSets
85 {
86  // Private Data
87 
88  //- Set of dimensions
90 
91  //- LU decomposition of dimensions
92  scalarSquareMatrix conversion_;
93 
94  //- See above
95  labelList conversionPivots_;
96 
97  //- Is LU decomposition valid
98  bool valid_;
99 
100 
101 public:
102 
103  // Constructors
104 
105  //- Construct from all units and set of units to use for inversion
107  (
109  const wordList& unitNames
110  );
111 
112 
113  // Member Functions
114 
115  //- Return the units
116  const PtrList<dimensionedScalar>& units() const
117  {
118  return units_;
119  }
120 
121  //- Is there a valid inverse of the selected unit
122  bool valid() const
123  {
124  return valid_;
125  }
126 
127  //- (if valid) obtain set of coefficients of unitNames
128  void coefficients(scalarField&) const;
129 };
130 
131 
132 //- Top level dictionary
133 dictionary& dimensionSystems();
134 
135 //- Set of all dimensions
136 const HashTable<dimensionedScalar>& unitSet();
137 
138 //- Set of units
139 const dimensionSets& writeUnitSet();
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
An STL-conforming hash table.
Definition: HashTable.H:127
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Dimension set for the base types.
Definition: dimensionSet.H:122
void coefficients(scalarField &) const
(if valid) obtain set of coefficients of unitNames
bool valid() const
Is there a valid inverse of the selected unit.
dimensionSets(const HashTable< dimensionedScalar > &, const wordList &unitNames)
Construct from all units and set of units to use for inversion.
const PtrList< dimensionedScalar > & units() const
Return the units.
Namespace for OpenFOAM.
const dimensionSet dimViscosity
const dimensionSet dimDynamicViscosity
const dimensionSet dimEnergy
const dimensionSet dimCurrent
const dimensionSet dimPressure
const dimensionSet dimMassFlux
const dimensionSet dimPower
const dimensionSet dimGasConstant
const HashTable< dimensionedScalar > & unitSet()
Set of all dimensions.
Definition: dimensionSets.C:77
const dimensionSet dimless
const dimensionSet dimLength
const dimensionSet dimTemperature
const dimensionSet dimAcceleration
const dimensionSet dimForce
const dimensionSet dimCompressibility
const dimensionSet dimSpecificHeatCapacity
const dimensionSet dimMomentum
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const dimensionSet dimTime
const dimensionSets & writeUnitSet()
Set of units.
const dimensionSet dimVol
const dimensionSet dimDensity
const dimensionSet dimVolume
const dimensionSet dimMoles
const dimensionSet dimLuminousIntensity
const dimensionSet dimMass
const dimensionSet dimVelocity
const dimensionSet dimArea
dictionary & dimensionSystems()
Top level dictionary.
Definition: dimensionSets.C:59
const dimensionSet dimFlux