18 #ifndef ELEMENT_DATA_CACHE_BASE_HH_ 19 #define ELEMENT_DATA_CACHE_BASE_HH_ 52 :
time_(-
std::numeric_limits<double>::infinity()),
67 bool is_actual(
double time, std::string field_name) {
74 virtual void read_ascii_data(Tokenizer &tok,
unsigned int n_components,
unsigned int i_row)=0;
79 virtual void read_binary_data(std::istream &data_stream,
unsigned int n_components,
unsigned int i_row)=0;
84 virtual void print_ascii(ostream &out_stream,
unsigned int idx) = 0;
94 virtual void print_binary_all(ostream &out_stream,
bool print_data_size =
true) = 0;
100 virtual void print_all_yaml(ostream &out_stream,
unsigned int precision) = 0;
215 ASSERT(
false).error(
"Unsupported VTK type");
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
double time_
time step stored in cache
virtual std::shared_ptr< ElementDataCacheBase > compute_node_data(std::vector< unsigned int > &conn_vec, unsigned int data_size)=0
void set_dof_handler_hash(std::size_t hash)
virtual void print_ascii(ostream &out_stream, unsigned int idx)=0
std::string field_input_name()
Getter for quantity name of cache.
unsigned int n_values() const
virtual void print_binary_all(ostream &out_stream, bool print_data_size=true)=0
virtual ~ElementDataCacheBase()
Destructor.
void set_n_values(unsigned int n_values)
double get_time()
Getter for time of cache.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
std::size_t dof_handler_hash() const
virtual std::shared_ptr< ElementDataCacheBase > element_node_cache_optimize_size(std::vector< unsigned int > &offset_vec)=0
virtual std::shared_ptr< ElementDataCacheBase > element_node_cache_fixed_size(std::vector< unsigned int > &offset_vec)=0
static constexpr bool value
void set_field_units(std::string unit_string)
bool is_actual(double time, std::string field_name)
Check if cache stored actual data.
VTKValueType
Types of VTK value.
virtual void read_ascii_data(Tokenizer &tok, unsigned int n_components, unsigned int i_row)=0
std::string field_input_name_
name of field stored in cache
virtual void get_min_max_range(double &min, double &max)=0
VTKValueType vtk_type_
Type of stored data.
virtual std::shared_ptr< ElementDataCacheBase > gather(Distribution *distr, LongIdx *local_to_global)=0
std::size_t dof_handler_hash_
Hash of DOF handler (attribute of native VTK data)
ElementDataCacheBase()
Constructor.
unsigned int n_comp() const
virtual void print_ascii_all(ostream &out_stream)=0
VTKValueType vtk_type() const
Get type of stored data.
virtual void read_binary_data(std::istream &data_stream, unsigned int n_components, unsigned int i_row)=0
virtual void print_all_yaml(ostream &out_stream, unsigned int precision)=0
std::string field_units() const