18 #ifndef ELEMENT_DATA_CACHE_HH_
19 #define ELEMENT_DATA_CACHE_HH_
32 struct MeshDataHeader;
52 typedef std::shared_ptr< std::vector<T> >
CacheData;
66 ElementDataCache(std::string field_name,
double time,
unsigned int row_vec_size,
unsigned int boundary_begin);
95 void read_ascii_data(Tokenizer &tok,
unsigned int n_components,
unsigned int i_row)
override;
98 void read_binary_data(std::istream &data_stream,
unsigned int n_components,
unsigned int i_row)
override;
106 void print_ascii(ostream &out_stream,
unsigned int idx)
override;
115 void print_ascii_all(ostream &out_stream,
unsigned int start=0)
override;
120 void print_binary_all(ostream &out_stream,
bool print_data_size =
true,
unsigned int start = 0)
override;
122 void print_yaml_subarray(ostream &out_stream,
unsigned int precision,
unsigned int begin,
unsigned int end)
override;
132 void add(
unsigned int idx,
const T *
value);
137 void zero(
unsigned int idx);
142 void normalize(
unsigned int idx,
unsigned int divisor);
std::string fe_type() const
unsigned int n_comp() const
unsigned int n_dofs_per_element() const
void read_binary_data(std::istream &data_stream, unsigned int n_components, unsigned int i_row) override
Implements ElementDataCacheBase::read_binary_data.
std::shared_ptr< ElementDataCacheBase > gather(Distribution *distr, LongIdx *local_to_global) override
Implements ElementDataCacheBase::gather.
void print_ascii_all(ostream &out_stream, unsigned int start=0) override
Print all data stored in output data ro ascii format.
void get_min_max_range(double &min, double &max) override
MPI_Datatype mpi_data_type()
Return MPI data type corresponding with template parameter of cache. Needs template specialization.
ElementDataCache()
Default constructor.
void print_yaml_subarray(ostream &out_stream, unsigned int precision, unsigned int begin, unsigned int end) override
void read_ascii_data(Tokenizer &tok, unsigned int n_components, unsigned int i_row) override
Implements ElementDataCacheBase::read_ascii_data.
CheckScaleData
Allow to hold sign, if data in cache is checked and scale (both can be executed only once)
@ check
Data is only checked.
@ none
Data is neither checked nor scaled.
void store_value(unsigned int idx, const T *value)
static CacheData create_data_cache(unsigned int row_vec_size)
std::shared_ptr< std::vector< T > > CacheData
void print_binary_all(ostream &out_stream, bool print_data_size=true, unsigned int start=0) override
Print all data stored in output data to appended binary format.
CheckScaleData check_scale_data_
Sign, if data in cache is checked and scale.
void zero(unsigned int idx)
std::shared_ptr< ElementDataCacheBase > compute_node_data(std::vector< unsigned int > &conn_vec, unsigned int data_size) override
Implements ElementDataCacheBase::compute_node_data.
std::shared_ptr< ElementDataCacheBase > element_node_cache_fixed_size(std::vector< unsigned int > &offset_vec) override
Implements ElementDataCacheBase::element_node_cache_fixed_size.
CacheData get_data()
Return underlying vector of element data.
T & operator[](unsigned int i)
Access i-th element in the data vector of 0th component.
void print_ascii(ostream &out_stream, unsigned int idx) override
virtual ~ElementDataCache() override
Destructor of ElementDataCache.
void add(unsigned int idx, const T *value)
void normalize(unsigned int idx, unsigned int divisor)
std::shared_ptr< ElementDataCacheBase > element_node_cache_optimize_size(std::vector< unsigned int > &offset_vec) override
Implements ElementDataCacheBase::element_node_cache_optimize_size.
CheckResult
Return type of method that checked data stored in ElementDataCache (NaN values, limits)
@ out_of_limits
Some value(s) is out of limits.
@ not_a_number
Some value(s) is set to NaN.
@ ok
All values are not NaN and are in limits.
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
static constexpr bool value