25 #include "create_processor.hh"
40 ready_to_reading_(false), element_eval_points_map_(nullptr), eval_point_data_(0),
57 for (
unsigned int i=0; i<ep_data_size; ++i)
64 std::sort(eval_point_data_tmp.
begin(), eval_point_data_tmp.
end());
67 unsigned int last_region_idx = -1;
68 unsigned int last_element_idx = -1;
70 bool is_new_reg, is_new_elm;
80 for (
auto it=eval_point_data_tmp.
begin();
it!=eval_point_data_tmp.
end(); ++
it) {
81 is_new_reg = (
it->i_reg_ != last_region_idx);
82 is_new_elm = is_new_reg || (
it->i_element_ != last_element_idx);
85 unsigned int last_eval_point = i_pos-1;
92 last_region_idx =
it->i_reg_;
94 if (
it->i_reg_ % 2 == 1) {
102 last_element_idx =
it->i_element_;
108 unsigned int last_eval_point = i_pos-1;
Auxiliary data class holds number of elements in cache and allow to set this value explicitly (e....
static unsigned int get()
Return number of stored elements.
Directing class of FieldValueCache.
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_.
ElementCacheMap()
Constructor.
RevertableList< unsigned int > element_starts_
Start positions of elements in eval_point_data_ (size = n_elements+1)
RevertableList< unsigned int > regions_starts_
Start positions of elements in regions (size = n_regions+1, last value is end of last region)
std::unordered_map< unsigned int, unsigned int > element_to_map_bdr_
Maps boundary element_idx to element index in patch - TODO remove.
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::unordered_set< unsigned int > set_of_regions_
Keeps set of unique region indices of added eval. points.
RevertableList< EvalPointData > eval_point_data_
static const int unused_point
Special constant (.
void init(std::shared_ptr< EvalPoints > eval_points)
Init cache.
static const unsigned int undef_elem_idx
Index of invalid element in cache.
bool ready_to_reading_
Flag is set down during update of cache when this can't be read.
std::unordered_map< unsigned int, unsigned int > element_to_map_
Maps bulk element_idx to element index in patch - TODO remove.
std::shared_ptr< EvalPoints > eval_points() const
Getter of eval_points object.
std::shared_ptr< EvalPoints > eval_points_
Pointer to EvalPoints.
~ElementCacheMap()
Destructor.
int * element_eval_points_map_
Holds data of evaluating points in patch.
unsigned int simd_size_double
std::vector< unsigned int > bdr_elm_idx_
Vector of boundary element indexes stored in cache.
std::vector< unsigned int > elm_idx_
Vector of bulk element indexes stored in cache.
std::vector< Type >::iterator begin()
void resize(std::size_t new_size)
std::vector< Type >::iterator end()
std::size_t make_permanent()
Finalize temporary part of data.
void reset()
Clear the list.
std::size_t emplace_back(Args &&... args)
std::size_t temporary_size() const
Return temporary size of list (full size of stored data).