initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / molecularDynamics / molecule / reducedUnits / reducedUnits.H
blobc66c71f1ab77795e165cca37f07eb36a39cda486
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::reducedUnits
28 Description
30 SourceFiles
31     reducedUnitsI.H
32     reducedUnits.C
33     reducedUnitsIO.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef reducedUnits_H
38 #define reducedUnits_H
40 #include "scalar.H"
41 #include "IOdictionary.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class reducedUnits Declaration
50 \*---------------------------------------------------------------------------*/
52 class reducedUnits
54     // Private data
56         // Reduced units
58             // Fundamental values
60                 scalar refLength_;
62                 scalar refTime_;
64                 scalar refMass_;
66             // Derived values
68                 scalar refEnergy_;
70                 scalar refTemp_;
72                 scalar refForce_;
74                 scalar refVelocity_;
76                 scalar refVolume_;
78                 scalar refPressure_;
80                scalar refMassDensity_;
82                 scalar refNumberDensity_;
85     // Private Member Functions
87         void calcRefValues();
89         //- Disallow default bitwise copy construct
90         reducedUnits(const reducedUnits&);
92         //- Disallow default bitwise assignment
93         void operator=(const reducedUnits&);
96 public:
98     // Static data members
100         //- Static data someStaticData
101         static const scalar kb;
104     // Constructors
106         //- Construct with no argument, uses default values:
107         // length  = 1nm
108         // mass = 1.660538782e−27kg (unified atomic mass unit)
109         // temperature = 1K (therefore, energy = 1*kb)
110         reducedUnits();
112         //- Construct from components
113         reducedUnits
114         (
115             scalar refLength,
116             scalar refTime,
117             scalar refMass
118         );
120         //- Construct from dictionary
121         reducedUnits(const IOdictionary& reducedUnitsDict);
124     // Destructor
126         ~reducedUnits();
129     // Member Functions
131         void setRefValues
132         (
133             scalar refLength,
134             scalar refTime,
135             scalar refMass
136         );
138         void setRefValues(const IOdictionary& reducedUnitsDict);
141         // Access
143             inline scalar refLength() const;
145             inline scalar refTime() const;
147             inline scalar refMass() const;
149             inline scalar refTemp() const;
151             inline scalar refEnergy() const;
153             inline scalar refForce() const;
155             inline scalar refVelocity() const;
157             inline scalar refVolume() const;
159             inline scalar refPressure() const;
161             inline scalar refMassDensity() const;
163             inline scalar refNumberDensity() const;
166     // IOstream Operators
168         friend Ostream& operator<<(Ostream&, const reducedUnits&);
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 } // End namespace Foam
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #include "reducedUnitsI.H"
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 #endif
184 // ************************************************************************* //