Flow123d
JS_before_hm-927-g0a4a2b5
|
Class holds precomputed field values of selected element set. More...
#include <field_value_cache.hh>
Public Member Functions | |
FieldValueCache (unsigned int n_rows, unsigned int n_cols) | |
Constructor. More... | |
~FieldValueCache () | |
Destructor. More... | |
void | init (std::shared_ptr< EvalPoints > eval_points, unsigned int n_cache_elements) |
Initialize cache. More... | |
unsigned int | size () const |
Return size of data cache (number of stored field values) More... | |
const Armor::Array< elm_type > & | data () const |
Return data vector. More... | |
Armor::Array< elm_type > & | data () |
template<uint nr, uint nc = 1> | |
arma::Mat< elm_type >::template fixed< nr, nc > & | get (uint i) |
Return data vector. More... | |
unsigned int | n_cache_points () const |
Return number of elements that data is stored in cache. More... | |
template<class Value > | |
Value::return_type | get_value (const ElementCacheMap &map, const DHCellAccessor &dh_cell, unsigned int eval_points_idx) |
Return value of evaluation point given by DHCell and local point idx in EvalPoints. More... | |
Private Attributes | |
Armor::Array< elm_type > | data_ |
unsigned int | n_cache_points_ |
Maximal number of points stored in cache. More... | |
Class holds precomputed field values of selected element set.
Every field in equation use own instance for every dimension of elements (typically 3 instances for dim = 1,2,3).
Definition at line 43 of file field_value_cache.hh.
FieldValueCache< elm_type >::FieldValueCache | ( | unsigned int | n_rows, |
unsigned int | n_cols | ||
) |
Constructor.
Definition at line 33 of file field_value_cache.cc.
FieldValueCache< elm_type >::~FieldValueCache | ( | ) |
Destructor.
Definition at line 37 of file field_value_cache.cc.
|
inline |
Return data vector.
Definition at line 61 of file field_value_cache.hh.
|
inline |
Definition at line 66 of file field_value_cache.hh.
|
inline |
Return data vector.
Definition at line 73 of file field_value_cache.hh.
Value::return_type FieldValueCache< elm_type >::get_value | ( | const ElementCacheMap & | map, |
const DHCellAccessor & | dh_cell, | ||
unsigned int | eval_points_idx | ||
) |
Return value of evaluation point given by DHCell and local point idx in EvalPoints.
Definition at line 28 of file field_value_cache.impl.hh.
void FieldValueCache< elm_type >::init | ( | std::shared_ptr< EvalPoints > | eval_points, |
unsigned int | n_cache_elements | ||
) |
Initialize cache.
Definition at line 40 of file field_value_cache.cc.
|
inline |
Return number of elements that data is stored in cache.
Definition at line 78 of file field_value_cache.hh.
|
inline |
Return size of data cache (number of stored field values)
Definition at line 55 of file field_value_cache.hh.
|
private |
Data cache.
Data is ordered like three dimensional table. The highest level is determinated by subsets, those data ranges are holds in subset_starts. Data block size of each subset is determined by number of eval_points (of subset) and maximal number of stored elements. The table is allocated to hold all subsets, but only those marked in used_subsets are updated. Order of subsets is same as in eval_points.
Definition at line 97 of file field_value_cache.hh.
|
private |
Maximal number of points stored in cache.
Definition at line 100 of file field_value_cache.hh.