Go to the documentation of this file.
20 #ifndef LIBMESH_PLT_LOADER_H
21 #define LIBMESH_PLT_LOADER_H
24 #include "libmesh/libmesh_common.h"
75 void read (
const std::string &
name);
82 const unsigned int version=10)
const;
185 const std::string &
var_name (
const unsigned int v)
const;
190 unsigned int var_type (
const unsigned int v)
const;
200 unsigned int zone_type (
const unsigned int z)
const;
205 const std::string &
zone_name (
const unsigned int z)
const;
210 unsigned int zone_pack (
const unsigned int z)
const;
215 unsigned int imax (
const unsigned int z)
const;
220 unsigned int jmax (
const unsigned int z)
const;
225 unsigned int kmax (
const unsigned int z)
const;
230 unsigned int n_nodes (
const unsigned int z)
const;
235 unsigned int n_elem (
const unsigned int z)
const;
245 const std::vector<std::vector<std::vector<float>>> &
get_data ()
const;
317 std::string &
var_name (
const unsigned int v);
322 unsigned int &
var_type (
const unsigned int v);
332 unsigned int &
zone_type (
const unsigned int z);
337 std::string &
zone_name (
const unsigned int z);
342 unsigned int &
zone_pack (
const unsigned int z);
347 unsigned int &
imax (
const unsigned int z);
352 unsigned int &
jmax (
const unsigned int z);
357 unsigned int &
kmax (
const unsigned int z);
430 std::vector<std::vector<std::vector<float>>>
_data;
436 std::vector<std::vector<int>>
_conn;
481 libmesh_assert_less (v, this->
n_vars());
493 libmesh_assert_less (v, this->
n_vars());
505 libmesh_assert_less (v, this->
n_vars());
517 libmesh_assert_less (v, this->
n_vars());
529 libmesh_assert_less (z, this->
n_zones());
541 libmesh_assert_less (z, this->
n_zones());
553 libmesh_assert_less (z, this->
n_zones());
565 libmesh_assert_less (z, this->
n_zones());
577 libmesh_assert_less (z, this->
n_zones());
589 libmesh_assert_less (z, this->
n_zones());
601 libmesh_assert_less (z, this->
n_zones());
602 libmesh_assert_equal_to (
_imax.size(), this->
n_zones());
612 libmesh_assert_less (z, this->
n_zones());
613 libmesh_assert_equal_to (
_imax.size(), this->
n_zones());
623 libmesh_assert_less (z, this->
n_zones());
624 libmesh_assert_equal_to (
_jmax.size(), this->
n_zones());
634 libmesh_assert_less (z, this->
n_zones());
635 libmesh_assert_equal_to (
_jmax.size(), this->
n_zones());
645 libmesh_assert_less (z, this->
n_zones());
646 libmesh_assert_equal_to (
_kmax.size(), this->
n_zones());
656 libmesh_assert_less (z, this->
n_zones());
657 libmesh_assert_equal_to (
_kmax.size(), this->
n_zones());
667 libmesh_assert_less (z, this->
n_zones());
670 libmesh_assert_greater (this->
zone_type(z), 1);
672 return this->
imax(z);
680 libmesh_assert_less (z, this->
n_zones());
683 libmesh_assert_greater (this->
zone_type(z), 1);
685 return this->
jmax(z);
693 libmesh_assert_less (z, this->
n_zones());
696 libmesh_assert_greater (this->
zone_type(z), 1);
698 return static_cast<FEType>(this->
kmax(z));
703 const std::vector<std::vector<std::vector<float>>> &
715 #endif // LIBMESH_PLT_LOADER_H
std::vector< unsigned int > _imax
The (imax,jmax,kmax) value for each zone.
std::string _title
The Tecplot data set title.
std::vector< std::string > _var_names
The name for each variable.
void read_block_data(std::istream &in, const unsigned int zn)
Read data for the zth zone in BLOCK structured format.
unsigned int zone_pack(const unsigned int z) const
const std::string & version() const
const std::string & var_name(const unsigned int v) const
std::string _version
The Tecplot Version number string.
std::vector< std::vector< int > > _conn
Vectors to hold the connectivity for each zone (only for unstructured files).
PltLoader(const bool v=false)
Constructor.
unsigned int n_vars() const
std::vector< unsigned int > _jmax
The libMesh namespace provides an interface to certain functionality in the library.
void write_dat(const std::string &name, const unsigned int version=10) const
Writes an ASCII Tecplot file.
std::vector< std::string > _zone_names
The name of each zone.
unsigned int var_type(const unsigned int v) const
unsigned int kmax(const unsigned int z) const
void read_data(std::istream &in)
Read data from the binary file.
unsigned int jmax(const unsigned int z) const
const std::vector< std::vector< std::vector< float > > > & get_data() const
const bool _verbose
Verbosity.
const std::string & zone_name(const unsigned int z) const
void set_n_vars(const unsigned int nv)
void read_header(std::istream &in)
Read the header of the binary file.
void read_feblock_data(std::istream &in, const unsigned int zn)
Read data for the zth zone in FEBLOCK unstructured format.
std::vector< unsigned int > _kmax
void read_point_data(std::istream &in, const unsigned int zn)
Read data for the zth zone in POINT structured format.
char buf[512]
Scratch data & relevant sizes.
DataType
Enum defining the data type of each variable.
unsigned int n_zones() const
FEType
Enum defining the finite element types.
void set_n_zones(const unsigned int nz)
static const unsigned int NNodes[4]
Enum defining the number of nodes for each element type.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
unsigned int zone_type(const unsigned int z) const
std::vector< unsigned int > _zone_pack
The data packing for each zone (new version only)
NewZoneType
Enum defining the zone type in the Tecplot binary file, for use with the new .plt format.
unsigned int imax(const unsigned int z) const
std::vector< std::vector< std::vector< float > > > _data
Vector to hold the data.
void read(const std::string &name)
Reads the .plt file specified by name.
bool _is_foreign
Is the data foreign?
std::vector< unsigned int > _var_types
The type of each variable.
FEType elem_type(const unsigned int z) const
unsigned int n_elem(const unsigned int z) const
This class will read a binary .plt file.
const std::string & title() const
unsigned int n_nodes(const unsigned int z) const
void read_fepoint_data(std::istream &in, const unsigned int zn)
Read data for the zth zone in FEPOINT unstructured format.
unsigned int _n_zones
The number of zones.
std::vector< unsigned int > _zone_types
The type of each zone.
unsigned int _n_vars
The number of variables in the data set.
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
void clear()
Clear all data and return to a pristine state.