Flow123d  JS_before_hm-1711-g43b724b37
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ElementDataCacheBase Class Referenceabstract

#include <element_data_cache_base.hh>

Inheritance diagram for ElementDataCacheBase:
Inheritance graph
[legend]
Collaboration diagram for ElementDataCacheBase:
Collaboration graph
[legend]

Public Types

enum  NumCompValueType { N_SCALAR = 1, N_VECTOR = 3, N_TENSOR = 9 }
 
enum  VTKValueType {
  VTK_INT8, VTK_UINT8, VTK_INT16, VTK_UINT16,
  VTK_INT32, VTK_UINT32, VTK_FLOAT32, VTK_FLOAT64
}
 Types of VTK value. More...
 

Public Member Functions

 ElementDataCacheBase ()
 Constructor. More...
 
virtual ~ElementDataCacheBase ()
 Destructor. More...
 
double get_time ()
 Getter for time of cache. More...
 
std::string field_input_name ()
 Getter for quantity name of cache. More...
 
bool is_actual (double time, std::string field_name)
 Check if cache stored actual data. More...
 
virtual void read_ascii_data (Tokenizer &tok, unsigned int n_components, unsigned int i_row)=0
 
virtual void read_binary_data (std::istream &data_stream, unsigned int n_components, unsigned int i_row)=0
 
virtual void print_ascii (ostream &out_stream, unsigned int idx)=0
 
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
 
virtual void print_yaml_subarray (ostream &out_stream, unsigned int precision, unsigned int begin, unsigned int end)=0
 
virtual void get_min_max_range (double &min, double &max)=0
 
void set_field_units (std::string unit_string)
 
void set_n_values (unsigned int n_values)
 
std::string field_units () const
 
unsigned int n_values () const
 
bool is_dummy () const
 
unsigned int n_comp () const
 
unsigned int n_dofs_per_element () const
 
VTKValueType vtk_type () const
 Get type of stored data. More...
 
std::size_t dof_handler_hash () const
 
void set_dof_handler_hash (std::size_t hash)
 
std::string fe_type () const
 
virtual std::shared_ptr< ElementDataCacheBasegather (Distribution *distr, LongIdx *local_to_global)=0
 
virtual std::shared_ptr< ElementDataCacheBaseelement_node_cache_fixed_size (std::vector< unsigned int > &offset_vec)=0
 
virtual std::shared_ptr< ElementDataCacheBaseelement_node_cache_optimize_size (std::vector< unsigned int > &offset_vec)=0
 
virtual std::shared_ptr< ElementDataCacheBasecompute_node_data (std::vector< unsigned int > &conn_vec, unsigned int data_size)=0
 

Protected Member Functions

template<class T >
void set_vtk_type ()
 

Protected Attributes

double time_
 time step stored in cache More...
 
std::string field_input_name_
 name of field stored in cache More...
 
std::string field_name_
 
std::string field_units_
 
unsigned int n_values_
 
unsigned int n_comp_
 
VTKValueType vtk_type_
 Type of stored data. More...
 
std::size_t dof_handler_hash_
 Hash of DOF handler (attribute of native VTK data) More...
 
std::string fe_type_
 
unsigned int n_dofs_per_element_
 
bool is_dummy_
 Is true for DummyElementDataCache. More...
 

Detailed Description

Definition at line 33 of file element_data_cache_base.hh.

Member Enumeration Documentation

◆ NumCompValueType

Number of components of element data stored in the database.

Enumerator
N_SCALAR 
N_VECTOR 
N_TENSOR 

Definition at line 39 of file element_data_cache_base.hh.

◆ VTKValueType

Types of VTK value.

Enumerator
VTK_INT8 
VTK_UINT8 
VTK_INT16 
VTK_UINT16 
VTK_INT32 
VTK_UINT32 
VTK_FLOAT32 
VTK_FLOAT64 

Definition at line 46 of file element_data_cache_base.hh.

Constructor & Destructor Documentation

◆ ElementDataCacheBase()

ElementDataCacheBase::ElementDataCacheBase ( )
inline

Constructor.

Definition at line 51 of file element_data_cache_base.hh.

◆ ~ElementDataCacheBase()

virtual ElementDataCacheBase::~ElementDataCacheBase ( )
inlinevirtual

Destructor.

Definition at line 56 of file element_data_cache_base.hh.

Member Function Documentation

◆ compute_node_data()

virtual std::shared_ptr< ElementDataCacheBase > ElementDataCacheBase::compute_node_data ( std::vector< unsigned int > &  conn_vec,
unsigned int  data_size 
)
pure virtual

