Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93099532
HelmholtzSolver.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, Nov 26, 05:17
Size
1 KB
Mime Type
text/x-python
Expires
Thu, Nov 28, 05:17 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22540003
Attached To
R6746 RationalROMPy
HelmholtzSolver.py
View Options
import
numpy
as
np
from
rrompy.hfengines.fenics
import
HelmholtzSquareBubbleProblemEngine
as
HSBPE
from
rrompy.hfengines.fenics
import
HelmholtzSquareTransmissionProblemEngine
as
HSTPE
from
rrompy.hfengines.fenics
import
HelmholtzBoxScatteringProblemEngine
as
HBSPE
from
rrompy.hsengines.fenics
import
HSEngine
as
HS
testNo
=
3
if
testNo
==
1
:
solver
=
HSBPE
(
kappa
=
12
**
.
5
,
theta
=
np
.
pi
/
3
,
n
=
40
)
uh
=
solver
.
solve
(
12.
+
0.j
)
plotter
=
HS
(
solver
.
V
)
plotter
.
plotmesh
(
save
=
True
)
print
(
plotter
.
norm
(
uh
))
plotter
.
plot
(
uh
,
save
=
True
)
###########
elif
testNo
==
2
:
solver
=
HSTPE
(
nT
=
1
,
nB
=
2
,
theta
=
np
.
pi
*
20
/
180
,
kappa
=
4.
,
n
=
50
)
uh
=
solver
.
solve
(
16.
)
plotter
=
HS
(
solver
.
V
)
print
(
plotter
.
norm
(
uh
))
plotter
.
plot
(
uh
)
###########
elif
testNo
==
3
:
solver
=
HBSPE
(
R
=
5
,
kappa
=
12
**.
5
,
theta
=
-
np
.
pi
*
60
/
180
,
n
=
30
)
plotter
=
HS
(
solver
.
V
)
uinc
=
-
solver
.
liftDirichletData
()
uh
=
solver
.
solve
(
12
**.
5
)
plotter
.
plotmesh
()
print
(
plotter
.
norm
(
uh
,
12
**.
5
))
print
(
plotter
.
norm
(
uh
+
uinc
,
12
**.
5
))
plotter
.
plot
(
uh
)
plotter
.
plot
(
uh
+
uinc
,
name
=
'u_tot'
)
Event Timeline
Log In to Comment