rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Toggle main menu visibility
Loading...
Searching...
No Matches
TableLookup.h
Go to the documentation of this file.
1
9
10
#ifndef RIZER_TABLE_LOOKUP_H
11
#define RIZER_TABLE_LOOKUP_H
12
13
#include "
numeric/Format.h
"
14
#include "
numeric/PropertyTable.h
"
15
#include "
numeric/TrialStateError.h
"
16
17
#include <string>
18
19
namespace
rizer
20
{
21
30
[[noreturn]]
inline
void
throwOutsideTable
(
const
PropertyTable
&table,
double
x,
31
const
char
*procedure,
32
const
std::string &what,
const
char
*unit,
33
const
char
*remedy)
34
{
35
throw
TrialStateError
(
36
procedure, what +
" is evaluated at "
+
significant
(x) +
" "
+ unit +
37
", outside its table ["
+
significant
(table.
first
()) +
", "
+
38
significant
(table.
last
()) +
"] "
+ unit +
". "
+ remedy);
39
}
40
50
inline
double
evalAtState
(
const
PropertyTable
&table,
double
x,
51
const
char
*procedure,
const
char
*what,
52
const
char
*unit,
const
char
*remedy)
53
{
54
if
(!table.
covers
(x))
55
{
56
throwOutsideTable
(table, x, procedure, what, unit, remedy);
57
}
58
return
table.
eval
(x);
59
}
60
61
}
// namespace rizer
62
63
#endif
// RIZER_TABLE_LOOKUP_H
Format.h
Number formatting for exception messages.
PropertyTable.h
TrialStateError.h
The error a closure raises for a state it cannot evaluate, so that the integrator proposing that stat...
rizer::PropertyTable
Definition
PropertyTable.h:60
rizer::PropertyTable::first
double first() const
First abscissa of a non-empty table, in the table's own units.
Definition
PropertyTable.h:162
rizer::PropertyTable::last
double last() const
Last abscissa of a non-empty table, in the table's own units.
Definition
PropertyTable.h:165
rizer::PropertyTable::covers
bool covers(double x) const
Whether eval() interpolates at x rather than holding an end value.
Definition
PropertyTable.h:156
rizer::PropertyTable::eval
double eval(double T) const
Linearly interpolated value at T; clamped to the table endpoints.
Definition
PropertyTable.h:170
rizer::TrialStateError::TrialStateError
TrialStateError(const std::string &procedure, std::string message)
Definition
TrialStateError.h:35
rizer
Definition
ElectronReactions.cpp:11
rizer::significant
std::string significant(double value)
value to 6 significant digits, for exception messages.
Definition
Format.h:18
rizer::evalAtState
double evalAtState(const PropertyTable &table, double x, const char *procedure, const char *what, const char *unit, const char *remedy)
Value of table at x, refused outside its tabulated range.
Definition
TableLookup.h:50
rizer::throwOutsideTable
void throwOutsideTable(const PropertyTable &table, double x, const char *procedure, const std::string &what, const char *unit, const char *remedy)
Throw the TrialStateError for x outside table.
Definition
TableLookup.h:30
rizer
cantera_ext
numeric
TableLookup.h
Generated by
1.18.0