Flow123d  JS_before_hm-1011-g79d7237
Public Member Functions | Private Attributes | List of all members
FieldValueCache< elm_type > Class Template Reference

Class holds precomputed field values of selected element set. More...

#include <field_value_cache.hh>

Collaboration diagram for FieldValueCache< elm_type >:
Collaboration graph
[legend]

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...
 

Detailed Description

template<class elm_type>
class FieldValueCache< elm_type >

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.

Constructor & Destructor Documentation

template<class elm_type >
FieldValueCache< elm_type >::FieldValueCache ( unsigned int  n_rows,
unsigned int  n_cols 
)

Constructor.

Definition at line 33 of file field_value_cache.cc.

template<class elm_type >
FieldValueCache< elm_type >::~FieldValueCache ( )

Destructor.

Definition at line 37 of file field_value_cache.cc.

Member Function Documentation

template<class elm_type>
const Armor::Array<elm_type>& FieldValueCache< elm_type >::data ( ) const
inline

Return data vector.

Definition at line 61 of file field_value_cache.hh.

Here is the caller graph for this function:

template<class elm_type>
Armor::Array<elm_type>& FieldValueCache< elm_type >::data ( )
inline

Definition at line 66 of file field_value_cache.hh.

template<class elm_type>
template<uint nr, uint nc = 1>
arma::Mat<elm_type>::template fixed<nr, nc>& FieldValueCache< elm_type >::get ( uint  i)
inline

Return data vector.

Definition at line 73 of file field_value_cache.hh.

template<class elm_type >
template<class Value >
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.

Here is the caller graph for this function:

template<class elm_type >
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.

Here is the caller graph for this function:

template<class elm_type>
unsigned int FieldValueCache< elm_type >::n_cache_points ( ) const
inline

Return number of elements that data is stored in cache.

Definition at line 78 of file field_value_cache.hh.

template<class elm_type>
unsigned int FieldValueCache< elm_type >::size ( ) const
inline

Return size of data cache (number of stored field values)

Definition at line 55 of file field_value_cache.hh.

Member Data Documentation

template<class elm_type>
Armor::Array<elm_type> FieldValueCache< elm_type >::data_
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.

template<class elm_type>
unsigned int FieldValueCache< elm_type >::n_cache_points_
private

Maximal number of points stored in cache.

Definition at line 100 of file field_value_cache.hh.


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