ExaDG
Loading...
Searching...
No Matches
precice_parameters.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2022 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_EXADG_FLUID_STRUCTURE_INTERACTION_PRECICE_PRECICE_PARAMETERS_H_
23#define INCLUDE_EXADG_FLUID_STRUCTURE_INTERACTION_PRECICE_PRECICE_PARAMETERS_H_
24
25#include <deal.II/base/parameter_handler.h>
26
27// ExaDG
28#include <exadg/fluid_structure_interaction/precice/coupling_base.h>
29#include <exadg/utilities/enum_utilities.h>
30
31namespace ExaDG
32{
33namespace preCICE
34{
41{
42 ConfigurationParameters() = default;
43
44 ConfigurationParameters(std::string const & input_file);
45
46 std::string config_file = "precice config-file";
47 std::string physics = "undefined";
48 std::string participant_name = "exadg";
49 std::string read_mesh_name = "default";
50 std::string write_mesh_name = "default";
51 std::string ale_mesh_name = "default";
52 std::string write_data_specification = "values_on_q_points";
53 std::string velocity_data_name = "default";
54 std::string displacement_data_name = "default";
55 std::string stress_data_name = "default";
56
57 WriteDataType write_data_type = WriteDataType::undefined;
58
59 void
60 add_parameters(dealii::ParameterHandler & prm);
61};
62
63
64
65ConfigurationParameters::ConfigurationParameters(std::string const & input_file)
66{
67 dealii::ParameterHandler prm;
68 add_parameters(prm);
69 prm.parse_input(input_file, "", true, true);
70
71 Utilities::string_to_enum(write_data_type, write_data_specification);
72}
73
74
75
76void
77ConfigurationParameters::add_parameters(dealii::ParameterHandler & prm)
78{
79 prm.enter_subsection("preciceConfiguration");
80 {
81 prm.add_parameter("preciceConfigFile",
82 config_file,
83 "Name of the precice configuration file",
84 dealii::Patterns::Anything());
85 prm.add_parameter("Physics",
86 physics,
87 "Specify the side you want to compute (Fluid vs Structure)",
88 dealii::Patterns::Selection("Structure|Fluid|undefined"));
89 prm.add_parameter("ParticipantName",
90 participant_name,
91 "Name of the participant in the precice-config.xml file",
92 dealii::Patterns::Anything());
93 prm.add_parameter("ReadMeshName",
94 read_mesh_name,
95 "Name of the read coupling mesh in the precice-config.xml file",
96 dealii::Patterns::Anything());
97 prm.add_parameter("WriteMeshName",
98 write_mesh_name,
99 "Name of the write coupling mesh in the precice-config.xml file",
100 dealii::Patterns::Anything());
101 prm.add_parameter("ALEMeshName",
102 ale_mesh_name,
103 "Name of the ale-mesh in the precice-config.xml file",
104 dealii::Patterns::Anything());
105 prm.add_parameter("WriteDataSpecification",
106 write_data_specification,
107 "Specification of the write data location and the data type",
108 dealii::Patterns::Selection(
109 "values_on_dofs|values_on_q_points|normal_gradients_on_q_points|"
110 "values_on_other_mesh|gradients_on_other_mesh"));
111 prm.add_parameter("VelocityDataName",
112 velocity_data_name,
113 "Name of the Velocity data in the precice-config.xml file",
114 dealii::Patterns::Anything());
115 prm.add_parameter("DisplacementDataName",
116 displacement_data_name,
117 "Name of the Displacement data in the precice-config.xml file",
118 dealii::Patterns::Anything());
119 prm.add_parameter("StressDataName",
120 stress_data_name,
121 "Name of the Stress data in the precice-config.xml file",
122 dealii::Patterns::Anything());
123 }
124 prm.leave_subsection();
125}
126
127} // namespace preCICE
128} // namespace ExaDG
129
130#endif
void string_to_enum(EnumType &enum_type, std::string const &enum_name)
Converts a string to an enum, which is provided as first function argument.
Definition enum_utilities.h:75
Definition driver.cpp:33
Definition precice_parameters.h:41