Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60980429
fracture.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, May 3, 18:47
Size
1 KB
Mime Type
text/x-python
Expires
Sun, May 5, 18:47 (2 d)
Engine
blob
Format
Raw Data
Handle
17448703
Attached To
R6746 RationalROMPy
fracture.py
View Options
import
numpy
as
np
import
ufl
import
fenics
as
fen
from
rrompy.hfengines.linear_problem.bidimensional
import
\
MembraneFractureEngine
as
MFE
from
rrompy.solver.fenics
import
affine_warping
verb
=
100
mu0
=
[
45.
**
.
5
,
.
7
]
H
=
1.
L
=
.
75
delta
=
.
05
n
=
50
solver
=
MFE
(
mu0
=
mu0
,
H
=
H
,
L
=
L
,
delta
=
delta
,
n
=
n
,
verbosity
=
verb
)
u0
=
solver
.
liftDirichletData
()
uh
=
solver
.
solve
(
mu0
)[
0
]
#solver.plotmesh(figsize = (7.5, 4.5))
#solver.plot(u0, what = 'REAL', figsize = (8, 5))
print
(
solver
.
norm
(
uh
))
#solver.plot(uh, what = 'REAL', figsize = (8, 5))
#solver.plot(solver.residual(mu0, uh)[0], name = 'res',
# what = 'REAL', figsize = (8, 5))
#solver.outParaviewTimeDomain(uh, mu0[0], filename = 'out', folder = True,
# forceNewFile = False)
y
=
fen
.
SpatialCoordinate
(
solver
.
V
.
mesh
())[
1
]
warp1
,
warpI1
=
affine_warping
(
solver
.
V
.
mesh
(),
np
.
array
([[
1
,
0
],
[
0
,
2.
*
mu0
[
1
]]]))
warp2
,
warpI2
=
affine_warping
(
solver
.
V
.
mesh
(),
np
.
array
([[
1
,
0
],
[
0
,
2.
-
2.
*
mu0
[
1
]]]))
warp
=
ufl
.
conditional
(
ufl
.
ge
(
y
,
0.
),
warp1
,
warp2
)
warpI
=
ufl
.
conditional
(
ufl
.
ge
(
y
,
0.
),
warpI1
,
warpI2
)
#solver.plotmesh([warp, warpI], figsize = (7.5, 4.5))
#solver.plot(u0, [warp, warpI], what = 'REAL', figsize = (8, 5))
solver
.
plot
(
uh
,
[
warp
,
warpI
],
what
=
'REAL'
,
figsize
=
(
8
,
5
))
#solver.plot(solver.residual(mu0, uh)[0], [warp, warpI], name = 'res',
# what = 'REAL', figsize = (8, 5))
#solver.outParaviewTimeDomain(uh, mu0[0], [warp, warpI],
# filename = 'outW', folder = True,
# forceNewFile = False)
Event Timeline
Log In to Comment