Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92115744
compression.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
Sun, Nov 17, 12:13
Size
1 KB
Mime Type
text/x-python
Expires
Tue, Nov 19, 12:13 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22209107
Attached To
rAKA akantu
compression.py
View Options
#!/usr/bin/env python3
""" compression.py: Python contact mechanics example"""
__author__
=
"Mohit Pundir"
__credits__
=
[
"Mohit Pundir <mohit.pundir@epfl.ch>"
,
]
__copyright__
=
"Copyright (©) 2018-2021 EPFL (Ecole Polytechnique Fédérale"
\
" de Lausanne) Laboratory (LSMS - Laboratoire de Simulation"
\
" en Mécanique des Solides)"
__license__
=
"LGPLv3"
import
akantu
as
aka
max_steps
=
20000
max_displacement
=
1e-2
damping_interval
=
10
damping_ratio
=
0.9
spatial_dimension
=
2
aka
.
parseInput
(
'compression.dat'
)
mesh
=
aka
.
Mesh
(
spatial_dimension
)
mesh
.
read
(
'compression.msh'
)
coupler
=
aka
.
CouplerSolidContact
(
mesh
)
solid
=
coupler
.
getSolidMechanicsModel
()
contact
=
coupler
.
getContactMechanicsModel
()
material_selector
=
aka
.
MeshDataMaterialSelectorString
(
"physical_names"
,
solid
)
solid
.
setMaterialSelector
(
material_selector
)
coupler
.
initFull
(
_analysis_method
=
aka
.
_explicit_lumped_mass
)
surface_selector
=
aka
.
PhysicalSurfaceSelector
(
mesh
)
detector
=
contact
.
getContactDetector
()
detector
.
setSurfaceSelector
(
surface_selector
)
solid
.
applyBC
(
aka
.
FixedValue
(
0.0
,
aka
.
_x
),
"sides"
)
time_step
=
solid
.
getStableTimeStep
()
time_step
*=
0.1
coupler
.
setTimeStep
(
time_step
)
coupler
.
setBaseName
(
"compression"
)
coupler
.
addDumpFieldVector
(
"displacement"
)
coupler
.
addDumpFieldVector
(
"contact_force"
)
coupler
.
addDumpFieldVector
(
"external_force"
)
coupler
.
addDumpFieldVector
(
"internal_force"
)
coupler
.
addDumpField
(
"gaps"
)
coupler
.
addDumpField
(
"areas"
)
coupler
.
addDumpField
(
"blocked_dofs"
)
coupler
.
addDumpField
(
"grad_u"
)
coupler
.
addDumpField
(
"stress"
)
coupler
.
dump
()
velocity
=
solid
.
getVelocity
()
increment
=
max_displacement
/
max_steps
for
s
in
range
(
0
,
max_steps
):
print
(
"Step : "
,
s
)
solid
.
applyBC
(
aka
.
IncrementValue
(
-
increment
,
aka
.
_y
),
"loading"
)
solid
.
applyBC
(
aka
.
IncrementValue
(
increment
,
aka
.
_y
),
"fixed"
)
coupler
.
solveStep
()
if
s
%
damping_interval
==
0
:
velocity
*=
damping_ratio
if
s
%
100
==
0
:
coupler
.
dump
()
Event Timeline
Log In to Comment