libMesh
|
This class will read a binary .plt file.
More...
#include <plt_loader.h>
Public Types | |
enum | OldZoneType { BLOCK =0, POINT, FEBLOCK, FEPOINT } |
Writes a plot3d files. More... | |
enum | NewZoneType { ORDERED =0, FELINESEG, FETRIANGLE, FEQUADRILATERAL, FETETRAHEDRON, FEBRICK } |
Enum defining the zone type in the Tecplot binary file, for use with the new .plt format. More... | |
enum | DataType { FLOAT =1, DOUBLE, LONGINT, SHORTINT, BYTE, BIT } |
Enum defining the data type of each variable. More... | |
enum | FEType { TRI =0, QUAD, TET, HEX } |
Enum defining the finite element types. More... | |
Public Member Functions | |
PltLoader (const bool v=false) | |
Constructor. More... | |
PltLoader (const std::string &name, const bool v=false) | |
Constructor. More... | |
~PltLoader () | |
Destructor. More... | |
void | clear () |
Clear all data and return to a pristine state. More... | |
bool | verbose () const |
void | read (const std::string &name) |
Reads the .plt file specified by name . More... | |
void | write_dat (const std::string &name, const unsigned int version=10) const |
Writes an ASCII Tecplot file. More... | |
const std::string & | version () const |
bool | is_foreign () const |
const std::string & | title () const |
unsigned int | n_vars () const |
const std::string & | var_name (const unsigned int v) const |
unsigned int | var_type (const unsigned int v) const |
unsigned int | n_zones () const |
unsigned int | zone_type (const unsigned int z) const |
const std::string & | zone_name (const unsigned int z) const |
unsigned int | zone_pack (const unsigned int z) const |
unsigned int | imax (const unsigned int z) const |
unsigned int | jmax (const unsigned int z) const |
unsigned int | kmax (const unsigned int z) const |
unsigned int | n_nodes (const unsigned int z) const |
unsigned int | n_elem (const unsigned int z) const |
FEType | elem_type (const unsigned int z) const |
const std::vector< std::vector< std::vector< float > > > & | get_data () const |
Static Public Attributes | |
static const unsigned int | NNodes [4] = {3, 4, 4, 8} |
Enum defining the number of nodes for each element type. More... | |
Private Member Functions | |
void | read_header (std::istream &in) |
Read the header of the binary file. More... | |
void | read_data (std::istream &in) |
Read data from the binary file. More... | |
void | read_block_data (std::istream &in, const unsigned int zn) |
Read data for the zth zone in BLOCK structured format. More... | |
void | read_point_data (std::istream &in, const unsigned int zn) |
Read data for the zth zone in POINT structured format. More... | |
void | read_feblock_data (std::istream &in, const unsigned int zn) |
Read data for the zth zone in FEBLOCK unstructured format. More... | |
void | read_fepoint_data (std::istream &in, const unsigned int zn) |
Read data for the zth zone in FEPOINT unstructured format. More... | |
std::string & | version () |
bool & | is_foreign () |
std::string & | title () |
void | set_n_vars (const unsigned int nv) |
std::string & | var_name (const unsigned int v) |
unsigned int & | var_type (const unsigned int v) |
void | set_n_zones (const unsigned int nz) |
unsigned int & | zone_type (const unsigned int z) |
std::string & | zone_name (const unsigned int z) |
unsigned int & | zone_pack (const unsigned int z) |
unsigned int & | imax (const unsigned int z) |
unsigned int & | jmax (const unsigned int z) |
unsigned int & | kmax (const unsigned int z) |
Private Attributes | |
const bool | _verbose |
Verbosity. More... | |
std::string | _version |
The Tecplot Version number string. More... | |
bool | _is_foreign |
Is the data foreign? More... | |
std::string | _title |
The Tecplot data set title. More... | |
unsigned int | _n_vars |
The number of variables in the data set. More... | |
std::vector< std::string > | _var_names |
The name for each variable. More... | |
std::vector< unsigned int > | _var_types |
The type of each variable. More... | |
unsigned int | _n_zones |
The number of zones. More... | |
std::vector< unsigned int > | _zone_types |
The type of each zone. More... | |
std::vector< std::string > | _zone_names |
The name of each zone. More... | |
std::vector< unsigned int > | _zone_pack |
The data packing for each zone (new version only) More... | |
std::vector< unsigned int > | _imax |
The (imax,jmax,kmax) value for each zone. More... | |
std::vector< unsigned int > | _jmax |
std::vector< unsigned int > | _kmax |
std::vector< std::vector< std::vector< float > > > | _data |
Vector to hold the data. More... | |
std::vector< std::vector< int > > | _conn |
Vectors to hold the connectivity for each zone (only for unstructured files). More... | |
char | buf [512] |
Scratch data & relevant sizes. More... | |
This class will read a binary .plt file.
These types of files are for use with Amtec's Tecplot visualization package.
Definition at line 43 of file plt_loader.h.
Enum defining the data type of each variable.
Enumerator | |
---|---|
FLOAT | |
DOUBLE | |
LONGINT | |
SHORTINT | |
BYTE | |
BIT |
Definition at line 136 of file plt_loader.h.
Enum defining the finite element types.
Enumerator | |
---|---|
TRI | |
QUAD | |
TET | |
HEX |
Definition at line 146 of file plt_loader.h.
Enum defining the zone type in the Tecplot binary file, for use with the new .plt format.
Enumerator | |
---|---|
ORDERED | |
FELINESEG | |
FETRIANGLE | |
FEQUADRILATERAL | |
FETETRAHEDRON | |
FEBRICK |
Definition at line 126 of file plt_loader.h.
Writes a plot3d files.
The grid will be in basename.g and the solution will be in basename.q. It is assumed that the first three variables from the .plt file are the (x,y,z) locations of the grid points. The optional parameter reverse
specifies if the output file will have reversed byte ordering. Writes a Cart3D .tri component file. The number of components will be the number of zones in the .plt file. Enum defining the zone type in the Tecplot binary file, for use with the old .plt format.
Enumerator | |
---|---|
BLOCK | |
POINT | |
FEBLOCK | |
FEPOINT |
Definition at line 117 of file plt_loader.h.
|
inline |
Constructor.
Initializes data.
Definition at line 449 of file plt_loader.h.
|
inline |
Constructor.
Reads the file specified by name
.
Definition at line 460 of file plt_loader.h.
References read().
|
inline |
void libMesh::PltLoader::clear | ( | ) |
Clear all data and return to a pristine state.
Definition at line 37 of file plt_loader.C.
References _conn, _data, _imax, _is_foreign, _jmax, _kmax, _n_vars, _n_zones, _title, _var_names, _var_types, _version, _zone_names, _zone_pack, and _zone_types.
|
inline |
zth
zone (for unstructured meshes). Definition at line 691 of file plt_loader.h.
References kmax(), n_zones(), and zone_type().
|
inline |
Definition at line 704 of file plt_loader.h.
References _data.
imax
for zone z
. Definition at line 599 of file plt_loader.h.
References _imax, and n_zones().
Referenced by n_nodes(), read_block_data(), read_data(), read_feblock_data(), read_fepoint_data(), read_header(), read_point_data(), and write_dat().
imax
for zone z
. Definition at line 610 of file plt_loader.h.
References _imax, and n_zones().
|
inline |
true
if the binary type of the file is different than the machine that is reading it. If this is the case we must perform an endian-swap on all input data. Definition at line 170 of file plt_loader.h.
References _is_foreign.
Referenced by read_block_data(), read_data(), read_feblock_data(), read_fepoint_data(), read_header(), and read_point_data().
|
inlineprivate |
true
if the binary type of the file is different than the machine that is reading it. If this is the case we must perform an endian-swap on all input data. Definition at line 302 of file plt_loader.h.
References _is_foreign.
jmax
for zone z
. Definition at line 621 of file plt_loader.h.
References _jmax, and n_zones().
Referenced by n_elem(), read_block_data(), read_data(), read_feblock_data(), read_fepoint_data(), read_header(), read_point_data(), and write_dat().
jmax
for zone z
. Definition at line 632 of file plt_loader.h.
References _jmax, and n_zones().
kmax
for zone z
. Definition at line 643 of file plt_loader.h.
References _kmax, and n_zones().
Referenced by elem_type(), read_block_data(), read_data(), read_feblock_data(), read_fepoint_data(), read_header(), read_point_data(), and write_dat().
kmax
for zone z
. Definition at line 654 of file plt_loader.h.
References _kmax, and n_zones().
Definition at line 678 of file plt_loader.h.
References jmax(), n_zones(), and zone_type().
Referenced by read_header().
Definition at line 665 of file plt_loader.h.
References imax(), n_zones(), and zone_type().
Referenced by read_header().
|
inline |
Definition at line 180 of file plt_loader.h.
References _n_vars.
Referenced by read_block_data(), read_data(), read_feblock_data(), read_fepoint_data(), read_header(), read_point_data(), set_n_vars(), set_n_zones(), var_name(), var_type(), and write_dat().
|
inline |
Definition at line 195 of file plt_loader.h.
References _n_zones.
Referenced by elem_type(), imax(), jmax(), kmax(), n_elem(), n_nodes(), read_data(), read_feblock_data(), read_header(), set_n_vars(), set_n_zones(), write_dat(), zone_name(), zone_pack(), and zone_type().
void libMesh::PltLoader::read | ( | const std::string & | name | ) |
Reads the .plt file specified by name
.
Definition at line 35 of file plt_loader_read.C.
References libMesh::Quality::name(), libMesh::out, read_data(), read_header(), and verbose().
Referenced by PltLoader().
|
private |
Read data for the zth zone in BLOCK structured format.
Definition at line 821 of file plt_loader_read.C.
References _data, DOUBLE, FLOAT, imax(), is_foreign(), jmax(), kmax(), libMesh::libmesh_assert(), n_vars(), and var_type().
Referenced by read_data().
|
private |
Read data from the binary file.
Definition at line 593 of file plt_loader_read.C.
References BLOCK, buf, FEBLOCK, FEPOINT, libMesh::BasicOStreamProxy< charT, traits >::flush(), imax(), is_foreign(), jmax(), kmax(), libMesh::libmesh_assert(), n_vars(), n_zones(), ORDERED, libMesh::out, POINT, read_block_data(), read_feblock_data(), read_fepoint_data(), read_point_data(), var_type(), verbose(), version(), zone_pack(), and zone_type().
Referenced by read().
|
private |
Read data for the zth zone in FEBLOCK unstructured format.
Definition at line 938 of file plt_loader_read.C.
References _conn, _data, DOUBLE, FLOAT, imax(), is_foreign(), jmax(), kmax(), libMesh::libmesh_assert(), n_vars(), n_zones(), NNodes, and var_type().
Referenced by read_data().
|
private |
Read data for the zth zone in FEPOINT unstructured format.
Definition at line 1014 of file plt_loader_read.C.
References _conn, _data, buf, DOUBLE, FLOAT, imax(), is_foreign(), jmax(), kmax(), libMesh::libmesh_assert(), n_vars(), NNodes, and var_type().
Referenced by read_data().
|
private |
Read the header of the binary file.
Definition at line 60 of file plt_loader_read.C.
References buf, libMesh::err, imax(), is_foreign(), jmax(), kmax(), libMesh::libmesh_assert(), n_elem(), n_nodes(), n_vars(), n_zones(), libMesh::Quality::name(), ORDERED, libMesh::out, set_n_vars(), set_n_zones(), title(), var_name(), var_type(), verbose(), version(), zone_name(), zone_pack(), and zone_type().
Referenced by read().
|
private |
Read data for the zth zone in POINT structured format.
Definition at line 885 of file plt_loader_read.C.
References _data, buf, DOUBLE, FLOAT, imax(), is_foreign(), jmax(), kmax(), libMesh::libmesh_assert(), n_vars(), and var_type().
Referenced by read_data().
|
private |
Definition at line 63 of file plt_loader.C.
References _data, _n_vars, _var_names, _var_types, libMesh::make_range(), n_vars(), and n_zones().
Referenced by read_header().
|
private |
Definition at line 85 of file plt_loader.C.
References _conn, _data, _imax, _jmax, _kmax, _n_zones, _zone_names, _zone_pack, _zone_types, libMesh::make_range(), n_vars(), and n_zones().
Referenced by read_header().
|
inline |
Definition at line 175 of file plt_loader.h.
References _title.
Referenced by read_header(), and write_dat().
|
inlineprivate |
Definition at line 307 of file plt_loader.h.
References _title.
|
inline |
v
. Definition at line 479 of file plt_loader.h.
References _var_names, and n_vars().
Referenced by read_header(), and write_dat().
|
inlineprivate |
v
. Definition at line 491 of file plt_loader.h.
References _var_names, and n_vars().
v
Definition at line 503 of file plt_loader.h.
References _var_types, and n_vars().
Referenced by read_block_data(), read_data(), read_feblock_data(), read_fepoint_data(), read_header(), and read_point_data().
v
Definition at line 515 of file plt_loader.h.
References _var_types, and n_vars().
|
inline |
Definition at line 70 of file plt_loader.h.
References _verbose.
Referenced by read(), read_data(), and read_header().
|
inline |
Definition at line 163 of file plt_loader.h.
References _version.
Referenced by read_data(), and read_header().
|
inlineprivate |
Definition at line 295 of file plt_loader.h.
References _version.
void libMesh::PltLoader::write_dat | ( | const std::string & | name, |
const unsigned int | version = 10 |
||
) | const |
Writes an ASCII Tecplot file.
The optional parameter version
specifies the version format to write.
Definition at line 453 of file plt_loader_write.C.
References _data, BLOCK, imax(), jmax(), kmax(), libMesh::make_range(), n_vars(), n_zones(), libMesh::Quality::name(), POINT, title(), var_name(), zone_name(), and zone_type().
|
inline |
z
. Definition at line 551 of file plt_loader.h.
References _zone_names, and n_zones().
Referenced by read_header(), and write_dat().
|
inlineprivate |
z
. Definition at line 563 of file plt_loader.h.
References _zone_names, and n_zones().
z
. Definition at line 575 of file plt_loader.h.
References _zone_pack, and n_zones().
Referenced by read_data(), and read_header().
z
. Definition at line 587 of file plt_loader.h.
References _zone_pack, and n_zones().
z
Definition at line 527 of file plt_loader.h.
References _zone_types, and n_zones().
Referenced by elem_type(), n_elem(), n_nodes(), read_data(), read_header(), and write_dat().
z
Definition at line 539 of file plt_loader.h.
References _zone_types, and n_zones().
|
private |
Vectors to hold the connectivity for each zone (only for unstructured files).
Definition at line 436 of file plt_loader.h.
Referenced by clear(), read_feblock_data(), read_fepoint_data(), and set_n_zones().
|
private |
Vector to hold the data.
Definition at line 430 of file plt_loader.h.
Referenced by clear(), get_data(), read_block_data(), read_feblock_data(), read_fepoint_data(), read_point_data(), set_n_vars(), set_n_zones(), and write_dat().
|
private |
The (imax,jmax,kmax) value for each zone.
Definition at line 423 of file plt_loader.h.
Referenced by clear(), imax(), and set_n_zones().
|
private |
Is the data foreign?
Definition at line 377 of file plt_loader.h.
Referenced by clear(), and is_foreign().
|
private |
Definition at line 424 of file plt_loader.h.
Referenced by clear(), jmax(), and set_n_zones().
|
private |
Definition at line 425 of file plt_loader.h.
Referenced by clear(), kmax(), and set_n_zones().
|
private |
The number of variables in the data set.
Definition at line 387 of file plt_loader.h.
Referenced by clear(), n_vars(), and set_n_vars().
|
private |
The number of zones.
Definition at line 403 of file plt_loader.h.
Referenced by clear(), n_zones(), and set_n_zones().
|
private |
The Tecplot data set title.
Definition at line 382 of file plt_loader.h.
|
private |
The name for each variable.
Definition at line 392 of file plt_loader.h.
Referenced by clear(), set_n_vars(), and var_name().
|
private |
The type of each variable.
Must be one of the enumerated DataType
types.
Definition at line 398 of file plt_loader.h.
Referenced by clear(), set_n_vars(), and var_type().
|
private |
|
private |
The Tecplot Version number string.
Definition at line 372 of file plt_loader.h.
|
private |
The name of each zone.
Definition at line 413 of file plt_loader.h.
Referenced by clear(), set_n_zones(), and zone_name().
|
private |
The data packing for each zone (new version only)
Definition at line 418 of file plt_loader.h.
Referenced by clear(), set_n_zones(), and zone_pack().
|
private |
The type of each zone.
Definition at line 408 of file plt_loader.h.
Referenced by clear(), set_n_zones(), and zone_type().
|
mutableprivate |
Scratch data & relevant sizes.
Definition at line 441 of file plt_loader.h.
Referenced by read_data(), read_fepoint_data(), read_header(), and read_point_data().
|
static |
Enum defining the number of nodes for each element type.
Definition at line 250 of file plt_loader.h.
Referenced by read_feblock_data(), and read_fepoint_data().