-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModelPSstruc.cpp
More file actions
109 lines (71 loc) · 2.25 KB
/
ModelPSstruc.cpp
File metadata and controls
109 lines (71 loc) · 2.25 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
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
//
// ModelPSstruc.cpp
// fullstructuralmodel
//
// Created by Will Zhang on 6/12/18.
// Copyright © 2018 Will Zhang. All rights reserved.
//
#include "ModelPSstruc.hpp"
#include <math.h>
void model_ps_struc::calc_new_old_fraction(double rate, double time)
{
rate_PS = rate;
time_elapsed = time;
fraction_old = exp( - rate * time);
fraction_new = 1.0 - fraction_old;
}
void model_ps_struc::update_reference(double arg[4])
{
F11_pushforward = arg[0];
F12_pushforward = arg[1];
F21_pushforward = arg[2];
F22_pushforward = arg[3];
}
void model_ps_struc::update_history(double arg[4])
{
for (int i = 0; i < 4; i++) {
strainhistory[i] = arg[i];
}
}
void model_ps_struc::updata_parameters(double arg[13])
{
kM = arg[0];
ratio = arg[1];
alpham1 = arg[2];
betam1 = arg[3];
kC = arg[4];
ODFmean = arg[5];
ODFstdev = arg[6];
Dxmean = arg[7];
Dxstdev = arg[8];
Dxlb = arg[9];
Dxub = arg[10];
Dx_aniso = arg[11];
kI = arg[12];
}
model_ps_struc::model_ps_struc(double arg[]):
matrixmodel(&arg[0]), collagenmodel(&arg[4]),
kM{arg[0]}, ratio{arg[1]}, alpham1{arg[2]}, betam1{arg[3]},
kC{arg[4]}, ODFmean{arg[5]}, ODFstdev{arg[6]},
Dxmean{arg[7]}, Dxstdev{arg[8]}, Dxlb{arg[9]}, Dxub{arg[10]}, Dx_aniso{arg[11]},
kI{arg[12]},
F11_pushforward{arg[13]}, F12_pushforward{arg[14]},F21_pushforward{arg[15]},F22_pushforward{arg[16]},
strainhistory{arg[19], arg[20], arg[21], arg[22]}
{calc_new_old_fraction(arg[17], arg[18]);};
int model_ps_struc::stress(double vF[4], double res[4])
{
double identityM[4] = {1.0, 0.0, 0.0, 1.0};
double collagenstress[4];
double oldmatrixstress[4];
double newmatrixstress[4];
matrixmodel.stress(identityM, vF, oldmatrixstress);
matrixmodel.stress(strainhistory, vF, newmatrixstress);
// Using the full exogenously crosslinked structural model
// collagenmodel.stress_total(vF, collagenstress);
// Using only the standard structural model
collagenmodel.stress(vF, collagenstress);
for (int i = 0; i < 4; i++) {
res[i] = collagenstress[i] + fraction_old * oldmatrixstress[i] + fraction_new * newmatrixstress[i];
}
return 0;
}