Flow123d
jenkins-Flow123d-linux-release-multijob-282
|
Container for various descendants of FieldCommonBase. More...
#include <field_set.hh>
Public Member Functions | |
DECLARE_EXCEPTION (ExcUnknownField,<< "Field set has no field with name: "<< FieldCommon::EI_Field::qval) | |
Input::Type::Record | make_field_descriptor_type (const std::string &equation_name) const |
Input::Type::Selection | make_output_field_selection (const string &name, const string &desc="") |
void | set_field (const std::string &dest_field_name, FieldCommon &source) |
FieldCommon * | field (const std::string &field_name) const |
FieldCommon & | operator[] (const std::string &field_name) const |
void | set_components (const std::vector< string > &names) |
void | set_mesh (const Mesh &mesh) |
void | set_input_list (Input::Array input_list) |
void | set_limit_side (LimitSide side) |
void | flags_add (FieldFlag::Flags::Mask mask) |
void | set_time (const TimeStep &time) |
void | output_type (OutputTime::DiscreteSpace rt) |
void | mark_input_times (TimeMark::Type mark_type) |
bool | changed () const |
bool | is_constant (Region reg) const |
void | output (OutputTime *stream) |
FieldCommon & | add_field (FieldCommon *field, const string &name, const string &desc, const string &d_val="") |
Protected Attributes | |
std::vector< FieldCommon * > | field_list |
List of all fields. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const FieldSet &set) |
Additional Inherited Members | |
Public Types inherited from FieldFlag | |
typedef FlagArray< FieldFlag > | Flags |
typedef Flags::Mask | Mask |
Static Public Attributes inherited from FieldFlag | |
static constexpr unsigned int | flags_size_ = 3 |
Number of bits used by Field itself. More... | |
static constexpr Mask | equation_input {1} |
The field is data parameter of the owning equation. (default on) More... | |
static constexpr Mask | declare_input {2} |
The field can be set from input. The key in input field descriptor is declared. (default on) More... | |
static constexpr Mask | allow_output {4} |
The field can output. Is part of generated output selection. (default on) More... | |
static constexpr Mask | input_copy = ~declare_input & equation_input |
A field that is input of its equation and can not read from input, thus must be set by copy. More... | |
static constexpr Mask | in_time_term {8} |
A field is part of time term of the equation. More... | |
static constexpr Mask | in_main_matrix {16} |
A field is part of main "stiffness matrix" of the equation. More... | |
static constexpr Mask | in_rhs {32} |
A field is part of the right hand side of the equation. More... | |
static constexpr Mask | equation_result = allow_output & ~declare_input & ~equation_input |
Match result fields. These are never given by input or copy of input. More... | |
static constexpr Mask | equation_external_output = allow_output & input_copy |
Match an output field, that can be also copy of other field. More... | |
Container for various descendants of FieldCommonBase.
Provides various collective operations. Typical usage:
class EqData : public FieldSet { EqData() { *this += scalar_field .name("scalar_field") .description("Some description for input and output documentation.") .input_default("{0.0}") .units("m"); *this += vector_field .name("vector_field") .description("Some description for input and output documentation.") .units("m"); }
Field<3, FieldValue<3>::Scalar> scalar_field; Field<3, FieldValue<3>::Vector> vector_field; };
This way the fields are destructed just before their pointers stored in the FieldSet.
TODO: Some set_XY functions set also to the fields added to the FieldSet in future. This behavior should be removed, since it is misleading in combination with mask subsets. If one set something to mask subset, it does not influence fields added to the original field set even if they match the mask of the subset.
Definition at line 51 of file field_set.hh.
FieldCommon & FieldSet::add_field | ( | FieldCommon * | field, |
const string & | name, | ||
const string & | desc, | ||
const string & | d_val = "" |
||
) |
OBSOLETE
Adds given field into list of fields for group operations on fields. Parameters are: field
pointer, name
of the key in the input, desc
- description of the key, and optional parameter d_val
with default value. This method is rather called through the macro ADD_FIELD
Definition at line 153 of file field_set.cc.
bool FieldSet::changed | ( | ) | const |
Collective interface to FieldCommonBase::set_mesh()
.
Definition at line 127 of file field_set.cc.
FieldSet::DECLARE_EXCEPTION | ( | ExcUnknownField | , |
<< "Field set has no field with name: "<< FieldCommon::EI_Field::qval | |||
) |
FieldCommon * FieldSet::field | ( | const std::string & | field_name | ) | const |
Return pointer to the field given by name field_name
. Return nullptr if not found.
Definition at line 109 of file field_set.cc.
|
inline |
Collective interface to FieldCommonBase::flags_add()
.
mask | mask to set for all fields in the field set. |
Definition at line 179 of file field_set.hh.
bool FieldSet::is_constant | ( | Region | reg | ) | const |
Collective interface to FieldCommonBase::set_mesh()
.
Definition at line 135 of file field_set.cc.
Input::Type::Record FieldSet::make_field_descriptor_type | ( | const std::string & | equation_name | ) | const |
Add an existing Field to the list. It stores just pointer to the field. Be careful to not destroy passed Field before the FieldSet.
Using operator allows elegant setting and adding of a field to the field set:
Definition at line 50 of file field_set.cc.
Input::Type::Selection FieldSet::make_output_field_selection | ( | const string & | name, |
const string & | desc = "" |
||
) |
Make Selection with strings for all field names in the FieldSet.
Definition at line 76 of file field_set.cc.
|
inline |
Collective interface to FieldCommonBase::mar_input_times()
.
Definition at line 201 of file field_set.hh.
FieldCommon & FieldSet::operator[] | ( | const std::string & | field_name | ) | const |
Returns reference to the field given by field_name
. Throws if the field with given name is not found.
Definition at line 117 of file field_set.cc.
void FieldSet::output | ( | OutputTime * | stream | ) |
Collective interface to FieldCommonBase::output()
.
Definition at line 143 of file field_set.cc.
|
inline |
Collective interface to FieldCommonBase::output_type()
.
rt | Discrete function space (element, node or corner data). |
Definition at line 194 of file field_set.hh.
|
inline |
Collective interface to FieldCommonBase::set_components()
. It is safe to call this for field sets containing also fields with return value other then variable vector as long as all variable vector fields should be set to the same number of components.
Definition at line 151 of file field_set.hh.
void FieldSet::set_field | ( | const std::string & | dest_field_name, |
FieldCommon & | source | ||
) |
Use FieldCommonBase::copy_from()
to set field of the field set given by the first parameter dest_field_name
. The source field is given as the second parameter source
. The field copies share the same input descriptor list and the same instances of FieldBase classes but each copy can be set to different time and different limit side.
See FieldCommonBase::copy_from
documentation for details.
Definition at line 101 of file field_set.cc.
|
inline |
Collective interface to FieldCommon::set_mesh()
.
Definition at line 164 of file field_set.hh.
|
inline |
Collective interface to FieldCommon::set_limit_side()
.
Definition at line 171 of file field_set.hh.
|
inline |
Collective interface to FieldCommonBase::set_mesh()
.
Definition at line 157 of file field_set.hh.
|
inline |
Collective interface to FieldCommonBase::set_mesh()
.
Definition at line 186 of file field_set.hh.
|
friend |
Stream output operator
Definition at line 161 of file field_set.cc.
|
protected |
List of all fields.
Definition at line 234 of file field_set.hh.