-
Notifications
You must be signed in to change notification settings - Fork 0
/
elastic.hpp
executable file
·71 lines (63 loc) · 1.7 KB
/
elastic.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
/*
ver.03.03
file elastic.hpp
*/
#pragma once
#include "common.h"
#include "material.h"
#include "matrix_algebraic.h"
using ABFEM::MATH::kronecker;
using ABFEM::MATH::kronecker2;
class Venant_: public Elastic<3,MATRIX33>{
public:
Venant_(const double E,const double nu):Elastic<3,MATRIX33>(E,nu){};
void getC_e(double dest[][3][3][3],MATRIX33* F_in){
for(unsigned i=0;i<3;i++)
for(unsigned j=0;j<3;j++)
for(unsigned k=0;k<3;k++)
for(unsigned l=0;l<3;l++){
dest[i][j][k][l]=
lambda*kronecker2[i][j][k][l]
+mu*(kronecker2[i][k][j][l]+kronecker2[i][l][j][k]);
}
};
void getSigma(MATRIX33* dest,MATRIX33* F_in){
Matrix33 Fd(F_in);
double J=Fd.I1()+Fd.I2()+Fd.det()+1.;
Matrix33 bd=Fd.transpose()+Fd+Fd*Fd.transpose();
Matrix33 bd2=bd*bd;
for(unsigned i=0;i<3;i++)
for(unsigned j=0;j<3;j++)
(*dest)(i,j)=
0.5*lambda/J*bd.I1()
*(bd(i,j)+kronecker[i][j])
+mu/J*(bd2(i,j)+bd(i,j));
};
};
class Bonet_comp_: public Elastic<3,MATRIX33>{
public:
Bonet_comp_(const double E,const double nu):Elastic<3,MATRIX33>(E,nu){};
void getC_e(double dest[][3][3][3],MATRIX33* F_in){
Matrix33 Fd(F_in);
double J_=Fd.I1()+Fd.I2()+Fd.det();
for(unsigned i=0;i<3;i++)
for(unsigned j=0;j<3;j++)
for(unsigned k=0;k<3;k++)
for(unsigned l=0;l<3;l++){
dest[i][j][k][l]=(
lambda*kronecker2[i][j][k][l]+
(mu-lambda*log1p(J_))*(kronecker2[i][k][j][l]+kronecker2[i][l][j][k])
)/(1.+J_);
}
};
void getSigma(MATRIX33* dest,MATRIX33* F_in){
Matrix33 Fd(F_in);
double J_=Fd.I1()+Fd.I2()+Fd.det();
Matrix33 bd=Fd.transpose()+Fd+Fd*Fd.transpose();
for(unsigned i=0;i<3;i++)
for(unsigned j=0;j<3;j++)
(*dest)(i,j)=(
mu*bd(i,j)+lambda*log1p(J_)*kronecker[i][j]
)/(1.+J_);
};
};