antioch-0.4.0
unit_base.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // Antioch - A Gas Dynamics Thermochemistry Library
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk,
7 // Sylvain Plessis, Roy H. Stonger
8 //
9 // Copyright (C) 2013 The PECOS Development Team
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the Version 2.1 GNU Lesser General
13 // Public License as published by the Free Software Foundation.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
23 // Boston, MA 02110-1301 USA
24 //
25 //-----------------------------------------------------------------------el-
26 //
27 #ifndef ANTIOCH_UNIT_BASE_H
28 #define ANTIOCH_UNIT_BASE_H
29 
30 //Antioch
32 #include "antioch/insi.h"
33 #include "antioch/converter.h"
34 
35 //C++
36 
37 
38 namespace Antioch{
39 
41 template <typename T = double>
42 class UnitBase{
43  public:
44  UnitBase(const std::string &sym, const std::string &nam, // name & symbol
45  const T &fac, const T &trans, // converter
46  int mi,int kgi=0, int si=0, int Ai=0, int Ki=0, int moli=0, int cdi=0, int radi=0):// power array
47  _conversion(fac,trans),
48  _power_base(mi,kgi,si,Ai,Ki,moli,cdi,radi),
49  _symbol(sym),_name(nam){}
50 
52 
53 
54  template <typename P = T>
55  const P factor() const {return _conversion.geta();}
56  template <typename P = T>
57  const P translator() const {return _conversion.getb();}
58  template <typename P = T>
59  const Converter<P> converter() const {return _conversion;}
60  const std::string name() const {return _name;}
61  const std::string symbol() const {return _symbol;}
62  const InSI power_array() const {return _power_base;}
63 
64  private:
67 
70  std::string _symbol;
71  std::string _name;
72 };
73 
74 }// end namespace
75 #endif
std::string _name
Definition: unit_base.h:71
UnitBase()
no default possible
Definition: unit_base.h:66
const std::string name() const
Definition: unit_base.h:60
const ANTIOCH_AUTO(StateType) EuckenThermalConductivity< ThermoEvaluator > return trans(s, mu_s)
#define antioch_error()
std::string _symbol
Definition: unit_base.h:70
const Converter< P > converter() const
Definition: unit_base.h:59
const std::string symbol() const
Definition: unit_base.h:61
Seven integers to characterize the power vector.
Definition: insi.h:43
const P translator() const
Definition: unit_base.h:57
wrapper for unit storage
Definition: unit_base.h:42
Class to deal with the conversion between units.
Definition: converter.h:47
Converter< T > _conversion
Definition: unit_base.h:68
The parameters are reduced parameters.
const P factor() const
Definition: unit_base.h:55
UnitBase(const std::string &sym, const std::string &nam, const T &fac, const T &trans, int mi, int kgi=0, int si=0, int Ai=0, int Ki=0, int moli=0, int cdi=0, int radi=0)
Definition: unit_base.h:44
const InSI power_array() const
Definition: unit_base.h:62

Generated on Thu Jul 7 2016 11:09:46 for antioch-0.4.0 by  doxygen 1.8.8