Flow123d  JS_before_hm-1576-g4d0b70e
field_common.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_common.hh
15  * @brief
16  */
17 
18 #ifndef FIELD_COMMON_HH_
19 #define FIELD_COMMON_HH_
20 
21 #include <algorithm> // for sort, unique
22 #include <limits> // for numeric_limits
23 #include <memory> // for shared_ptr
24 #include <ostream> // for operator<<
25 #include <string> // for string, basic_...
26 #include <utility> // for make_pair, pair
27 #include <vector> // for vector, allocator
28 #include "fields/field_algo_base.hh" // for FieldResult
29 #include "fields/field_flag.hh" // for FieldFlag, Fie...
30 #include "fields/field_values.hh" // for FieldEnum
31 #include "tools/unit_si.hh" // for UnitSI
32 #include "input/accessors.hh" // for Record, Array ...
33 #include "input/input_exception.hh" // for ExcInputMessage
34 #include "input/type_base.hh" // for Array, Type
35 #include "input/type_generic.hh" // for Instance
36 #include "input/type_record.hh" // for Record
37 #include "input/type_selection.hh" // for Selection
38 #include "io/output_time.hh" // for OutputTime
39 #include "mesh/region.hh" // for Region (ptr only)
40 #include "system/asserts.hh" // for Assert, ASSERT
41 #include "system/exc_common.hh" // for EI_Message
42 #include "system/exceptions.hh" // for operator<<
43 #include "system/flag_array.hh" // for FlagArray<>::Mask
44 #include "tools/time_governor.hh" // for TimeGovernor (...
45 
46 class Mesh;
47 class Observe;
48 class EvalPoints;
49 class ElementCacheMap;
50 class FieldSet;
51 
52 
53 using namespace std;
54 
55 namespace IT=Input::Type;
56 
57 /**
58  * Left and right time limit, used in the @p set_time() method.
59  * Assigned values allow to index an array.
60  */
61 enum class LimitSide {
62  left=0,
63  right=1
64 };
65 
66 
67 
68 /**
69  * @brief Common abstract parent of all Field<...> classes.
70  *
71  * We need common ancestor in order to keep a list of all fields in one EqData object and allow
72  * collective operations like @p set_time or @p init_from_input.
73  */
74 class FieldCommon {
75 
76 public:
77  TYPEDEF_ERR_INFO(EI_Time, double);
78  TYPEDEF_ERR_INFO(EI_Field, std::string);
79  DECLARE_INPUT_EXCEPTION(ExcNonascendingTime,
80  << "Non-ascending time: " << EI_Time::val << " for field " << EI_Field::qval << ".\n");
81  DECLARE_INPUT_EXCEPTION(ExcMissingDomain,
82  << "Missing domain specification (region or r_id) in the field descriptor:");
83  DECLARE_EXCEPTION(ExcFieldMeshDifference,
84  << "Two copies of the field " << EI_Field::qval << "call set_mesh with different arguments.\n");
85 
86 
87 
88  /// Store data of one initialization message.
89  struct MessageData {
90  /// Constructor
91  MessageData(std::string default_value, std::string field_name, std::string region_list)
92  : default_value_(default_value), field_name_(field_name), region_list_(region_list) {};
93 
94  std::string default_value_; ///< Default value of the field.
95  std::string field_name_; ///< Parameter name_ of the field.
96  std::string region_list_; ///< List of regions separated by comma.
97  };
98 
99  /**
100  * Set name of the field. In fact there are two attributes set by this method.
101  *
102  * The first is name used to identify the field as part of a FieldSet or MultiField objects.
103  * This name is permanent and can be set only by this method. Can be accessed by @p name() method.
104  * This name is also used at output.
105  *
106  * The second is @p input_name_ that determines appropriate key name in the input field descriptor.
107  * This name is also set by this method, but is stored in the internal shared space which
108  * is overwritten during call of copy_from method or assignment operator. Can be accessed by @p input_name() mathod.
109  *
110  */
111  FieldCommon &name(const string & name)
112  { name_=shared_->input_name_ = name;
113  return *this;
114  }
115  /**
116  * Set description of the field, used for description of corresponding key in documentation.
117  */
118  FieldCommon & description(const string & description)
119  { shared_->input_description_ = description; return *this;}
120  /**
121  * Set default value for the field's key from which the default constant valued field will be constructed.
122  *
123  * During the first call of the @p set_time method, we check that the field is defined on all regions.
124  * On regions where it is not set yet, we use given @p dflt string to get particular instance of
125  * FieldBase<> (see @p check_initialized_region_fields_).
126  * The default string is interpreted in the same way as if it appears in the input file
127  * as the value of the field. In particular it can be whole record with @p TYPE of the field etc.
128  * Most common choice is however mere constant.
129  */
130  FieldCommon & input_default(const string &input_default)
131  { shared_->input_default_ = input_default; return *this;}
132  /**
133  * @brief Set basic units of the field.
134  *
135  * Currently, we use it only during output and we represents units just by a string.
136  *
137  * TODO:
138  * Particular class for representing and conversion of various units would be more appropriate.
139  * This can allow specification of the units on the inptu, automatic conversion and the same on the output.
140  * Possibly this allow using Boost::Units library, however, it seems to introduce lot of boilerplate code.
141  * But can increase correctness of the calculations.
142  */
143  FieldCommon & units(const UnitSI & units)
144  { shared_->units_ = units; return *this;}
145 
146  /**
147  * Set limits of value of the field.
148  */
149  FieldCommon & set_limits(double min, double max = std::numeric_limits<double>::max())
150  {
151  ASSERT(min < max)(min)(max).error("Invalid field limits!");
152  shared_->limits_ = std::make_pair(min, max);
153  return *this;
154  }
155 
156  /**
157  * For the fields returning "Enum", we have to pass the Input::Type::Selection object to
158  * the field implementations.
159  *
160  * We must save raw pointer since selection may not be yet initialized (during static initialization phase).
161  */
163  {
164  shared_->input_element_selection_=element_selection;
165  return *this;
166  }
167 
168  /**
169  * Output discrete space used in the output() method. Can be different for different field copies.
170  * one can choose between:
171  * data constant on elements, linear data given in nodes, and discontinuous linear data.
172  *
173  * If not set explicitly by this method, the default value is OutputTime::ELEM_DATA
174  */
176  { if (rt!=OutputTime::UNDEFINED) type_of_output_data_ = rt; return *this; }
177 
178  /**
179  * Set given mask to the field flags, ignoring default setting.
180  * Default setting is declare_input & equation_input & allow_output.
181  */
182  FieldCommon & flags(FieldFlag::Flags::Mask mask)
183  { flags_ = FieldFlag::Flags(mask); return *this; }
184 
185  /**
186  * Add given mask to the field flags.
187  */
188  FieldCommon & flags_add(FieldFlag::Flags::Mask mask)
189  { flags().add(mask); return *this; }
190 
191  /**
192  * Set vector of component names.
193  * Set number of components for run-time sized vectors. This is used latter when we construct
194  * objects derived from FieldBase<...>.
195  *
196  * n_comp_ is constant zero for fixed values, this zero is set by Field<...> constructors
197  */
198  void set_components(const std::vector<string> &names) {
199  // Test of unique values in names vector for MultiField
200  if (multifield_) {
201  std::vector<string> cpy = names;
202  std::sort( cpy.begin(), cpy.end() );
203  cpy.erase( std::unique( cpy.begin(), cpy.end() ), cpy.end() );
204  if (names.size() != cpy.size()) {
205  THROW( Input::ExcInputMessage() << EI_Message("The field " + this->input_name()
206  + " has set non-unique names of components.") );
207  }
208  shared_->n_comp_ = names.size();
209  } else {
210  shared_->n_comp_ = (shared_->n_comp_ ? names.size() : 0);
211  }
212 
213  shared_->comp_names_ = names;
214  }
215 
216 
217  /**
218  * Set internal mesh pointer.
219  */
220  virtual void set_mesh(const Mesh &mesh) = 0;
221  /**
222  * Set the data list from which field will read its input. It is list of "field descriptors".
223  * When reading from the input list we consider only field descriptors containing key of
224  * named by the field name. These field descriptors has to have times forming ascending sequence.
225  *
226  * The list is used by set_time method to set field on individual regions to actual FieldBase descendants.
227  */
228  virtual void set_input_list(const Input::Array &list, const TimeGovernor &tg) =0;
229 
230  /**
231  * Getters.
232  */
233  const std::string &input_name() const
234  { return shared_->input_name_;}
235 
236  const std::string &name() const
237  { return name_;}
238 
239  const std::string description() const
240  {return shared_->input_description_;}
241 
242  const std::string &input_default() const
243  { return shared_->input_default_;}
244 
245  const UnitSI &units() const
246  {
247  ASSERT(shared_->units_.is_def())(name()).error("Getting undefined unit.\n");
248  return shared_->units_;
249  }
250 
251  std::pair<double, double> limits() const
252  {
253  return shared_->limits_;
254  }
255 
257  { return type_of_output_data_; }
258 
259  bool is_bc() const
260  { return shared_->bc_;}
261 
262  unsigned int n_comp() const
263  { return shared_->comp_names_.size();}
264 
265  const Mesh * mesh() const
266  { return shared_->mesh_;}
267 
269  { return flags_; }
270 
272  { return flags_; }
273 
274  /**
275  * Returns time set by last call of set_time method.
276  * Can be different for different field copies.
277  */
278  double time() const
279  { return last_time_; }
280 
281  /**
282  * Returns true if the field change algorithm for the current time set through the @p set_time method.
283  * This happen for all times in the field descriptors on the input of this particular field.
284  */
285  bool is_jump_time() {
286  return is_jump_time_;
287  }
288 
289  /**
290  * Returns number of field descriptors containing the field.
291  */
292  unsigned int input_list_size() const {
293  return shared_->input_list_.size();
294  }
295 
296  /**
297  * If the field on given region @p reg exists and is of type FieldConstant<...> the method method returns true
298  * otherwise it returns false.
299  * Then one can call ElementAccessor<spacedim>(mesh(), reg ) to construct an ElementAccessor @p elm
300  * pointing to "virtual" element on which Field::value returns constant value.
301  * Unlike the Field<>::field_result method, this one provides no value, so it have common header (arguments, return type) and
302  * could be part of FieldCommon and FieldSet which is useful in some applications.
303  *
304  * TODO:Current implementation use virtual functions and can be prohibitively slow if called for every element. If this
305  * becomes necessary it is possible to incorporate such test into set_time method and in this method just return precomputed result.
306  */
307  virtual bool is_constant(Region reg) =0;
308 
309 
310  /**
311  * @brief Indicates special field states.
312  *
313  * Extension of the previous method. Return possible values from the enum @p FieldResult, see description there.
314  * The initial state is @p field_none, if the field is correctly set on all regions of the @p region_set given as parameter
315  * we return state @p field_other or even more particular result.
316  *
317  * Special field values spatially constant. Could allow optimization of tensor multiplication and
318  * tensor or vector addition. field_result_ should be set in constructor and in set_time method of particular Field implementation.
319  * We return value @p result_none, if the field is not initialized on the region of the given element accessor @p elm.
320  * Other possible results are: result_zeros, result_eye, result_ones, result_constant, result_other
321  * see @p FieldResult for explanation.
322  *
323  * Multifield return most particular value that holds for all its subfields.
324  *
325  *
326  */
327  virtual FieldResult field_result( RegionSet region_set) const =0;
328 
329  /**
330  * Return specification of the field value type in form of the string:
331  * [ <element type>, NRows, NCols]
332  *
333  * Result is valid JSON (and/or flow style YAML).
334  * For multifields not implemented.
335  */
336  virtual std::string get_value_attribute() const =0;
337 
338  /**
339  * Returns true if set_time_result_ is not @p TimeStatus::constant.
340  * Returns the same value as last set_time method.
341  */
342  bool changed() const
343  {
344  ASSERT( set_time_result_ != TimeStatus::unknown ).error("Invalid time status.");
345  return ( (set_time_result_ == TimeStatus::changed) );
346  }
347 
348  /**
349  * Common part of the field descriptor. To get finished record
350  * one has to add keys for individual fields. This is done automatically
351  * using FieldSet::get_input_type().
352  */
353  static IT::Record field_descriptor_record(const string& record_name);
354 
355  /**
356  * Create description of field descriptor record.
357  */
358  static const std::string field_descriptor_record_description(const string& record_name);
359 
360  /**
361  * Returns input type for particular field instance, this is reference to a static member input_type of the corresponding @p FieldBase
362  * class (i.e. with the same template parameters). This is used in FieldSet::make_field_descriptor_type.
363  */
364  virtual IT::Instance get_input_type() =0;
365 
366  /**
367  * Returns input type for MultiField instance.
368  * TODO: temporary solution, see @p multifield_
369  */
370  virtual IT::Array get_multifield_input_type() =0;
371 
372  /**
373  * Pass through the input array @p input_list_, collect all times where the field could change and
374  * put appropriate time marks into global TimeMarks object.
375  * Introduced time marks have both given @p mark_type and @p type_input() type.
376  *
377  * Further development:
378  * - we have to distinguish "jump" times and "smooth" times
379  */
380  void mark_input_times(const TimeGovernor &tg);
381 
382  /**
383  * Abstract method to update field to the new time level.
384  * Implemented by in class template Field<...>.
385  *
386  * Return true if the value of the field was changed on some region.
387  * The returned value is also stored in @p changed_during_set_time data member.
388  *
389  * Default values helps when creating steady field. Note that default TimeGovernor constructor
390  * set time to 0.0.
391  *
392  * Different field copies can be set to different times.
393  *
394  * TODO: update following:
395  * Set side of limit when calling @p set_time
396  * with jump time, i.e. time where the field change implementation on some region.
397  * Wee assume that implementations prescribe only smooth fields.
398  * This method invalidate result of
399  * @p changed() so it should be called just before @p set_time.
400  * Can be different for different field copies.
401  */
402  virtual bool set_time(const TimeStep &time, LimitSide limit_side) =0;
403 
404  /**
405  * Check that @p other is instance of the same Field<..> class and
406  * perform assignment. Polymorphic copy.
407  *
408  * The copy is performed only if *this have set flag 'input_copy'.
409  * If *this have set also the flag 'decare_input' the copy is performed only if the
410  * input_list is empty.
411  */
412  virtual void copy_from(const FieldCommon & other) =0;
413 
414  /**
415  * Output the field.
416  * The parameter @p output_fields is checked for value named by the field name. If the key exists,
417  * then the output of the field is performed. If the key do not appear in the input, no output is done.
418  */
419  virtual void field_output(std::shared_ptr<OutputTime> stream) =0;
420 
421  /**
422  * Perform the observe output of the field.
423  * The Observe object passed by the parameter is called with the particular Field<> as the parameter
424  * to evaluate the field in observation points and store the values in the OutputData arrays.
425  */
426  virtual void observe_output(std::shared_ptr<Observe> observe) =0;
427 
428  /**
429  * Set reference of FieldSet to all instances of FieldFormula.
430  */
431  virtual std::vector<const FieldCommon *> set_dependency(FieldSet &field_set, unsigned int i_reg) const =0;
432 
433  /**
434  * Sets @p component_index_
435  */
436  void set_component_index(unsigned int idx)
437  {
438  this->component_index_ = idx;
439  }
440 
441  /**
442  * Return @p multifield_ flag.
443  * TODO: temporary solution
444  */
445  inline bool is_multifield() const
446  {
447  return this->multifield_;
448  }
449 
450  /**
451  * Reallocate field value cache of Field on given region.
452  */
453  virtual void cache_reallocate(const ElementCacheMap &cache_map, unsigned int region_idx) const = 0;
454 
455  /**
456  * Read data to cache for appropriate elements given by ElementCacheMap object.
457  */
458  virtual void cache_update(ElementCacheMap &cache_map, unsigned int region_patch_idx) const = 0;
459 
460 
461  /**
462  * Returns pointer to this (Field) or the sub-field component (MultiField).
463  */
464  virtual FieldCommon *get_component(FMT_UNUSED unsigned int idx) {
465  return this;
466  }
467 
468 
469  /**
470  * Returns FieldValueCache if element_type of field is double or nullptr for other element_types.
471  */
472  virtual FieldValueCache<double> * value_cache() =0;
473 
474 
475  /**
476  * Same as previous but return const pointer
477  */
478  virtual const FieldValueCache<double> * value_cache() const =0;
479 
480 
481  /**
482  * Print stored messages to table.
483  *
484  * Return true if messages_data_ vector is nonempty and clear its.
485  */
486  static bool print_message_table(ostream& stream, std::string equation_name);
487 
488  /**
489  * Virtual destructor.
490  */
491  virtual ~FieldCommon();
492 
493  /**
494  * Hold shape of Field.
495  *
496  * Value is set in constructor of descendant class.
497  */
499 
500 
501 protected:
502  /**
503  * Private default constructor. Should be used only through
504  * Field<...>
505  */
506  FieldCommon();
507 
508  /**
509  * Private copy constructor. Should be used only through
510  * Field<...>
511  */
512  FieldCommon(const FieldCommon & other);
513 
514  /**
515  * Invalidate last time in order to force set_time method
516  * update region_fields_.
517  */
519  {
520  last_time_ = -numeric_limits<double>::infinity();
521  }
522 
523  void set_shape(uint n_rows, uint n_cols) {
524  if (n_cols==1) this->shape_ = { n_rows };
525  else this->shape_ = { n_rows, n_cols };
526  }
527 
528  /**
529  * Setters for essential field properties.
530  */
531  /**
532  * Data shared among copies of the same field.
533  *
534  * This allow field copies in different equations with different time setting, but
535  * sharing common input field descriptor array and common history.
536  */
537  struct SharedData {
538  /**
539  * Empty constructor.
540  */
542  : list_idx_(0), limits_(std::make_pair(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max())) {};
543 
544  /**
545  * True for boundary fields.
546  */
547  bool bc_;
548  /**
549  * Number of components for fields that return variable size vectors. Zero in other cases.
550  */
551  unsigned int n_comp_;
552  /**
553  * Names of field components.
554  */
556  /**
557  * Name of the particular field. Used to name the key in the Field list Record.
558  */
559  std::string input_name_;
560  /**
561  * Description of corresponding key in the Field list Record.
562  */
563  std::string input_description_;
564  /**
565  * Units of the field values. Currently just a string description.
566  */
568  /**
569  * For Enum valued fields this is the input type selection that should be used
570  * to read possible values of the field (e.g. for FieldConstant the key 'value' has this selection input type).
571  *
572  * Is empty selection for for non-enum values fields.
573  */
575  /**
576  * Possible default value of the field.
577  */
579  /**
580  * Pointer to the mesh on which the field lives.
581  */
582  const Mesh *mesh_;
583 
584  /**
585  * Vector of input field descriptors from which the field is set.
586  */
588 
589  /**
590  * Index to current position of input field descriptor.
591  */
592  unsigned int list_idx_;
593 
594  /**
595  * True after check_initialized_region_fields_ is called. That happen at first call of the set_time method.
596  */
598 
599  /**
600  * For which values of an enum valued field we do not
601  * check the field. User is responsible, that the value will not be called
602  * on such regions.
603  */
605 
606  /**
607  * Allow set minimal and maximal limit value of Field.
608  */
609  std::pair<double, double> limits_;
610 
611 
612  };
613 
614  /**
615  * Name that identifies the field in the field_set. By default this is same as
616  * shared_->input_name_.
617  */
618  std::string name_;
619 
620  /**
621  * Data shared among copies of the same input field.
622  */
623  std::shared_ptr<SharedData> shared_;
624 
625  /**
626  * Result of last set time method
627  */
628  enum class TimeStatus {
629  changed, //< Field changed during last set time call.
630  constant, //< Field doesn't change.
631  unknown //< Before first call of set_time.
632  };
633 
634  // TODO: Merge time information: set_time_result_, last_time_, last_limit_side_, is_jump_time into
635  // a single structure with single getter.
636  /**
637  * Status of @p history.
638  */
640 
641  /**
642  * Last set time. Can be different for different field copies.
643  * Store also time limit, since the field may be discontinuous.
644  */
645  double last_time_ = -numeric_limits<double>::infinity();
646  LimitSide last_limit_side_ = LimitSide::left;
647 
648  /**
649  * Set to true by the @p set_time method the field algorithm change on any region.
650  * Accessible through the @p is_jump_time method.
651  */
653 
654  /**
655  * Output data type used in the output() method. Can be different for different field copies.
656  */
658 
659  /**
660  * Specify if the field is part of a MultiField and which component it is
661  */
662  unsigned int component_index_;
663 
664  /**
665  * Flag determining if object is Multifield or Field.
666  * TODO: temporary solution, goal is to make these two classes to behave similarly
667  */
669 
670  /**
671  * Maximum number of FieldBase objects we store per one region.
672  */
673  static const unsigned int history_length_limit_=3;
674 
675  /// Field flags. Default setting is "an equation input field, that can read from user input, and can be written to output"
677 
678  /// Vector of data of initialization messages.
680 
681  /**
682  * Stream output operator
683  */
684  friend std::ostream &operator<<(std::ostream &stream, const FieldCommon &field) {
685 
686  vector<string> limit_side_str = {"left", "right"};
687 
688  stream
689  << "field name:" << field.name()
690  << " n. comp.:" << field.n_comp()
691  << " last time:" << field.last_time_
692  << " last limit side:" << limit_side_str[(unsigned int) field.last_limit_side_];
693  return stream;
694  }
695 
696 public:
697 
698  /// Manually mark flag that the field has been changed.
700  { set_time_result_ = TimeStatus::changed; }
701 };
702 
703 
704 
705 
706 
707 
708 
709 #endif /* FIELD_COMMON_HH_ */
std::string input_description_
Common abstract parent of all Field<...> classes.
Definition: field_common.hh:74
Container for various descendants of FieldCommonBase.
Definition: field_set.hh:159
std::pair< double, double > limits_
bool is_jump_time_
Accessor to input data conforming to declared Array.
Definition: accessors.hh:566
unsigned int uint
FieldCommon & input_selection(Input::Type::Selection element_selection)
static constexpr Mask allow_output
The field can output. Is part of generated output selection. (default on)
Definition: field_flag.hh:37
FieldFlag::Flags get_flags() const
FieldCommon & flags_add(FieldFlag::Flags::Mask mask)
OutputTime::DiscreteSpace get_output_type() const
std::string name_
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
Definition: exceptions.hh:158
unsigned int component_index_
std::pair< double, double > limits() const
Store data of one initialization message.
Definition: field_common.hh:89
Definitions of ASSERTS.
vector< Input::Record > input_list_
Directing class of FieldValueCache.
Definition: mesh.h:77
Helper class that stores data of generic types.
Definition: type_generic.hh:89
double last_time_
const std::string & input_default() const
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
Definition: asserts.hh:347
Basic time management functionality for unsteady (and steady) solvers (class Equation).
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
const std::string description() const
Basic time management class.
Class for declaration of inputs sequences.
Definition: type_base.hh:339
std::vector< uint > shape_
std::string default_value_
Default value of the field.
Definition: field_common.hh:92
std::shared_ptr< SharedData > shared_
double time() const
friend std::ostream & operator<<(std::ostream &stream, const FieldCommon &field)
#define FMT_UNUSED
Definition: posix.h:75
std::string field_name_
Parameter name_ of the field.
Definition: field_common.hh:95
const std::string & name() const
FieldFlag::Flags & flags()
FieldCommon & input_default(const string &input_default)
const UnitSI & units() const
void set_time_result_changed()
Manually mark flag that the field has been changed.
MessageData(std::string default_value, std::string field_name, std::string region_list)
Constructor.
Definition: field_common.hh:91
virtual FieldCommon * get_component(FMT_UNUSED unsigned int idx)
unsigned int input_list_size() const
bool is_multifield() const
LimitSide last_limit_side_
void set_shape(uint n_rows, uint n_cols)
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
Definition: exceptions.hh:194
std::vector< FieldEnum > no_check_values_
FieldResult
bool is_jump_time()
#define DECLARE_INPUT_EXCEPTION(ExcName, Format)
Macro for simple definition of input exceptions.
FieldCommon & description(const string &description)
Class holds local coordinations of evaluating points (bulk and sides) specified by element dimension...
Definition: eval_points.hh:43
static std::vector< MessageData > messages_data_
Vector of data of initialization messages.
void set_component_index(unsigned int idx)
IT::Selection input_element_selection_
const Mesh * mesh() const
FieldCommon & name(const string &name)
unsigned int n_comp() const
bool changed() const
void set_components(const std::vector< string > &names)
Record type proxy class.
Definition: type_record.hh:182
void set_history_changed()
FieldCommon & set_limits(double min, double max=std::numeric_limits< double >::max())
FlagArray< FieldFlag > Flags
Definition: field_flag.hh:26
FieldCommon & flags(FieldFlag::Flags::Mask mask)
const std::string & input_name() const
static constexpr Mask equation_input
The field is data parameter of the owning equation. (default on)
Definition: field_flag.hh:33
Class for representation SI units of Fields.
Definition: unit_si.hh:40
bool is_bc() const
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Definition: exceptions.hh:53
Representation of one time step..
TimeStatus set_time_result_
std::string region_list_
List of regions separated by comma.
Definition: field_common.hh:96
Template for classes storing finite set of named values.
LimitSide
Definition: field_common.hh:61
FieldCommon & output_type(OutputTime::DiscreteSpace rt)
static constexpr Mask declare_input
The field can be set from input. The key in input field descriptor is declared. (default on) ...
Definition: field_flag.hh:35
std::vector< std::string > comp_names_