38 ready_to_reading_(false), element_eval_points_map_(nullptr), eval_point_data_(0),
55 for (
unsigned int i=0; i<ep_data_size; ++i)
62 std::sort(eval_point_data_tmp.
begin(), eval_point_data_tmp.
end());
65 unsigned int last_region_idx = -1;
66 unsigned int last_element_idx = -1;
75 for (
auto it=eval_point_data_tmp.
begin();
it!=eval_point_data_tmp.
end(); ++
it) {
76 if (
it->i_element_ != last_element_idx) {
77 if (
it->i_reg_ != last_region_idx) {
78 unsigned int last_eval_point = i_pos-1;
85 last_region_idx =
it->i_reg_;
90 last_element_idx =
it->i_element_;
96 unsigned int last_eval_point = i_pos-1;
RevertableList< unsigned int > regions_starts_
Start positions of elements in regions (size = n_regions+1, last value is end of last region) ...
void init(std::shared_ptr< EvalPoints > eval_points)
Init cache.
bool ready_to_reading_
Flag is set down during update of cache when this can't be read.
ElementCacheMap()
Constructor.
static unsigned int get()
Return number of stored elements.
std::vector< Type >::iterator end()
static const int unused_point
Special constant (.
Directing class of FieldValueCache.
std::unordered_map< unsigned int, unsigned int > element_to_map_
Maps element_idx to element index in patch - TODO remove.
Auxiliary data class holds number of elements in cache and allow to set this value explicitly (e...
int * element_eval_points_map_
Holds data of evaluating points in patch.
RevertableList< EvalPointData > eval_point_data_
std::vector< Type >::iterator begin()
void set_element_eval_point(unsigned int i_elem_in_cache, unsigned int i_eval_point, int val) const
Set item of element_eval_points_map_.
static const unsigned int undef_elem_idx
Index of invalid element in cache.
void reset()
Clear the list.
~ElementCacheMap()
Destructor.
std::size_t emplace_back(Args &&...args)
void resize(std::size_t new_size)
std::vector< unsigned int > elm_idx_
Vector of element indexes stored in cache.
void start_elements_update()
Start update of cache.
void finish_elements_update()
Finish update after reading data to cache.
void create_patch()
Create patch of cached elements before reading data to cache.
std::shared_ptr< EvalPoints > eval_points_
Pointer to EvalPoints.
std::shared_ptr< EvalPoints > eval_points() const
Getter of eval_points object.
std::size_t temporary_size() const
Return temporary size of list (full size of stored data).
std::size_t make_permanent()
Finalize temporary part of data.
static const unsigned int simd_size_double
RevertableList< unsigned int > element_starts_
Start positions of elements in eval_point_data_ (size = n_elements+1)