![]() |
Reference documentation for deal.II version 8.1.0
|
#include <data_out_stack.h>
Classes | |
struct | DataVector |
Public Types | |
enum | VectorType { cell_vector, dof_vector } |
![]() | |
enum | OutputFormat |
Public Member Functions | |
virtual | ~DataOutStack () |
void | new_parameter_value (const double parameter_value, const double parameter_step) |
void | attach_dof_handler (const DH &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 () |
void | clear () |
std::size_t | memory_consumption () const |
DeclException0 (ExcNoDoFHandlerSelected) | |
DeclException3 (ExcInvalidVectorSize, int, int, int,<< "The vector has size "<< arg1<< " but the DoFHandler objects says there are "<< arg2<< " degrees of freedom and there are "<< arg3<< " active cells.") | |
DeclException2 (ExcInvalidCharacter, std::string, size_t,<< "Please use only the characters [a-zA-Z0-9_<>()] for"<< std::endl<< "description strings since some graphics formats will only accept these."<< std::endl<< "The string you gave was <"<< arg1<< ">, the invalid character is <"<< arg1[arg2]<< ">."<< std::endl) | |
DeclException2 (ExcInvalidNumberOfNames, int, int,<< "You have to give one name per component in your "<< "data vector. The number you gave was "<< arg1<< ", but the number of components is "<< arg2) | |
DeclException1 (ExcVectorNotDeclared, std::string,<< "The data vector for which the first component has the name "<< arg1<< " has not been declared before.") | |
DeclException0 (ExcDataNotCleared) | |
DeclException0 (ExcDataAlreadyAdded) | |
DeclException1 (ExcNameAlreadyUsed, std::string,<< "You tried to declare a component of a data vector with "<< "the name <"<< arg1<< ">, but that name is already used.") | |
DeclException1 (ExcInvalidNumberOfSubdivisions, int,<< "The number of subdivisions per patch, "<< arg1<< ", is not valid.") | |
![]() | |
DataOutInterface () | |
virtual | ~DataOutInterface () |
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_tecplot_binary (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 char *filename, MPI_Comm comm) const |
void | write_pvtu_record (std::ostream &out, const std::vector< std::string > &piece_names) const |
void | write_pvd_record (std::ostream &out, const std::vector< std::pair< double, std::string > > ×_and_names) const |
void | write_visit_record (std::ostream &out, const std::vector< std::string > &piece_names) const |
void | write_visit_record (std::ostream &out, const std::vector< std::vector< std::string > > &piece_names) const |
void | write_svg (std::ostream &out) const |
void | write_deal_II_intermediate (std::ostream &out) const |
XDMFEntry | create_xdmf_entry (const std::string &h5_filename, const double cur_time, MPI_Comm comm) const DEAL_II_DEPRECATED |
XDMFEntry | create_xdmf_entry (const DataOutFilter &data_filter, const std::string &h5_filename, const double cur_time, MPI_Comm comm) const |
XDMFEntry | create_xdmf_entry (const DataOutFilter &data_filter, const std::string &h5_mesh_filename, const std::string &h5_solution_filename, const double cur_time, MPI_Comm comm) const |
void | write_xdmf_file (const std::vector< XDMFEntry > &entries, const std::string &filename, MPI_Comm comm) const |
void | write_hdf5_parallel (const std::string &filename, MPI_Comm comm) const DEAL_II_DEPRECATED |
void | write_hdf5_parallel (const DataOutFilter &data_filter, const std::string &filename, MPI_Comm comm) const |
void | write_hdf5_parallel (const DataOutFilter &data_filter, const bool write_mesh_file, const std::string &mesh_filename, const std::string &solution_filename, MPI_Comm comm) const |
void | write_filtered_data (DataOutFilter &filtered_data) const |
void | write (std::ostream &out, const OutputFormat output_format=default_format) const |
void | set_default_format (const OutputFormat default_format) |
void | set_flags (const DXFlags &dx_flags) |
void | set_flags (const UcdFlags &ucd_flags) |
void | set_flags (const GnuplotFlags &gnuplot_flags) |
void | set_flags (const PovrayFlags &povray_flags) |
void | set_flags (const EpsFlags &eps_flags) |
void | set_flags (const GmvFlags &gmv_flags) |
void | set_flags (const TecplotFlags &tecplot_flags) |
void | set_flags (const VtkFlags &vtk_flags) |
void | set_flags (const SvgFlags &svg_flags) |
void | set_flags (const Deal_II_IntermediateFlags &deal_II_intermediate_flags) |
std::string | default_suffix (const OutputFormat output_format=default_format) const |
void | parse_parameters (ParameterHandler &prm) |
std::size_t | memory_consumption () const |
Private Member Functions | |
virtual const std::vector < ::DataOutBase::Patch< dim+1, dim+1 > > & | get_patches () const |
virtual std::vector< std::string > | get_dataset_names () const |
Private Attributes | |
double | parameter |
double | parameter_step |
SmartPointer< const DH, DataOutStack< dim, spacedim, DH > > | dof_handler |
std::vector < ::DataOutBase::Patch< dim+1, dim+1 > > | patches |
std::vector< DataVector > | dof_data |
std::vector< DataVector > | cell_data |
Additional Inherited Members | |
![]() | |
static void | declare_parameters (ParameterHandler &prm) |
![]() | |
virtual std::vector < std_cxx1x::tuple< unsigned int, unsigned int, std::string > > | get_vector_data_ranges () const |
![]() | |
unsigned int | default_subdivisions |
This class is used to stack the output from several computations into one output file by stacking the data sets in another co-ordinate 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.
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.
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.
Definition at line 111 of file data_out_stack.h.
enum DataOutStack::VectorType |
Data type declaring the two types of vectors which are used in this class.
Definition at line 119 of file data_out_stack.h.
|
virtual |
Destructor. Only declared to make it virtual
.
void DataOutStack< dim, spacedim, DH >::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.
void DataOutStack< dim, spacedim, DH >::attach_dof_handler | ( | const DH & | 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.
void DataOutStack< dim, spacedim, DH >::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.
void DataOutStack< dim, spacedim, DH >::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 vector<string>
containing only one element if the finite element has only one component.
void DataOutStack< dim, spacedim, DH >::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.
void DataOutStack< dim, spacedim, DH >::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 vector<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.
void DataOutStack< dim, spacedim, DH >::build_patches | ( | const unsigned int | n_subdivisions = 0 | ) |
Actually build the patches for output by the base classes from the data stored in the data vectors and using the previously attached DoFHandler object.
By n_subdivisions
you can decide into how many subdivisions (in each space and parameter direction) each patch is divided. This is useful if higher order elements are used. Note however, that the number of subdivisions in parameter direction is always the same as the one is space direction for technical reasons.
void DataOutStack< dim, spacedim, DH >::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.
Couterpart of new_parameter_value
.
void DataOutStack< dim, spacedim, DH >::clear | ( | ) |
Clear all data presently stored in this object.
std::size_t DataOutStack< dim, spacedim, DH >::memory_consumption | ( | ) | const |
Determine an estimate for the memory consumption (in bytes) of this object.
DataOutStack< dim, spacedim, DH >::DeclException0 | ( | ExcNoDoFHandlerSelected | ) |
Exception
DataOutStack< dim, spacedim, DH >::DeclException3 | ( | ExcInvalidVectorSize | , |
int | , | ||
int | , | ||
int | , | ||
<< "The vector has size "<< arg1<< " but the DoFHandler objects says there are "<< arg2<< " degrees of freedom and there are "<< arg3<< " active cells." | |||
) |
Exception
DataOutStack< dim, spacedim, DH >::DeclException2 | ( | ExcInvalidCharacter | , |
std::string | , | ||
size_t | |||
) |
Exception
DataOutStack< dim, spacedim, DH >::DeclException2 | ( | ExcInvalidNumberOfNames | , |
int | , | ||
int | , | ||
<< "You have to give one name per component in your "<< "data vector. The number you gave was "<< arg1<< " | , | ||
but the number of components is"<< | arg2 | ||
) |
Exception
DataOutStack< dim, spacedim, DH >::DeclException1 | ( | ExcVectorNotDeclared | , |
std::string | , | ||
<< "The data vector for which the first component has the name "<< arg1<< " has not been declared before." | |||
) |
Exception
DataOutStack< dim, spacedim, DH >::DeclException0 | ( | ExcDataNotCleared | ) |
Exception
DataOutStack< dim, spacedim, DH >::DeclException0 | ( | ExcDataAlreadyAdded | ) |
Exception
DataOutStack< dim, spacedim, DH >::DeclException1 | ( | ExcNameAlreadyUsed | , |
std::string | |||
) |
Exception
DataOutStack< dim, spacedim, DH >::DeclException1 | ( | ExcInvalidNumberOfSubdivisions | , |
int | , | ||
<< "The number of subdivisions per | patch, | ||
"<< arg1<< " | , | ||
is not valid." | |||
) |
Exception
|
privatevirtual |
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 >.
|
privatevirtual |
Virtual function through which the names of data sets are obtained by the output functions of the base class.
Implements DataOutInterface< dim+1 >.
|
private |
Present parameter value.
Definition at line 365 of file data_out_stack.h.
|
private |
Present parameter step, i.e. length of the parameter interval to be written next.
Definition at line 372 of file data_out_stack.h.
|
private |
DoF handler to be used for the data corresponding to the present parameter value.
Definition at line 379 of file data_out_stack.h.
|
private |
List of patches of all past and present parameter value data sets.
Definition at line 385 of file data_out_stack.h.
|
private |
List of DoF data vectors.
Definition at line 416 of file data_out_stack.h.
|
private |
List of cell data vectors.
Definition at line 421 of file data_out_stack.h.