Flow123d  release_2.1.0-87-gfbc1563
field_values.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file field_values.hh
15  * @brief
16  */
17 
18 #ifndef FIELD_VALUES_HH_
19 #define FIELD_VALUES_HH_
20 
21 #include <armadillo>
22 #include <boost/format.hpp>
23 #include <system/exceptions.hh>
24 #include "input/input_type.hh"
25 #include "input/accessors.hh"
26 #include <ostream>
27 #include <cmath>
28 
29 namespace IT=Input::Type;
30 
31 /**
32  * @file
33  *
34  * This file contains various dispatch classes to simplify implementation of Fields. Essential is class template
35  * @p FieldValues_ which provides unified access and initialization to scalar, vector and matrix type object in Armadillo library
36  */
37 
38 TYPEDEF_ERR_INFO( EI_InputMsg, const string );
39 DECLARE_INPUT_EXCEPTION( ExcFV_Input, << "Wrong field value input: " << EI_InputMsg::val );
40 
41 typedef unsigned int FieldEnum;
42 
43 
44 
45 namespace internal {
46 
47 // Helper functions to get scalar type name
48 /*
49 std::string type_name_(double);
50 std::string type_name_(int);
51 std::string type_name_(FieldEnum);
52 */
53 
54 /**
55  * InputType dispatch from elementary type @p ET of FieldValues_ to elementary Input::Type, i.e. descendant of Input::Type::Scalar.
56  */
57 template <class ET>
58 struct InputType { typedef Input::Type::Double type; };
59 
60 template <>
61 struct InputType<int> { typedef Input::Type::Integer type; };
62 
63 template <>
65 
66 
67 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
68 // resolution of Value::return_type
69 
70 // general element type
71 template<int NRows, int NCols, class ET>
72 struct ReturnType { typedef typename arma::Mat<ET>::template fixed<NRows, NCols> return_type; };
73 
74 template<class ET>
75 struct ReturnType<1,1,ET> { typedef ET return_type; };
76 
77 template <class ET>
78 struct ReturnType<0,1,ET> { typedef arma::Col<ET> return_type; };
79 
80 template <int NRows, class ET>
81 struct ReturnType<NRows,1,ET> { typedef typename arma::Col<ET>::template fixed<NRows> return_type; };
82 
83 
84 // FiledEnum element type - this just returns types with ET=unsigned int, however input should be different
85 template<int NRows, int NCols>
86 struct ReturnType<NRows, NCols, FieldEnum> { typedef typename arma::Mat<unsigned int>::template fixed<NRows, NCols> return_type; };
87 
88 template<>
89 struct ReturnType<1,1, FieldEnum> { typedef unsigned int return_type; };
90 
91 template <>
92 struct ReturnType<0,1, FieldEnum> { typedef arma::Col<unsigned int> return_type; };
93 
94 template <int NRows>
95 struct ReturnType<NRows,1, FieldEnum> { typedef typename arma::Col<unsigned int>::template fixed<NRows> return_type; };
96 
97 
98 // Resolution of helper functions for raw constructor
99 template <class RT> inline RT & set_raw_scalar(RT &val, double *raw_data) { return *raw_data;}
100 template <class RT> inline RT & set_raw_scalar(RT &val, int *raw_data) { return *raw_data;}
101 template <class RT> inline RT & set_raw_scalar(RT &val, FieldEnum *raw_data) { return *raw_data;}
102 
103 template <class RT> inline RT & set_raw_vec(RT &val, double *raw_data) { arma::access::rw(val.mem) = raw_data; return val;}
104 template <class RT> inline RT & set_raw_vec(RT &val, int *raw_data) { arma::access::rw(val.mem) = raw_data; return val;}
105 template <class RT> inline RT & set_raw_vec(RT &val, FieldEnum *raw_data) { arma::access::rw(val.mem) = raw_data; return val;}
106 
107 template <class RT> inline RT & set_raw_fix(RT &val, double *raw_data) { val = RT(raw_data); return val;}
108 template <class RT> inline RT & set_raw_fix(RT &val, int *raw_data) { val = RT(raw_data); return val;}
109 template <class RT> inline RT & set_raw_fix(RT &val, FieldEnum *raw_data) { val = RT(raw_data); return val;}
110 
111 
112 
113 // Resolution of input accessor for vector values of enums,
114 template <class ET>
115 struct AccessTypeDispatch { typedef ET type;};
116 template <>
117 struct AccessTypeDispatch<unsigned int> { typedef Input::Enum type; };
118 
119 
120 
121 
122 /**
123  * Initialize an Armadillo matrix from the input.
124  * Since only limited methods are used we can use this template to initialize StringTensor as well.
125  * Used methodas are: at(row,col), zeros()
126  */
127 template<class MatrixType>
128 void init_matrix_from_input( MatrixType &value, Input::Array rec ) {
129  typedef typename MatrixType::elem_type ET;
130  unsigned int nrows = value.n_rows;
131  unsigned int ncols = value.n_cols;
132 
134  if (it->size() == 1 && nrows == ncols) {
135  // square tensor
136  // input = 3 expands to [ [ 3 ] ]; init to 3 * (identity matrix)
137  // input = [1, 2, 3] expands to [[1], [2], [3]]; init to diag. matrix
138  // input = [1, 2, 3, .. , (N+1)*N/2], .... ; init to symmetric matrix [ [1 ,2 ,3], [2, 4, 5], [ 3, 5, 6] ]
139  if (rec.size() == 1) {// scalar times identity
140  value.zeros();
141  ET scalar=*(it->begin<ET>());
142  for(unsigned int i=0; i< nrows; i++) value.at(i,i)=scalar;
143  } else if (rec.size() == nrows) { // diagonal vector
144  value.zeros();
145  for(unsigned int i=0; i< nrows; i++, ++it) value.at(i,i)=*(it->begin<ET>());
146  } else if (rec.size() == (nrows+1)*nrows/2) { // symmetric part
147  for( unsigned int row=0; row<nrows; row++)
148  for( unsigned int col=0; col<ncols; col++)
149  if (row <= col) {
150  value.at(row,col) = *(it->begin<ET>());
151  ++it;
152  } else value.at(row,col) = value.at(col,row);
153  } else {
154  THROW( ExcFV_Input()
155  << EI_InputMsg(
156  boost::str(boost::format("Initializing symmetric matrix %dx%d by vector of wrong size %d, should be 1, %d, or %d.")
157  % nrows % ncols % rec.size() % nrows % ((nrows+1)*nrows/2)))
158  << rec.ei_address()
159 
160  );
161  }
162 
163  } else {
164  // accept only full tensor
165  if (rec.size() == nrows && it->size() == ncols) {
166 
167  for (unsigned int row = 0; row < nrows; row++, ++it) {
168  if (it->size() != ncols)
169  THROW( ExcFV_Input() << EI_InputMsg("Wrong number of columns.")
170  << rec.ei_address());
171  Input::Iterator<ET> col_it = it->begin<ET>();
172  for (unsigned int col = 0; col < ncols; col++, ++col_it)
173  value.at(row, col) = *col_it;
174  }
175  } else {
176  THROW( ExcFV_Input()
177  << EI_InputMsg(
178  boost::str(boost::format("Initializing matrix %dx%d by matrix of wrong size %dx%d.")
179  % nrows % ncols % rec.size() % it->size() ))
180  << rec.ei_address()
181  );
182  }
183  }
184 }
185 
186 /**
187  * Initialize an Armadillo vector from the input.
188  * Since only limited methods are used we can use this template to initialize StringTensor as well.
189  * Used methodas are: at(row,col), zeros()
190  */
191 template<class VectorType>
192 void init_vector_from_input( VectorType &value, Input::Array rec ) {
193  typedef typename VectorType::elem_type ET;
194  unsigned int nrows = value.n_rows;
195 
196  typedef typename AccessTypeDispatch<ET>::type InnerType;
197  Input::Iterator<InnerType> it = rec.begin<InnerType>();
198 
199  if ( rec.size() == 1 ) {
200  for(unsigned int i=0; i< nrows; i++)
201  value.at(i)=ET(*it);
202  } else if ( rec.size() == nrows ) {
203  for(unsigned int i=0; i< nrows; i++, ++it) {
204  value.at(i)=ET(*it);
205  }
206  } else {
207  THROW( ExcFV_Input()
208  << EI_InputMsg(
209  boost::str(boost::format("Initializing vector of size %d by vector of size %d.")
210  % nrows % rec.size() ))
211  << rec.ei_address()
212  );
213  }
214 }
215 
216 
217 
218 } // namespace internal
219 
220 
221 
222 /**
223  * Template for class representing all possible Filed values. It is just common interface to
224  * scalar (double, int) values, vector and tensor values with fixed size and vector/tensor values with variable size.
225  *
226  * ET is type of elements, n_cols and n_rows gives fixed dimensions of the tensor value (nx1 is vector, 1x1 is scalar,
227  * 0x1 is variable size vector, 0x0 is variable size tensor (not implemented yet) )
228  *
229  *
230  */
231 template <int NRows, int NCols, class ET>
232 class FieldValue_ {
233 public:
234  typedef ET element_type;
238  const static int NRows_ = NRows;
239  const static int NCols_ = NCols;
240 
241  static std::string type_name() { return boost::str(boost::format("R[%d,%d]") % NRows % NCols); }
243  if (NRows == NCols) {
244  // for square tensors allow initialization by diagonal vector, etc.
245  return IT::Array( IT::Array( IT::Parameter("element_input_type"), 1), 1 );
246  }
247  else {
248  return IT::Array( IT::Array( IT::Parameter("element_input_type"), NCols, NCols), NRows, NRows );
249  }
250 
251  }
252  static constexpr bool is_scalable() {
254  }
255 
256 
257  inline FieldValue_(return_type &val) : value_(val) {}
258  inline static const return_type &from_raw(return_type &val, ET *raw_data) {return internal::set_raw_fix(val, raw_data);}
259  const ET * mem_ptr() { return value_.memptr(); }
260 
261  void init_from_input( AccessType rec ) {
263  }
264 
265  void set_n_comp(unsigned int) {};
266  inline unsigned int n_cols() const
267  { return NCols; }
268  inline unsigned int n_rows() const
269  { return NRows; }
270  inline ET &operator() ( unsigned int i, unsigned int j)
271  { return value_.at(i,j); }
272  inline ET operator() ( unsigned int i, unsigned int j) const
273  { return value_.at(i,j); }
274  inline operator return_type() const
275  { return value_;}
276 
277  // Set value to matrix of zeros.
278  void zeros() {
279  value_.zeros();
280  }
281  // Set value to identity matrix.
282  void eye() {
283  value_.eye();
284  }
285  // Set value to matrix of ones.
286  void ones() {
287  value_.ones();
288  }
289  // Elementwise equivalence.
290  bool equal_to(const return_type &other) {
291  return arma::max(arma::max(arma::abs(value_ - other))) < 4*std::numeric_limits<ET>::epsilon();
292  }
293  // Multiplied value_ by double coefficient
294  void scale(double scale_coef) {
295  if (is_scalable())
296  for( unsigned int row=0; row<n_rows(); row++)
297  for( unsigned int col=0; col<n_cols(); col++)
298  value_.at(row,col) = scale_coef * value_.at(row,col);
299  }
300 
301 private:
302  return_type &value_;
303 };
304 
305 
306 
307 
308 
309 /// **********************************************************************
310 /// Specialization for scalars
311 template <class ET>
312 class FieldValue_<1,1,ET> {
313 public:
314  typedef ET element_type;
318  const static int NRows_ = 1;
319  const static int NCols_ = 1;
320 
321  static std::string type_name() { return "R"; }
323  {
324  return IT::Parameter("element_input_type");
325  }
326  static constexpr bool is_scalable() {
328  }
329 
330  inline FieldValue_(return_type &val) : value_(val) {}
331 
332  /**
333  * Returns reference to the return_type (i.e. double, or arma::vec or arma::mat); with data provided by the parameter @p raw_data.
334  * A reference to a work space @p val has to be provided for efficient work with vector and matrix values.
335  */
336  inline static const return_type &from_raw(return_type &val, ET *raw_data) {return internal::set_raw_scalar(val, raw_data);}
337  const ET * mem_ptr() { return &(value_); }
338 
339  void init_from_input( AccessType val ) { value_ = return_type(val); }
340 
341  void set_n_comp(unsigned int) {};
342  inline unsigned int n_cols() const
343  { return 1; }
344  inline unsigned int n_rows() const
345  { return 1; }
346  inline ET &operator() ( unsigned int, unsigned int )
347  { return value_; }
348  inline ET operator() ( unsigned int i, unsigned int j) const
349  { return value_; }
350  inline operator return_type() const
351  { return value_;}
352 
353  // Set value to matrix of zeros.
354  void zeros() {
355  value_=0;
356  }
357  // Set value to identity matrix.
358  void eye() {
359  value_=1;
360  }
361  // Set value to matrix of ones.
362  void ones() {
363  value_=1;
364  }
365  bool equal_to(const return_type &other) {
366  return std::abs(value_ - other) < 4*std::numeric_limits<ET>::epsilon();
367  }
368  // Multiplied value_ by double coefficient
369  void scale(double scale_coef) {
370  if (is_scalable())
371  value_ = scale_coef * value_;
372  }
373 
374 private:
375  return_type &value_;
376 };
377 
378 
379 
380 
381 /// **********************************************************************
382 /// Specialization for variable size vectors
383 template <class ET>
384 class FieldValue_<0,1,ET> {
385 public:
386  typedef ET element_type;
390  const static int NRows_ = 0;
391  const static int NCols_ = 1;
392 
393 
394  static std::string type_name() { return "R[n]"; }
396  return IT::Array( IT::Parameter("element_input_type"), 1);
397  }
398  static constexpr bool is_scalable() {
400  }
401  inline static const return_type &from_raw(return_type &val, ET *raw_data) {return internal::set_raw_vec(val, raw_data);}
402  const ET * mem_ptr() { return value_.memptr(); }
403 
404  inline FieldValue_(return_type &val) : value_(val) {}
405 
406 
407  void init_from_input( AccessType rec ) {
409  }
410 
411  void set_n_comp(unsigned int n_comp) { value_ = return_type(n_comp,1); };
412  inline unsigned int n_cols() const
413  { return 1; }
414  inline unsigned int n_rows() const
415  { return value_.n_rows; }
416  inline ET &operator() ( unsigned int i, unsigned int )
417  { return value_.at(i); }
418  inline ET operator() ( unsigned int i, unsigned int j) const
419  { return value_.at(i); }
420 
421  inline operator return_type() const
422  { return value_;}
423 
424  // Set value to matrix of zeros.
425  void zeros() {
426  value_.zeros();
427  }
428  // Set value to identity matrix.
429  void eye() {
430  value_.ones();
431  }
432  // Set value to matrix of ones.
433  void ones() {
434  value_.ones();
435  }
436  // Elementwise equivalence.
437  bool equal_to(const return_type &other) {
438  return arma::max(arma::abs(value_ - other)) < 4*std::numeric_limits<ET>::epsilon();
439  }
440  // Multiplied value_ by double coefficient
441  void scale(double scale_coef) {
442  if (is_scalable())
443  for(unsigned int i=0; i< n_rows(); i++) {
444  value_.at(i) = scale_coef * value_.at(i);
445  }
446  }
447 
448 
449 private:
450  return_type &value_;
451 };
452 
453 /// **********************************************************************
454 /// Specialization for fixed size vectors
455 template <int NRows, class ET>
456 class FieldValue_<NRows,1,ET> {
457 public:
458  typedef ET element_type;
462  const static int NRows_ = NRows;
463  const static int NCols_ = 1;
464 
465 
466  static std::string type_name() { return boost::str(boost::format("R[%d]") % NRows ); }
468  return IT::Array( IT::Parameter("element_input_type"), 1, NRows);
469  }
470  static constexpr bool is_scalable() {
472  }
473 
474  inline FieldValue_(return_type &val) : value_(val) {}
475  inline static const return_type &from_raw(return_type &val, ET *raw_data) {return internal::set_raw_fix(val, raw_data);}
476  const ET * mem_ptr() { return value_.memptr(); }
477 
478  void init_from_input( AccessType rec ) {
480  }
481 
482  void set_n_comp(unsigned int) {};
483  inline unsigned int n_cols() const
484  { return 1; }
485  inline unsigned int n_rows() const
486  { return NRows; }
487  inline ET &operator() ( unsigned int i, unsigned int )
488  { return value_.at(i); }
489  inline ET operator() ( unsigned int i, unsigned int j) const
490  { return value_.at(i); }
491 
492  inline operator return_type() const
493  { return value_;}
494 
495  // Set value to matrix of zeros.
496  void zeros() {
497  value_.zeros();
498  }
499  // Set value to identity matrix.
500  void eye() {
501  value_.ones();
502  }
503  // Set value to matrix of ones.
504  void ones() {
505  value_.ones();
506  }
507  // Elementwise equivalence.
508  bool equal_to(const return_type &other) {
509  return arma::max(arma::abs(value_ - other)) < 4*std::numeric_limits<ET>::epsilon();
510  }
511  // Multiplied value_ by double coefficient
512  void scale(double scale_coef) {
513  if (is_scalable())
514  for(unsigned int i=0; i< n_rows(); i++) {
515  value_.at(i) = scale_coef * value_.at(i);
516  }
517  }
518 
519 private:
520  return_type &value_;
521 };
522 
523 
524 
525 //****************************************************************************
526 // string tensor (for FieldFormula)
527 
528 
529 /**
530  * Mimics arma::mat<std::string>. Used in FieldFormula
531  */
533 public:
534  typedef std::string elem_type;
535 
536  StringTensor( unsigned int n_rows, unsigned int n_cols )
537  : n_rows(n_rows),n_cols(n_cols), values_(n_rows*n_cols) {}
538 
539  std::string & at(unsigned int row) { return at(row,0); }
540  std::string & at(unsigned int row, unsigned int col) { return values_[col*n_rows+row]; }
541 
542  void zeros() {
543  for( auto &elem: values_) elem = "0.0";
544  }
545  unsigned int n_rows;
546  unsigned int n_cols;
547 private:
549 
550 };
551 
552 
553 template<int NRows, int NCols>
555 {
558  if (NRows == NCols) {
559  // for square tensors allow initialization by diagonal vector, etc.
560  return IT::Array( IT::Array( IT::String(), 1), 1 );
561  }
562  else {
563  return IT::Array( IT::Array( IT::String(), NCols, NCols), NRows, NRows );
564  }
565 
566  }
567 
568  static void init_from_input(StringTensor &tensor, AccessType input) {
569  internal::init_matrix_from_input(tensor, input);
570  }
571 };
572 
573 template<>
574 struct StringTensorInput<1,1> {
575  typedef std::string AccessType;
576  static IT::String get_input_type() { return IT::String(); }
577  static void init_from_input(StringTensor &tensor, AccessType input) {
578  tensor.at(0,0) = input;
579  }
580 };
581 
582 template<int Nrows>
583 struct StringTensorInput<Nrows,1> {
586  return IT::Array( IT::String(), 1);
587  }
588  static void init_from_input(StringTensor &tensor, AccessType input) {
589  internal::init_vector_from_input(tensor, input);
590  }
591 };
592 
593 
594 
595 
596 /**
597  * Class that provides common template-less interface to all templated Field structes.
598  *
599  * Maybe we can delete this since common interface will be given by "Quantity".
600  */
601 
602 template <int spacedim>
603 struct FieldValue {
604  // typedefs for possible field values
613 };
614 
615 
616 
617 
618 
619 
620 
621 
622 
623 
624 #endif /* FIELD_VALUES_HH_ */
void init_from_input(AccessType val)
internal::ReturnType< 1, 1, ET >::return_type return_type
Iterator< ValueType > begin() const
internal::InputType< ET >::type ElementInputType
Accessor to input data conforming to declared Array.
Definition: accessors.hh:561
static const return_type & from_raw(return_type &val, ET *raw_data)
static IT::Array get_input_type()
EI_Address ei_address() const
Definition: accessors.cc:314
void set_n_comp(unsigned int)
arma::Col< unsigned int > return_type
Definition: field_values.hh:92
std::vector< std::string > values_
static void init_from_input(StringTensor &tensor, AccessType input)
internal::InputType< ET >::type ElementInputType
static void init_from_input(StringTensor &tensor, AccessType input)
bool equal_to(const return_type &other)
FieldValue_< 0, 1, int > IntVector
static const return_type & from_raw(return_type &val, ET *raw_data)
void set_n_comp(unsigned int n_comp)
std::string format(CStringRef format_str, ArgList args)
Definition: format.h:3141
void set_n_comp(unsigned int)
void init_from_input(AccessType rec)
void scale(double scale_coef)
Class for representing parametric types in IST.
Definition: type_generic.hh:52
static std::string type_name()
RT & set_raw_vec(RT &val, double *raw_data)
void set_n_comp(unsigned int)
unsigned int n_cols() const
const ET * mem_ptr()
internal::ReturnType< NRows, NCols, ET >::return_type return_type
FieldValue_(return_type &val)
void init_from_input(AccessType rec)
Input::Type::Selection type
Definition: field_values.hh:64
FieldValue_< 1, 1, FieldEnum > Enum
Class for declaration of the integral input data.
Definition: type_base.hh:483
void init_matrix_from_input(MatrixType &value, Input::Array rec)
void init_from_input(AccessType rec)
Class for declaration of inputs sequences.
Definition: type_base.hh:339
static constexpr bool value
Definition: json.hpp:87
arma::Col< unsigned int >::template fixed< NRows > return_type
Definition: field_values.hh:95
StringTensor(unsigned int n_rows, unsigned int n_cols)
internal::InputType< ET >::type ElementInputType
static IT::Array get_input_type()
Class for declaration of the input data that are floating point numbers.
Definition: type_base.hh:534
static std::string type_name()
FieldValue_< 0, 1, FieldEnum > EnumVector
std::string elem_type
unsigned int FieldEnum
Definition: field_values.hh:41
static constexpr bool is_scalable()
unsigned int n_rows
internal::InputType< ET >::type ElementInputType
internal::ReturnType< NRows, 1, ET >::return_type return_type
void scale(double scale_coef)
bool equal_to(const return_type &other)
static constexpr bool is_scalable()
return_type & value_
std::string & at(unsigned int row, unsigned int col)
FieldValue_< spacedim, 1, double > VectorFixed
bool equal_to(const return_type &other)
static IT::Array get_input_type()
void init_vector_from_input(VectorType &value, Input::Array rec)
static std::string type_name()
unsigned int n_rows() const
RT & set_raw_fix(RT &val, double *raw_data)
arma::Mat< ET >::template fixed< NRows, NCols > return_type
Definition: field_values.hh:72
static void init_from_input(StringTensor &tensor, AccessType input)
internal::ReturnType< 0, 1, ET >::return_type return_type
static constexpr bool is_scalable()
TYPEDEF_ERR_INFO(EI_InputMsg, const string)
std::string & at(unsigned int row)
const double epsilon
Definition: mathfce.h:23
unsigned int n_cols() const
static IT::Array get_input_type()
unsigned int n_rows() const
Input::Type::Integer type
Definition: field_values.hh:61
arma::Mat< unsigned int >::template fixed< NRows, NCols > return_type
Definition: field_values.hh:86
unsigned int n_cols() const
void scale(double scale_coef)
Input::Type::Double type
Definition: field_values.hh:58
unsigned int n_cols
FieldValue_< 1, 1, int > Integer
FieldValue_(return_type &val)
FieldValue_< 0, 1, double > Vector
internal::AccessTypeDispatch< ET >::type AccessType
static std::string type_name()
DECLARE_INPUT_EXCEPTION(ExcFV_Input,<< "Wrong field value input: "<< EI_InputMsg::val)
static const return_type & from_raw(return_type &val, ET *raw_data)
FieldValue_(return_type &val)
static IT::Array get_input_type()
void scale(double scale_coef)
unsigned int size() const
Input::Array AccessType
static const return_type & from_raw(return_type &val, ET *raw_data)
FieldValue_< spacedim, spacedim, double > TensorFixed
unsigned int n_rows() const
Input::Array AccessType
unsigned int n_cols() const
arma::Col< ET >::template fixed< NRows > return_type
Definition: field_values.hh:81
RT & set_raw_scalar(RT &val, double *raw_data)
Definition: field_values.hh:99
Class for declaration of the input data that are in string format.
Definition: type_base.hh:582
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Definition: exceptions.hh:45
static IT::Parameter get_input_type()
Template for classes storing finite set of named values.
static IT::String get_input_type()
FieldValue_< 1, 1, double > Scalar
bool equal_to(const return_type &other)
FieldValue_(return_type &val)
unsigned int n_rows() const
static constexpr bool is_scalable()