Create final node data cache.

Compute average value of each nodes.

Parameters
conn_vecVector of connectivities, holds node indices to values of this cache
data_sizenumber of nodes

Implemented in ElementDataCache< T >, and DummyElementDataCache.

◆ dof_handler_hash()

std::size_t ElementDataCacheBase::dof_handler_hash ( ) const
inline

Get dof_handler_hash_ value.

Definition at line 164 of file element_data_cache_base.hh.

◆ element_node_cache_fixed_size()

virtual std::shared_ptr< ElementDataCacheBase > ElementDataCacheBase::element_node_cache_fixed_size ( std::vector< unsigned int > &  offset_vec)
pure virtual

Create node data cache of constant data size for each elements.

Method must be call on node data cache.

Every element is represented of 4 nodes maximal. Method returns cache with size = 4*n_elements*n_components. If dimension of element is less than 3, part of data is not used. This construction of node data cache allow call gather of node data for continuous and discontinuous output meshes.

Parameters
offset_vecvector of appropriate offsets (number of nodes) of each elements

Implemented in ElementDataCache< T >, and DummyElementDataCache.

◆ element_node_cache_optimize_size()

virtual std::shared_ptr< ElementDataCacheBase > ElementDataCacheBase::element_node_cache_optimize_size ( std::vector< unsigned int > &  offset_vec)
pure virtual

Inverse method to previous.

Must be call on node cache with constant data size for each elements. Return data cache, that corresponds with offset vector.

Parameters
offset_vecvector of appropriate offsets (number of nodes) of each elements

Implemented in ElementDataCache< T >, and DummyElementDataCache.

◆ fe_type()

std::string ElementDataCacheBase::fe_type ( ) const
inline

Get fe_type_ value.

Definition at line 178 of file element_data_cache_base.hh.

Here is the caller graph for this function:

◆ field_input_name()

std::string ElementDataCacheBase::field_input_name ( )
inline

Getter for quantity name of cache.

Definition at line 63 of file element_data_cache_base.hh.

◆ field_units()

std::string ElementDataCacheBase::field_units ( ) const
inline

Get string representation of SI units.

Definition at line 124 of file element_data_cache_base.hh.

◆ gather()

virtual std::shared_ptr< ElementDataCacheBase > ElementDataCacheBase::gather ( Distribution distr,
LongIdx local_to_global 
)
pure virtual

Method for gathering parallel data to serial cache.

Gather data of individual processes to serial cache that is created only on zero process. Other processes return uninitialized shared pointer.

Parameters
distrCollective distribution
local_to_globalMaps local indices to global

Implemented in ElementDataCache< T >, and DummyElementDataCache.

◆ get_min_max_range()

virtual void ElementDataCacheBase::get_min_max_range ( double &  min,
double &  max 
)
pure virtual

Find minimal and maximal range of stored data

Implemented in ElementDataCache< T >, and DummyElementDataCache.

◆ get_time()

double ElementDataCacheBase::get_time ( )
inline

Getter for time of cache.

Definition at line 59 of file element_data_cache_base.hh.

◆ is_actual()

bool ElementDataCacheBase::is_actual ( double  time,
std::string  field_name 
)
inline

Check if cache stored actual data.

Definition at line 67 of file element_data_cache_base.hh.

◆ is_dummy()

bool ElementDataCacheBase::is_dummy ( ) const
inline

Is only true when the object is DummyElementDataCache.

Definition at line 138 of file element_data_cache_base.hh.

◆ n_comp()

unsigned int ElementDataCacheBase::n_comp ( ) const
inline

Get number of data elements per data value.

Definition at line 145 of file element_data_cache_base.hh.

Here is the caller graph for this function:

◆ n_dofs_per_element()

unsigned int ElementDataCacheBase::n_dofs_per_element ( ) const
inline

Get number of DOFs per element.

Definition at line 152 of file element_data_cache_base.hh.

Here is the caller graph for this function:

◆ n_values()

unsigned int ElementDataCacheBase::n_values ( ) const
inline

Get number of data values.

Definition at line 131 of file element_data_cache_base.hh.

Here is the caller graph for this function:

◆ print_ascii()

virtual void ElementDataCacheBase::print_ascii ( ostream &  out_stream,
unsigned int  idx 
)
pure virtual

Print one value at given index in ascii format

Implemented in DummyElementDataCache, and ElementDataCache< T >.

◆ print_ascii_all()

