21 #include <boost/algorithm/string/replace.hpp> 28 OLD_ASSERT(&add_field==found_field,
"Another field of the same name exists when adding field: %s\n",
29 add_field.
name().c_str());
39 for(
auto field_ptr : other.
field_list) this->operator +=(*field_ptr);
47 for(
auto name : names)
set += (*this)[name];
53 FieldSet FieldSet::subset( FieldFlag::Flags::Mask mask)
const {
63 string rec_name = equation_name +
":Data";
68 for(
auto field : field_list) {
80 std::shared_ptr<Input::Type::TypeBase> field_type_ptr;
92 if (default_val !=
"") {
93 boost::replace_all(default_val,
"\"",
"\\\"");
134 auto &
field = (*this)[dest_field_name];
141 for(
auto field : field_list)
150 if (found_field)
return *found_field;
152 THROW(ExcUnknownField() << FieldCommon::EI_Field(field_name));
153 return *field_list[0];
158 bool changed_all=
false;
159 for(
auto field : field_list) changed_all =
field->
set_time(time, limit_side) || changed_all;
166 bool changed_all=
false;
181 bool is_jump =
false;
190 const string &desc,
const string & d_val) {
std::vector< FieldCommon * > field_list
List of all fields.
bool is_jump_time() const
Common abstract parent of all Field<...> classes.
Container for various descendants of FieldCommonBase.
virtual void copy_from(const FieldCommon &other)=0
FieldCommon & operator[](const std::string &field_name) const
virtual bool is_constant(Region reg)=0
virtual std::string get_value_attribute() const =0
virtual IT::Instance get_input_type()=0
virtual bool set_time(const TimeStep &time, LimitSide limit_side)=0
static string field_default_value()
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
static const std::string field_descriptor_record_description(const string &record_name)
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
FieldCommon * field(const std::string &field_name) const
FieldCommon & add_field(FieldCommon *field, const string &name, const string &desc, const string &d_val="")
FieldCommon & input_default(const string &input_default)
static IT::Record field_descriptor_record(const string &record_name)
void set_field(const std::string &dest_field_name, FieldCommon &source)
static string field_value_shape()
bool is_multifield() const
FieldCommon & description(const string &description)
virtual IT::Array get_multifield_input_type()=0
bool set_time(const TimeStep &time, LimitSide limit_side)
bool is_constant(Region reg) const
FieldCommon & name(const string &name)
static string field_unit()
friend std::ostream & operator<<(std::ostream &stream, const FieldSet &set)
FieldCommon & flags(FieldFlag::Flags::Mask mask)
const std::string & input_name() const
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Representation of one time step..
Input::Type::Record make_field_descriptor_type(const std::string &equation_name) const
static constexpr Mask declare_input
The field can be set from input. The key in input field descriptor is declared. (default on) ...