Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92932751
helmholtz_square_bubble_problem_engine.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
Sun, Nov 24, 22:34
Size
1 KB
Mime Type
text/x-python
Expires
Tue, Nov 26, 22:34 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22541259
Attached To
R6746 RationalROMPy
helmholtz_square_bubble_problem_engine.py
View Options
# Copyright (C) 2018-2020 by the RROMPy authors
#
# This file is part of RROMPy.
#
# RROMPy is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RROMPy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with RROMPy. If not, see <http://www.gnu.org/licenses/>.
#
import
numpy
as
np
import
fenics
as
fen
from
rrompy.hfengines.fenics_engines
import
HelmholtzProblemEngine
class
HelmholtzSquareBubbleProblemEngine
(
HelmholtzProblemEngine
):
"""
Solver for square bubble Helmholtz problems with parametric wavenumber.
- \Delta u - omega^2 * u = f in \Omega
u = 0 on \Gamma_D
with exact solution square bubble times plane wave.
"""
def
__init__
(
self
,
kappa
:
float
,
theta
:
float
,
n
:
int
,
*
args
,
**
kwargs
):
super
()
.
__init__
(
kappa
,
*
args
,
**
kwargs
)
pi
=
np
.
pi
mesh
=
fen
.
RectangleMesh
(
fen
.
Point
(
0
,
0
),
fen
.
Point
(
pi
,
pi
),
3
*
n
,
3
*
n
)
self
.
V
=
fen
.
FunctionSpace
(
mesh
,
"P"
,
1
)
c
,
s
=
np
.
cos
(
theta
),
np
.
sin
(
theta
)
x
,
y
=
fen
.
SpatialCoordinate
(
mesh
)[:]
C
=
16.
/
pi
**
4.
bR
=
C
*
2
*
(
x
*
(
pi
-
x
)
+
y
*
(
pi
-
y
))
bI
=
C
*
2
*
kappa
*
(
c
*
(
pi
-
2
*
x
)
*
y
*
(
pi
-
y
)
+
s
*
x
*
(
pi
-
x
)
*
(
pi
-
2
*
y
))
wR
=
fen
.
cos
(
kappa
*
(
c
*
x
+
s
*
y
))
wI
=
fen
.
sin
(
kappa
*
(
c
*
x
+
s
*
y
))
self
.
forcingTerm
=
[
bR
*
wR
+
bI
*
wI
,
bI
*
wR
-
bR
*
wI
]
Event Timeline
Log In to Comment