General interface for writing visualization data in different file formats.
More...
#include <Visualizer.hpp>
|
static std::unique_ptr< Visualizer > | create (std::string format, int n_dim_geom, int n_dim_topo, std::string file_name, std::vector< std::string > variable_names, double time, elem_type element_type) |
| Creates a Visualizer object, selecting the appropriate backend based on the requested file format.
|
|
static std::unique_ptr< Visualizer > | create (std::string format, int n_dim_geom, int n_dim_topo, std::string file_name, const Output_data &, double time, elem_type) |
| overload of create(std::string, int, int, std::string, std::vector<std::string>, double, elem_type)
|
|
|
static const std::string | default_format |
| Default file format to visualize in, depending on what libraries you have enabled.
|
|
General interface for writing visualization data in different file formats.
◆ elem_type
enum
used to indicate the type of elements to visualize
Enumerator |
---|
block | line segment, quad, or hex depending on the number of topological dimensions
|
simplex | line segment, triangle, or tet depending on the number of topological dimensions
|
◆ create() [1/2]
std::unique_ptr< Visualizer > hexed::Visualizer::create |
( |
std::string | format, |
|
|
int | n_dim_geom, |
|
|
int | n_dim_topo, |
|
|
std::string | file_name, |
|
|
const Output_data & | dat, |
|
|
double | time, |
|
|
elem_type | elem_t ) |
|
static |
overload of create(std::string, int, int, std::string, std::vector<std::string>, double, elem_type)
The number and names of variables are determined from the Output_data
supplied.
◆ create() [2/2]
std::unique_ptr< Visualizer > hexed::Visualizer::create |
( |
std::string | format, |
|
|
int | n_dim_geom, |
|
|
int | n_dim_topo, |
|
|
std::string | file_name, |
|
|
std::vector< std::string > | variable_names, |
|
|
double | time, |
|
|
elem_type | element_type ) |
|
static |
Creates a Visualizer
object, selecting the appropriate backend based on the requested file format.
- Parameters
-
format | File format to visualize in. Supported formats are:
|
n_dim_geom | Number of geometric dimensions. I.e., does your data exist in 1D, 2D, or 3D space? |
n_dim_topo | Number of topological dimensions. I.e. 1 => curve, 2 => surface, 3 => solid |
file_name | Name of file to write, not including extension. |
variable_names | List of names of output variables to be written, not including position variables, which are named automatically. This can be empty if you're only writing position. It also determines number of output variables. |
time | Flow time to include in the output file, if applicable. |
element_type | Along with n_dim_topo , specifies the type of elements to visualize. |
◆ write_block()
virtual void hexed::Visualizer::write_block |
( |
Array< double > | pos, |
|
|
Array< double > | vars ) |
|
pure virtual |
writes a structured block of data
- Parameters
-
pos | Array of position data. Layout: [i_dim][i_row]([j_row]([k_row])) (j_row and k_row optional depending on the topological dimension) |
vars | Array of field variable data. Layout: [i_var][i_row]([j_row]([k_row])) |
Implemented in hexed::Csv, hexed::Tecplot_file, and hexed::Xdmf_wrapper.
◆ write_unstruct()
virtual void hexed::Visualizer::write_unstruct |
( |
Array< int > | elements, |
|
|
Array< double > | pos, |
|
|
Array< double > | vars ) |
|
pure virtual |
writes unstructured data
Unstructured data is specified by a list of vertices, each of which has values of position and field variables associated with it, and a list of elements, each of which is specified by the indices of its vertices. All elements must be the same type (e.g. line segment, triangle, quad, etc.) and the element type is inferred from the number of vertices for each element. If you call write_unstruct()
multiple times on the same Visualizer
, the vertex indices you supply should restart from 0.
- Parameters
-
elements | Indices of the vertices for each element. Layout: [i_element][i_vertex] E.g. for a mesh containing 2 quadrilateral elements, elements will have shape {2, 4}. |
pos | Position data for all vertices. Layout: [i_dim][i_vertex] E.g. if the above mesh was specifying a surface in 3D space and the two quadrilateral elements shared exactly one edge, pos would have shape {3, 6} (there would be 6 total vertices, 4 for each element minus 2 shared) |
vars | Values of field variables for all vertices. Layout [i_var][i_vertex]. The number of columns must be the same as pos . |
Implemented in hexed::Csv, hexed::Tecplot_file, and hexed::Xdmf_wrapper.
◆ default_format
const std::string hexed::Visualizer::default_format |
|
static |
Initial value:
Default file format to visualize in, depending on what libraries you have enabled.
Determined based on build options as follows:
- if
--use_xdmf
is true, then "xdmf"
- otherwise, if
--use_tecio
is true, then "tecplot"
- otherwise,
"csv"
The documentation for this class was generated from the following files:
- /home/micaiah/Desktop/hexed/include/Visualizer.hpp
- /home/micaiah/Desktop/hexed/libhexed/Visualizer.cpp