23 template <
class Value>
26 return it::Tuple(
"IndependentValue",
"Value of Field for independent variable.")
28 "Independent variable of stamp." )
30 "Value of the field in given stamp." )
34 template <
class Value>
37 return it::Record(
"TableFunction",
"Allow set variable series initialization of Fields.")
39 "Initizaliation values of Field." )
46 template <
class Value>
53 template <
class Value>
56 ASSERT( !this->
initialized() ).error(
"TableFunction can't be initialized more than once.");
61 double t =
it->val<
double>(
"t");
63 WarningOut().fmt(
"Nonascending order of declared stamps in TableFunction at address {}.\nStamp {} will be skipped.",
68 typename Value::return_type r_value;
70 value.init_from_input(
it->val<
typename Value::AccessType>(
"value") );
76 template <
class Value>
82 template <
class Value>
85 ASSERT( this->
initialized() ).error(
"Compute value of uninitialized TableFunction.");
90 WarningOut().fmt(
"Value of stamp {} is out of range of TableFunction: <{}, {}>. Extrapolation of minimal value will be used.",
94 WarningOut().fmt(
"Value of stamp {} is out of range of TableFunction: <{}, {}>. Extrapolation of maximal value will be used.",
98 for (
unsigned int i=0; i<last_idx; ++i) {
111 template <
class Value>
114 ASSERT(coef >= 0 && coef <= 1)(coef).error();
119 if (Value::is_scalable())
120 for(
unsigned int row=0; row<
value_.n_rows(); row++)
121 for(
unsigned int col=0; col<
value_.n_cols(); col++) {
122 value_(row,col) = val_0(row,col) + coef * (val_1(row,col) - val_0(row,col));
bool initialized()
Return true if TableFunction is initialized (method init_from_input was called).
static const Input::Type::Record & get_input_type()
Value value_
Last value, prevents passing large values (vectors) by value.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
double last_t_
Last t stamp of computed value_ (to prevent repetitive calculation)
void init_from_input(const Input::Record &rec)
Initialize actual values of the field given from the given Input::Record rec.
void interpolated(double coef, unsigned int idx)
TableFunction()
Default constructor.
static const Input::Type::Tuple & get_input_type_val()
return_type const & value(double t)
Value::return_type return_type
#define WarningOut()
Macro defining 'warning' record of log.
std::vector< struct TableValue > table_values_
Vector of values in all stamps.
Store value in one t stamp.