![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <core/exceptions.h>#include <core/revision.h>#include <core/utilities.h>#include <core/vector.h>#include <deal.II/base/mpi.h>#include <deal.II/base/revision.h>#include <deal.II/numerics/vector_tools.h>#include <boost/algorithm/string/replace.hpp>#include <filesystem>#include <iostream>#include <regex>#include <system_error>#include <type_traits>Go to the source code of this file.
Functions | |
| template<typename T> | |
| TableHandler | make_table_scalars_vectors (const std::vector< T > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< double > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template<int dim, typename T> | |
| TableHandler | make_table_scalars_tensors (const std::vector< T > &independent_vector, const std::string &independent_column_name, const std::vector< Tensor< 1, dim > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template<int dim, typename T> | |
| TableHandler | make_table_scalars_tensors (const std::vector< T > &independent_vector, const std::string &independent_column_name, const std::vector< std::vector< Tensor< 1, dim > > > &dependent_vectors, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template<int dim> | |
| TableHandler | make_table_tensors_tensors (const std::vector< Tensor< 1, dim > > &independent_vector, const std::vector< std::string > &independent_column_names, const std::vector< Tensor< 1, dim > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template<int dim> | |
| TableHandler | make_table_tensors_scalars (const std::vector< Tensor< 1, dim > > &independent_vector, const std::vector< std::string > &independent_column_names, const std::vector< double > &dependent_vector, const std::string &dependent_column_name, const unsigned int display_precision, const bool display_scientific_notation) |
| void | check_file_exists (const std::string &file_name, const std::string &file_description) |
| void | fill_table_from_file (TableHandler &table, const std::string &file_name, const std::string &delimiter) |
| void | fill_vectors_from_file (std::map< std::string, std::vector< double > > &map, const std::string &file, const std::string &delimiter) |
| void | fill_string_vectors_from_file (std::map< std::string, std::vector< std::string > > &map, const std::string &file, const std::string &delimiter) |
| void | create_output_folder (const std::string &dirname) |
| void | delete_output_folder (const std::string &dirname) |
| template TableHandler | make_table_scalars_vectors (const std::vector< double > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< double > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_vectors (const std::vector< unsigned int > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< double > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_vectors (const std::vector< int > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< double > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< double > &independent_values, const std::string &independent_column_name, const std::vector< Tensor< 1, 2 > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< double > &independent_values, const std::string &independent_column_name, const std::vector< Tensor< 1, 3 > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< double > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< Tensor< 1, 2 > > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< double > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< Tensor< 1, 3 > > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< unsigned int > &independent_values, const std::string &independent_column_name, const std::vector< Tensor< 1, 2 > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< unsigned int > &independent_values, const std::string &independent_column_name, const std::vector< Tensor< 1, 3 > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< unsigned int > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< Tensor< 1, 2 > > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< unsigned int > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< Tensor< 1, 3 > > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< int > &independent_values, const std::string &independent_column_name, const std::vector< Tensor< 1, 2 > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< int > &independent_values, const std::string &independent_column_name, const std::vector< Tensor< 1, 3 > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< int > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< Tensor< 1, 2 > > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_scalars_tensors (const std::vector< int > &independent_values, const std::string &independent_column_name, const std::vector< std::vector< Tensor< 1, 3 > > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_tensors_tensors (const std::vector< Tensor< 1, 2 > > &independent_values, const std::vector< std::string > &independent_column_names, const std::vector< Tensor< 1, 2 > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_tensors_tensors (const std::vector< Tensor< 1, 3 > > &independent_values, const std::vector< std::string > &independent_column_names, const std::vector< Tensor< 1, 3 > > &dependent_vector, const std::vector< std::string > &dependent_column_names, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_tensors_scalars (const std::vector< Tensor< 1, 2 > > &independent_vector, const std::vector< std::string > &independent_column_names, const std::vector< double > &dependent_values, const std::string &dependent_column_name, const unsigned int display_precision, const bool display_scientific_notation) |
| template TableHandler | make_table_tensors_scalars (const std::vector< Tensor< 1, 3 > > &independent_vector, const std::vector< std::string > &independent_column_names, const std::vector< double > &dependent_values, const std::string &dependent_column_name, const unsigned int display_precision, const bool display_scientific_notation) |
| std::string | get_last_value_of_parameter (const std::string &file_name, const std::string ¶meter_name) |
| int | get_max_value_of_parameter (const std::string &file_name, const std::string ¶meter_name) |
| unsigned int | get_dimension (const std::string &file_name) |
| int | get_max_subsection_size (const std::string &file_name, const bool require_subsection_size) |
| std::string | concatenate_strings (const int argc, char **argv) |
| void | print_version_info (const ConditionalOStream &pcout) |
| std::tuple< std::map< std::string, bool >, std::vector< std::string > > | parse_args (int argc, char **argv) |
| void | warn_deprecated_parameter_value (const std::string ¶meter_name, const std::string &deprecated_value, const std::string &new_value) |
| void | print_parameters_to_output_file (const ConditionalOStream &pcout, const ParameterHandler &prm, const std::string &file_name) |
| void | interpret_escape_sequences (std::string &s) |
| void | print_comment_to_output_file (const ConditionalOStream &pcout, ParameterHandler &prm) |
| void | delete_vtu_and_pvd_files (const std::string &output_path) |
| template<int dim, typename VectorType> | |
| void | evaluate_values_at_points (const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const VectorType &solution_field, const std::vector< Point< dim > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< dim > &remote_point_evaluator, std::vector< double > &evaluated_scalar_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 2, GlobalVectorType > (const Mapping< 2 > &mapping, const DoFHandler< 2 > &dof_handler, const GlobalVectorType &solution_field, const std::vector< Point< 2 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 2 > &remote_point_evaluator, std::vector< double > &evaluated_scalar_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 3, GlobalVectorType > (const Mapping< 3 > &mapping, const DoFHandler< 3 > &dof_handler, const GlobalVectorType &solution_field, const std::vector< Point< 3 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 3 > &remote_point_evaluator, std::vector< double > &evaluated_scalar_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 2, GlobalBlockVectorType > (const Mapping< 2 > &mapping, const DoFHandler< 2 > &dof_handler, const GlobalBlockVectorType &solution_field, const std::vector< Point< 2 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 2 > &remote_point_evaluator, std::vector< double > &evaluated_scalar_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 3, GlobalBlockVectorType > (const Mapping< 3 > &mapping, const DoFHandler< 3 > &dof_handler, const GlobalBlockVectorType &solution_field, const std::vector< Point< 3 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 3 > &remote_point_evaluator, std::vector< double > &evaluated_scalar_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 2, LinearAlgebra::distributed::Vector< double > > (const Mapping< 2 > &mapping, const DoFHandler< 2 > &dof_handler, const LinearAlgebra::distributed::Vector< double > &solution_field, const std::vector< Point< 2 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 2 > &remote_point_evaluator, std::vector< double > &evaluated_scalar_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 3, LinearAlgebra::distributed::Vector< double > > (const Mapping< 3 > &mapping, const DoFHandler< 3 > &dof_handler, const LinearAlgebra::distributed::Vector< double > &solution_field, const std::vector< Point< 3 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 3 > &remote_point_evaluator, std::vector< double > &evaluated_scalar_values, const unsigned int first_selected_component) |
| template<int n_component, int dim, typename VectorType> | |
| void | evaluate_values_at_points (const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const VectorType &solution_field, const std::vector< Point< dim > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< dim > &remote_point_evaluator, std::vector< Tensor< 1, dim, double > > &evaluated_vector_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 2, 2, GlobalVectorType > (const Mapping< 2 > &mapping, const DoFHandler< 2 > &dof_handler, const GlobalVectorType &solution_field, const std::vector< Point< 2 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 2 > &remote_point_evaluator, std::vector< Tensor< 1, 2, double > > &evaluated_vector_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 3, 3, GlobalVectorType > (const Mapping< 3 > &mapping, const DoFHandler< 3 > &dof_handler, const GlobalVectorType &solution_field, const std::vector< Point< 3 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 3 > &remote_point_evaluator, std::vector< Tensor< 1, 3, double > > &evaluated_vector_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 2, 2, GlobalBlockVectorType > (const Mapping< 2 > &mapping, const DoFHandler< 2 > &dof_handler, const GlobalBlockVectorType &solution_field, const std::vector< Point< 2 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 2 > &remote_point_evaluator, std::vector< Tensor< 1, 2, double > > &evaluated_vector_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 3, 3, GlobalBlockVectorType > (const Mapping< 3 > &mapping, const DoFHandler< 3 > &dof_handler, const GlobalBlockVectorType &solution_field, const std::vector< Point< 3 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 3 > &remote_point_evaluator, std::vector< Tensor< 1, 3, double > > &evaluated_vector_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 2, 2, LinearAlgebra::distributed::Vector< double > > (const Mapping< 2 > &mapping, const DoFHandler< 2 > &dof_handler, const LinearAlgebra::distributed::Vector< double > &solution_field, const std::vector< Point< 2 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 2 > &remote_point_evaluator, std::vector< Tensor< 1, 2, double > > &evaluated_vector_values, const unsigned int first_selected_component) |
| template void | evaluate_values_at_points< 3, 3, LinearAlgebra::distributed::Vector< double > > (const Mapping< 3 > &mapping, const DoFHandler< 3 > &dof_handler, const LinearAlgebra::distributed::Vector< double > &solution_field, const std::vector< Point< 3 > > &evaluation_points, Utilities::MPI::RemotePointEvaluation< 3 > &remote_point_evaluator, std::vector< Tensor< 1, 3, double > > &evaluated_vector_values, const unsigned int first_selected_component) |
| void check_file_exists | ( | const std::string & | file_name, |
| const std::string & | file_description ) |
Verify that a file that Lethe must read exists and can be opened, and raise an error stated in the user's terms otherwise.
This function is meant to be called right before a file whose path comes from the user, either from the command line or from the parameter file, is opened. It distinguishes a file name that was left empty, a file that does not exist and a file that exists but cannot be read, so that the user is told what to correct instead of facing the error that the reader of the file would raise further down.
| [in] | file_name | Path of the file, exactly as it was given by the user. |
| [in] | file_description | Role of the file in the simulation. It is used to build the error message and should read naturally after "The", for example "parameter file given to the application" or "gmsh mesh file given by 'subsection mesh' - 'set file name'". |
Definition at line 225 of file utilities.cc.
| std::string concatenate_strings | ( | const int | argc, |
| char ** | argv ) |
Concatenate words which are passed from the command line to a main function into a single string in which the words are separated by space.
Concatenate words which are passed from the command line to a main function into a single string in which the words are seperated by space.
| [in] | argc | number of arguments in C style. |
| [in] | argv | arguments themselves in C style. |
Definition at line 758 of file utilities.cc.
| void create_output_folder | ( | const std::string & | dirname | ) |
Creates the simulation output folder.
| [in] | dirname | Output directory name |
Definition at line 401 of file utilities.cc.
| void delete_output_folder | ( | const std::string & | dirname | ) |
Delete the output folder and its content.
| [in] | dirname | Output directory name. |
Definition at line 407 of file utilities.cc.
| void delete_vtu_and_pvd_files | ( | const std::string & | output_path | ) |
Delete vtu and pvd files.
Definition at line 917 of file utilities.cc.
| void evaluate_values_at_points | ( | const Mapping< dim > & | mapping, |
| const DoFHandler< dim > & | dof_handler, | ||
| const VectorType & | solution_field, | ||
| const std::vector< Point< dim > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< dim > & | remote_point_evaluator, | ||
| std::vector< double > & | evaluated_scalar_values, | ||
| const unsigned int | first_selected_component = 0 ) |
Evaluates the values of a scalar field at remote points of the domain from the mapping, the DoF handler and the solution field.
| dim | Denotes the number of spatial dimensions. |
| VectorType | Vector type of the solution vector. |
| [in] | mapping | Mapping of the domain. |
| [in] | dof_handler | DoF handler associated to the solution field. |
| [in] | solution_field | Vector containing the solution field. For distributed meshes, ghost elements must be updated. |
| [in] | evaluation_points | Vector of points where the values of the solution field are to be evaluated. |
| [in,out] | remote_point_evaluator | Utilities::MPI::RemotePointEvaluation object used to evaluate values of the variable of interest at given points of the domain. |
| [in,out] | evaluated_scalar_values | Vector of evaluated scalar values. |
| [in] | first_selected_component | First component of the solution to select if the solution field is a vector field. This is used to extract the correct field when the solution vector contains multiple fields (e.g., velocity and pressure are stored in a same solution vector). |
Definition at line 930 of file utilities.cc.
References points_are_in_domain().
| void evaluate_values_at_points | ( | const Mapping< dim > & | mapping, |
| const DoFHandler< dim > & | dof_handler, | ||
| const VectorType & | solution_field, | ||
| const std::vector< Point< dim > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< dim > & | remote_point_evaluator, | ||
| std::vector< Tensor< 1, dim, double > > & | evaluated_vector_values, | ||
| const unsigned int | first_selected_component = 0 ) |
Evaluates the values of a vector field at remote points of the domain from the mapping, the DoF handler and the solution field.
| n_component | Number of components of the evaluated vector solution. |
| dim | Denotes the number of spatial dimensions. |
| VectorType | Vector type of the solution vector. |
| [in] | mapping | Mapping of the domain. |
| [in] | dof_handler | DoF handler associated to the solution field. |
| [in] | solution_field | Vector containing the vector solution field. |
| [in] | evaluation_points | Vector of points where the values of the solution field are to be evaluated. |
| [in,out] | remote_point_evaluator | Utilities::MPI::RemotePointEvaluation object used to evaluate values of the variable of interest at given points of the domain. |
| [in,out] | evaluated_vector_values | Vector of evaluated vector values. |
| [in] | first_selected_component | First component of the solution to select. This is used to extract the correct fields when the solution vector contains multiple fields (e.g., velocity and pressure are stored in a same solution vector). |
Definition at line 1027 of file utilities.cc.
References points_are_in_domain().
| template void evaluate_values_at_points< 2, 2, GlobalBlockVectorType > | ( | const Mapping< 2 > & | mapping, |
| const DoFHandler< 2 > & | dof_handler, | ||
| const GlobalBlockVectorType & | solution_field, | ||
| const std::vector< Point< 2 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 2 > & | remote_point_evaluator, | ||
| std::vector< Tensor< 1, 2, double > > & | evaluated_vector_values, | ||
| const unsigned int | first_selected_component ) |
| template void evaluate_values_at_points< 2, 2, GlobalVectorType > | ( | const Mapping< 2 > & | mapping, |
| const DoFHandler< 2 > & | dof_handler, | ||
| const GlobalVectorType & | solution_field, | ||
| const std::vector< Point< 2 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 2 > & | remote_point_evaluator, | ||
| std::vector< Tensor< 1, 2, double > > & | evaluated_vector_values, | ||
| const unsigned int | first_selected_component ) |
| template void evaluate_values_at_points< 2, 2, LinearAlgebra::distributed::Vector< double > > | ( | const Mapping< 2 > & | mapping, |
| const DoFHandler< 2 > & | dof_handler, | ||
| const LinearAlgebra::distributed::Vector< double > & | solution_field, | ||
| const std::vector< Point< 2 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 2 > & | remote_point_evaluator, | ||
| std::vector< Tensor< 1, 2, double > > & | evaluated_vector_values, | ||
| const unsigned int | first_selected_component ) |
References evaluate_values_at_points().
| template void evaluate_values_at_points< 2, GlobalBlockVectorType > | ( | const Mapping< 2 > & | mapping, |
| const DoFHandler< 2 > & | dof_handler, | ||
| const GlobalBlockVectorType & | solution_field, | ||
| const std::vector< Point< 2 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 2 > & | remote_point_evaluator, | ||
| std::vector< double > & | evaluated_scalar_values, | ||
| const unsigned int | first_selected_component ) |
| template void evaluate_values_at_points< 2, GlobalVectorType > | ( | const Mapping< 2 > & | mapping, |
| const DoFHandler< 2 > & | dof_handler, | ||
| const GlobalVectorType & | solution_field, | ||
| const std::vector< Point< 2 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 2 > & | remote_point_evaluator, | ||
| std::vector< double > & | evaluated_scalar_values, | ||
| const unsigned int | first_selected_component ) |
| template void evaluate_values_at_points< 2, LinearAlgebra::distributed::Vector< double > > | ( | const Mapping< 2 > & | mapping, |
| const DoFHandler< 2 > & | dof_handler, | ||
| const LinearAlgebra::distributed::Vector< double > & | solution_field, | ||
| const std::vector< Point< 2 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 2 > & | remote_point_evaluator, | ||
| std::vector< double > & | evaluated_scalar_values, | ||
| const unsigned int | first_selected_component ) |
References evaluate_values_at_points().
| template void evaluate_values_at_points< 3, 3, GlobalBlockVectorType > | ( | const Mapping< 3 > & | mapping, |
| const DoFHandler< 3 > & | dof_handler, | ||
| const GlobalBlockVectorType & | solution_field, | ||
| const std::vector< Point< 3 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 3 > & | remote_point_evaluator, | ||
| std::vector< Tensor< 1, 3, double > > & | evaluated_vector_values, | ||
| const unsigned int | first_selected_component ) |
| template void evaluate_values_at_points< 3, 3, GlobalVectorType > | ( | const Mapping< 3 > & | mapping, |
| const DoFHandler< 3 > & | dof_handler, | ||
| const GlobalVectorType & | solution_field, | ||
| const std::vector< Point< 3 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 3 > & | remote_point_evaluator, | ||
| std::vector< Tensor< 1, 3, double > > & | evaluated_vector_values, | ||
| const unsigned int | first_selected_component ) |
| template void evaluate_values_at_points< 3, 3, LinearAlgebra::distributed::Vector< double > > | ( | const Mapping< 3 > & | mapping, |
| const DoFHandler< 3 > & | dof_handler, | ||
| const LinearAlgebra::distributed::Vector< double > & | solution_field, | ||
| const std::vector< Point< 3 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 3 > & | remote_point_evaluator, | ||
| std::vector< Tensor< 1, 3, double > > & | evaluated_vector_values, | ||
| const unsigned int | first_selected_component ) |
References evaluate_values_at_points().
| template void evaluate_values_at_points< 3, GlobalBlockVectorType > | ( | const Mapping< 3 > & | mapping, |
| const DoFHandler< 3 > & | dof_handler, | ||
| const GlobalBlockVectorType & | solution_field, | ||
| const std::vector< Point< 3 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 3 > & | remote_point_evaluator, | ||
| std::vector< double > & | evaluated_scalar_values, | ||
| const unsigned int | first_selected_component ) |
| template void evaluate_values_at_points< 3, GlobalVectorType > | ( | const Mapping< 3 > & | mapping, |
| const DoFHandler< 3 > & | dof_handler, | ||
| const GlobalVectorType & | solution_field, | ||
| const std::vector< Point< 3 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 3 > & | remote_point_evaluator, | ||
| std::vector< double > & | evaluated_scalar_values, | ||
| const unsigned int | first_selected_component ) |
| template void evaluate_values_at_points< 3, LinearAlgebra::distributed::Vector< double > > | ( | const Mapping< 3 > & | mapping, |
| const DoFHandler< 3 > & | dof_handler, | ||
| const LinearAlgebra::distributed::Vector< double > & | solution_field, | ||
| const std::vector< Point< 3 > > & | evaluation_points, | ||
| Utilities::MPI::RemotePointEvaluation< 3 > & | remote_point_evaluator, | ||
| std::vector< double > & | evaluated_scalar_values, | ||
| const unsigned int | first_selected_component ) |
References evaluate_values_at_points().
| void fill_string_vectors_from_file | ( | std::map< std::string, std::vector< std::string > > & | map, |
| const std::string & | file_name, | ||
| const std::string & | delimiter = " " ) |
Function that read a file that was build from a dealii table and create a map with the key being the column name and the variable the vectors of data.
| [in,out] | map | A map used to store the data based on column names. |
| [in] | file_name | Path to the file to read the table from. |
| [in] | delimiter | Delimiter used in the file to separate values. Default is a space (" "). |
Definition at line 352 of file utilities.cc.
References check_file_exists().
| void fill_table_from_file | ( | TableHandler & | table, |
| const std::string & | file_name, | ||
| const std::string & | delimiter = " " ) |
Reads a file generated by a deal.II TableHandler and fills a TableHandler with its data.
This function reads a table from a file and populates the given TableHandler. Warning: If the table already contains data, it will be erased.
| [in,out] | table | The table to be filled. Existing content will be overwritten. |
| [in] | file_name | Path to the file to read the table from. |
| [in] | delimiter | Delimiter used in the file to separate values. Default is a space (" "). |
Definition at line 253 of file utilities.cc.
References check_file_exists().
| void fill_vectors_from_file | ( | std::map< std::string, std::vector< double > > & | map, |
| const std::string & | file_name, | ||
| const std::string & | delimiter = " " ) |
function that read a file that was build from a dealii table and fill 2 vectors. The first vector contains all the columns names and the second one contained all the column data.
| [in,out] | map | A map used to store the data based on column names. |
| [in] | file_name | Path to the file to read the table from. |
| [in] | delimiter | Delimiter used in the file to separate values. Default is a space (" "). |
Definition at line 299 of file utilities.cc.
References check_file_exists().
| unsigned int get_dimension | ( | const std::string & | file_name | ) |
Extract the dimension in which to run Lethe from the contents of the parameter file. This is something that we need to do before processing the parameter file since we need to know whether to use the dim=2 or dim=3 instantiation of the main classes.
| file_name[in] | The file name from which dimension is read |
Definition at line 670 of file utilities.cc.
References get_last_value_of_parameter().
| std::string get_last_value_of_parameter | ( | const std::string & | file_name, |
| const std::string & | parameter_name ) |
Retrieves the value of a specific parameter from an input file. Returns an empty string if the parameter is not found. This function is adapted from ASPECT and is mainly used to parse the dimension of the problem before creating the full parameter parser.
| [in] | file_name | File from which we retrieve the parameter. |
| [in] | parameter_name | Name of the parameter to retrieve. |
Definition at line 585 of file utilities.cc.
References check_file_exists().
| int get_max_subsection_size | ( | const std::string & | file_name, |
| const bool | require_subsection_size = true ) |
Extract the maximum value between the number of boundary conditions and the number of manifolds from the file. This value is linked to the "number" string defined in the simulation parameter file. It provides an estimate for the amount of parameters or manifolds and is used to determine the size of the vectors that will store boundary conditions and manifold data. This feature will need to be monitored extensively in the future.
| [in] | file_name | The file name from which the number of boundary conditions is read |
| [in] | require_subsection_size | If true, the file must contain at least one "number" entry and an exception is raised otherwise. Solvers for which no variable size subsection is mandatory, such as the DEM solvers whose boundary conditions are declared with a "number of boundary conditions" entry, set this to false. A file without any "number" entry then yields a size of zero. |
Definition at line 736 of file utilities.cc.
References get_max_value_of_parameter().
| int get_max_value_of_parameter | ( | const std::string & | file_name, |
| const std::string & | parameter_name ) |
Definition at line 625 of file utilities.cc.
References check_file_exists().
| void interpret_escape_sequences | ( | std::string & | s | ) |
Identify escape sequences listed below and apply them to the string.
| [in,out] | s | String to be modified if escape sequences are specified. |
Definition at line 892 of file utilities.cc.
| template TableHandler make_table_scalars_tensors | ( | const std::vector< double > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< Tensor< 1, 2 > > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< double > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< Tensor< 1, 3 > > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< double > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< Tensor< 1, 2 > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< double > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< Tensor< 1, 3 > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< Tensor< 1, 2 > > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< Tensor< 1, 3 > > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< Tensor< 1, 2 > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< Tensor< 1, 3 > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| TableHandler make_table_scalars_tensors | ( | const std::vector< T > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< Tensor< 1, dim > > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation = false ) |
Generate a table from a vector of scalar (independent variable) and a vector of vectors of Tensor<1,dim> (dependent variables).
| T | Scalar type of independent variables. |
| dim | Integer that denotes the number of spatial dimensions. |
| [in] | independent_values | Vector of scalar values that serve as the independent variable (e.g., time). |
| [in] | independent_column_name | Label of the independent variable. |
| [in] | dependent_vector | Vector of vectors of Tensor<1,dim> containing dependent variables values (e.g., force). |
| [in] | dependent_column_names | Vector of strings representing the labels of dependent variables. |
| [in] | display_precision | Integer indicating the precision at which the table is written. |
| [in] | display_scientific_notation | Boolean indicating if the values should be displayed in scientific notation (true) or not (false). |
Definition at line 98 of file utilities.cc.
| TableHandler make_table_scalars_tensors | ( | const std::vector< T > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< Tensor< 1, dim > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation = false ) |
Generate a table from a vector of scalars (independent variable) and a vector of Tensor<1,dim> (dependent variables).
| T | Scalar type of independent variables. |
| dim | Integer that denotes the number of spatial dimensions. |
| [in] | independent_values | Vector of scalar values that serve as the independent variable (e.g., time). |
| [in] | independent_column_name | Label of the independent variable. |
| [in] | dependent_vector | Vector of Tensor<1,dim> containing dependent variables values (e.g., force). |
| [in] | dependent_column_names | Vector of strings representing the labels of dependent variables. |
| [in] | display_precision | Integer indicating the precision at which the table is written. |
| [in] | display_scientific_notation | Boolean indicating if the values should be displayed in scientific notation (true) or not (false). |
Definition at line 59 of file utilities.cc.
| template TableHandler make_table_scalars_tensors | ( | const std::vector< unsigned int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< Tensor< 1, 2 > > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< unsigned int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< Tensor< 1, 3 > > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< unsigned int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< Tensor< 1, 2 > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_tensors | ( | const std::vector< unsigned int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< Tensor< 1, 3 > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_vectors | ( | const std::vector< double > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< double > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_scalars_vectors | ( | const std::vector< int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< double > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| TableHandler make_table_scalars_vectors | ( | const std::vector< T > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< double > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation = false ) |
Generate a table from a vector of scalars (independent variable) and a vector of vectors of scalars (dependent variables).
| T | Scalar type of independent variables. |
| [in] | independent_values | Vector of scalar values that serve as the independent variable (e.g., time). |
| [in] | independent_column_name | Label of the independent variable. |
| [in] | dependent_vector | Vector of vectors of scalar values containing dependant variables values. |
| [in] | dependent_column_names | Vector of strings representing the labels of dependent variables. |
| [in] | display_precision | Integer indicating the precision at which the table is written. |
| [in] | display_scientific_notation | Boolean indicating if the values should be displayed in scientific notation (true) or not (false). |
Definition at line 24 of file utilities.cc.
| template TableHandler make_table_scalars_vectors | ( | const std::vector< unsigned int > & | independent_values, |
| const std::string & | independent_column_name, | ||
| const std::vector< std::vector< double > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_tensors_scalars | ( | const std::vector< Tensor< 1, 2 > > & | independent_vector, |
| const std::vector< std::string > & | independent_column_names, | ||
| const std::vector< double > & | dependent_values, | ||
| const std::string & | dependent_column_name, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_tensors_scalars | ( | const std::vector< Tensor< 1, 3 > > & | independent_vector, |
| const std::vector< std::string > & | independent_column_names, | ||
| const std::vector< double > & | dependent_values, | ||
| const std::string & | dependent_column_name, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| TableHandler make_table_tensors_scalars | ( | const std::vector< Tensor< 1, dim > > & | independent_vector, |
| const std::vector< std::string > & | independent_column_names, | ||
| const std::vector< double > & | dependent_values, | ||
| const std::string & | dependent_column_name, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation = false ) |
Generate a table from a vector of Tensor<1,dim> (independent variables) and a vector of scalars (dependent variable).
| dim | Integer that denotes the number of spatial dimensions. |
| [in] | independent_vector | Vector of Tensor<1,dim> that serves as the independent variable (e.g., position). |
| [in] | independent_column_names | Vector of strings representing labels of the independent tensor. |
| [in] | dependent_values | Vector of doubles containing dependent variables values (e.g., force). |
| [in] | dependent_column_name | Label of the dependent variable. |
| [in] | display_precision | Integer indicating the precision at which the table is written. |
| [in] | display_scientific_notation | Boolean indicating if the values should be displayed in scientific notation (true) or not (false). |
Definition at line 189 of file utilities.cc.
| template TableHandler make_table_tensors_tensors | ( | const std::vector< Tensor< 1, 2 > > & | independent_values, |
| const std::vector< std::string > & | independent_column_names, | ||
| const std::vector< Tensor< 1, 2 > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| template TableHandler make_table_tensors_tensors | ( | const std::vector< Tensor< 1, 3 > > & | independent_values, |
| const std::vector< std::string > & | independent_column_names, | ||
| const std::vector< Tensor< 1, 3 > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation ) |
| TableHandler make_table_tensors_tensors | ( | const std::vector< Tensor< 1, dim > > & | independent_vector, |
| const std::vector< std::string > & | independent_column_names, | ||
| const std::vector< Tensor< 1, dim > > & | dependent_vector, | ||
| const std::vector< std::string > & | dependent_column_names, | ||
| const unsigned int | display_precision, | ||
| const bool | display_scientific_notation = false ) |
Generate a table from a vector of Tensor<1,dim> (independent variables) and a vector of Tensor<1,dim> (dependent variables).
| dim | Integer that denotes the number of spatial dimensions. |
| [in] | independent_vector | Vector of Tensor<1,dim> that serves as the independent variable (e.g., position). |
| [in] | independent_column_names | Vector of strings representing labels of the independent tensor. |
| [in] | dependent_vector | Vector of vectors of Tensor<1,dim> containing dependent variables values (e.g., force). |
| [in] | dependent_column_names | Vector of strings representing the labels of dependent variables. |
| [in] | display_precision | Integer indicating the precision at which the table is written. |
| [in] | display_scientific_notation | Boolean indicating if the values should be displayed in scientific notation (true) or not (false). |
Definition at line 147 of file utilities.cc.
| std::tuple< std::map< std::string, bool >, std::vector< std::string > > parse_args | ( | int | argc, |
| char ** | argv ) |
Parse the arguments given to the application.
| [in] | argc | Number of arguments |
| [in] | argv | Array of strings representing the arguments |
Definition at line 800 of file utilities.cc.
| void print_comment_to_output_file | ( | const ConditionalOStream & | pcout, |
| ParameterHandler & | prm ) |
Print a user comment at the beginning of the simulation on the console output.
| [in] | pcout | Parallel console output stream. |
| [in,out] | prm | ParameterHandler. specified. |
Definition at line 902 of file utilities.cc.
References interpret_escape_sequences().
| void print_parameters_to_output_file | ( | const ConditionalOStream & | pcout, |
| const ParameterHandler & | prm, | ||
| const std::string & | file_name ) |
Print the parameters given by the parameter file of the application.
| [in] | pcout | Parallel output stream |
| [in] | prm | Object containing the parameters parsed from the parameter file |
Definition at line 865 of file utilities.cc.
References get_last_value_of_parameter().
| void print_version_info | ( | const ConditionalOStream & | pcout | ) |
Print the information of the deal.II and Lethe branches used to run an application in the "git describe" format.
| [in] | pcout | Parallel output stream |
Definition at line 775 of file utilities.cc.
| void warn_deprecated_parameter_value | ( | const std::string & | parameter_name, |
| const std::string & | deprecated_value, | ||
| const std::string & | new_value ) |
Print a warning stating that a deprecated value was given to a parameter, along with the value which replaces it. The warning is only printed by the first MPI process.
| [in] | parameter_name | Name of the parameter in the parameter file. |
| [in] | deprecated_value | Deprecated value which was given. |
| [in] | new_value | Value which replaces deprecated_value. |
Definition at line 839 of file utilities.cc.