Reference documentation for deal.II version Git 473ab123f9 2021-10-27 21:58:47 -0600
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
DataOutStack< dim, spacedim, void > Class Template Reference

#include <deal.II/numerics/data_out_stack.h>

Inheritance diagram for DataOutStack< dim, spacedim, void >:
[legend]

Classes

struct  DataVector
 

Public Types

enum  VectorType { cell_vector, dof_vector }
 

Public Member Functions

virtual ~DataOutStack () override=default
 
void new_parameter_value (const double parameter_value, const double parameter_step)
 
void attach_dof_handler (const DoFHandler< dim, spacedim > &dof_handler)
 
void declare_data_vector (const std::string &name, const VectorType vector_type)
 
void declare_data_vector (const std::vector< std::string > &name, const VectorType vector_type)
 
template<typename number >
void add_data_vector (const Vector< number > &vec, const std::string &name)
 
template<typename number >
void add_data_vector (const Vector< number > &vec, const std::vector< std::string > &names)
 
void build_patches (const unsigned int n_subdivisions=0)
 
void finish_parameter_value ()
 
std::size_t memory_consumption () const
 
void write_dx (std::ostream &out) const
 
void write_eps (std::ostream &out) const
 
void write_gmv (std::ostream &out) const
 
void write_gnuplot (std::ostream &out) const
 
void write_povray (std::ostream &out) const
 
void write_tecplot (std::ostream &out) const
 
void write_ucd (std::ostream &out) const
 
void write_vtk (std::ostream &out) const
 
void write_vtu (std::ostream &out) const
 
void write_vtu_in_parallel (const std::string &filename, const MPI_Comm &comm) const
 
void write_pvtu_record (std::ostream &out, const std::vector< std::string > &piece_names) const
 
std::string write_vtu_with_pvtu_record (const std::string &directory, const std::string &filename_without_extension, const unsigned int counter, const MPI_Comm &mpi_communicator, const unsigned int n_digits_for_counter=numbers::invalid_unsigned_int, const unsigned int n_groups=0) const
 
void write_svg (std::ostream &out) const
 
void write_deal_II_intermediate (std::ostream &out) const
 
XDMFEntry create_xdmf_entry (const DataOutBase::DataOutFilter &data_filter, const std::string &h5_filename, const double cur_time, const MPI_Comm &comm) const
 
XDMFEntry create_xdmf_entry (const DataOutBase::DataOutFilter &data_filter, const std::string &h5_mesh_filename, const std::string &h5_solution_filename, const double cur_time, const MPI_Comm &comm) const
 
void write_xdmf_file (const std::vector< XDMFEntry > &entries, const std::string &filename, const MPI_Comm &comm) const
 
void write_hdf5_parallel (const DataOutBase::DataOutFilter &data_filter, const std::string &filename, const MPI_Comm &comm) const
 
void write_hdf5_parallel (const DataOutBase::DataOutFilter &data_filter, const bool write_mesh_file, const std::string &mesh_filename, const std::string &solution_filename, const MPI_Comm &comm) const
 
void write_filtered_data (DataOutBase::DataOutFilter &filtered_data) const
 
void write (std::ostream &out, const DataOutBase::OutputFormat output_format=DataOutBase::default_format) const
 
void set_default_format (const DataOutBase::OutputFormat default_format)
 
void set_flags (const FlagType &flags)
 
std::string default_suffix (const DataOutBase::OutputFormat output_format=DataOutBase::default_format) const
 
void parse_parameters (ParameterHandler &prm)
 

Static Public Member Functions

static ::ExceptionBaseExcVectorNotDeclared (std::string arg1)
 
static ::ExceptionBaseExcDataNotCleared ()
 
static ::ExceptionBaseExcDataAlreadyAdded ()
 
static ::ExceptionBaseExcNameAlreadyUsed (std::string arg1)
 
static void declare_parameters (ParameterHandler &prm)
 

Static Public Attributes

static constexpr int patch_dim = dim + 1
 
static constexpr int patch_spacedim = spacedim + 1
 

Protected Member Functions

virtual std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > get_nonscalar_data_ranges () const
 
void validate_dataset_names () const
 

Protected Attributes

unsigned int default_subdivisions
 

Private Member Functions

virtual const std::vector<::DataOutBase::Patch< DataOutStack< dim, spacedim, void >::patch_dim, DataOutStack< dim, spacedim, void >::patch_spacedim > > & get_patches () const override
 
