24 #include <boost/algorithm/string/replace.hpp> 34 OLD_ASSERT(&add_field==found_field,
"Another field of the same name exists when adding field: %s\n",
35 add_field.
name().c_str());
45 for(
auto field_ptr : other.
field_list) this->operator +=(*field_ptr);
54 for(
auto name : names)
set += (*this)[name];
60 FieldSet FieldSet::subset( FieldFlag::Flags::Mask mask)
const {
70 string rec_name = equation_name +
":Data";
87 std::shared_ptr<Input::Type::TypeBase> field_type_ptr;
99 if (default_val !=
"") {
100 boost::replace_all(default_val,
"\"",
"\\\"");
141 auto &
field = (*this)[dest_field_name];
157 if (found_field)
return *found_field;
159 THROW(ExcUnknownField() << FieldCommon::EI_Field(field_name));
165 bool changed_all=
false;
173 bool changed_all=
false;
188 bool is_jump =
false;
196 for (
unsigned int i_reg_patch=0; i_reg_patch<cache_map.
n_regions(); ++i_reg_patch) {
205 std::unordered_set<const FieldCommon *> used_fields;
207 unordered_map<std::string, unsigned int>::iterator
it;
218 if (used_fields.find(f) != used_fields.end() )
return;
219 used_fields.insert(f);
221 for (
auto f_dep : dep_vec) {
256 s <<
"\nregion_idx " << reg_it.first <<
": ";
257 for (
auto f_it : reg_it.second) {
258 s << f_it->name() <<
", ";
std::vector< FieldCommon * > field_list
List of all fields.
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell...
unsigned int size() const
FieldDepth depth_
Field holds surface depth for computing of FieldFormulas.
bool is_jump_time() const
Common abstract parent of all Field<...> classes.
Container for various descendants of FieldCommonBase.
std::map< unsigned int, std::vector< const FieldCommon * > > region_field_update_order_
virtual void copy_from(const FieldCommon &other)=0
const Mesh * mesh_
Pointer to the mesh.
FieldCommon & operator[](const std::string &field_name) const
FieldCoords X_
Field holds coordinates for computing of FieldFormulas.
void set_field_coords(FieldCoords *field_coords)
Setter of field_coords data member.
void set_dependency(FieldSet &used_fieldset)
virtual bool is_constant(Region reg)=0
Implementation of bidirectional map.
virtual std::string get_value_attribute() const =0
virtual IT::Instance get_input_type()=0
Directing class of FieldValueCache.
virtual bool set_time(const TimeStep &time, LimitSide limit_side)=0
static string field_default_value()
const RegionDB & region_db() const
#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)
#define ASSERT_GT_DBG(a, b)
Definition of comparative assert macro (Greater Than) only for debug mode.
std::string print_dependency() const
Return order of evaluated fields by dependency and region_idx.
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
unsigned int n_regions() const
Return number of stored regions.
unsigned int region_idx_from_chunk_position(unsigned int chunk_pos) const
Return begin position of region chunk specified by position in map.
FieldCommon * field(const std::string &field_name) const
Range< FieldListAccessor > fields_range() const
Returns range of Fields held in field_list.
static constexpr Mask input_copy
FieldCommon & input_default(const string &input_default)
static IT::Record field_descriptor_record(const string &record_name)
virtual std::vector< const FieldCommon * > set_dependency(FieldSet &field_set, unsigned int i_reg) const =0
void set_field(const std::string &dest_field_name, FieldCommon &source)
static string field_value_shape()
bool is_multifield() const
void topological_sort(const FieldCommon *f, unsigned int i_reg, std::unordered_set< const FieldCommon * > &used_fields)
Helper method sort used fields by dependency.
FieldCommon & description(const string &description)
virtual IT::Array get_multifield_input_type()=0
void cache_update(ElementCacheMap &cache_map)
bool set_time(const TimeStep &time, LimitSide limit_side)
bool is_constant(Region reg) const
FieldCommon & name(const string &name)
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc...
static string field_unit()
void set_mesh(const Mesh &mesh)
friend std::ostream & operator<<(std::ostream &stream, const FieldSet &set)
FieldCommon & flags(FieldFlag::Flags::Mask mask)
const std::string & input_name() const
Class for representation SI units of Fields.
virtual void cache_update(ElementCacheMap &cache_map, unsigned int region_patch_idx) const =0
FieldSet()
Default constructor.
#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) ...