Flow123d  JS_before_hm-927-g0a4a2b5
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
FieldModel< spacedim, Value, Fn, InputFields > Class Template Reference

#include <field_model.hh>

Inheritance diagram for FieldModel< spacedim, Value, Fn, InputFields >:
Inheritance graph
[legend]
Collaboration diagram for FieldModel< spacedim, Value, Fn, InputFields >:
Collaboration graph
[legend]

Public Types

typedef FieldAlgorithmBase< spacedim, Value >::Point Point
 
- Public Types inherited from FieldAlgorithmBase< spacedim, Value >
typedef Space< spacedim >::Point Point
 

Public Member Functions

 FieldModel (Fn *func, InputFields...args)
 
void cache_update (FieldValueCache< typename Value::element_type > &data_cache, ElementCacheMap &cache_map, unsigned int region_idx) override
 
Value::return_type const & value (const Point &p, const ElementAccessor< spacedim > &elm) override
 Implementation of virtual method. More...
 
void value_list (const Armor::array &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list) override
 Implementation of virtual method. More...
 
- Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
 FieldAlgorithmBase (unsigned int n_comp=0)
 
virtual void init_from_input (const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
 
virtual bool set_time (const TimeStep &time)
 
virtual void set_mesh (const Mesh *mesh, bool boundary_domain)
 
void set_component_idx (unsigned int idx)
 
unsigned int n_comp () const
 
FieldResult field_result () const
 
virtual double next_change_time ()
 
virtual void set_native_dh (std::shared_ptr< DOFHandlerMultiDim >)
 
bool is_constant_in_space () const
 
virtual ~FieldAlgorithmBase ()
 

Private Types

typedef std::tuple< InputFields... > FieldsTuple
 

Private Attributes

Fn * fn
 
FieldsTuple input_fields
 

Additional Inherited Members

- Static Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
static std::string template_name ()
 
static Input::Type::Abstractget_input_type ()
 
static const Input::Type::Instanceget_input_type_instance (Input::Type::Selection value_selection=Input::Type::Selection())
 
static const Input::Type::Recordget_field_algo_common_keys ()
 
static std::shared_ptr< FieldAlgorithmBase< spacedim, Value > > function_factory (const Input::AbstractRecord &rec, const struct FieldAlgoBaseInitData &init_data)
 
- 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...
 
bool is_constant_in_space_
 Flag detects that field is only dependent on time. More...
 

Detailed Description

template<int spacedim, class Value, typename Fn, class... InputFields>
class FieldModel< spacedim, Value, Fn, InputFields >

Class representing field computing form results of other fields.

Example of usage:

// Functor class with defined operator ()
class FnProduct {
public:
Vector operator() (Scalar a, Vector v) {
return a(0) * v;
}
};
...
// Create ElementCacheMap
std::shared_ptr<EvalPoints> eval_points = std::make_shared<EvalPoints>();
eval_poinzs->add_bulk<3>( quad ); // initialize EvalPoints
ElementCacheMap elm_cache_map;
elm_cache_map.init(eval_points);
// Definition of fields
... // fill data to fields f_scal, f_vec
// create instance FieldModel class, use helper method Model::create to simply passsing of parameters
auto f_product = Model<3, FieldValue<3>::VectorFixed>::create(FnProduct(), f_scal, f_vec);
// set field on all regions
result.set_mesh( *mesh );
result.set_field(mesh->region_db().get_region_set("ALL"), f_product);
result.cache_allocate(eval_points);
result.set_time(tg.step(), LimitSide::right);
// cache_update
result.cache_update(elm_cache_map);

Definition at line 223 of file field_model.hh.

Member Typedef Documentation

template<int spacedim, class Value , typename Fn , class... InputFields>
typedef std::tuple<InputFields...> FieldModel< spacedim, Value, Fn, InputFields >::FieldsTuple
private

Definition at line 227 of file field_model.hh.

template<int spacedim, class Value , typename Fn , class... InputFields>
typedef FieldAlgorithmBase<spacedim, Value>::Point FieldModel< spacedim, Value, Fn, InputFields >::Point

Definition at line 231 of file field_model.hh.

Constructor & Destructor Documentation

template<int spacedim, class Value , typename Fn , class... InputFields>
FieldModel< spacedim, Value, Fn, InputFields >::FieldModel ( Fn *  func,
InputFields...  args 
)
inline

Definition at line 233 of file field_model.hh.

Member Function Documentation

template<int spacedim, class Value , typename Fn , class... InputFields>
void FieldModel< spacedim, Value, Fn, InputFields >::cache_update ( FieldValueCache< typename Value::element_type > &  data_cache,
ElementCacheMap cache_map,
unsigned int  region_idx 
)
inlineoverridevirtual

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 240 of file field_model.hh.

template<int spacedim, class Value , typename Fn , class... InputFields>
Value::return_type const& FieldModel< spacedim, Value, Fn, InputFields >::value ( const Point p,
const ElementAccessor< spacedim > &  elm 
)
inlineoverridevirtual

Implementation of virtual method.

Implements FieldAlgorithmBase< spacedim, Value >.

Definition at line 257 of file field_model.hh.

template<int spacedim, class Value , typename Fn , class... InputFields>
void FieldModel< spacedim, Value, Fn, InputFields >::value_list ( const Armor::array point_list,
const ElementAccessor< spacedim > &  elm,
std::vector< typename Value::return_type > &  value_list 
)
inlineoverridevirtual

Implementation of virtual method.

Implements FieldAlgorithmBase< spacedim, Value >.

Definition at line 263 of file field_model.hh.

Member Data Documentation

template<int spacedim, class Value , typename Fn , class... InputFields>
Fn* FieldModel< spacedim, Value, Fn, InputFields >::fn
private

Definition at line 226 of file field_model.hh.

template<int spacedim, class Value , typename Fn , class... InputFields>
FieldsTuple FieldModel< spacedim, Value, Fn, InputFields >::input_fields
private

Definition at line 228 of file field_model.hh.


The documentation for this class was generated from the following file: