Flow123d
jenkins-Flow123d-windows-release-multijob-285
|
Class for representation of a vector of fields of the same physical quantity. More...
#include <multi_field.hh>
Classes | |
class | MultiFieldFactory |
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 |
IT::Record & | get_multifield_input_type () override |
bool | set_time (const TimeStep &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... | |
SubFieldType & | operator[] (unsigned int idx) |
void | set_up_components () |
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_components (const std::vector< string > &names) |
void | set_input_list (const Input::Array &list) |
void | set_limit_side (LimitSide side) |
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 |
void | set_component_index (unsigned int idx) |
bool | is_multifield () const |
virtual | ~FieldCommon () |
Private Attributes | |
std::vector< SubFieldType > | sub_fields_ |
SubFieldType | sub_field_type_ |
Helper class members, used only for input record. More... | |
TransposedField | transposed_field_ |
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 |
unsigned int | component_index_ |
bool | multifield_ |
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:
Definition of MultiField must be in separate file. In other case source file field.cc is too big and compiler can throw compile error.
Definition at line 45 of file multi_field.hh.
typedef Field<spacedim, Value> MultiField< spacedim, Value >::SubFieldType |
Definition at line 48 of file multi_field.hh.
typedef Field<spacedim, typename FieldValue<spacedim>::Vector > MultiField< spacedim, Value >::TransposedField |
Definition at line 49 of file multi_field.hh.
MultiField< spacedim, Value >::MultiField | ( | ) |
Default constructor.
Definition at line 22 of file multi_field.impl.hh.
|
inlinevirtual |
Virtual destructor.
Definition at line 113 of file multi_field.hh.
|
overridevirtual |
Polymorphic copy. Check correct type, allows copy of MultiField or Field.
Implements FieldCommon.
Definition at line 86 of file multi_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 31 of file multi_field.impl.hh.
|
overridevirtual |
Returns input type for MultiField instance. TODO: temporary solution, see multifield_
Implements FieldCommon.
Definition at line 40 of file multi_field.impl.hh.
|
overridevirtual |
Implementation of FieldCommonBase::is_constant()
.
Implements FieldCommon.
Definition at line 112 of file multi_field.impl.hh.
|
inline |
Returns reference to the sub-field (component) of given index idx
.
Definition at line 122 of file multi_field.hh.
|
overridevirtual |
Implementation of FieldCommonBase::output()
.
Implements FieldCommon.
Definition at line 100 of file multi_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 75 of file multi_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.
In first call 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.
Implements FieldCommon.
Definition at line 55 of file multi_field.impl.hh.
void MultiField< spacedim, Value >::set_up_components | ( | ) |
Initialize components of MultiField.
Must be call after setting components, mesh and limit side.
Definition at line 121 of file multi_field.impl.hh.
|
inline |
Number of subfields that compose the multi-field.
Definition at line 116 of file multi_field.hh.
|
private |
Helper class members, used only for input record.
Definition at line 139 of file multi_field.hh.
|
private |
Definition at line 136 of file multi_field.hh.
|
private |
Definition at line 140 of file multi_field.hh.