virtual std::vector< std::string > get_dataset_names () const override
 

Private Attributes

double parameter
 
double parameter_step
 
SmartPointer< const DoFHandler< dim, spacedim >, DataOutStack< dim, spacedim, void > > dof_handler
 
std::vector<::DataOutBase::Patch< patch_dim, patch_spacedim > > patches
 
std::vector< DataVector > dof_data
 
std::vector< DataVector > cell_data
 

Detailed Description

template<int dim, int spacedim>
class DataOutStack< dim, spacedim, void >

This class is used to stack the output from several computations into one output file by stacking the data sets in another coordinate direction orthogonal to the space directions. The most common use is to stack the results of several time steps into one space-time output file, or for example to connect the results of solutions of a parameter dependent equation for several parameter value together into one. The interface is mostly modelled after the DataOut class, see there for some more documentation. The class is used in step-78.

We will explain the concept for a time dependent problem, but instead of the time any parameter can be substituted. In our example, a solution of an equation is computed for each discrete time level. This is then added to an object of the present class and after all time levels are added, a space- time plot will be written in any of the output formats supported by the base class. Upon output, the (spatial) solution on each time level is extended into the time direction by writing it twice, once for the time level itself and once for a time equal to the time level minus a given time step. These two copies are connected, to form a space-time slab, with constant values in time.

Due to the piecewise constant output in time, the written solution will in general be discontinuous at discrete time levels, but the output is still sufficient in most cases. More sophisticated interpolations in time may be added in the future.

Example of use

The following little example shall illustrate the different steps of use of this class. It is assumed that the finite element used is composed of two components, u and v, that the solution vector is named solution and that a vector error is computed which contains an error indicator for each spatial cell.

Note that unlike for the DataOut class it is necessary to first declare data vectors and the names of the components before first use. This is because on all time levels the same data should be present to produce reasonable time-space output. The output is generated with two subdivisions in each space and time direction, which is suitable for quadratic finite elements in space, for example.

