32 template<
class elm_type>
34 : data_(n_rows, n_cols) {}
36 template<
class elm_type>
39 template<
class elm_type>
58 ready_to_reading_(false), element_eval_points_map_(nullptr), points_in_cache_(0) {
104 unsigned int n_stored_element = 0, n_region = 0;
108 for (
unsigned int i_elm=0; i_elm<region_it->second.n_elements_; ++i_elm) {
109 unsigned int elm_idx = region_it->second.elm_indices_[i_elm];
111 elm_idx_[n_stored_element] = elm_idx;
122 unsigned int idx_to_region = 1;
127 for (
unsigned int i_point=0; i_point<size; ++i_point) {
133 if (region_last_elm==i_elm+1) {
155 unsigned int points_begin =
eval_points_->subset_begin(dh_cell.
dim(), subset_idx) + start_point;
156 for (
unsigned int i=points_begin; i<points_begin+data_size; ++i)
165 for (
unsigned int i_point=0; i_point<size; ++i_point)
188 unsigned int elm_idx = dh_cell.
elm_idx();
189 std::unordered_map<unsigned int, unsigned int>::const_iterator
it =
cache_idx_.find(elm_idx);
UpdateCacheHelper update_data_
Holds data used for cache update.
void mark_used_eval_points(const DHCellAccessor &dh_cell, unsigned int subset_idx, unsigned int data_size, unsigned int start_point=0)
void init(std::shared_ptr< EvalPoints > eval_points)
Init cache.
unsigned int size() const
unsigned int elm_idx() const
Return serial idx to element of loc_ele_idx_.
bool ready_to_reading_
Flag is set down during update of cache when this can't be read.
ElementCacheMap()
Constructor.
void clear_element_eval_points_map()
Reset all items of elements_eval_points_map.
static const int unused_point
Special constant (.
FieldValueCache(unsigned int n_rows, unsigned int n_cols)
Constructor.
unsigned int dim() const
Return dimension of element appropriate to cell.
Directing class of FieldValueCache.
Cell accessor allow iterate over DOF handler cells.
Class holds precomputed field values of selected element set.
void add_to_region(ElementAccessor< 3 > elm)
Add element to appropriate region data of update_data_ object.
void prepare_elements_to_update()
Prepare data member before reading data to cache.
std::array< unsigned int, ElementCacheMap::n_cached_elements+1 > region_value_cache_range_
Maps of begin and end positions of different regions data in FieldValueCache.
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
unsigned int n_elements_
Number of elements in all regions holds in cache.
static const unsigned int undef_elem_idx
Index of invalid element in cache.
void create_elements_points_map()
Create map of used eval points on cached elements.
std::unordered_map< unsigned int, unsigned int > region_cache_indices_range_
int ** element_eval_points_map_
Armor::Array< elm_type > data_
std::unordered_map< unsigned int, unsigned int > cache_idx_
~ElementCacheMap()
Destructor.
void set_element_cache_index(unsigned int idx) const
Setter of elm_cache_index_.
void add(const DHCellAccessor &dh_cell)
Adds element to region_cache_indices_map_ set.
~FieldValueCache()
Destructor.
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
unsigned int n_cache_points_
Maximal number of points stored in cache.
std::array< unsigned int, ElementCacheMap::n_cached_elements+1 > region_element_cache_range_
Maps of begin and end positions of elements of different regions in ElementCacheMap.
static constexpr unsigned int n_cached_elements
Number of cached elements which values are stored in cache.
std::vector< unsigned int > elm_idx_
DHCellAccessor & operator()(DHCellAccessor &dh_cell) const
Set index of cell in ElementCacheMap (or undef value if cell is not stored in cache).
unsigned int points_in_cache_
Number of points stored in cache.
void start_elements_update()
Start update of cache.
void finish_elements_update()
Finish update after reading data to cache.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than)
std::shared_ptr< EvalPoints > eval_points_
Pointer to EvalPoints.
RegionIdx region_idx() const
std::shared_ptr< EvalPoints > eval_points() const
Getter of eval_points object.
#define ASSERT_PTR_DBG(ptr)
Definition of assert macro checking non-null pointer (PTR) only for debug mode.
std::unordered_map< unsigned int, RegionData > region_cache_indices_map_
void init(std::shared_ptr< EvalPoints > eval_points, unsigned int n_cache_elements)
Initialize cache.
static const int point_in_proggress
Special constant (.
Side accessor allows to iterate over sides of DOF handler cell.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)
unsigned int idx() const
Returns a global index of the region.