Flow123d
release_3.0.0-973-g92f55e826
|
Go to the documentation of this file.
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.");
virtual void print_ascii_all(ostream &out_stream)=0
std::shared_ptr< ElementDataCacheBase > gather(Distribution *, LongIdx *) override
virtual std::shared_ptr< ElementDataCacheBase > compute_node_data(std::vector< unsigned int > &conn_vec, unsigned int data_size)=0
virtual ~DummyElementDataCache() override
std::string field_units() const
VTKValueType vtk_type() const
Get type of stored data.
double time_
time step stored in cache
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
virtual void print_binary_all(ostream &out_stream, bool print_data_size=true)=0
void get_min_max_range(double &, double &) override
std::shared_ptr< ElementDataCacheBase > compute_node_data(std::vector< unsigned int > &, unsigned int) override
std::string field_input_name()
Getter for quantity name of cache.
static constexpr bool value
unsigned int n_comp() const
void set_field_units(std::string unit_string)
virtual std::shared_ptr< ElementDataCacheBase > element_node_cache_fixed_size(std::vector< unsigned int > &offset_vec)=0
void print_ascii(ostream &out_stream, unsigned int) override
void set_n_values(unsigned int n_values)
void set_dof_handler_hash(std::size_t hash)
void read_binary_data(std::istream &, unsigned int, unsigned int) override
virtual std::shared_ptr< ElementDataCacheBase > element_node_cache_optimize_size(std::vector< unsigned int > &offset_vec)=0
double get_time()
Getter for time of cache.
void read_ascii_data(Tokenizer &, unsigned int, unsigned int) override
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.
std::shared_ptr< ElementDataCacheBase > element_node_cache_fixed_size(std::vector< unsigned int > &) override
virtual std::shared_ptr< ElementDataCacheBase > gather(Distribution *distr, LongIdx *local_to_global)=0
bool is_dummy_
Is true for DummyElementDataCache.
std::shared_ptr< ElementDataCacheBase > element_node_cache_optimize_size(std::vector< unsigned int > &) override
void print_ascii_all(ostream &out_stream) override
virtual void read_ascii_data(Tokenizer &tok, unsigned int n_components, unsigned int i_row)=0
void print_yaml_subarray(ostream &, unsigned int, unsigned int, unsigned int) override
std::size_t dof_handler_hash_
Hash of DOF handler (attribute of native VTK data)
std::string field_input_name_
name of field stored in cache
virtual void read_binary_data(std::istream &data_stream, unsigned int n_components, unsigned int i_row)=0
bool is_actual(double time, std::string field_name)
Check if cache stored actual data.
VTKValueType
Types of VTK value.
void print_binary_all(ostream &, bool) override
virtual void print_ascii(ostream &out_stream, unsigned int idx)=0
DummyElementDataCache(std::string field_name_in, unsigned int n_comp_in)
std::size_t dof_handler_hash() const
ElementDataCacheBase()
Constructor.
unsigned int n_values() const
virtual void get_min_max_range(double &min, double &max)=0
virtual ~ElementDataCacheBase()
Destructor.