Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122247956
rough_contact.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
Wed, Jul 16, 21:47
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Jul 18, 21:47 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27456050
Attached To
rTAMAAS tamaas
rough_contact.py
View Options
#!/usr/bin/env python3
#
# Copyright (©) 2016-2025 EPFL (École Polytechnique Fédérale de Lausanne),
# Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
# Copyright (©) 2020-2025 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
# Initialize threads and fftw
tm
.
set_log_level
(
tm
.
LogLevel
.
info
)
# Show progression of solver
# Surface size
n
=
512
# Surface generator
sg
=
tm
.
SurfaceGeneratorFilter2D
([
n
,
n
])
sg
.
random_seed
=
1
# Spectrum
sg
.
spectrum
=
tm
.
Isopowerlaw2D
()
# Parameters
sg
.
spectrum
.
q0
=
16
sg
.
spectrum
.
q1
=
16
sg
.
spectrum
.
q2
=
64
sg
.
spectrum
.
hurst
=
0.8
# Generating surface
surface
=
sg
.
buildSurface
()
surface
/=
tm
.
Statistics2D
.
computeSpectralRMSSlope
(
surface
)
# Creating model
model
=
tm
.
ModelFactory
.
createModel
(
tm
.
model_type
.
basic_2d
,
[
1.0
,
1.0
],
[
n
,
n
])
# Solver
solver
=
tm
.
PolonskyKeerRey
(
model
,
surface
,
1e-11
)
# Solve for target pressure
p_target
=
0.1
solver
.
solve
(
p_target
)
fig
,
axs
=
plt
.
subplots
(
1
,
2
,
figsize
=
(
12
,
4
))
axs
[
0
]
.
imshow
(
surface
)
axs
[
0
]
.
set_title
(
"Rough surface"
)
axs
[
1
]
.
imshow
(
model
.
traction
)
axs
[
1
]
.
set_title
(
"Contact tractions"
)
print
(
model
.
traction
.
mean
())
fig
.
tight_layout
()
plt
.
show
()
publications
()
Event Timeline
Log In to Comment