#include <parsed_data_out.h>
Public Member Functions | |
ParsedDataOut (const std::string &name="", const std::string &output_format="vtu", const unsigned int &subdivisions=1, const std::string &incremental_run_prefix="", const std::string &base_name_input="solution", const std::string &files_to_save="", const MPI_Comm &comm=MPI_COMM_WORLD) | |
Optional name for parameter section. More... | |
virtual void | declare_parameters (ParameterHandler &prm) |
Initialize the given values for the paramter file. More... | |
virtual void | parse_parameters_call_back () |
Prepare names for output directories. More... | |
void | prepare_data_output (const DoFHandler< dim, spacedim > &dh, const std::string &suffix="") |
Prepare to output data on the given file. More... | |
template<typename VECTOR > | |
void | add_data_vector (const VECTOR &data_vector, const std::string &desc) |
Add the given vector to the output file. More... | |
template<typename VECTOR > | |
void | add_data_vector (const VECTOR &data_vector, const DataPostprocessor< spacedim > &postproc) |
Wrapper for the corrisponding function in dealii. More... | |
void | write_data_and_clear (const Mapping< dim, spacedim > &mapping=StaticMappingQ1< dim, spacedim >::mapping) |
Actually write the file. More... | |
Public Member Functions inherited from ParameterAcceptor | |
ParameterAcceptor (const std::string section_name="") | |
The constructor adds derived classes to the list of acceptors. More... | |
virtual | ~ParameterAcceptor () |
The destructor sets to zero the pointer relative to this index, so that it is safe to destroy the mother class. More... | |
virtual void | parse_parameters (ParameterHandler &prm) |
Parse the parameter file. More... | |
std::string | get_section_name () const |
Return the section name of this class. More... | |
std::vector< std::string > | get_section_path () const |
Travers all registered classes, and figure out what subsections we need to enter. More... | |
template<class T > | |
void | add_parameter (ParameterHandler &prm, T *parameter, const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation=std::string()) |
Add a parameter the given parameter list. More... | |
template<class T > | |
void | add_parameter (T ¶meter, const std::string &entry, const std::string &documentation=std::string(), ParameterHandler &prm=ParameterAcceptor::prm) |
Add a parameter to the global parameter handler ParameterAcceptor::prm. More... | |
void | enter_my_subsection (ParameterHandler &prm) |
Make sure we enter the right subsection of the global parameter file. More... | |
void | leave_my_subsection (ParameterHandler &prm) |
This function undoes what the enter_my_subsection() function did. More... | |
template<> | |
std_cxx11::shared_ptr< Patterns::PatternBase > | to_pattern (const double &) |
double More... | |
template<> | |
std::string | to_string (const double &entry) |
template<> | |
double | to_type (const std::string ¶meter) |
template<> | |
std_cxx11::shared_ptr< Patterns::PatternBase > | to_pattern (const int &) |
int More... | |
template<> | |
std::string | to_string (const int &entry) |
template<> | |
int | to_type (const std::string ¶meter) |
template<> | |
std_cxx11::shared_ptr< Patterns::PatternBase > | to_pattern (const unsigned int &) |
unsigned int More... | |
template<> | |
std::string | to_string (const unsigned int &entry) |
template<> | |
unsigned int | to_type (const std::string ¶meter) |
template<> | |
std_cxx11::shared_ptr< Patterns::PatternBase > | to_pattern (const bool &) |
bool More... | |
template<> | |
std::string | to_string (const bool &entry) |
template<> | |
bool | to_type (const std::string ¶meter) |
Public Member Functions inherited from Subscriptor | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
Subscriptor (Subscriptor &&) | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
Subscriptor & | operator= (Subscriptor &&) |
void | subscribe (const char *identifier=0) const |
void | unsubscribe (const char *identifier=0) const |
unsigned int | n_subscriptions () const |
void | list_subscribers () const |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
bool | initialized |
Initialization flag. More... | |
const MPI_Comm & | comm |
MPI communicator. More... | |
const unsigned int | n_mpi_processes |
Number of processes. More... | |
const unsigned int | this_mpi_process |
My mpi process. More... | |
std::string | path_solution_dir |
Folder where solutions are stored. More... | |
std::string | output_format |
Output format. More... | |
unsigned int | subdivisions |
Number of subdivisions. More... | |
std::string | base_name |
Base name for output files. More... | |
std::string | incremental_run_prefix |
name of progressive directories. More... | |
std::string | files_to_save |
a list of file to save at each run in @ incremental_run_prefix directory. More... | |
std::string | solution_names |
Solution names. More... | |
std::string | current_name |
Current output name. More... | |
bool | output_partitioning |
Output the partitioning of the domain. More... | |
std::ofstream | output_file |
Output file. More... | |
shared_ptr< DataOut< dim, DoFHandler< dim, spacedim > > > | data_out |
Outputs only the data that refers to this process. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ParameterAcceptor | |
static void | initialize (const std::string filename="", const std::string outfilename="") |
Call declare_all_parameters(), read filename (if it is present as input parameter) and parse_all_parameters() on the static member prm. More... | |
static void | clear () |
Clear class list and global parameter file. More... | |
static void | parse_all_parameters (ParameterHandler &prm=ParameterAcceptor::prm) |
Parse the given ParameterHandler. More... | |
static void | log_info () |
Print information about all stored classes. More... | |
static void | declare_all_parameters (ParameterHandler &prm=ParameterAcceptor::prm) |
Initialize the ParameterHandler with all derived classes parameters.This function enters the subsection returned by get_section_name() for each derived class, and declares all parameters that were added using add_parameter(). More... | |
template<class T > | |
static std_cxx11::shared_ptr< Patterns::PatternBase > | to_pattern (const T &) |
Given a class T, construct its default pattern to be used when declaring parameters. More... | |
template<class T > | |
static T | to_type (const std::string &) |
Given a string, fill the value of the given parameter. More... | |
template<class T > | |
static std::string | to_string (const T &) |
Given a parameter, return a string containing the given parameter. More... | |
Static Public Member Functions inherited from Subscriptor | |
static::ExceptionBase & | ExcInUse (int arg1, char *arg2, std::string &arg3) |
static::ExceptionBase & | ExcNoSubscriber (char *arg1, char *arg2) |
Static Public Attributes inherited from ParameterAcceptor | |
static ParameterHandler | prm |
Static parameter. More... | |
Protected Attributes inherited from ParameterAcceptor | |
const std::string | section_name |
The subsection name for this class. More... | |
Definition at line 37 of file parsed_data_out.h.
DEAL_II_DISABLE_EXTRA_DIAGNOSTICS DEAL_II_ENABLE_EXTRA_DIAGNOSTICS ParsedDataOut< dim, spacedim >::ParsedDataOut | ( | const std::string & | name = "" , |
const std::string & | output_format = "vtu" , |
||
const unsigned int & | subdivisions = 1 , |
||
const std::string & | incremental_run_prefix = "" , |
||
const std::string & | base_name_input = "solution" , |
||
const std::string & | files_to_save = "" , |
||
const MPI_Comm & | comm = MPI_COMM_WORLD |
||
) |
Optional name for parameter section.
incremental_run_prefix
creates a progressive directories/subdirectories for every run. For istance if incremental_run_prefix
= "sol/run" the function will create sol/run001 the first time the code is runned, sol/run002 the second time, and so on.
Definition at line 44 of file parsed_data_out.cc.
void ParsedDataOut< dim, spacedim >::add_data_vector | ( | const VECTOR & | data_vector, |
const std::string & | desc | ||
) |
Add the given vector to the output file.
Prior to calling this method, you have to call the prepare_data_output method. The string can be a comma separated list of components, or a single description. In this latter case, a progressive number per component is added in the end.
Definition at line 155 of file parsed_data_out.h.
void ParsedDataOut< dim, spacedim >::add_data_vector | ( | const VECTOR & | data_vector, |
const DataPostprocessor< spacedim > & | postproc | ||
) |
Wrapper for the corrisponding function in dealii.
Definition at line 201 of file parsed_data_out.h.
|
virtual |
Initialize the given values for the paramter file.
Reimplemented from ParameterAcceptor.
Definition at line 65 of file parsed_data_out.cc.
|
virtual |
Prepare names for output directories.
Reimplemented from ParameterAcceptor.
Definition at line 88 of file parsed_data_out.cc.
void ParsedDataOut< dim, spacedim >::prepare_data_output | ( | const DoFHandler< dim, spacedim > & | dh, |
const std::string & | suffix = "" |
||
) |
Prepare to output data on the given file.
This will initialize the data_out object and a file with a filename that is the combination of the base_name
, the optional suffix
, eventually a processor number and the output suffix.
Definition at line 112 of file parsed_data_out.cc.
void ParsedDataOut< dim, spacedim >::write_data_and_clear | ( | const Mapping< dim, spacedim > & | mapping = StaticMappingQ1<dim,spacedim>::mapping | ) |
Actually write the file.
Once the data_out has been prepared, vectors have been added, the data can be written to a file. This is done in this class. At the end of this function call, data_out and output_file are in a pristine situation, and the process can be started again. used_files
is an optional variable that takes a list of useful files (ex. "parameter.prm time.dat") and copies these files in the incremental_run_prefix
of the costructor function.
Definition at line 166 of file parsed_data_out.cc.
|
private |
Base name for output files.
This base is used to generate all filenames.
Definition at line 116 of file parsed_data_out.h.
|
private |
MPI communicator.
Definition at line 97 of file parsed_data_out.h.
|
private |
Current output name.
When preparing data_out, this name will contain the base for the current output. This allows the user to use a different output name in different part of the program.
Definition at line 136 of file parsed_data_out.h.
|
private |
Outputs only the data that refers to this process.
Definition at line 145 of file parsed_data_out.h.
|
private |
a list of file to save at each run in @ incremental_run_prefix directory.
This list should be separated usign '', e.g.: file1.txt % file2.dat % etc..
Definition at line 128 of file parsed_data_out.h.
|
private |
name of progressive directories.
One for every run. For example sol/run will produces sol/run001 for the first run, sol/run002 for the second, and so on.
Definition at line 121 of file parsed_data_out.h.
|
private |
Initialization flag.
Definition at line 94 of file parsed_data_out.h.
|
private |
Number of processes.
Definition at line 100 of file parsed_data_out.h.
|
private |
Output file.
Definition at line 142 of file parsed_data_out.h.
|
private |
Output format.
Definition at line 109 of file parsed_data_out.h.
|
private |
Output the partitioning of the domain.
Definition at line 139 of file parsed_data_out.h.
|
private |
Folder where solutions are stored.
Definition at line 106 of file parsed_data_out.h.
|
private |
Solution names.
Definition at line 131 of file parsed_data_out.h.
|
private |
Number of subdivisions.
Definition at line 112 of file parsed_data_out.h.
|
private |
My mpi process.
Definition at line 103 of file parsed_data_out.h.