dimensionSets.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 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
100  // (writing)
102  (
104  const wordList& unitNames
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 
127 //- Top level dictionary
129 
130 //- Set of all dimensions
132 
133 //- Set of units
134 const dimensionSets& writeUnitSet();
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
const dimensionSet dimPressure
const dimensionSet dimForce
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
const dimensionSet dimCompressibility
An STL-conforming hash table.
Definition: HashTable.H:61
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
Definition: dimensionSets.H:53
const dimensionSet dimVol(dimVolume)
Definition: dimensionSets.H:59
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:57
const dimensionSet dimEnergy
dictionary & dimensionSystems()
Top level dictionary.
Definition: dimensionSets.C:79
const dimensionSet dimGasConstant
const dimensionSet dimDensity
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const dimensionSet dimPower
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
const HashTable< dimensionedScalar > & unitSet()
Set of all dimensions.
Definition: dimensionSets.C:97
Namespace for OpenFOAM.
bool valid() const
Is there a valid inverse of the selected unit.
Dimension set for the base types.
Definition: dimensionSet.H:116
const dimensionSet dimDynamicViscosity
const dimensionSet dimViscosity
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
const dimensionSets & writeUnitSet()
Set of units.
const dimensionSet dimAcceleration
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dimensionSets(const HashTable< dimensionedScalar > &, const wordList &unitNames)
Construct from all units and set of units to use for inversion.
const dimensionSet dimCurrent(0, 0, 0, 0, 0, 1, 0)
Definition: dimensionSets.H:54
void coefficients(scalarField &) const
(if valid) obtain set of coefficients of unitNames
const PtrList< dimensionedScalar > & units() const
Return the units.
const dimensionSet dimLuminousIntensity(0, 0, 0, 0, 0, 0, 1)
Definition: dimensionSets.H:55
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
const dimensionSet dimSpecificHeatCapacity(dimGasConstant)
Definition: dimensionSets.H:71
const dimensionSet dimVelocity