Flow123d
jenkins-Flow123d-windows32-release-multijob-51
|
Class for representation of a vector of fields of the same physical quantity. More...
#include <field.hh>
Public Types | |
typedef Field< spacedim, Value > | SubFieldType |
typedef Field< spacedim, typename FieldValue< spacedim > ::Vector > | TransposedField |
Public Member Functions | |
MultiField () | |
IT::AbstractRecord & | get_input_type () override |
void | set_limit_side (LimitSide side) override |
bool | set_time (const TimeGovernor &time) override |
void | set_mesh (const Mesh &mesh) override |
void | copy_from (const FieldCommon &other) override |
void | output (OutputTime *stream) override |
bool | is_constant (Region reg) override |
virtual | ~MultiField () |
unsigned int | size () const |
Number of subfields that compose the multi-field. More... | |
void | init (const vector< string > &names) |
void | set_complemented_vector_field (TransposedField &complemented) |
SubFieldType & | operator[] (unsigned int idx) |
Public Member Functions inherited from FieldCommon | |
TYPEDEF_ERR_INFO (EI_Time, double) | |
TYPEDEF_ERR_INFO (EI_Field, std::string) | |
DECLARE_INPUT_EXCEPTION (ExcNonascendingTime,<< "Non-ascending time: "<< EI_Time::val<< " for field "<< EI_Field::qval<< ".\n") | |
DECLARE_INPUT_EXCEPTION (ExcMissingDomain,<< "Missing domain specification (region, r_id, or r_set) in the field descriptor:") | |
DECLARE_EXCEPTION (ExcFieldMeshDifference,<< "Two copies of the field "<< EI_Field::qval<< "call set_mesh with different arguments.\n") | |
FieldCommon & | name (const string &name) |
FieldCommon & | description (const string &description) |
FieldCommon & | input_default (const string &input_default) |
FieldCommon & | units (const UnitSI &units) |
Set basic units of the field. More... | |
FieldCommon & | input_selection (const Input::Type::Selection *element_selection) |
FieldCommon & | output_type (OutputTime::DiscreteSpace rt) |
FieldCommon & | flags (FieldFlag::Flags::Mask mask) |
FieldCommon & | flags_add (FieldFlag::Flags::Mask mask) |
void | set_n_components (unsigned int n_comp) |
void | set_input_list (const Input::Array &list) |
const std::string & | input_name () const |
const std::string & | name () const |
const std::string | description () const |
const std::string & | input_default () const |
const UnitSI & | units () const |
OutputTime::DiscreteSpace | output_type () const |
bool | is_bc () const |
unsigned int | n_comp () const |
const Mesh * | mesh () const |
LimitSide | limit_side () const |
FieldFlag::Flags & | flags () |
double | time () const |
void | mark_input_times (TimeMark::Type mark_type) |
bool | changed () const |
virtual | ~FieldCommon () |
Private Attributes | |
std::vector< SubFieldType > | sub_fields_ |
std::vector< std::string > | sub_names_ |
Additional Inherited Members | |
Static Public Member Functions inherited from FieldCommon | |
static IT::Record | field_descriptor_record (const string &record_name) |
Protected Types inherited from FieldCommon | |
enum | TimeStatus { TimeStatus::changed, TimeStatus::constant, TimeStatus::unknown } |
Protected Member Functions inherited from FieldCommon | |
FieldCommon () | |
FieldCommon (const FieldCommon &other) | |
void | set_history_changed () |
Protected Attributes inherited from FieldCommon | |
std::string | name_ |
std::shared_ptr< SharedData > | shared_ |
LimitSide | limit_side_ |
TimeStatus | set_time_result_ |
Status of history . More... | |
double | last_time_ = -numeric_limits<double>::infinity() |
OutputTime::DiscreteSpace | type_of_output_data_ = OutputTime::ELEM_DATA |
FieldFlag::Flags | flags_ = FieldFlag::declare_input & FieldFlag::equation_input & FieldFlag::allow_output |
Field flags. Default setting is "an equation input field, that can read from user input, and can be written to output". More... | |
Static Protected Attributes inherited from FieldCommon | |
static const unsigned int | history_length_limit_ =3 |
Class for representation of a vector of fields of the same physical quantity.
When solving a system of same equations with the number of components given at runtime (as in the case of transport equation for runtime given number of substances) we need means how to work with the whole vector of fields at once. This is the aim of this class. It provides the interface given by the parent class FieldCommonBase
, but principally it is just a vector of Field<Value,dim> objects. The sub-fields or components of a MultiField
are independent objects, how ever the setters propagates the values from the MultiFields to the individual fields. The only exception is the set_name
method which in conjunction with MultiField::set_subfield_names
can set unique name to each component.
Template parameters are used for every subfield.
TODO:
typedef Field<spacedim, Value> MultiField< spacedim, Value >::SubFieldType |
typedef Field<spacedim, typename FieldValue<spacedim>::Vector > MultiField< spacedim, Value >::TransposedField |
MultiField< spacedim, Value >::MultiField | ( | ) |
Default constructor.
Definition at line 466 of file field.impl.hh.
|
inlinevirtual |
|
overridevirtual |
Polymorphic copy. Check correct type, allows copy of MultiField or Field.
Implements FieldCommon.
Definition at line 528 of file field.impl.hh.
|
overridevirtual |
Returns input type of particular field instance, this is usually static member input_type of the corresponding FieldBase class ( with same template parameters), however, for fields returning "Enum" we have to create whole unique Input::Type hierarchy for every instance since every such field use different Selection for initialization, even if all returns just unsigned int.
Implements FieldCommon.
Definition at line 492 of file field.impl.hh.
void MultiField< spacedim, Value >::init | ( | const vector< string > & | names | ) |
Initialize MultiField to the number of components given by the size of names
and use this vector to name individual components. Should be called after the setters derived from FieldCommonBase.
Definition at line 473 of file field.impl.hh.
|
overridevirtual |
Implementation of FieldCommonBase::is_constant()
.
Implements FieldCommon.
Definition at line 554 of file field.impl.hh.
|
inline |
|
overridevirtual |
Implementation of FieldCommonBase::output()
.
Implements FieldCommon.
Definition at line 542 of file field.impl.hh.
void MultiField< spacedim, Value >::set_complemented_vector_field | ( | TransposedField & | complemented | ) |
Allows set Field<dim, Vector> that can be used for alternative initialization in "transposed" form.
|
overridevirtual |
Set side of limit when calling set_time
with jump time. This method invalidate result of changed()
so it should be called just before set_time
. Can be different for different field copies.
Implements FieldCommon.
Definition at line 498 of file field.impl.hh.
|
overridevirtual |
We have to override the set_mesh
method in order to call set_mesh method for subfields.
Reimplemented from FieldCommon.
Definition at line 520 of file field.impl.hh.
|
overridevirtual |
Abstract method to update field to the new time level. Implemented by in class template Field<...>.
Return true if the value of the field was changed on some region. The returned value is also stored in changed_during_set_time
data member.
Implements FieldCommon.
Definition at line 506 of file field.impl.hh.
|
inline |
|
private |
|
private |