Loading...
Searching...
No Matches
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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Global
27 dimensionSets
28
29Description
30 Useful dimension sets
31
32SourceFiles
33 dimensionSets.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_dimensionSets_H
38#define Foam_dimensionSets_H
39
40#include "scalarMatrices.H"
42#include "PtrList.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51//- Dimensionless
52extern const dimensionSet dimless;
54extern const dimensionSet dimMass;
56extern const dimensionSet dimTime;
59extern const dimensionSet dimCurrent;
61
62extern const dimensionSet dimArea;
63extern const dimensionSet dimVolume;
64
65//- Older spelling for dimVolume
66// \deprecated(2019-01) use dimVolume instead
67extern const dimensionSet dimVol;
68
69extern const dimensionSet dimDensity;
70extern const dimensionSet dimForce;
71extern const dimensionSet dimEnergy;
72extern const dimensionSet dimPower;
73
74extern const dimensionSet dimVelocity;
75extern const dimensionSet dimAcceleration;
76extern const dimensionSet dimPressure;
78extern const dimensionSet dimGasConstant;
80extern const dimensionSet dimViscosity;
82
83
84/*---------------------------------------------------------------------------*\
85 Class dimensionSets Declaration
86\*---------------------------------------------------------------------------*/
87
88//- Construction of unit sets
90{
91 // Private Data
92
93 //- Set of dimensions
95
96 //- LU decomposition of dimensions
97 scalarSquareMatrix conversion_;
98
99 //- See above
100 labelList conversionPivots_;
101
102 //- Is LU decomposition valid
103 bool valid_;
104
105public:
106
107 // Constructors
108
109 //- Construct from all units and set of units to use
110 //- for inversion (writing)
112 (
114 const wordList& unitNames
115 );
116
117
118 // Member Functions
119
120 //- Return the units
121 const PtrList<dimensionedScalar>& units() const noexcept
122 {
123 return units_;
124 }
125
126 //- Is there a valid inverse of the selected unit
127 bool good() const noexcept { return valid_; }
128
129 //- Is there a valid inverse of the selected unit
130 bool valid() const noexcept { return valid_; }
131
132 //- (if valid) obtain set of coefficients of unitNames
133 void coefficients(scalarField& exponents) const;
134};
135
136
137//- Top level dictionary
139
140//- Set of all dimensions
142
143//- Set of units
145
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149} // End namespace Foam
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153#endif
154
155// ************************************************************************* //
A HashTable similar to std::unordered_map.
Definition HashTable.H:124
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
const PtrList< dimensionedScalar > & units() const noexcept
Return the units.
void coefficients(scalarField &exponents) const
(if valid) obtain set of coefficients of unitNames
bool good() const noexcept
Is there a valid inverse of the selected unit.
bool valid() const noexcept
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 (writing).
Namespace for OpenFOAM.
const dimensionSet dimPressure
const dimensionSet dimViscosity
List< word > wordList
List of word.
Definition fileName.H:60
const dimensionSet dimPower
const dimensionSet dimless
Dimensionless.
const dimensionSet dimCompressibility
List< label > labelList
A List of labels.
Definition List.H:62
const dimensionSet dimEnergy
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const dimensionSet dimCurrent(0, 0, 0, 0, 0, 1, 0)
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity
const dimensionSet dimGasConstant
dictionary & dimensionSystems()
Top level dictionary.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const dimensionSet dimSpecificHeatCapacity(dimGasConstant)
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
const HashTable< dimensionedScalar > & unitSet()
Set of all dimensions.
const dimensionSet dimForce
SquareMatrix< scalar > scalarSquareMatrix
const dimensionSets & writeUnitSet()
Set of units.
const dimensionSet dimDynamicViscosity
const direction noexcept
Definition scalarImpl.H:265
const dimensionSet dimAcceleration
const dimensionSet dimVolume(pow3(dimLength))
const dimensionSet dimDensity
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
const dimensionSet dimLuminousIntensity(0, 0, 0, 0, 0, 0, 1)