forked from tan2/DynEarthSol-old
-
Notifications
You must be signed in to change notification settings - Fork 3
/
matprops.hpp
168 lines (131 loc) · 4.55 KB
/
matprops.hpp
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#ifndef DYNEARTHSOL3D_MATPROPS_HPP
#define DYNEARTHSOL3D_MATPROPS_HPP
#include "parameters.hpp"
double ref_pressure(const Param& param, double z);
class VectorBase
{
public:
// factory method
static VectorBase* create(const double_vec&, int);
virtual ~VectorBase() {};
virtual double operator[] (std::size_t) const = 0;
virtual std::size_t size() const = 0;
};
class MatProps
{
public:
MatProps(const Param& param, const Variables& var);
~MatProps();
const int rheol_type;
const int nmat;
double bulkm(int e) const;
double shearm(int e) const;
double visc(int e) const;
double rho(int e) const;
double cp(int e) const;
double k(int e) const;
void plastic_props(int e, double pls,
double& amc, double& anphi, double& anpsi,
double& hardn, double& ten_max) const;
const bool is_plane_strain;
const double visc_min;
const double visc_max;
const double tension_max;
const double therm_diff_max;
const static int rh_elastic = 1 << 0;
const static int rh_viscous = 1 << 1;
const static int rh_plastic = 1 << 2;
const static int rh_plastic2d = rh_plastic | 1 << 3;
const static int rh_maxwell = rh_elastic | rh_viscous;
const static int rh_ep = rh_elastic | rh_plastic;
const static int rh_evp = rh_elastic | rh_viscous | rh_plastic;
private:
// alias to field variables in var
// ie. var.mat.temperature == var.temperature
const array_t &coord;
const conn_t &connectivity;
const double_vec &temperature;
const tensor_t &stress;
const tensor_t &strain_rate;
const int_vec2D &elemmarkers;
const VectorBase *rho0, *alpha;
const VectorBase *bulk_modulus, *shear_modulus;
const VectorBase *visc_exponent, *visc_coefficient, *visc_activation_energy;
const VectorBase *visc_activation_volume;
const VectorBase *heat_capacity, *therm_cond;
const VectorBase *pls0, *pls1;
const VectorBase *cohesion0, *cohesion1;
const VectorBase *friction_angle0, *friction_angle1;
const VectorBase *dilation_angle0, *dilation_angle1;
void plastic_weakening(int e, double pls,
double &cohesion, double &friction_angle,
double &dilation_angle, double &hardening) const;
};
#endif
// ACC version
/*
#ifndef DYNEARTHSOL3D_MATPROPS_HPP
#define DYNEARTHSOL3D_MATPROPS_HPP
#include "parameters.hpp"
#pragma acc routine seq
double ref_pressure(const Param& param, double z);
using VectorBase = double_vec;
class MatProps
{
public:
MatProps(const Param& param, const Variables& var);
~MatProps();
const int rheol_type;
const int nmat;
#pragma acc routine seq
double bulkm(int e) const;
#pragma acc routine seq
double shearm(int e) const;
#pragma acc routine seq
double visc(int e) const;
#pragma acc routine seq
double rho(int e) const;
#pragma acc routine seq
double cp(int e) const;
#pragma acc routine seq
double k(int e) const;
#pragma acc routine seq
void plastic_props(int e, double pls,
double& amc, double& anphi, double& anpsi,
double& hardn, double& ten_max) const;
const bool is_plane_strain;
const double visc_min;
const double visc_max;
const double tension_max;
const double therm_diff_max;
const static int rh_elastic = 1 << 0;
const static int rh_viscous = 1 << 1;
const static int rh_plastic = 1 << 2;
const static int rh_plastic2d = rh_plastic | 1 << 3;
const static int rh_maxwell = rh_elastic | rh_viscous;
const static int rh_ep = rh_elastic | rh_plastic;
const static int rh_evp = rh_elastic | rh_viscous | rh_plastic;
private:
// alias to field variables in var
// ie. var.mat.temperature == var.temperature
const array_t &coord;
const conn_t &connectivity;
const double_vec &temperature;
const tensor_t &stress;
const tensor_t &strain_rate;
const int_vec2D &elemmarkers;
VectorBase rho0, alpha;
VectorBase bulk_modulus, shear_modulus;
VectorBase visc_exponent, visc_coefficient, visc_activation_energy;
VectorBase heat_capacity, therm_cond;
VectorBase pls0, pls1;
VectorBase cohesion0, cohesion1;
VectorBase friction_angle0, friction_angle1;
VectorBase dilation_angle0, dilation_angle1;
#pragma acc routine seq
void plastic_weakening(int e, double pls,
double &cohesion, double &friction_angle,
double &dilation_angle, double &hardening) const;
};
#endif
*/