Flow123d
release_2.2.0-37-g336ee74
|
#include <field_elementwise.hh>
Public Types | |
typedef FieldAlgorithmBase< spacedim, Value >::Point | Point |
typedef FieldAlgorithmBase< spacedim, Value > | FactoryBaseType |
Public Types inherited from FieldAlgorithmBase< spacedim, Value > | |
typedef Space< spacedim >::Point | Point |
Public Member Functions | |
FieldElementwise (unsigned int n_comp=0) | |
FieldElementwise (std::shared_ptr< std::vector< typename Value::element_type > > data, unsigned int n_components) | |
virtual void | init_from_input (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data) override |
bool | set_time (const TimeStep &time) override |
void | set_mesh (const Mesh *mesh, bool boundary_domain) override |
Value::return_type const & | value (const Point &p, const ElementAccessor< spacedim > &elm) override |
void | value_list (const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list) override |
virtual | ~FieldElementwise () |
Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value > | |
FieldAlgorithmBase (unsigned int n_comp=0) | |
void | set_component_idx (unsigned int idx) |
unsigned int | n_comp () const |
FieldResult | field_result () const |
virtual double | next_change_time () |
virtual | ~FieldAlgorithmBase () |
Static Public Member Functions | |
static const Input::Type::Record & | get_input_type () |
Implementation. More... | |
Static Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value > | |
static std::string | template_name () |
static Input::Type::Abstract & | get_input_type () |
static const Input::Type::Instance & | get_input_type_instance (Input::Type::Selection value_selection=Input::Type::Selection()) |
static const Input::Type::Record & | get_field_algo_common_keys () |
static std::shared_ptr< FieldAlgorithmBase< spacedim, Value > > | function_factory (const Input::AbstractRecord &rec, const struct FieldAlgoBaseInitData &init_data) |
Private Member Functions | |
void | scale_and_check_limits () |
Multiply data_ with unit_conversion_coefficient_ and check limits of field. More... | |
Private Attributes | |
bool | internal_raw_data |
bool | boundary_domain_ |
std::shared_ptr< std::vector< typename Value::element_type > > | data_ |
Raw buffer of n_entities rows each containing Value::size() doubles. More... | |
unsigned int | n_entities_ |
Number of rows in data_ buffer. More... | |
unsigned int | n_components_ |
Size of Value. More... | |
FilePath | reader_file_ |
const Mesh * | mesh_ |
std::string | field_name_ |
Input::Record | in_rec_ |
Accessor to Input::Record. More... | |
UnitSI & | unit_si_ |
std::pair< double, double > | limits_ |
Static Private Attributes | |
static const int | registrar |
Registrar of class to factory. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from FieldAlgorithmBase< spacedim, Value > | |
static const unsigned int | spacedim_ =spacedim |
static constexpr bool | is_enum_valued = boost::is_same<typename Value::element_type, FieldEnum>::value |
Protected Member Functions inherited from FieldAlgorithmBase< spacedim, Value > | |
void | init_unit_conversion_coefficient (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data) |
Init value of unit_conversion_coefficient_ from input. More... | |
Protected Attributes inherited from FieldAlgorithmBase< spacedim, Value > | |
TimeStep | time_ |
Actual time level; initial value is -infinity. More... | |
Value | value_ |
Last value, prevents passing large values (vectors) by value. More... | |
Value::return_type | r_value_ |
FieldResult | field_result_ |
Indicator of particular values (zero, one) constant over space. More... | |
unsigned int | component_idx_ |
Specify if the field is part of a MultiField and which component it is. More... | |
double | unit_conversion_coefficient_ |
Coeficient of conversion of user-defined unit. More... | |
The simplest approximative Field. In future we want to replace it by pair: DofHandler + vector of dof values.
In current setting: This should implement mapping: (ElementAccessor.INDEX) -> value Currently INDEX is global index of element (any dimension, both bulk and boundary part). In future INDEX should probably consist of MESH_LEVEL (unique mesh, dimension, bulk/boundary, level of refinement) and INDEX within this level. We want to make memory optimization since usually field lives either on boundary or on bulk part and some bulk fields live only on some dimension(s). This can be achieved by two level indirection table of mesh_levelscontaining tables for indexes. We should test if the performance penalty is not to big.
Currently, we just use one vector for bulk and one for boundary elements.
TODO:
Definition at line 50 of file field_elementwise.hh.
typedef FieldAlgorithmBase<spacedim, Value> FieldElementwise< spacedim, Value >::FactoryBaseType |
Definition at line 54 of file field_elementwise.hh.
typedef FieldAlgorithmBase<spacedim, Value>::Point FieldElementwise< spacedim, Value >::Point |
Definition at line 53 of file field_elementwise.hh.
FieldElementwise< spacedim, Value >::FieldElementwise | ( | unsigned int | n_comp = 0 | ) |
Definition at line 57 of file field_elementwise.cc.
FieldElementwise< spacedim, Value >::FieldElementwise | ( | std::shared_ptr< std::vector< typename Value::element_type > > | data, |
unsigned int | n_components | ||
) |
Alternative to previous constructor.
Definition at line 68 of file field_elementwise.cc.
|
virtual |
Definition at line 222 of file field_elementwise.cc.
|
static |
Implementation.
Definition at line 34 of file field_elementwise.cc.
|
overridevirtual |
Function can provide way to initialize itself from the input data.
TODO: make protected, should be called through function factory
Reimplemented from FieldAlgorithmBase< spacedim, Value >.
Definition at line 82 of file field_elementwise.cc.
|
private |
Multiply data_
with unit_conversion_coefficient_
and check limits of field.
Definition at line 202 of file field_elementwise.cc.
|
overridevirtual |
Has to be set before calling init_from_input. This also allocate and initialize internal buffer. Do nothing if mesh is already set.
See also description of the FieldBase<...>::set_mesh.
Reimplemented from FieldAlgorithmBase< spacedim, Value >.
Definition at line 131 of file field_elementwise.cc.
|
overridevirtual |
Set row of boundary data. Used to implement old BC input. Update time and possibly update data from GMSH file.
Reimplemented from FieldAlgorithmBase< spacedim, Value >.
Definition at line 114 of file field_elementwise.cc.
|
overridevirtual |
Returns one value in one given point. ResultType can be used to avoid some costly calculation if the result is trivial.
Implements FieldAlgorithmBase< spacedim, Value >.
Definition at line 159 of file field_elementwise.cc.
|
overridevirtual |
Returns std::vector of scalar values in several points at once.
Implements FieldAlgorithmBase< spacedim, Value >.
Definition at line 176 of file field_elementwise.cc.
|
private |
Is set in set_mesh method. Value true means, that we accept only boundary element accessors in the value
method. TODO: temporary solution until we have separate mesh for the boundary part
Definition at line 110 of file field_elementwise.hh.
|
private |
Raw buffer of n_entities rows each containing Value::size() doubles.
Definition at line 112 of file field_elementwise.hh.
|
private |
Definition at line 120 of file field_elementwise.hh.
|
private |
Accessor to Input::Record.
Definition at line 123 of file field_elementwise.hh.
|
private |
Is flase whne the data vector is provided at construction. Then, we disallow initialization form input and do not delete data pointer in destructor.
Definition at line 105 of file field_elementwise.hh.
|
private |
Definition at line 131 of file field_elementwise.hh.
|
private |
Definition at line 119 of file field_elementwise.hh.
|
private |
Size of Value.
Definition at line 116 of file field_elementwise.hh.
|
private |
Number of rows in data_
buffer.
Definition at line 114 of file field_elementwise.hh.
|
private |
Definition at line 118 of file field_elementwise.hh.
|
staticprivate |
Registrar of class to factory.
Definition at line 134 of file field_elementwise.hh.
|
private |
Initialization data of field. Necessary for check limits.
TODO: Temporary solution will be replaced with shared_ptr to field data in FieldAlgoBase
Definition at line 130 of file field_elementwise.hh.