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