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);
703 const std::vector<std::vector<std::vector<float>>> &
715 #endif // LIBMESH_PLT_LOADER_H std::string name(const ElemQuality q)
This function returns a string containing some name for q.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
void set_n_zones(const unsigned int nz)
FEType elem_type(const unsigned int z) const
unsigned int n_vars() const
std::vector< std::vector< int > > _conn
Vectors to hold the connectivity for each zone (only for unstructured files).
std::vector< std::string > _zone_names
The name of each zone.
std::vector< std::vector< std::vector< float > > > _data
Vector to hold the data.
std::vector< unsigned int > _zone_pack
The data packing for each zone (new version only)
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.
std::vector< unsigned int > _var_types
The type of each variable.
void set_n_vars(const unsigned int nv)
const bool _verbose
Verbosity.
void clear()
Clear all data and return to a pristine state.
This class will read a binary .plt file.
std::vector< unsigned int > _zone_types
The type of each zone.
The libMesh namespace provides an interface to certain functionality in the library.
const std::string & var_name(const unsigned int v) const
std::vector< unsigned int > _jmax
std::vector< unsigned int > _imax
The (imax,jmax,kmax) value for each zone.
void read(const std::string &name)
Reads the .plt file specified by name.
static const unsigned int NNodes[4]
Enum defining the number of nodes for each element type.
unsigned int imax(const unsigned int z) const
const std::string & zone_name(const unsigned int z) const
std::vector< std::string > _var_names
The name for each variable.
unsigned int jmax(const unsigned int z) const
unsigned int zone_pack(const unsigned int z) const
PltLoader(const bool v=false)
Constructor.
std::string _title
The Tecplot data set title.
unsigned int _n_vars
The number of variables in the data set.
void read_fepoint_data(std::istream &in, const unsigned int zn)
Read data for the zth zone in FEPOINT unstructured format.
unsigned int n_nodes(const unsigned int z) const
DataType
Enum defining the data type of each variable.
std::string _version
The Tecplot Version number string.
const std::vector< std::vector< std::vector< float > > > & get_data() const
unsigned int var_type(const unsigned int v) const
char buf[512]
Scratch data & relevant sizes.
const std::string & title() const
bool _is_foreign
Is the data foreign?
unsigned int n_zones() const
unsigned int kmax(const unsigned int z) const
NewZoneType
Enum defining the zone type in the Tecplot binary file, for use with the new .plt format...
FEType
Enum defining the finite element types.
OldZoneType
Writes a plot3d files.
void read_header(std::istream &in)
Read the header of the binary file.
void read_block_data(std::istream &in, const unsigned int zn)
Read data for the zth zone in BLOCK structured format.
const std::string & version() const
unsigned int _n_zones
The number of zones.
unsigned int n_elem(const unsigned int z) const
void read_data(std::istream &in)
Read data from the binary file.
void read_feblock_data(std::istream &in, const unsigned int zn)
Read data for the zth zone in FEBLOCK unstructured format.
void write_dat(const std::string &name, const unsigned int version=10) const
Writes an ASCII Tecplot file.
unsigned int zone_type(const unsigned int z) const