forked from LLNL/zero-rk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpecies.h
117 lines (86 loc) · 2.54 KB
/
Species.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
* @file Species.h
*
*/
// Copyright 2001 California Institute of Technology
#ifndef CKR_SPECIES_H
#define CKR_SPECIES_H
#include "ckr_defs.h"
#include "Constituent.h"
#include <map>
#include <vector>
//#include "Cantera.h"
using namespace std;
namespace ckr {
/**
* Holds species data read in from entries in the THERMO section of
* the input file.
*/
class Species {
public:
/// Construct an empty Species object
Species() :
name ("<empty>"),
id ("<none>"),
phase (""),
tlow(0.0),
tmid(0.0),
thigh(0.0),
valid(0),
index(-1)
{}
/// Destructor
~Species() {}
/// Assignment operator
Species& operator=(const Species& s) {
if (&s == this) return *this;
name = s.name;
id = s.id;
phase = s.phase;
tlow = s.tlow;
tmid = s.tmid;
thigh = s.thigh;
elements = s.elements;
comp = s.comp;
lowCoeffs = s.lowCoeffs;
highCoeffs = s.highCoeffs;
valid = s.valid;
index = s.index;
return *this;
}
/// Test for equality based on name only.
bool operator==(const Species& s) const {
return (s.name == name);
}
bool operator!=(const Species& s) const {
return !(*this == s);
}
/// Used to sort lists of species by index number.
bool operator<(const Species& s) const {
return (index < s.index);
}
string name; //!< Species name
string id; //!< ID tag from 'date' field in input
string phase; //!< Phase string. Usually "G", "L", or "S".
double tlow; //!< Min temperature for thermo data fit
double tmid; //!< Mid temperature for thermo data fit
double thigh; //!< Max temperature for thermo data fit
/// list of Constituent objects defining elemental composition
vector<Constituent> elements;
/// map from element symbols to atom numbers
mutable map<string, double> comp;
/// polynomial coefficients for the lower temperature range
vector_fp lowCoeffs;
/// polynomial coefficients for the upper temperature range
vector_fp highCoeffs;
/// flag set by the validation routines
int valid;
/// position in the list of species in the input file
int index;
};
/// A list of Species
typedef vector<Species> speciesList;
/// A map from species names to Species objects
typedef map<string, Species> speciesTable;
}
#endif