16 #ifndef _d2k_parsed_data_out_h 17 #define _d2k_parsed_data_out_h 19 #include <deal2lkit/config.h> 36 template <
int dim,
int spacedim=dim>
49 const std::string &base_name_input=
"solution",
51 const MPI_Comm &
comm=MPI_COMM_WORLD);
64 const std::string &suffix=
"");
71 template<
typename VECTOR>
72 void add_data_vector(
const VECTOR &data_vector,
const std::string &desc);
78 template<
typename VECTOR>
145 shared_ptr<DataOut<dim, DoFHandler<dim, spacedim> > >
data_out;
153 template <
int dim,
int spacedim>
154 template<
typename VECTOR>
156 const std::string &desc)
159 deallog.push(
"AddingData");
161 if (
data_out->default_suffix() !=
"")
165 data_out->add_data_vector (data_vector, desc);
169 std::vector<std::string>::iterator sit = dd.begin();
170 std::vector<int> occurrances;
172 for (; sit!=dd.end(); ++sit)
173 occurrances.push_back(std::count (dd.begin(), dd.end(), *sit));
175 std::vector<int>::iterator iit = occurrances.begin();
178 std::vector<DataComponentInterpretation::DataComponentInterpretation>
179 data_component_interpretation;
181 for (; iit !=occurrances.end(); ++iit, ++sit)
184 data_component_interpretation.push_back(DataComponentInterpretation::component_is_part_of_vector);
186 data_component_interpretation.push_back(DataComponentInterpretation::component_is_scalar);
190 data_component_interpretation);
193 deallog <<
"Added data: " << desc << std::endl;
199 template <
int dim,
int spacedim>
200 template<
typename VECTOR>
205 data_out->add_data_vector(data_vector,postproc);
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.
bool output_partitioning
Output the partitioning of the domain.
const unsigned int this_mpi_process
My mpi process.
std::string output_format
Output format.
static::ExceptionBase & ExcNotInitialized()
#define AssertThrow(cond, exc)
const unsigned int n_mpi_processes
Number of processes.
unsigned int subdivisions
Number of subdivisions.
std::ofstream output_file
Output file.
bool initialized
Initialization flag.
std::string current_name
Current output name.
std::string solution_names
Solution names.
std::string path_solution_dir
Folder where solutions are stored.
void write_data_and_clear(const Mapping< dim, spacedim > &mapping=StaticMappingQ1< dim, spacedim >::mapping)
Actually write the file.
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.
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.
void add_data_vector(const VECTOR &data_vector, const std::string &desc)
Add the given vector to the output file.