All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2019 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;
56 extern const dimensionSet dimMoles;
57 extern const dimensionSet dimCurrent;
59 
60 extern const dimensionSet dimArea;
61 extern const dimensionSet dimVolume;
62 extern const dimensionSet dimVol;
63 
64 extern const dimensionSet dimDensity;
65 extern const dimensionSet dimForce;
66 extern const dimensionSet dimEnergy;
67 extern const dimensionSet dimPower;
68 
69 extern const dimensionSet dimVelocity;
70 extern const dimensionSet dimAcceleration;
72 extern const dimensionSet dimCompressibility;
73 extern const dimensionSet dimGasConstant;
75 extern const dimensionSet dimViscosity;
77 
78 
79 class dimensionSets
80 {
81  // Private Data
82 
83  //- Set of dimensions
85 
86  //- LU decomposition of dimensions
87  scalarSquareMatrix conversion_;
88 
89  //- See above
90  labelList conversionPivots_;
91 
92  //- Is LU decomposition valid
93  bool valid_;
94 
95 public:
96 
97  // Constructors
98 
99  //- Construct from all units and set of units to use for inversion
101  (
103  const wordList& unitNames
104  );
105 
106 
107  // Member Functions
108 
109  //- Return the units
110  const PtrList<dimensionedScalar>& units() const
111  {
112  return units_;
113  }
114 
115  //- Is there a valid inverse of the selected unit
116  bool valid() const
117  {
118  return valid_;
119  }
120 
121  //- (if valid) obtain set of coefficients of unitNames
122  void coefficients(scalarField&) const;
123 };
124 
125 
126 //- Top level dictionary
128 
129 //- Set of all dimensions
131 
132 //- Set of units
133 const dimensionSets& writeUnitSet();
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
const dimensionSet dimViscosity
const dimensionSet dimSpecificHeatCapacity(dimGasConstant)
Definition: dimensionSets.H:71
const dimensionSet dimVol(dimVolume)
Definition: dimensionSets.H:59
const dimensionSet dimDynamicViscosity
dimensionSets(const HashTable< dimensionedScalar > &, const wordList &unitNames)
Construct from all units and set of units to use for inversion.
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
const dimensionSet dimAcceleration
Dimension set for the base types.
Definition: dimensionSet.H:120
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
const PtrList< dimensionedScalar > & units() const
Return the units.
const HashTable< dimensionedScalar > & unitSet()
Set of all dimensions.
An STL-conforming hash table.
Definition: HashTable.H:61
const dimensionSet dimPressure
const dimensionSet dimPower
const dimensionSet dimForce
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
Definition: dimensionSets.H:53
const dimensionSet dimEnergy
const dimensionSet dimDensity
dictionary & dimensionSystems()
Top level dictionary.
Definition: dimensionSets.C:85
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
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 dimCurrent(0, 0, 0, 0, 0, 1, 0)
Definition: dimensionSets.H:54
const dimensionSet dimGasConstant
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
const dimensionSet dimLuminousIntensity(0, 0, 0, 0, 0, 0, 1)
Definition: dimensionSets.H:55
const dimensionSets & writeUnitSet()
Set of units.
const dimensionSet dimCompressibility
void coefficients(scalarField &) const
(if valid) obtain set of coefficients of unitNames
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:57
Namespace for OpenFOAM.
bool valid() const
Is there a valid inverse of the selected unit.
const dimensionSet dimVelocity