-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathelement.h
More file actions
62 lines (40 loc) · 1.19 KB
/
element.h
File metadata and controls
62 lines (40 loc) · 1.19 KB
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
#ifndef ELEMENT_H_
#define ELEMENT_H_
#include "eigen.h"
#include "gmsh.h"
#include <array>
struct element {
Matrix4d coef_matrix;
double volumn;
std::array<int, 6> basis_global_index;
int element_index;
double epsilon;
double sigma;
double mu;
double a(int i) { return coef_matrix(i-1, 3); }
double b(int i) { return coef_matrix(i-1, 0); }
double c(int i) { return coef_matrix(i-1, 1); }
double d(int i) { return coef_matrix(i-1, 2); }
Vector3d u(int i, int j) {
Vector3d upsi;
upsi(0) = c(i) * d(j) - c(j) * d(i);
upsi(1) = b(j) * d(i) - b(i) * d(j);
upsi(2) = b(i) * c(j) - b(j) * c(i);
return upsi;
}
double p(int i, int j) {
return b(i) * b(j) + c(i) * c(j) + d(i) * d(j);
}
Vector3d t(int e);
double l(int e);
int simplex_index(int e, int i);
double E(int i, int j);
double F(int i, int j);
double K(int i, int j);
double M(int i, int j);
double P(int i, int j);
static element create_element(int tet_n);
Vector3d center_coord();
Vector3d center_field();
};
#endif /* ELEMENT_H_ */