24 template <
class Value>
27 return it::Tuple(
"IndependentValue",
"Value of Field for independent variable.")
29 "Independent variable of stamp." )
31 "Value of the field in given stamp." )
35 template <
class Value>
38 return it::Record(
"TableFunction",
"Allow set variable series initialization of Fields.")
40 "Initizaliation values of Field." )
47 template <
class Value>
54 template <
class Value>
57 ASSERT( !this->
initialized() ).error(
"TableFunction can't be initialized more than once.");
62 double t =
it->val<
double>(
"t");
64 WarningOut().fmt(
"Nonascending order of declared stamps in TableFunction at address {}.\nStamp {} will be skipped.",
69 typename Value::return_type r_value;
71 value.init_from_input(
it->val<
typename Value::AccessType>(
"value") );
77 template <
class Value>
83 template <
class Value>
86 ASSERT( this->
initialized() ).error(
"Compute value of uninitialized TableFunction.");
91 WarningOut().fmt(
"Value of stamp {} is out of range of TableFunction: <{}, {}>. Extrapolation of minimal value will be used.",
95 WarningOut().fmt(
"Value of stamp {} is out of range of TableFunction: <{}, {}>. Extrapolation of maximal value will be used.",
99 for (
unsigned int i=0; i<last_idx; ++i) {
112 template <
class Value>
115 ASSERT(coef >= 0 && coef <= 1)(coef).error();
120 if (Value::is_scalable())
121 for(
unsigned int row=0; row<
value_.n_rows(); row++)
122 for(
unsigned int col=0; col<
value_.n_cols(); col++) {
123 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.