Flow123d
JS_before_hm-1754-g1847fd3ed
|
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;
89 virtual void print_ascii_all(ostream &out_stream,
unsigned int start=0) = 0;
94 virtual void print_binary_all(ostream &out_stream,
bool print_data_size =
true,
unsigned int start = 0) = 0;
100 virtual void print_yaml_subarray(ostream &out_stream,
unsigned int precision,
unsigned int begin,
unsigned int end) = 0;
236 ASSERT(
false).error(
"Unsupported VTK type");
306 for(
unsigned int i=0; i<
n_comp_;i++) out_stream << 0 <<
" ";
311 for(
unsigned int i=start; i<
n_comp_;i++) out_stream << 0 <<
" ";
316 ASSERT(
false).error(
"Not implemented.");
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.
virtual void print_ascii_all(ostream &out_stream, unsigned int start=0)=0
virtual void print_binary_all(ostream &out_stream, bool print_data_size=true, unsigned int start=0)=0
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.
unsigned int n_dofs_per_element_
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)
unsigned int n_dofs_per_element() const
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 print_ascii_all(ostream &out_stream, unsigned int start=0) override
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
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
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
void print_binary_all(ostream &, bool, unsigned int) override
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.
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.
std::string fe_type() const