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-2021 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 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;
71 extern const dimensionSet dimPressure;
72 extern const dimensionSet dimCompressibility;
73 extern const dimensionSet dimGasConstant;
74 extern const dimensionSet dimSpecificHeatCapacity;
75 extern const dimensionSet dimViscosity;
76 extern const dimensionSet dimDynamicViscosity;
77 
78 extern const dimensionSet dimFlux;
80 
81 
82 class dimensionSets
83 {
84  // Private Data
85 
86  //- Set of dimensions
88 
89  //- LU decomposition of dimensions
90  scalarSquareMatrix conversion_;
91 
92  //- See above
93  labelList conversionPivots_;
94 
95  //- Is LU decomposition valid
96  bool valid_;
97 
98 
99 public:
100 
101  // Constructors
102 
103  //- Construct from all units and set of units to use for inversion
105  (
107  const wordList& unitNames
108  );
109 
110 
111  // Member Functions
112 
113  //- Return the units
114  const PtrList<dimensionedScalar>& units() const
115  {
116  return units_;
117  }
118 
119  //- Is there a valid inverse of the selected unit
120  bool valid() const
121  {
122  return valid_;
123  }
124 
125  //- (if valid) obtain set of coefficients of unitNames
126  void coefficients(scalarField&) const;
127 };
128 
129 
130 //- Top level dictionary
132 
133 //- Set of all dimensions
135 
136 //- Set of units
137 const dimensionSets& writeUnitSet();
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
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:120
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.