8 #ifndef FIELD_COMMON_HH_
9 #define FIELD_COMMON_HH_
25 namespace IT=Input::Type;
51 <<
"Non-ascending time: " << EI_Time::val <<
" for field " << EI_Field::qval <<
".\n");
53 <<
"Missing domain specification (region, r_id, or r_set) in the field descriptor:");
55 <<
"Two copies of the field " << EI_Field::qval <<
"call set_mesh with different arguments.\n");
72 { name_=shared_->input_name_ = name;
79 { shared_->input_description_ = description;
return *
this;}
91 { shared_->input_default_ = input_default;
return *
this;}
104 { shared_->units_ = units;
return *
this;}
114 shared_->input_element_selection_=element_selection;
126 { type_of_output_data_ = rt;
return *
this; }
139 { flags().add(mask);
return *
this; }
148 { shared_->n_comp_ = (shared_->n_comp_ ? n_comp : 0);}
170 virtual void set_limit_side(
LimitSide side) = 0;
176 {
return shared_->input_name_;}
178 const std::string &
name()
const
182 {
return shared_->input_description_;}
185 {
return shared_->input_default_;}
188 {
return shared_->units_;}
191 {
return type_of_output_data_; }
194 {
return shared_->bc_;}
197 {
return shared_->n_comp_;}
200 {
return shared_->mesh_;}
203 {
return limit_side_;}
213 {
return last_time_; }
221 static IT::Record field_descriptor_record(
const string& record_name);
257 virtual void copy_from(
const FieldCommon & other) =0;
276 virtual bool is_constant(
Region reg) =0;
284 ASSERT( set_time_result_ != TimeStatus::unknown,
"Invalid time status.\n");
285 return ( (set_time_result_ == TimeStatus::changed) );
313 last_time_ = -numeric_limits<double>::infinity();
420 double last_time_ = -numeric_limits<double>::infinity();
430 static const unsigned int history_length_limit_=3;
440 string limit_side_str =
446 <<
"field name:" << field.
name()
447 <<
" limit side:" << limit_side_str
448 <<
" n. comp.:" << field.
n_comp()
virtual void set_mesh(const Mesh &mesh)
std::string input_description_
Common abstract parent of all Field<...> classes.
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.
const std::string & input_default() const
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.
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_
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
The class for outputing data during time.
std::vector< FieldEnum > no_check_values_
FieldCommon & description(const string &description)
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_n_components(unsigned int n_comp)
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.
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) ...
bool is_fully_initialized_