Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
solutions_output.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2020, 2023-2025 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_solutions_output_h
5#define lethe_solutions_output_h
6
7#include <core/pvd_handler.h>
8
9#include <deal.II/numerics/data_out.h>
10#include <deal.II/numerics/data_out_faces.h>
11
12using namespace dealii;
13
14/**
15 * @brief Output the data out to "group_files" vtu files, with a pvtu file and a pvd to store the timing
16 * This function outputs the data out to "group_files" vtu file that are
17 * orchestrated by a .pvtu file. An additional pvd file takes care of storing
18 * the time associated with each .pvtu file.
19 *
20 * @param[in] pvd_handler a PVDHandler to store the information about the file
21 * name and time associated with it
22 * @param[in] data_out the DataOut class to which the data has been attached
23 * @param[in] folder a string that contains the path where the results are to be
24 * saved
25 * @param[in] file_prefix a string that stores the name of the file without the
26 * iteration number and the extension
27 * @param[in] time the time associated with the file
28 * @param[in] iter the iteration number associated with the file
29 * @param[in] group_files the number of vtu files that will be generated.
30 * @param[in] mpi_communicator The mpi communicator
31 * @param[in] digits An optional parameter that specifies the amount of digit
32 * used to store iteration number in the file name
33 */
34template <int dim, int spacedim = dim>
35void
36write_vtu_and_pvd(PVDHandler &pvd_handler,
37 const DataOutInterface<dim, spacedim> &data_out,
38 const std::string &folder,
39 const std::string &file_prefix,
40 const double time,
41 const unsigned int iter,
42 const unsigned int group_files,
43 const MPI_Comm &mpi_communicator,
44 const unsigned int digits = 5);
45
46/**
47 * @brief Output the Data Out Faces to a single vtu file
48 * This function outputs the DataOutFaces to a vtu file.
49 *
50 * @param[in] data_out the DataOutFaces class to which the data has been
51 * attached
52 * @param[in] folder a string that contains the path where the results are to be
53 * saved
54 * @param[in] time the time associated with the file
55 * @param[in] iter the iteration number associated with the file
56 * @param[in] mpi_communicator The mpi communicator
57 * @param[in] file_prefix a string that stores the name of the file without the
58 * iteration number and the extension
59 * @param[in] digits An optional parameter that specifies the amount of digit
60 * used to store iteration number in the file name
61 */
62template <int dim>
63void
64write_boundaries_vtu(const DataOutFaces<dim> &data_out,
65 const std::string &folder,
66 const double time,
67 const unsigned int iter,
68 const MPI_Comm &mpi_communicator,
69 const std::string &file_prefix = std::string("boundaries"),
70 const unsigned int digits = 5);
71
72/**
73 * @brief Output the Data Out Faces as vtu files, with a pvtu file and a pvd to store the timing
74 * This function is used only when the mortar feature is enabled, since the
75 * rotating domain changes its boundary position over time.
76 *
77 * @param[in] pvd_handler a PVDHandler to store the information about the file
78 * name and time associated with it
79 * @param[in] data_out_faces the DataOutFaces class to which the data has been
80 * attached
81 * @param[in] folder a string that contains the path where the results are to be
82 * saved
83 * @param[in] time the time associated with the file
84 * @param[in] iter the iteration number associated with the file
85 * @param[in] group_files the number of vtu files that will be generated.
86 * @param[in] mpi_communicator The mpi communicator
87 * @param[in] file_prefix a string that stores the name of the file without the
88 * iteration number and the extension
89 * @param[in] digits An optional parameter that specifies the amount of digit
90 * used to store iteration number in the file name
91 * @param[in] file_prefix a string that stores the name of the file without the
92 * iteration number and the extension.
93 * @param[in] digits An optional parameter that specifies the amount of digit
94 * used to store iteration number in the file name
95 */
96template <int dim>
97void
99 PVDHandler &pvd_handler_boundary,
100 const DataOutFaces<dim> &data_out_faces,
101 const std::string &folder,
102 const double time,
103 const unsigned int iter,
104 const unsigned int group_files,
105 const MPI_Comm &mpi_communicator,
106 const std::string &file_prefix = std::string("boundaries"),
107 const unsigned int digits = 5);
108#endif
The PVDHandler class manages the storage of the information required to write pvd file....
Definition pvd_handler.h:17
void write_boundaries_vtu_and_pvd(PVDHandler &pvd_handler_boundary, const DataOutFaces< dim > &data_out_faces, const std::string &folder, const double time, const unsigned int iter, const unsigned int group_files, const MPI_Comm &mpi_communicator, const std::string &file_prefix=std::string("boundaries"), const unsigned int digits=5)
Output the Data Out Faces as vtu files, with a pvtu file and a pvd to store the timing This function ...
void write_vtu_and_pvd(PVDHandler &pvd_handler, const DataOutInterface< dim, spacedim > &data_out, const std::string &folder, const std::string &file_prefix, const double time, const unsigned int iter, const unsigned int group_files, const MPI_Comm &mpi_communicator, const unsigned int digits=5)
Output the data out to "group_files" vtu files, with a pvtu file and a pvd to store the timing This f...
void write_boundaries_vtu(const DataOutFaces< dim > &data_out, const std::string &folder, const double time, const unsigned int iter, const MPI_Comm &mpi_communicator, const std::string &file_prefix=std::string("boundaries"), const unsigned int digits=5)
Output the Data Out Faces to a single vtu file This function outputs the DataOutFaces to a vtu file.