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_yaml_subarray(ostream &out_stream,
unsigned int precision,
unsigned int begin,
unsigned int end) = 0;
222 ASSERT(
false).error(
"Unsupported VTK type");
282 for(
unsigned int i=0; i<
n_comp_;i++) out_stream << 0 <<
" ";
287 for(
unsigned int i=0; i<
n_comp_;i++) out_stream << 0 <<
" ";
292 ASSERT(
false).error(
"Not implemented.");
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.
void print_ascii_all(ostream &out_stream) override
unsigned int n_values() const
virtual void print_binary_all(ostream &out_stream, bool print_data_size=true)=0
virtual ~ElementDataCacheBase()
Destructor.
DummyElementDataCache(std::string field_name_in, unsigned int n_comp_in)
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
std::shared_ptr< ElementDataCacheBase > compute_node_data(std::vector< unsigned int > &, unsigned int) override
bool is_dummy_
Is true for DummyElementDataCache.
virtual std::shared_ptr< ElementDataCacheBase > element_node_cache_optimize_size(std::vector< unsigned int > &offset_vec)=0
void print_yaml_subarray(ostream &, unsigned int, unsigned int, unsigned int) override
virtual std::shared_ptr< ElementDataCacheBase > element_node_cache_fixed_size(std::vector< unsigned int > &offset_vec)=0
static constexpr bool value
std::shared_ptr< ElementDataCacheBase > element_node_cache_fixed_size(std::vector< unsigned int > &) override
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::shared_ptr< ElementDataCacheBase > element_node_cache_optimize_size(std::vector< unsigned int > &) override
void get_min_max_range(double &, double &) override
void print_ascii(ostream &out_stream, unsigned int) override
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
std::string field_input_name_
name of field stored in cache
virtual void get_min_max_range(double &min, double &max)=0
virtual void print_yaml_subarray(ostream &out_stream, unsigned int precision, unsigned int begin, unsigned int end)=0
VTKValueType vtk_type_
Type of stored data.
virtual std::shared_ptr< ElementDataCacheBase > gather(Distribution *distr, LongIdx *local_to_global)=0
std::shared_ptr< ElementDataCacheBase > gather(Distribution *, LongIdx *) override
void read_binary_data(std::istream &, unsigned int, unsigned int) override
virtual ~DummyElementDataCache() override
void print_binary_all(ostream &, bool) override
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
void read_ascii_data(Tokenizer &, unsigned int, unsigned int) override
std::string field_units() const