DataOutStack<dim> data_out_stack;
// first declare the vectors
// to be used later
std::vector<std::string> solution_names;
solution_names.emplace_back ("u");
solution_names.emplace_back ("v");
data_out_stack.declare_data_vector (solution_names,
data_out_stack.declare_data_vector ("error",
// now do computations
for (double parameter=0; ...)
{
... // compute something
// now for output
data_out_stack.new_parameter_value (parameter,
delta_parameter);
data_out_stack.attach_dof_handler (dof_handler);
data_out_stack.add_data_vector (solution, solution_names);
data_out_stack.add_data_vector (error, "error");
data_out_stack.build_patches (2);
data_out_stack.finish_parameter_value ();
};

Definition at line 134 of file data_out_stack.h.

Member Enumeration Documentation

◆ VectorType

template<int dim, int spacedim>
enum DataOutStack< dim, spacedim, void >::VectorType

Data type declaring the two types of vectors which are used in this class.

Enumerator
cell_vector 

The data describes one value for each cell.

dof_vector 

The data describes one value for each DoF.

Definition at line 155 of file data_out_stack.h.

Constructor & Destructor Documentation

◆ ~DataOutStack()

template<int dim, int spacedim>
virtual DataOutStack< dim, spacedim, void >::~DataOutStack ( )
overridevirtualdefault

Destructor. Only declared to make it virtual.

Member Function Documentation

◆ new_parameter_value()

template<int dim, int spacedim>
void DataOutStack< dim, spacedim, void >::new_parameter_value ( const double  parameter_value,
const double  parameter_step 
)

Start the next set of data for a specific parameter value. The argument parameter_step denotes the interval (in backward direction, counted from parameter_value) with which the output will be extended in parameter direction, i.e. orthogonal to the space directions.

Definition at line 52 of file data_out_stack.cc.

◆ attach_dof_handler()

template<int dim, int spacedim>
void DataOutStack< dim, spacedim, void >::attach_dof_handler ( const DoFHandler< dim, spacedim > &  dof_handler)

Attach the DoF handler for the grid and data associated with the parameter previously set by new_parameter_value.

This has to happen before adding data vectors for the present parameter value.

Definition at line 75 of file data_out_stack.cc.

◆ declare_data_vector() [1/2]

template<int dim, int spacedim>
void DataOutStack< dim, spacedim, void >::declare_data_vector ( const std::string &  name,
const VectorType  vector_type 
)

Declare a data vector. The vector_type argument determines whether the data vector will be considered as DoF or cell data.

This version may be called if the finite element presently used by the DoFHandler (and previously attached to this object) has only one component and therefore only one name needs to be given.

Definition at line 84 of file data_out_stack.cc.

◆ declare_data_vector() [2/2]

template<int dim, int spacedim>
void DataOutStack< dim, spacedim, void >::declare_data_vector ( const std::vector< std::string > &  name,
const VectorType  vector_type 
)

Declare a data vector. The vector_type argument determines whether the data vector will be considered as DoF or cell data.

This version must be called if the finite element presently used by the DoFHandler (and previously attached to this object) has more than one component and therefore more than one name needs to be given. However, you can also call this function with a std::vector<std::string> containing only one element if the finite element has only one component.

Definition at line 96 of file data_out_stack.cc.

◆ add_data_vector() [1/2]

template<int dim, int spacedim>
template<typename number >
void DataOutStack< dim, spacedim, void >::add_data_vector ( const Vector< number > &  vec,
const std::string &  name 
)

Add a data vector for the presently set value of the parameter.

This version may be called if the finite element presently used by the DoFHandler (and previously attached to this object) has only one component and therefore only one name needs to be given.

If vec is a vector with multiple components this function will generate distinct names for all components by appending an underscore and the number of each component to name

The data vector must have been registered using the declare_data_vector function before actually using it the first time.

Note that a copy of this vector is stored until finish_parameter_value is called the next time, so if you are short of memory you may want to call this function only after all computations involving large matrices are already done.

Definition at line 139 of file data_out_stack.cc.

◆ add_data_vector() [2/2]

template<int dim, int spacedim>
template<typename number >
void DataOutStack< dim, spacedim, void >::add_data_vector ( const Vector< number > &  vec,
const std::vector< std::string > &  names 
)

Add a data vector for the presently set value of the parameter.

This version must be called if the finite element presently used by the DoFHandler (and previously attached to this object) has more than one component and therefore more than one name needs to be given. However, you can also call this function with a std::vector<std::string> containing only one element if the finite element has only one component.

The data vector must have been registered using the declare_data_vector function before actually using it the first time.

Note that a copy of this vector is stored until finish_parameter_value is called the next time, so if you are short of memory you may want to call this function only after all computations involving large matrices are already done.

Definition at line 173 of file data_out_stack.cc.

◆ build_patches()

template<int dim, int spacedim>
void DataOutStack< dim, spacedim, void >::build_patches ( const unsigned int  n_subdivisions = 0)

This is the central function of this class since it builds the list of patches to be written by the low-level functions of the base class. A patch is, in essence, some intermediate representation of the data on each cell of a triangulation and DoFHandler object that can then be used to write files in some format that is readable by visualization programs.

You can find an overview of the use of this function in the general documentation of this class. An example is also provided in the documentation of this class's base class DataOut_DoFData.

Parameters
n_subdivisionsSee DataOut::build_patches() for an extensive description of this parameter. The number of subdivisions is always one in the direction of the time-like parameter used by this class.

Definition at line 247 of file data_out_stack.cc.

◆ finish_parameter_value()

template<int dim, int spacedim>
void DataOutStack< dim, spacedim, void >::finish_parameter_value ( )

Release all data that is no more needed once build_patches was called and all other transactions for a given parameter value are done.

Counterpart of new_parameter_value.

Definition at line 435 of file data_out_stack.cc.

◆ memory_consumption()

template<int dim, int spacedim>
std::size_t DataOutStack< dim, spacedim, void >::memory_consumption ( ) const

Determine an estimate for the memory consumption (in bytes) of this object.

Definition at line 454 of file data_out_stack.cc.

◆ get_patches()

template<int dim, int spacedim>
const std::vector<::DataOutBase::Patch< DataOutStack< dim, spacedim, void >::patch_dim, DataOutStack< dim, spacedim, void >::patch_spacedim > > & DataOutStack< dim, spacedim, void >::get_patches ( ) const
overrideprivatevirtual

This is the function through which derived classes propagate preprocessed data in the form of Patch structures (declared in the base class DataOutBase) to the actual output function.

Implements DataOutInterface< dim+1, spacedim+1 >.

Definition at line 472 of file data_out_stack.cc.

◆ get_dataset_names()

template<int dim, int spacedim>
std::vector< std::string > DataOutStack< dim, spacedim, void >::get_dataset_names ( ) const
overrideprivatevirtual

Virtual function through which the names of data sets are obtained by the output functions of the base class.

Implements DataOutInterface< dim+1, spacedim+1 >.

Definition at line 481 of file data_out_stack.cc.

◆ write_dx()

void DataOutInterface< dim, spacedim >::write_dx ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in OpenDX format. See DataOutBase::write_dx.

Definition at line 7265 of file data_out_base.cc.

◆ write_eps()

void DataOutInterface< dim, spacedim >::write_eps ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in EPS format. See DataOutBase::write_eps.

Definition at line 7317 of file data_out_base.cc.

◆ write_gmv()

void DataOutInterface< dim, spacedim >::write_gmv ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in GMV format. See DataOutBase::write_gmv.

Definition at line 7330 of file data_out_base.cc.

◆ write_gnuplot()

void DataOutInterface< dim, spacedim >::write_gnuplot ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in GNUPLOT format. See DataOutBase::write_gnuplot.

Definition at line 7291 of file data_out_base.cc.

◆ write_povray()

void DataOutInterface< dim, spacedim >::write_povray ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in POVRAY format. See DataOutBase::write_povray.

Definition at line 7304 of file data_out_base.cc.

◆ write_tecplot()

void DataOutInterface< dim, spacedim >::write_tecplot ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in Tecplot format. See DataOutBase::write_tecplot.

Definition at line 7343 of file data_out_base.cc.

◆ write_ucd()

void DataOutInterface< dim, spacedim >::write_ucd ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in UCD format for AVS. See DataOutBase::write_ucd.

Definition at line 7278 of file data_out_base.cc.

◆ write_vtk()

void DataOutInterface< dim, spacedim >::write_vtk ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in Vtk format. See DataOutBase::write_vtk.

Note
VTK is a legacy format and has largely been supplanted by the VTU format (an XML-structured version of VTK). In particular, VTU allows for the compression of data and consequently leads to much smaller file sizes that equivalent VTK files for large files. Since all visualization programs that support VTK also support VTU, you should consider using the latter file format instead, by using the write_vtu() function.

Definition at line 7356 of file data_out_base.cc.

◆ write_vtu()

void DataOutInterface< dim, spacedim >::write_vtu ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in Vtu (VTK's XML) format. See DataOutBase::write_vtu.

Some visualization programs, such as ParaView, can read several separate VTU files to parallelize visualization. In that case, you need a .pvtu file that describes which VTU files form a group. The DataOutInterface::write_pvtu_record() function can generate such a centralized record. Likewise, DataOutInterface::write_visit_record() does the same for older versions of VisIt (although VisIt can also read pvtu records since version 2.5.1). Finally, DataOutInterface::write_pvd_record() can be used to group together the files that jointly make up a time dependent simulation.

Definition at line 7367 of file data_out_base.cc.

◆ write_vtu_in_parallel()

void DataOutInterface< dim, spacedim >::write_vtu_in_parallel ( const std::string &  filename,
const MPI_Comm comm 
) const
inherited

Collective MPI call to write the solution from all participating nodes (those in the given communicator) to a single compressed .vtu file on a shared file system. The communicator can be a sub communicator of the one used by the computation. This routine uses MPI I/O to achieve high performance on parallel filesystems. Also see DataOutInterface::write_vtu().

Definition at line 7389 of file data_out_base.cc.

◆ write_pvtu_record()

void DataOutInterface< dim, spacedim >::write_pvtu_record ( std::ostream &  out,
const std::vector< std::string > &  piece_names 
) const
inherited

Some visualization programs, such as ParaView, can read several separate VTU files that all form part of the same simulation, in order to parallelize visualization. In that case, you need a .pvtu file that describes which VTU files (written, for example, through the DataOutInterface::write_vtu() function) form a group. The current function can generate such a centralized record.

The central record file generated by this function contains a list of (scalar or vector) fields that describes which fields can actually be found in the individual files that comprise the set of parallel VTU files along with the names of these files. This function gets the names and types of fields through the get_dataset_names() and get_nonscalar_data_ranges() functions of this class. The second argument to this function specifies the names of the files that form the parallel set.

Note
Use DataOutBase::write_vtu() and DataOutInterface::write_vtu() for writing each piece. Also note that only one parallel process needs to call the current function, listing the names of the files written by all parallel processes.
The use of this function is explained in step-40.
In order to tell Paraview to group together multiple pvtu files that each describe one time step of a time dependent simulation, see the DataOutBase::write_pvd_record() function.
Older versions of VisIt (before 2.5.1), can not read pvtu records. However, it can read visit records as written by the write_visit_record() function.

Definition at line 7493 of file data_out_base.cc.

◆ write_vtu_with_pvtu_record()

std::string DataOutInterface< dim, spacedim >::write_vtu_with_pvtu_record ( const std::string &  directory,
const std::string &  filename_without_extension,
const unsigned int  counter,
const MPI_Comm mpi_communicator,
const unsigned int  n_digits_for_counter = numbers::invalid_unsigned_int,
const unsigned int  n_groups = 0 
) const
inherited

This function writes several .vtu files and a .pvtu record in parallel and constructs the filenames automatically. It is a combination of DataOutInterface::write_vtu() or DataOutInterface::write_vtu_in_parallel(), and DataOutInterface::write_pvtu_record().

For example, running write_vtu_with_pvtu_record("output/", "solution", 3, comm, 4, 2) on 10 processes generates the files

output/solution_0003.0.vtu
output/solution_0003.1.vtu
output/solution_0003.pvtu

where the .0.vtu file contains the output of the first half of the processes grouped together, and the .1.vtu the data from the remaining half.

A specified directory and a filename_without_extension form the first part of the filename. The filename is then extended with a counter labeling the current timestep/iteration/etc., the processor ID, and finally the .vtu/.pvtu ending. Since the number of timesteps to be written depends on the application, the number of digits to be reserved in the filename can be specified as parameter n_digits_for_counter, and the number is not padded with leading zeros if this parameter is left at its default value numbers::invalid_unsigned_int. If more than one file identifier is needed (e.g. time step number and iteration counter of solver), the last identifier is used as counter, while all other identifiers have to be added to filename_without_extension when calling this function.

In a parallel setting, several files are typically written per time step. The number of files written in parallel depends on the number of MPI processes (see parameter mpi_communicator), and a specified number of n_groups with default value 0. The background is that VTU file output supports grouping files from several CPUs into a given number of files using MPI I/O when writing on a parallel filesystem. The default value of n_groups is 0, meaning that every MPI rank will write one file. A value of 1 will generate one big file containing the solution over the whole domain, while a larger value will create n_groups files (but not more than there are MPI ranks).

Note that only one processor needs to generate the .pvtu file, where processor zero is chosen to take over this job.

The return value is the filename of the centralized file for the pvtu record.

Note
The code simply combines the strings directory and filename_without_extension, i.e., the user has to make sure that directory contains a trailing character, e.g. "/", that separates the directory from the filename.
Use an empty string "" for the first argument if output is to be written in the current working directory.

Definition at line 7508 of file data_out_base.cc.

◆ write_svg()

void DataOutInterface< dim, spacedim >::write_svg ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in SVG format. See DataOutBase::write_svg.

Definition at line 7378 of file data_out_base.cc.

◆ write_deal_II_intermediate()

void DataOutInterface< dim, spacedim >::write_deal_II_intermediate ( std::ostream &  out) const
inherited

Obtain data through get_patches() and write it to out in deal.II intermediate format. See DataOutBase::write_deal_II_intermediate.

Note that the intermediate format is what its name suggests: a direct representation of internal data. It isn't standardized and will change whenever we change our internal representation. You can only expect to process files written in this format using the same version of deal.II that was used for writing.

Definition at line 7590 of file data_out_base.cc.

◆ create_xdmf_entry() [1/2]

XDMFEntry DataOutInterface< dim, spacedim >::create_xdmf_entry ( const DataOutBase::DataOutFilter data_filter,
const std::string &  h5_filename,
const double  cur_time,
const MPI_Comm comm 
) const
inherited

Create an XDMFEntry based on the data in the data_filter. This assumes the mesh and solution data were written to a single file. See write_xdmf_file() for an example of usage.

Definition at line 7603 of file data_out_base.cc.

◆ create_xdmf_entry() [2/2]

XDMFEntry DataOutInterface< dim, spacedim >::create_xdmf_entry ( const DataOutBase::DataOutFilter data_filter,
const std::string &  h5_mesh_filename,
const std::string &  h5_solution_filename,
const double  cur_time,
const MPI_Comm comm 
) const
inherited

Create an XDMFEntry based on the data in the data_filter. This assumes the mesh and solution data were written to separate files. See write_xdmf_file() for an example of usage.

Definition at line 7617 of file data_out_base.cc.

◆ write_xdmf_file()

void DataOutInterface< dim, spacedim >::write_xdmf_file ( const std::vector< XDMFEntry > &  entries,
const std::string &  filename,
const MPI_Comm comm 
) const
inherited

Write an XDMF file based on the provided vector of XDMFEntry objects. Below is an example of how to use this function with HDF5 and the DataOutFilter:

DataOutBase::DataOutFilter data_filter(flags);
std::vector<XDMFEntry> xdmf_entries;
// Filter the data and store it in data_filter
data_out.write_filtered_data(data_filter);
// Write the filtered data to HDF5
data_out.write_hdf5_parallel(data_filter, "solution.h5", MPI_COMM_WORLD);
// Create an XDMF entry detailing the HDF5 file
auto new_xdmf_entry = data_out.create_xdmf_entry(data_filter,
"solution.h5",
simulation_time,
MPI_COMM_WORLD);
// Add the XDMF entry to the list
xdmf_entries.push_back(new_xdmf_entry);
// Create an XDMF file from all stored entries
data_out.write_xdmf_file(xdmf_entries, "solution.xdmf", MPI_COMM_WORLD);

Definition at line 7690 of file data_out_base.cc.

◆ write_hdf5_parallel() [1/2]

void DataOutInterface< dim, spacedim >::write_hdf5_parallel ( const DataOutBase::DataOutFilter data_filter,
const std::string &  filename,
const MPI_Comm comm 
) const
inherited

Write the data in data_filter to a single HDF5 file containing both the mesh and solution values. Below is an example of how to use this function with the DataOutFilter:

DataOutBase::DataOutFilter data_filter(flags);
// Filter the data and store it in data_filter
data_out.write_filtered_data(data_filter);
// Write the filtered data to HDF5
data_out.write_hdf5_parallel(data_filter, "solution.h5", MPI_COMM_WORLD);

Definition at line 7868 of file data_out_base.cc.

◆ write_hdf5_parallel() [2/2]

void DataOutInterface< dim, spacedim >::write_hdf5_parallel ( const DataOutBase::DataOutFilter data_filter,
const bool  write_mesh_file,
const std::string &  mesh_filename,
const std::string &  solution_filename,
const MPI_Comm comm 
) const
inherited

Write the data in data_filter to HDF5 file(s). If write_mesh_file is false, the mesh data will not be written and the solution file will contain only the solution values. If write_mesh_file is true and the filenames are the same, the resulting file will contain both mesh data and solution values.

Definition at line 7880 of file data_out_base.cc.

◆ write_filtered_data()

void DataOutInterface< dim, spacedim >::write_filtered_data ( DataOutBase::DataOutFilter filtered_data) const
inherited

DataOutFilter is an intermediate data format that reduces the amount of data that will be written to files. The object filled by this function can then later be used again to write data in a concrete file format; see, for example, DataOutBase::write_hdf5_parallel().

Definition at line 7740 of file data_out_base.cc.

◆ write()

void DataOutInterface< dim, spacedim >::write ( std::ostream &  out,
const DataOutBase::OutputFormat  output_format = DataOutBase::default_format 
) const
inherited

Write data and grid to out according to the given data format. This function simply calls the appropriate write_* function. If no output format is requested, the default_format is written.

An error occurs if no format is provided and the default format is default_format.

Definition at line 8272 of file data_out_base.cc.

◆ set_default_format()

void DataOutInterface< dim, spacedim >::set_default_format ( const DataOutBase::OutputFormat  default_format)
inherited

Set the default format. The value set here is used anytime, output for format default_format is requested.

Definition at line 8338 of file data_out_base.cc.

◆ set_flags()

void DataOutInterface< dim, spacedim >::set_flags ( const FlagType &  flags)
inherited

Set the flags to be used for output. This method expects flags to be a member of one of the child classes of OutputFlagsBase.

Definition at line 8348 of file data_out_base.cc.

◆ default_suffix()

std::string DataOutInterface< dim, spacedim >::default_suffix ( const DataOutBase::OutputFormat  output_format = DataOutBase::default_format) const
inherited

A function that returns the same string as the respective function in the base class does; the only exception being that if the parameter is omitted, then the value for the present default format is returned, i.e. the correct suffix for the format that was set through set_default_format() or parse_parameters() before calling this function.

Definition at line 8383 of file data_out_base.cc.

◆ declare_parameters()

void DataOutInterface< dim, spacedim >::declare_parameters ( ParameterHandler prm)
staticinherited

Declare parameters for all output formats by declaring subsections within the parameter file for each output format and call the respective declare_parameters functions of the flag classes for each output format.

Some of the declared subsections may not contain entries, if the respective format does not export any flags.

Note that the top-level parameters denoting the number of subdivisions per patch and the output format are not declared, since they are only passed to virtual functions and are not stored inside objects of this type. You have to declare them yourself.

Definition at line 8396 of file data_out_base.cc.

◆ parse_parameters()

void DataOutInterface< dim, spacedim >::parse_parameters ( ParameterHandler prm)
inherited

Read the parameters declared in declare_parameters() and set the flags for the output formats accordingly.

The flags thus obtained overwrite all previous contents of the flag objects as default-constructed or set by the set_flags() function.

Definition at line 8449 of file data_out_base.cc.

◆ get_nonscalar_data_ranges()

std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > DataOutInterface< dim, spacedim >::get_nonscalar_data_ranges ( ) const
protectedvirtualinherited

This functions returns information about how the individual components of output files that consist of more than one data set are to be interpreted.

It returns a list of index pairs and corresponding name and type indicating which components of the output are to be considered vector- or tensor-valued rather than just a collection of scalar data. The index pairs are inclusive; for example, if we have a Stokes problem in 2d with components (u,v,p), then the corresponding vector data range should be (0,1), and the returned list would consist of only a single element with a tuple such as (0,1,"velocity",component_is_part_of_vector).

Since some of the derived classes do not know about non-scalar data, this function has a default implementation that simply returns an empty string, meaning that all data is to be considered a collection of scalar fields.

Definition at line 8519 of file data_out_base.cc.

◆ validate_dataset_names()

void DataOutInterface< dim, spacedim >::validate_dataset_names ( ) const
protectedinherited

Validate that the names of the datasets returned by get_dataset_names() and get_nonscalar_data_ranges() are valid. This currently consists of checking that names are not used more than once. If an invalid state is encountered, an Assert() will be triggered in debug mode.

Definition at line 8531 of file data_out_base.cc.

Member Data Documentation

◆ patch_dim

template<int dim, int spacedim>
constexpr int DataOutStack< dim, spacedim, void >::patch_dim = dim + 1
static

Dimension parameters for the patches.

Definition at line 148 of file data_out_stack.h.

◆ patch_spacedim

template<int dim, int spacedim>
constexpr int DataOutStack< dim, spacedim, void >::patch_spacedim = spacedim + 1
static

Definition at line 149 of file data_out_stack.h.

◆ parameter

template<int dim, int spacedim>
double DataOutStack< dim, spacedim, void >::parameter
private

Present parameter value.

Definition at line 334 of file data_out_stack.h.

◆ parameter_step

template<int dim, int spacedim>
double DataOutStack< dim, spacedim, void >::parameter_step
private

Present parameter step, i.e. length of the parameter interval to be written next.

Definition at line 340 of file data_out_stack.h.

◆ dof_handler

template<int dim, int spacedim>
SmartPointer<const DoFHandler<dim, spacedim>, DataOutStack<dim, spacedim, void> > DataOutStack< dim, spacedim, void >::dof_handler
private

DoF handler to be used for the data corresponding to the present parameter value.

Definition at line 348 of file data_out_stack.h.

◆ patches

template<int dim, int spacedim>
std::vector<::DataOutBase::Patch<patch_dim, patch_spacedim> > DataOutStack< dim, spacedim, void >::patches
private

List of patches of all past and present parameter value data sets.

Definition at line 353 of file data_out_stack.h.

◆ dof_data

template<int dim, int spacedim>
std::vector<DataVector> DataOutStack< dim, spacedim, void >::dof_data
private

List of DoF data vectors.

Definition at line 382 of file data_out_stack.h.

◆ cell_data

template<int dim, int spacedim>
std::vector<DataVector> DataOutStack< dim, spacedim, void >::cell_data
private

List of cell data vectors.

Definition at line 387 of file data_out_stack.h.

◆ default_subdivisions

unsigned int DataOutInterface< dim, spacedim >::default_subdivisions
protectedinherited

The default number of subdivisions for patches. This is filled by parse_parameters() and should be obeyed by build_patches() in derived classes.

Definition at line 3046 of file data_out_base.h.


The documentation for this class was generated from the following files: