25 template <
class Value>
33 return it::Tuple(
"IndependentValue",
"Value of Field for time variable.")
39 "Value of the field in given stamp." )
43 template <
class Value>
46 return it::Record(
"TableFunction",
"Allow set variable series initialization of Fields.")
48 "Initizaliation values of Field." )
55 template <
class Value>
62 template <
class Value>
65 ASSERT( !this->
initialized() ).error(
"TableFunction can't be initialized more than once.");
72 WarningOut().fmt(
"Nonascending order of declared stamps in TableFunction at address {}.\nStamp {} will be skipped.",
77 typename Value::return_type r_value;
79 value.init_from_input(
it->val<
typename Value::AccessType>(
"value") );
85 template <
class Value>
91 template <
class Value>
94 ASSERT( this->
initialized() ).error(
"Compute value of uninitialized TableFunction.");
99 WarningOut().fmt(
"Value of stamp {} is out of range of TableFunction: <{}, {}>. Extrapolation of minimal value will be used.",
103 WarningOut().fmt(
"Value of stamp {} is out of range of TableFunction: <{}, {}>. Extrapolation of maximal value will be used.",
107 for (
unsigned int i=0; i<last_idx; ++i) {
120 template <
class Value>
123 ASSERT(coef >= 0 && coef <= 1)(coef).error();
128 if (Value::is_scalable())
129 for(
unsigned int row=0; row<
value_.n_rows(); row++)
130 for(
unsigned int col=0; col<
value_.n_cols(); col++) {
131 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 interpolated(double coef, unsigned int idx)
Basic time management class.
static const Input::Type::Tuple & get_input_time_type(double lower_bound=-std::numeric_limits< double >::max(), double upper_bound=std::numeric_limits< double >::max())
TableFunction()
Default constructor.
double read_time(Input::Iterator< Input::Tuple > time_it, double default_time=std::numeric_limits< double >::quiet_NaN()) const
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.
Representation of one time step..
Store value in one t stamp.
void init_from_input(const Input::Record &rec, const TimeStep &time)
Initialize actual values of the field given from the given Input::Record rec.