Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78418564
laplace.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, Aug 20, 18:25
Size
1 KB
Mime Type
text/x-python
Expires
Thu, Aug 22, 18:25 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
20043470
Attached To
R6746 RationalROMPy
laplace.py
View Options
# Copyright (C) 2018 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
from
rrompy.hfengines.linear_problem
import
LaplaceDiskGaussian
from
rrompy.hfengines.linear_problem.bidimensional
import
LaplaceDiskGaussian2
def
test_laplace_disk
():
solver
=
LaplaceDiskGaussian
(
n
=
20
,
verbosity
=
0
)
mu
=
1.5
solver
.
setSolver
(
"BICG"
,
{
"tol"
:
1e-15
})
uh
=
solver
.
solve
(
mu
)[
0
]
assert
np
.
isclose
(
solver
.
norm
(
uh
),
1.053403077447029
,
rtol
=
1e-2
)
assert
np
.
isclose
(
solver
.
norm
(
solver
.
residual
(
uh
,
mu
)[
0
]),
5.27345e-13
,
rtol
=
1e-1
)
def
test_laplace_disk_2
():
solver
=
LaplaceDiskGaussian2
(
n
=
20
,
verbosity
=
0
)
mu
=
[[
0.
,
1.5
]]
mu
=
[
0.
,
1.5
]
uh
=
solver
.
solve
(
mu
)[
0
]
assert
np
.
isclose
(
solver
.
norm
(
uh
),
1.0534030774205372
,
rtol
=
1e-2
)
assert
np
.
isclose
(
solver
.
norm
(
solver
.
residual
(
uh
,
mu
)[
0
]),
5.27345e-13
,
rtol
=
1e-1
)
Event Timeline
Log In to Comment