Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90441015
static_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
Fri, Nov 1, 16:49
Size
606 B
Mime Type
text/x-python
Expires
Sun, Nov 3, 16:49 (2 d)
Engine
blob
Format
Raw Data
Handle
22064694
Attached To
rAKA akantu
static_solver.py
View Options
import
copy
import
scipy.sparse.linalg
as
spl
from
.
import
export
from
.
import
fe
@export
class
StaticSolver
(
fe
.
Solver
):
def
__init__
(
self
,
model
):
self
.
_model
=
model
def
_assembleResidual
(
self
):
self
.
_r
=
self
.
_model
.
f_ext
-
self
.
_model
.
f_int
def
_assembleJacobian
(
self
):
self
.
_J
=
copy
.
copy
(
self
.
_model
.
K
)
self
.
_model
.
applyDirichletBC
()
self
.
_zero_rows
(
self
.
_J
,
self
.
_model
.
blocked
)
def
solveStep
(
self
):
self
.
_assembleJacobian
()
self
.
_assembleResidual
()
x
=
spl
.
spsolve
(
self
.
_J
,
self
.
_r
)
self
.
_model
.
u
+=
x
Event Timeline
Log In to Comment