libMesh
|
This class implements writing meshes in the Tecplot format. More...
#include <tecplot_io.h>
Public Member Functions | |
TecplotIO (const MeshBase &, const bool binary=false, const double time=0., const int strand_offset=0) | |
Constructor. More... | |
virtual void | write (const std::string &) override |
This method implements writing a mesh to a specified file. More... | |
virtual void | write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided. More... | |
bool & | binary () |
Flag indicating whether or not to write a binary file (if the tecio.a library was found by configure ). More... | |
double & | time () |
Solution time for transient data. More... | |
int & | strand_offset () |
Strand offset for this file. More... | |
std::string & | zone_title () |
The zone title to write. More... | |
bool & | ascii_append () |
Set to true to write multiple solutions to a single file (ASCII only). More... | |
virtual void | write_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr) |
This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems object. More... | |
virtual void | write_discontinuous_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr) |
This method implements writing a mesh with discontinuous data to a specified file where the data is taken from the EquationSystems object. More... | |
virtual void | write_nodal_data (const std::string &, const NumericVector< Number > &, const std::vector< std::string > &) |
This method may be overridden by "parallel" output formats for writing nodal data. More... | |
virtual void | write_nodal_data (const std::string &, const EquationSystems &, const std::set< std::string > *) |
This method should be overridden by "parallel" output formats for writing nodal data. More... | |
virtual void | write_nodal_data_discontinuous (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) |
This method implements writing a mesh with discontinuous data to a specified file where the nodal data and variables names are provided. More... | |
unsigned int & | ascii_precision () |
Return/set the precision to use when writing ASCII files. More... | |
Protected Member Functions | |
const MeshBase & | mesh () const |
virtual bool | get_add_sides () |
Protected Attributes | |
const bool | _is_parallel_format |
Flag specifying whether this format is parallel-capable. More... | |
const bool | _serial_only_needed_on_proc_0 |
Flag specifying whether this format can be written by only serializing the mesh to processor zero. More... | |
Private Member Functions | |
void | write_ascii (const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr) |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are optionally provided. More... | |
void | write_binary (const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr) |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are optionally provided. More... | |
unsigned | elem_dimension () |
Determines the logical spatial dimension of the elements in the Mesh. More... | |
Private Attributes | |
bool | _binary |
Flag to write binary data. More... | |
double | _time |
Solution time. More... | |
int | _strand_offset |
Offset for Tecplot's STRANDID. More... | |
std::string | _zone_title |
The zone title to write. More... | |
bool | _ascii_append |
If true, when writing in ASCII format, open the file in std::ofstream::app mode. More... | |
std::set< subdomain_id_type > | _subdomain_ids |
The subdomains in the mesh. More... | |
This class implements writing meshes in the Tecplot format.
Definition at line 43 of file tecplot_io.h.
|
explicit |
Constructor.
Takes a reference to a constant mesh object. This constructor will only allow us to write the mesh. The optional parameter binary
can be used to switch between ASCII (false
, the default) or binary (true
) output files.
Definition at line 121 of file tecplot_io.C.
References _subdomain_ids, and libMesh::MeshBase::subdomain_ids().
bool & libMesh::TecplotIO::ascii_append | ( | ) |
Set to true to write multiple solutions to a single file (ASCII only).
Tecplot will read multiple zones in a single file, but currently you have to repeat the mesh information each time.
Definition at line 168 of file tecplot_io.C.
References _ascii_append.
|
inlineinherited |
Return/set the precision to use when writing ASCII files.
By default we use numeric_limits<Real>::max_digits10, which should be enough to write out to ASCII and get the exact same Real back when reading in.
Definition at line 269 of file mesh_output.h.
Referenced by libMesh::UNVIO::nodes_out(), libMesh::FroIO::write(), libMesh::MEDITIO::write_ascii(), write_ascii(), libMesh::GMVIO::write_ascii_new_impl(), and libMesh::GMVIO::write_ascii_old_impl().
bool & libMesh::TecplotIO::binary | ( | ) |
Flag indicating whether or not to write a binary file (if the tecio.a library was found by configure
).
Definition at line 141 of file tecplot_io.C.
References _binary.
Referenced by write(), and write_nodal_data().
|
private |
Determines the logical spatial dimension of the elements in the Mesh.
Ex: A 1D edge element living in 3D is a logically one-dimensional element as far as Tecplot is concerned. Throws an error if mixed-dimension element types are found, since I'm not sure how to handle that case currently.
Definition at line 204 of file tecplot_io.C.
References libMesh::MeshOutput< MT >::mesh().
Referenced by write_ascii(), and write_binary().
|
inlineprotectedvirtualinherited |
Reimplemented in libMesh::ExodusII_IO.
Definition at line 176 of file mesh_output.h.
|
inlineprotectedinherited |
Definition at line 259 of file mesh_output.h.
References libMesh::libmesh_assert().
Referenced by libMesh::FroIO::write(), write(), libMesh::MEDITIO::write(), libMesh::PostscriptIO::write(), libMesh::EnsightIO::write(), write_ascii(), write_binary(), write_nodal_data(), libMesh::MEDITIO::write_nodal_data(), and libMesh::GnuPlotIO::write_solution().
int & libMesh::TecplotIO::strand_offset | ( | ) |
Strand offset for this file.
Each mesh block will be written to (strand_id=block_id+1+strand_offset). Written to newer binary formats that are time-aware, defaults to 0.
Definition at line 155 of file tecplot_io.C.
References _strand_offset.
Referenced by write_binary().
double & libMesh::TecplotIO::time | ( | ) |
Solution time for transient data.
Written to newer binary formats that are time-aware.
Definition at line 148 of file tecplot_io.C.
References _time.
|
overridevirtual |
This method implements writing a mesh to a specified file.
Implements libMesh::MeshOutput< MeshBase >.
Definition at line 174 of file tecplot_io.C.
References binary(), libMesh::MeshOutput< MeshBase >::mesh(), write_ascii(), and write_binary().
Referenced by libMesh::NameBasedIO::write().
|
private |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are optionally provided.
This will write an ASCII file.
Definition at line 232 of file tecplot_io.C.
References _ascii_append, _time, std::abs(), libMesh::MeshOutput< MeshBase >::ascii_precision(), elem_dimension(), libMesh::make_range(), libMesh::MeshOutput< MT >::mesh(), libMesh::MeshOutput< MeshBase >::mesh(), libMesh::MeshBase::n_active_sub_elem(), libMesh::MeshBase::n_nodes(), n_vars, libMesh::out, libMesh::MeshBase::point(), libMesh::TECPLOT, and libMesh::TypeVector< T >::write_unformatted().
Referenced by write(), write_binary(), and write_nodal_data().
|
private |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are optionally provided.
This will write a binary file if the tecio.a library was found at compile time, otherwise a warning message will be printed and an ASCII file will be created.
Definition at line 351 of file tecplot_io.C.
References _subdomain_ids, _time, std::abs(), libMesh::as_range(), elem_dimension(), libMesh::err, libMesh::ierr, libMesh::index_range(), libMesh::make_range(), libMesh::MeshOutput< MT >::mesh(), libMesh::MeshOutput< MeshBase >::mesh(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_active_sub_elem(), libMesh::MeshBase::n_nodes(), n_vars, libMesh::MeshBase::point(), strand_offset(), libMesh::MeshBase::subdomain_name(), libMesh::TECPLOT, write_ascii(), and zone_title().
Referenced by write(), and write_nodal_data().
|
virtualinherited |
This method implements writing a mesh with discontinuous data to a specified file where the data is taken from the EquationSystems
object.
Definition at line 89 of file mesh_output.C.
References libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::EquationSystems::get_mesh(), libMesh::libmesh_assert(), and libMesh::out.
Referenced by libMesh::ExodusII_IO::write_timestep_discontinuous().
|
virtualinherited |
This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems
object.
Reimplemented in libMesh::NameBasedIO.
Definition at line 31 of file mesh_output.C.
References libMesh::EquationSystems::build_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::EquationSystems::get_mesh(), libMesh::libmesh_assert(), and libMesh::out.
Referenced by libMesh::Nemesis_IO::write_timestep(), and libMesh::ExodusII_IO::write_timestep().
|
overridevirtual |
This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided.
Reimplemented from libMesh::MeshOutput< MeshBase >.
Definition at line 187 of file tecplot_io.C.
References binary(), libMesh::MeshOutput< MeshBase >::mesh(), write_ascii(), and write_binary().
Referenced by libMesh::NameBasedIO::write_nodal_data().
|
virtualinherited |
This method may be overridden by "parallel" output formats for writing nodal data.
Instead of getting a localized copy of the nodal solution vector, it is passed a NumericVector of type=PARALLEL which is in node-major order i.e. (u0,v0,w0, u1,v1,w1, u2,v2,w2, u3,v3,w3, ...) and contains n_nodes*n_vars total entries. Then, it is up to the individual I/O class to extract the required solution values from this vector and write them in parallel.
If not implemented, localizes the parallel vector into a std::vector and calls the other version of this function.
Reimplemented in libMesh::Nemesis_IO.
Definition at line 149 of file mesh_output.C.
References libMesh::NumericVector< T >::localize().
|
virtualinherited |
This method should be overridden by "parallel" output formats for writing nodal data.
Instead of getting a localized copy of the nodal solution vector, it directly uses EquationSystems current_local_solution vectors to look up nodal values.
If not implemented, reorders the solutions into a nodal-only NumericVector and calls the above version of this function.
Reimplemented in libMesh::Nemesis_IO.
Definition at line 162 of file mesh_output.C.
References libMesh::EquationSystems::build_parallel_solution_vector(), and libMesh::EquationSystems::build_variable_names().
|
inlinevirtualinherited |
This method implements writing a mesh with discontinuous data to a specified file where the nodal data and variables names are provided.
Reimplemented in libMesh::ExodusII_IO.
Definition at line 118 of file mesh_output.h.
std::string & libMesh::TecplotIO::zone_title | ( | ) |
The zone title to write.
Definition at line 162 of file tecplot_io.C.
References _zone_title.
Referenced by write_binary().
|
private |
If true, when writing in ASCII format, open the file in std::ofstream::app mode.
Definition at line 167 of file tecplot_io.h.
Referenced by ascii_append(), and write_ascii().
|
private |
|
protectedinherited |
Flag specifying whether this format is parallel-capable.
If this is false (default) I/O is only permitted when the mesh has been serialized.
Definition at line 184 of file mesh_output.h.
Referenced by libMesh::FroIO::write(), libMesh::PostscriptIO::write(), and libMesh::EnsightIO::write().
|
protectedinherited |
Flag specifying whether this format can be written by only serializing the mesh to processor zero.
If this is false (default) the mesh will be serialized to all processors
Definition at line 193 of file mesh_output.h.
|
private |
Offset for Tecplot's STRANDID.
Definition at line 156 of file tecplot_io.h.
Referenced by strand_offset().
|
private |
The subdomains in the mesh.
Definition at line 172 of file tecplot_io.h.
Referenced by TecplotIO(), and write_binary().
|
private |
Solution time.
Definition at line 151 of file tecplot_io.h.
Referenced by time(), write_ascii(), and write_binary().
|
private |