Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F83517767
test_model_solver.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, Sep 17, 14:09
Size
642 B
Mime Type
text/x-python
Expires
Thu, Sep 19, 14:09 (2 d)
Engine
blob
Format
Raw Data
Handle
20851180
Attached To
rAKA akantu
test_model_solver.py
View Options
#!/usr/bin/env python3
import
numpy
as
np
import
numpy.linalg
as
npl
import
python_fe
as
pfe
sim_u
=
np
.
genfromtxt
(
"disp.csv"
,
delimiter
=
","
,
names
=
True
)
Ne
=
int
(
sim_u
[
'node'
][
-
1
])
F
=
sim_u
[
'force'
]
blocked
=
sim_u
[
'blocked'
]
u
=
sim_u
[
'disp'
]
trusses
=
pfe
.
TrussFE
(
Ne
=
Ne
,
F
=
{
f
:
[
np
.
where
(
F
==
f
)]
for
f
in
np
.
unique
(
F
)},
blocked
=
(
np
.
where
(
blocked
==
1
),
u
[
blocked
==
1
]))
solver
=
pfe
.
StaticSolver
(
trusses
)
solver
.
solveStep
()
upy
=
trusses
.
u
n
=
npl
.
norm
(
upy
-
u
)
/
npl
.
norm
(
upy
)
if
n
>
1e-14
:
raise
ValueError
(
'Something went wrong in the simulation'
)
Event Timeline
Log In to Comment