Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91211437
nonperiodic.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
Sat, Nov 9, 00:39
Size
1 KB
Mime Type
text/x-python
Expires
Mon, Nov 11, 00:39 (1 d, 26 m)
Engine
blob
Format
Raw Data
Handle
22180148
Attached To
rTAMAAS tamaas
nonperiodic.py
View Options
#!/usr/bin/env python3
#
# Copyright (©) 2016-2024 EPFL (École Polytechnique Fédérale de Lausanne),
# Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
# Copyright (©) 2020-2024 Lucas Frérot
#
# 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/>.
import
tamaas
as
tm
import
matplotlib.pyplot
as
plt
from
tamaas.utils
import
publications
,
hertz_surface
# Surface size
n
=
512
# Surface radius
R
=
0.1
# Surface generator
surface
=
hertz_surface
([
1.
,
1.
],
[
n
,
n
],
R
)
plt
.
imshow
(
surface
)
# Creating model
model
=
tm
.
ModelFactory
.
createModel
(
tm
.
model_type
.
basic_2d
,
[
1.
,
1.
],
[
n
,
n
])
tm
.
ModelFactory
.
registerNonPeriodic
(
model
,
'dcfft'
)
# Solver
solver
=
tm
.
PolonskyKeerRey
(
model
,
surface
,
1e-12
)
solver
.
setIntegralOperator
(
'dcfft'
)
# Solve for target pressure
p_target
=
1.2
solver
.
solve
(
p_target
)
# The concact solver always shifts the displacement so that gap >= 0
# To compute the true displacement, one needs to re-evaluate the displacement
model
.
operators
[
'dcfft'
](
model
.
traction
,
model
.
displacement
)
delta
=
(
9
*
p_target
**
2
/
(
16
*
R
*
model
.
E_star
**
2
))
**
(
1
/
3
)
print
(
f
"Hertzian interference = {delta:.4f}, computed = {model.displacement.max():.4f}"
)
plt
.
figure
()
plt
.
imshow
(
model
.
traction
)
plt
.
title
(
'Contact tractions'
)
plt
.
show
()
publications
()
Event Timeline
Log In to Comment