-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathparameters.h
114 lines (94 loc) · 2.89 KB
/
parameters.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#ifndef PARAMETERS_H
#define PARAMETERS_H
#include <deal.II/base/parameter_handler.h>
/**
* This class declares all parameters, which can be specified in the parameter
* file. The subsection abut preCICE configurations is directly interlinked
* to the Adapter class.
*/
namespace Parameters
{
using namespace dealii;
/**
* @brief Time: Specifies simulation time properties
*/
struct Time
{
double end_time = 1;
double delta_t = 0.1;
int output_interval = 1;
std::string output_folder = "";
void
add_output_parameters(ParameterHandler &prm);
};
/**
* @brief The System struct keeps material properties and body force contributions
*/
struct System
{
double nu = 0.3;
double mu = 1538462;
double lambda = -1;
double rho = 1000;
Tensor<1, 3, double> body_force;
void
add_output_parameters(ParameterHandler &prm);
};
/**
* @brief LinearSolver: Specifies linear solver properties
*/
struct Solver
{
std::string model = "linear";
std::string type_lin = "Direct";
double tol_lin = 1e-6;
double max_iterations_lin = 1;
unsigned int max_iterations_NR = 10;
double tol_f = 1e-9;
double tol_u = 1e-6;
void
add_output_parameters(ParameterHandler &prm);
};
/**
* @brief Discretization: Specifies parameters for time integration by a
* theta scheme and polynomial degree of the FE system
*/
struct Discretization
{
unsigned int poly_degree = 3;
// For the linear elastic model (theta-scheme)
double theta = 0.5;
// For the nonlinear elastic model (Newmark)
double beta = 0.25;
double gamma = 0.5;
void
add_output_parameters(ParameterHandler &prm);
};
/**
* @brief PreciceAdapterConfiguration: Specifies preCICE related information.
* A lot of these information need to be consistent with the
* precice-config.xml file.
*/
struct PreciceAdapterConfiguration
{
std::string scenario = "FSI3";
std::string config_file = "precice-config.xml";
std::string participant_name = "dealiisolver";
std::string mesh_name = "dealii-mesh";
std::string read_data_name = "Stress";
std::string write_data_name = "Displacement";
double flap_location = 0.0;
bool data_consistent = true;
void
add_output_parameters(ParameterHandler &prm);
};
struct AllParameters : public Solver,
public Discretization,
public System,
public Time,
public PreciceAdapterConfiguration
{
AllParameters(const std::string &input_file);
};
} // namespace Parameters
#endif // PARAMETERS_H