virtual void ElementDataCacheBase::print_ascii_all ( ostream &  out_stream,
unsigned int  start = 0 
)
pure virtual

Print all data in ascii format at once stored in database

Implemented in DummyElementDataCache, and ElementDataCache< T >.

◆ print_binary_all()

virtual void ElementDataCacheBase::print_binary_all ( ostream &  out_stream,
bool  print_data_size = true,
unsigned int  start = 0 
)
pure virtual

Print all data in binary format at once stored in database

Implemented in ElementDataCache< T >, and DummyElementDataCache.

◆ print_yaml_subarray()

virtual void ElementDataCacheBase::print_yaml_subarray ( ostream &  out_stream,
unsigned int  precision,
unsigned int  begin,
unsigned int  end 
)
pure virtual

Print stored values in the YAML format (using JSON like arrays). Used for output of observe values.

Implemented in ElementDataCache< T >, and DummyElementDataCache.

◆ read_ascii_data()

virtual void ElementDataCacheBase::read_ascii_data ( Tokenizer &  tok,
unsigned int  n_components,
unsigned int  i_row 
)
pure virtual

Read ascii data of given i_row from tokenizer

Implemented in ElementDataCache< T >, and DummyElementDataCache.

Here is the caller graph for this function:

◆ read_binary_data()

virtual void ElementDataCacheBase::read_binary_data ( std::istream &  data_stream,
unsigned int  n_components,
unsigned int  i_row 
)
pure virtual

Read binary data of given i_row from data stream

Implemented in ElementDataCache< T >, and DummyElementDataCache.

Here is the caller graph for this function:

◆ set_dof_handler_hash()

void ElementDataCacheBase::set_dof_handler_hash ( std::size_t  hash)
inline

Set dof_handler_hash_ value.

Definition at line 171 of file element_data_cache_base.hh.

Here is the caller graph for this function:

◆ set_field_units()

void ElementDataCacheBase::set_field_units ( std::string  unit_string)
inline

Set string representation of SI units.

Definition at line 110 of file element_data_cache_base.hh.

◆ set_n_values()

void ElementDataCacheBase::set_n_values ( unsigned int  n_values)
inline

Set string representation of SI units.

Definition at line 117 of file element_data_cache_base.hh.

◆ set_vtk_type()

template<class T >
void ElementDataCacheBase::set_vtk_type ( )
inlineprotected

Definition at line 228 of file element_data_cache_base.hh.

◆ vtk_type()

VTKValueType ElementDataCacheBase::vtk_type ( ) const
inline

Get type of stored data.

Definition at line 157 of file element_data_cache_base.hh.

Member Data Documentation

◆ dof_handler_hash_

std::size_t ElementDataCacheBase::dof_handler_hash_
protected

Hash of DOF handler (attribute of native VTK data)

Definition at line 266 of file element_data_cache_base.hh.

◆ fe_type_

std::string ElementDataCacheBase::fe_type_
protected

FiniteElement type (attribute of native VTK data)

Definition at line 271 of file element_data_cache_base.hh.

◆ field_input_name_

std::string ElementDataCacheBase::field_input_name_
protected

name of field stored in cache

Definition at line 244 of file element_data_cache_base.hh.

◆ field_name_

std::string ElementDataCacheBase::field_name_
protected

Definition at line 245 of file element_data_cache_base.hh.

◆ field_units_

std::string ElementDataCacheBase::field_units_
protected

Data copied from Field.

Definition at line 250 of file element_data_cache_base.hh.

◆ is_dummy_

bool ElementDataCacheBase::is_dummy_
protected

Is true for DummyElementDataCache.

Definition at line 279 of file element_data_cache_base.hh.

◆ n_comp_

unsigned int ElementDataCacheBase::n_comp_
protected

Number of data elements per data value.

Definition at line 260 of file element_data_cache_base.hh.

◆ n_dofs_per_element_

unsigned int ElementDataCacheBase::n_dofs_per_element_
protected

Number of DOFs per element (attribute of native VTK data)

Definition at line 276 of file element_data_cache_base.hh.

◆ n_values_

unsigned int ElementDataCacheBase::n_values_
protected

Number of data values.

Definition at line 255 of file element_data_cache_base.hh.

◆ time_

double ElementDataCacheBase::time_
protected

time step stored in cache

Definition at line 241 of file element_data_cache_base.hh.

◆ vtk_type_

VTKValueType ElementDataCacheBase::vtk_type_
protected

Type of stored data.

Definition at line 263 of file element_data_cache_base.hh.


The documentation for this class was generated from the following file: