Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90464821
stiffness_matrix.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
Fri, Nov 1, 22:27
Size
1 KB
Mime Type
text/x-python
Expires
Sun, Nov 3, 22:27 (2 d)
Engine
blob
Format
Raw Data
Handle
22081244
Attached To
rAKA akantu
stiffness_matrix.py
View Options
#!/usr/bin/env python3
import
akantu
as
aka
def
getStiffnessMatrix
(
material_file
,
mesh_file
,
traction
):
aka
.
parseInput
(
material_file
)
spatial_dimension
=
2
# --------------------------------------------------------------------------
# Initialization
# --------------------------------------------------------------------------
mesh
=
aka
.
Mesh
(
spatial_dimension
)
mesh
.
read
(
mesh_file
)
model
=
aka
.
SolidMechanicsModel
(
mesh
)
model
.
initFull
(
_analysis_method
=
aka
.
_static
)
model
.
assembleStiffnessMatrix
()
K
=
model
.
getDOFManager
()
.
getMatrix
(
'K'
)
stiff
=
aka
.
AkantuSparseMatrix
(
K
)
.
toarray
()
return
stiff
# --------------------------------------------------------------------------
# main
# --------------------------------------------------------------------------
def
main
():
mesh_file
=
'plate.msh'
material_file
=
'material.dat'
traction
=
1.
mat
=
getStiffnessMatrix
(
material_file
,
mesh_file
,
traction
)
print
(
mat
)
# --------------------------------------------------------------------------
if
__name__
==
"__main__"
:
main
()
Event Timeline
Log In to Comment