18 #ifndef FIELD_COMMON_HH_ 19 #define FIELD_COMMON_HH_ 66 <<
"Non-ascending time: " << EI_Time::val <<
" for field " << EI_Field::qval <<
".\n");
68 <<
"Missing domain specification (region or r_id) in the field descriptor:");
70 <<
"Two copies of the field " << EI_Field::qval <<
"call set_mesh with different arguments.\n");
87 { name_=shared_->input_name_ = name;
94 { shared_->input_description_ = description;
return *
this;}
106 { shared_->input_default_ = input_default;
return *
this;}
119 { shared_->units_ = units;
return *
this;}
129 shared_->input_element_selection_=element_selection;
141 { type_of_output_data_ = rt;
return *
this; }
154 { flags().add(mask);
return *
this; }
167 std::sort( cpy.begin(), cpy.end() );
168 cpy.erase( std::unique( cpy.begin(), cpy.end() ), cpy.end() );
169 if (names.size() != cpy.size()) {
170 THROW( Input::ExcInputMessage() << EI_Message(
"The field " + this->input_name()
171 +
" has set non-unique names of components.") );
175 shared_->comp_names_ = names;
176 shared_->n_comp_ = (shared_->n_comp_ ? names.size() : 0);
197 {
return shared_->input_name_;}
199 const std::string &
name()
const 203 {
return shared_->input_description_;}
206 {
return shared_->input_default_;}
210 ASSERT(shared_->units_.is_def())(name()).error(
"Getting undefined unit.\n");
211 return shared_->units_;
215 {
return type_of_output_data_; }
218 {
return shared_->bc_;}
221 {
return shared_->n_comp_;}
224 {
return shared_->mesh_;}
234 {
return last_time_; }
241 return is_jump_time_;
255 virtual bool is_constant(
Region reg) =0;
285 return ( (set_time_result_ == TimeStatus::changed) );
293 static IT::Record field_descriptor_record(
const string& record_name);
298 static const std::string field_descriptor_record_description(
const string& record_name);
310 virtual IT::Array get_multifield_input_type() =0;
352 virtual void copy_from(
const FieldCommon & other) =0;
359 virtual void output(std::shared_ptr<OutputTime> stream) =0;
366 virtual void observe_output(std::shared_ptr<Observe> observe) =0;
374 this->component_index_ = idx;
383 return this->multifield_;
411 last_time_ = -numeric_limits<double>::infinity();
525 double last_time_ = -numeric_limits<double>::infinity();
553 static const unsigned int history_length_limit_=3;
566 <<
"field name:" << field.
name()
567 <<
" n. comp.:" << field.
n_comp()
569 <<
" last limit side:" << limit_side_str[(
unsigned int) field.
last_limit_side_];
virtual void set_mesh(const Mesh &mesh)
std::string input_description_
Common abstract parent of all Field<...> classes.
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)
FieldCommon & flags_add(FieldFlag::Flags::Mask mask)
unsigned int component_index_
vector< Input::Record > input_list_
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...
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
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
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
bool is_multifield() const
LimitSide last_limit_side_
std::vector< FieldEnum > no_check_values_
FieldCommon & description(const string &description)
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
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
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.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Representation of one time step..
TimeStatus set_time_result_
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_