#include <plt_loader.h>
Public Types | |
enum | OldZoneType { BLOCK =0, POINT, FEBLOCK, FEPOINT } |
enum | NewZoneType { ORDERED =0, FELINESEG, FETRIANGLE, FEQUADRILATERAL, FETETRAHEDRON, FEBRICK } |
enum | DataType { FLOAT =1, DOUBLE, LONGINT, SHORTINT, BYTE, BIT } |
enum | FEType { TRI =0, QUAD, TET, HEX } |
Public Member Functions | |
PltLoader (const bool v=false) | |
PltLoader (const std::string &name, const bool v=false) | |
~PltLoader () | |
void | clear () |
bool | verbose () const |
void | read (const std::string &name) |
void | write_dat (const std::string &name, const unsigned int version=10) const |
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} |
Private Member Functions | |
void | read_header (std::istream &in) |
void | read_data (std::istream &in) |
void | read_block_data (std::istream &in, const unsigned int zn) |
void | read_point_data (std::istream &in, const unsigned int zn) |
void | read_feblock_data (std::istream &in, const unsigned int zn) |
void | read_fepoint_data (std::istream &in, const unsigned int zn) |
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 |
std::string | _version |
bool | _is_foreign |
std::string | _title |
unsigned int | _n_vars |
std::vector< std::string > | _var_names |
std::vector< unsigned int > | _var_types |
unsigned int | _n_zones |
std::vector< unsigned int > | _zone_types |
std::vector< std::string > | _zone_names |
std::vector< unsigned int > | _zone_pack |
std::vector< unsigned int > | _imax |
std::vector< unsigned int > | _jmax |
std::vector< unsigned int > | _kmax |
std::vector< std::vector< std::vector< float > > > | _data |
std::vector< std::vector< int > > | _conn |
char | buf [512] |
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 |
|
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 35 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.
|
inline |
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().
|
inlineprivate |
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.
|
inline |
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().
|
inlineprivate |
jmax
for zone z
. Definition at line 632 of file plt_loader.h.
References _jmax, and n_zones().
|
inline |
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().
|
inlineprivate |
kmax
for zone z
. Definition at line 654 of file plt_loader.h.
References _kmax, and n_zones().
|
inline |
Definition at line 678 of file plt_loader.h.
References jmax(), n_zones(), and zone_type().
Referenced by read_header().
|
inline |
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 829 of file plt_loader_read.C.
References _data, data, DOUBLE, FLOAT, imax(), is_foreign(), jmax(), kmax(), n_vars(), and var_type().
Referenced by read_data().
|
private |
Read data from the binary file.
Definition at line 598 of file plt_loader_read.C.
References BLOCK, buf, FEBLOCK, FEPOINT, libMesh::BasicOStreamProxy< charT, traits >::flush(), imax(), is_foreign(), jmax(), kmax(), 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 946 of file plt_loader_read.C.
References _conn, _data, data, DOUBLE, FLOAT, imax(), is_foreign(), jmax(), kmax(), 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 1026 of file plt_loader_read.C.
References _conn, _data, buf, data, DOUBLE, FLOAT, imax(), is_foreign(), jmax(), kmax(), n_vars(), NNodes, and var_type().
Referenced by read_data().
|
private |
Read the header of the binary file.
Definition at line 62 of file plt_loader_read.C.
References buf, libMesh::err, imax(), is_foreign(), jmax(), kmax(), 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 893 of file plt_loader_read.C.
References _data, buf, data, DOUBLE, FLOAT, imax(), is_foreign(), jmax(), kmax(), n_vars(), and var_type().
Referenced by read_data().
|
private |
Definition at line 61 of file plt_loader.C.
References _data, _n_vars, _var_names, _var_types, n_vars(), and n_zones().
Referenced by read_header().
|
private |
Definition at line 83 of file plt_loader.C.
References _conn, _data, _imax, _jmax, _kmax, _n_zones, _zone_names, _zone_pack, _zone_types, 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 |
|
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().
|
inline |
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().
|
inlineprivate |
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 451 of file plt_loader_write.C.
References _data, BLOCK, imax(), jmax(), kmax(), 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().
|
inline |
z
. Definition at line 575 of file plt_loader.h.
References _zone_pack, and n_zones().
Referenced by read_data(), and read_header().
|
inlineprivate |
z
. Definition at line 587 of file plt_loader.h.
References _zone_pack, and n_zones().
|
inline |
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().
|
inlineprivate |
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().