8 #ifndef FIELD_COMMON_HH_
9 #define FIELD_COMMON_HH_
27 namespace IT=Input::Type;
53 <<
"Non-ascending time: " << EI_Time::val <<
" for field " << EI_Field::qval <<
".\n");
55 <<
"Missing domain specification (region, r_id, or r_set) in the field descriptor:");
57 <<
"Two copies of the field " << EI_Field::qval <<
"call set_mesh with different arguments.\n");
74 { name_=shared_->input_name_ = name;
81 { shared_->input_description_ = description;
return *
this;}
93 { shared_->input_default_ = input_default;
return *
this;}
106 { shared_->units_ = units;
return *
this;}
116 shared_->input_element_selection_=element_selection;
128 { type_of_output_data_ = rt;
return *
this; }
141 { flags().add(mask);
return *
this; }
151 shared_->comp_names_ = names;
152 shared_->n_comp_ = (shared_->n_comp_ ? names.size() : 0);
178 { this->limit_side_=side; }
184 {
return shared_->input_name_;}
186 const std::string &
name()
const
190 {
return shared_->input_description_;}
193 {
return shared_->input_default_;}
196 {
return shared_->units_;}
199 {
return type_of_output_data_; }
202 {
return shared_->bc_;}
205 {
return shared_->n_comp_;}
208 {
return shared_->mesh_;}
211 {
return limit_side_;}
221 {
return last_time_; }
229 static IT::Record field_descriptor_record(
const string& record_name);
241 virtual IT::Record &get_multifield_input_type() =0;
265 virtual bool set_time(
const TimeStep &time) =0;
271 virtual void copy_from(
const FieldCommon & other) =0;
290 virtual bool is_constant(
Region reg) =0;
299 return ( (set_time_result_ == TimeStatus::changed) );
307 this->component_index_ = idx;
316 return this->multifield_;
344 last_time_ = -numeric_limits<double>::infinity();
460 double last_time_ = -numeric_limits<double>::infinity();
481 static const unsigned int history_length_limit_=3;
491 string limit_side_str =
497 <<
"field name:" << field.
name()
498 <<
" limit side:" << limit_side_str
499 <<
" n. comp.:" << field.
n_comp()
virtual void set_mesh(const Mesh &mesh)
std::string input_description_
Common abstract parent of all Field<...> classes.
void set_limit_side(LimitSide side)
static constexpr Mask allow_output
The field can output. Is part of generated output selection. (default on)
FieldCommon & flags_add(FieldFlag::Flags::Mask mask)
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
unsigned int component_index_
const std::string & input_default() const
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
const std::string description() const
Basic time management class.
std::shared_ptr< SharedData > shared_
OutputTime::DiscreteSpace output_type() const
friend std::ostream & operator<<(std::ostream &stream, const FieldCommon &field)
const std::string & name() const
FieldFlag::Flags & flags()
FieldCommon & input_default(const string &input_default)
const UnitSI & units() const
FieldCommon & input_selection(const Input::Type::Selection *element_selection)
const IT::Selection * input_element_selection_
Input::Iterator< Input::Record > list_it_
bool is_multifield() const
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
The class for outputting data during time.
std::vector< FieldEnum > no_check_values_
FieldCommon & description(const string &description)
void set_component_index(unsigned int idx)
LimitSide limit_side() const
const Mesh * mesh() const
FieldCommon & name(const string &name)
unsigned int n_comp() const
DECLARE_INPUT_EXCEPTION(ExcFV_Input,<< "Wrong field value input: "<< EI_InputMsg::val)
void set_components(const std::vector< string > &names)
void set_history_changed()
FlagArray< FieldFlag > Flags
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)
Class for representation SI units of Fields.
Representation of one time step.
TimeStatus set_time_result_
Status of history.
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) ...
std::vector< std::string > comp_names_
bool is_fully_initialized_