Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93428018
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
Thu, Nov 28, 16:40
Size
1 KB
Mime Type
text/x-python
Expires
Sat, Nov 30, 16:40 (2 d)
Engine
blob
Format
Raw Data
Handle
22595196
Attached To
R6746 RationalROMPy
laplace.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
from
laplace_disk_gaussian
import
LaplaceDiskGaussian
,
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
(
mu
,
uh
)[
0
],
dual
=
True
),
4.66728e-10
,
atol
=
1e-7
)
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
(
mu
,
uh
)[
0
],
dual
=
True
),
2.40043363e-08
,
atol
=
1e-7
)
Event Timeline
Log In to Comment