#include <gnuplot_io.h>
Public Types | |
enum | PlottingProperties { GRID_ON = 1, PNG_OUTPUT = 2 } |
Public Member Functions | |
GnuPlotIO (const MeshBase &, const std::string &=std::string("FE 1D Solution"), int properties=0) | |
virtual void | write (const std::string &) override |
virtual void | write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override |
void | set_title (const std::string &title) |
void | use_grid (bool grid) |
void | set_png_output (bool png_output) |
virtual void | write_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr) |
virtual void | write_discontinuous_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr) |
virtual void | write_nodal_data (const std::string &, const NumericVector< Number > &, const std::vector< std::string > &) |
virtual void | write_nodal_data_discontinuous (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) |
unsigned int & | ascii_precision () |
Public Attributes | |
std::string | axes_limits |
Protected Member Functions | |
const MeshBase & | mesh () const |
Protected Attributes | |
const bool | _is_parallel_format |
const bool | _serial_only_needed_on_proc_0 |
Private Member Functions | |
void | write_solution (const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr) |
Private Attributes | |
std::string | _title |
bool | _grid |
bool | _png_output |
This class implements writing meshes using GNUplot, designed for use only with 1D meshes.
Definition at line 43 of file gnuplot_io.h.
Define enumerations to set plotting properties on construction
Enumerator | |
---|---|
GRID_ON | |
PNG_OUTPUT |
Definition at line 50 of file gnuplot_io.h.
|
explicit |
Constructor. Takes a reference to a constant mesh object. To set the properties, we input a bitwise OR of the GnuPlotIO::PlottingProperties enumerations, e.g. GnuPlotIO::GRID_ON | GnuPlotIO::PNG_OUTPUT
Definition at line 32 of file gnuplot_io.C.
References _grid, _png_output, GRID_ON, and PNG_OUTPUT.
|
inlineinherited |
Return/set the precision to use when writing ASCII files.
By default we use numeric_limits<Real>::digits10 + 2, which should be enough to write out to ASCII and get the exact same Real back when reading in.
Definition at line 244 of file mesh_output.h.
Referenced by libMesh::TecplotIO::write_ascii(), libMesh::GMVIO::write_ascii_new_impl(), and libMesh::GMVIO::write_ascii_old_impl().
|
inlineprotectedinherited |
Definition at line 234 of file mesh_output.h.
Referenced by libMesh::FroIO::write(), libMesh::TecplotIO::write(), libMesh::MEDITIO::write(), libMesh::PostscriptIO::write(), libMesh::EnsightIO::write(), libMesh::TecplotIO::write_ascii(), libMesh::TecplotIO::write_binary(), libMesh::TecplotIO::write_nodal_data(), libMesh::MEDITIO::write_nodal_data(), and write_solution().
|
inline |
Write output to a .png file using gnuplot
Definition at line 97 of file gnuplot_io.h.
References _png_output.
|
inline |
|
inline |
|
overridevirtual |
Write the mesh to the specified file.
Implements libMesh::MeshOutput< MeshBase >.
Definition at line 43 of file gnuplot_io.C.
References write_solution().
|
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 92 of file mesh_output.C.
References libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::EquationSystems::get_mesh(), 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_parallel_solution_vector(), libMesh::EquationSystems::build_solution_vector(), libMesh::EquationSystems::build_variable_names(), libMesh::EquationSystems::get_mesh(), 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 48 of file gnuplot_io.C.
References write_solution().
|
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 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 150 of file mesh_output.C.
References libMesh::NumericVector< T >::localize().
|
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 114 of file mesh_output.h.
|
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 59 of file gnuplot_io.C.
References _grid, _png_output, _title, libMesh::MeshBase::active_element_ptr_range(), axes_limits, data, libMesh::MeshOutput< MeshBase >::mesh(), libMesh::MeshOutput< MT >::mesh(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_active_elem(), n_vars, libMesh::MeshBase::point(), and libMesh::Real.
Referenced by write(), and write_nodal_data().
|
private |
Definition at line 121 of file gnuplot_io.h.
Referenced by GnuPlotIO(), use_grid(), and write_solution().
|
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 159 of file mesh_output.h.
Referenced by libMesh::FroIO::write(), libMesh::PostscriptIO::write(), and libMesh::EnsightIO::write().
|
private |
Definition at line 122 of file gnuplot_io.h.
Referenced by GnuPlotIO(), set_png_output(), and write_solution().
|
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 168 of file mesh_output.h.
|
private |
Definition at line 119 of file gnuplot_io.h.
Referenced by set_title(), and write_solution().
std::string libMesh::GnuPlotIO::axes_limits |
GNUplot automatically adjusts the x and y-axes of 2D plots to "zoom in" on the data. You can set this string to force GNUplot to maintain a fixed set of axes. Example: axes_limits = "[0:1] [0:1]" would force x and y to be plotted on the range 0<=x<=1 and 0<=y<=1 regardless of where the data lie.
Definition at line 107 of file gnuplot_io.h.
Referenced by write_solution().