24 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
27 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
43 template <
int dim,
int spacedim>
45 const std::string &output_format,
46 const unsigned int &subdivisions,
47 const std::string &incremental_run_prefix,
48 const std::string &base_name_input,
49 const std::string &files_to_save,
50 const MPI_Comm &comm) :
55 output_format(output_format),
56 subdivisions(subdivisions),
57 base_name(base_name_input),
58 incremental_run_prefix(incremental_run_prefix),
59 files_to_save(files_to_save)
64 template <
int dim,
int spacedim>
75 "Comma separated list of names for the components. If a " 76 "name is repeated, then the repeated names are grouped into " 87 template <
int dim,
int spacedim>
95 #ifdef DEAL_II_WITH_MPI 100 #ifdef DEAL_II_WITH_MPI 111 template <
int dim,
int spacedim>
113 const std::string &suffix)
115 deallog.push(
"PrepareOutput");
123 if (
data_out->default_suffix() !=
"")
136 fname +=
data_out->default_suffix();
139 deallog <<
"Will write on file: " << fname.c_str() << std::endl;
149 deallog <<
"Writing partitioning" << std::endl;
151 for (
unsigned int i=0; i<partitioning.size(); ++i)
154 static_partitioning.
swap(partitioning);
155 data_out->add_data_vector (static_partitioning,
"partitioning");
165 template <
int dim,
int spacedim>
173 std::vector<std::string> files;
175 for (
unsigned int i = 0; i<files.size(); ++i)
183 deallog.push(
"WritingData");
184 if (
data_out->default_suffix() !=
"")
189 deallog <<
"Wrote output file." << std::endl;
193 std::vector<std::string> filenames;
200 std::ofstream master_output ((
current_name +
".pvtu").c_str());
201 data_out->write_pvtu_record (master_output, filenames);
205 deallog <<
"Reset output." << std::endl;
214 template class deal2lkit::ParsedDataOut<1,1>;
215 template class deal2lkit::ParsedDataOut<1,2>;
216 template class deal2lkit::ParsedDataOut<1,3>;
217 template class deal2lkit::ParsedDataOut<2,2>;
218 template class deal2lkit::ParsedDataOut<2,3>;
219 template class deal2lkit::ParsedDataOut<3,3>;
virtual void parse_parameters_call_back()
Prepare names for output directories.
std::string base_name
Base name for output files.
shared_ptr< DataOut< dim, DoFHandler< dim, spacedim > > > data_out
Outputs only the data that refers to this process.
std::string incremental_run_prefix
name of progressive directories.
std::string files_to_save
a list of file to save at each run in @ incremental_run_prefix directory.
A parameter acceptor base class.
static ParameterHandler prm
Static parameter.
static::ExceptionBase & ExcIO()
bool output_partitioning
Output the partitioning of the domain.
const unsigned int this_mpi_process
My mpi process.
std::string output_format
Output format.
const Triangulation< dim, spacedim > & get_triangulation() const
static::ExceptionBase & ExcNotInitialized()
#define AssertThrow(cond, exc)
shared_ptr< T > SP(T *t)
Construct a shared pointer to a non const class T.
const unsigned int n_mpi_processes
Number of processes.
unsigned int subdivisions
Number of subdivisions.
std::string get_next_available_directory_name(const std::string &base, int n_digits, unsigned int start, unsigned int index_max)
A function that return the name of the first non existing folder matching a pattern make by base and ...
std::ofstream output_file
Output file.
bool initialized
Initialization flag.
std::string current_name
Current output name.
bool copy_files(const std::string &files, const std::string &destination)
A function to copy a list of file ( "file1 file2 file3" ) in the destination folder (destination) ...
OutputFormat parse_output_format(const std::string &format_name)
std::string solution_names
Solution names.
std::string path_solution_dir
Folder where solutions are stored.
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
bool create_directory(const std::string &name)
A function to create directory.
unsigned int n_mpi_processes(const MPI_Comm &mpi_communicator)
void write_data_and_clear(const Mapping< dim, spacedim > &mapping=StaticMappingQ1< dim, spacedim >::mapping)
Actually write the file.
virtual void swap(Vector< Number > &v)
void prepare_data_output(const DoFHandler< dim, spacedim > &dh, const std::string &suffix="")
Prepare to output data on the given file.
std::vector< std::string > split_string_list(const std::string &s, const char delimiter=',')
virtual void declare_parameters(ParameterHandler &prm)
Initialize the given values for the paramter file.
unsigned int this_mpi_process(const MPI_Comm &mpi_communicator)
std::string get_output_format_names()
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.
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.
const MPI_Comm & comm
MPI communicator.