Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63654003
test_epic.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, May 21, 15:39
Size
1 KB
Mime Type
text/x-python
Expires
Thu, May 23, 15:39 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17801780
Attached To
rTAMAAS tamaas
test_epic.py
View Options
# -*- coding: utf-8 -*-
# @file
# @section LICENSE
#
# Copyright (©) 2016-2020 EPFL (École Polytechnique Fédérale de Lausanne),
# Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from
__future__
import
division
,
print_function
import
tamaas
as
tm
from
numpy.linalg
import
norm
from
tamaas.nonlinear_solvers
import
DFSANESolver
def
test_epic
(
pkr
):
"""Test the full elastic-plastic solve step in elasticity"""
# We use computed values from basic PKR to test
model_elastic
,
hertz
=
pkr
model
=
tm
.
ModelFactory
.
createModel
(
tm
.
model_type
.
volume_2d
,
[
0.001
,
hertz
.
domain_size
,
hertz
.
domain_size
],
[
3
,
hertz
.
n
,
hertz
.
n
]
)
model
.
setElasticity
(
hertz
.
e_star
,
0
)
residual
=
tm
.
ModelFactory
.
createResidual
(
model
,
sigma_y
=
1e2
*
model
.
E
,
hardening
=
0
)
epsolver
=
DFSANESolver
(
residual
,
model
)
csolver
=
tm
.
PolonskyKeerRey
(
model
,
hertz
.
surface
,
1e-12
)
epic
=
tm
.
EPICSolver
(
csolver
,
epsolver
,
1e-12
)
epic
.
solve
(
hertz
.
load
)
error
=
norm
((
model
[
'traction'
][
...
,
2
]
-
model_elastic
[
'traction'
])
*
(
model
[
'displacement'
][
0
,
...
,
2
]
-
model_elastic
[
'displacement'
]))
error
/=
norm
(
hertz
.
pressure
*
hertz
.
displacement
)
assert
error
<
1e-16
Event Timeline
Log In to Comment