Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80974221
py_mazars.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 3, 13:45
Size
1 KB
Mime Type
text/x-python
Expires
Thu, Sep 5, 13:45 (2 d)
Engine
blob
Format
Raw Data
Handle
20371375
Attached To
rAKA akantu
py_mazars.py
View Options
#!/usr/bin/env python3
import
numpy
as
np
import
aka_test
class
Mazars
:
def
__init__
(
self
,
**
kwargs
):
self
.
K0
=
kwargs
.
pop
(
"K0"
,
1e-4
);
self
.
At
=
kwargs
.
pop
(
"At"
,
1.0
);
self
.
Bt
=
kwargs
.
pop
(
"Bt"
,
5e3
);
self
.
Ac
=
kwargs
.
pop
(
"Ac"
,
0.8
);
self
.
Bc
=
kwargs
.
pop
(
"Bc"
,
1391.3
);
self
.
E
=
kwargs
.
pop
(
"E"
,
25e9
);
self
.
nu
=
kwargs
.
pop
(
"nu"
,
0.2
);
self
.
dam
=
0
self
.
Gf
=
0
self
.
ε
_p
=
0
self
.
σ
_p
=
0
def
compute
(
self
,
**
kwargs
):
epsilons
=
np
.
array
(
kwargs
[
'epsilons'
],
copy
=
False
)
sigmas
=
np
.
array
(
kwargs
[
'sigmas'
],
copy
=
False
)
damages
=
np
.
array
(
kwargs
[
'damages'
],
copy
=
False
)
for
t
,
ε
in
enumerate
(
epsilons
):
compute_step
()
self
.
Gf
=
self
.
Gf
+
(
σ
+
σ
_p
)
*
(
ε
-
ε
_p
)
/
2.
self
.
σ
_p
=
σ
self
.
ε
_p
=
ε
sigmas
[
t
]
=
σ
damages
[
t
]
=
self
.
dam
return
self
.
Gf
def
compute_step
(
self
,
ε
,
σ
,
dam
,
trace
):
dam_t
=
0
dam_c
=
0
if
trace
:
import
pdb
pdb
.
set_trace
()
σ
=
self
.
E
*
ε
if
ε
>
self
.
K0
:
dam_t
=
1
-
self
.
K0
*
(
1
-
self
.
At
)
/
ε
-
\
self
.
At
*
np
.
exp
(
-
self
.
Bt
*
(
ε
-
self
.
K0
))
dam_c
=
1
-
self
.
K0
*
(
1
-
self
.
Ac
)
/
ε
-
\
self
.
Ac
*
np
.
exp
(
-
self
.
Bc
*
(
ε
-
self
.
K0
))
dam
=
max
(
dam
,
dam_t
)
dam
=
min
(
dam
,
1
)
σ
=
(
1
-
dam
)
*
σ
return
σ
,
dam
Event Timeline
Log In to Comment