Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sumpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
sumpy
Commits
02ce9094
Commit
02ce9094
authored
4 years ago
by
Isuru Fernando
Browse files
Options
Downloads
Patches
Plain Diff
remove no kernels passing in LayerPotentialBase and fix tests
parent
222a357f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sumpy/qbx.py
+0
-10
0 additions, 10 deletions
sumpy/qbx.py
test/test_matrixgen.py
+11
-7
11 additions, 7 deletions
test/test_matrixgen.py
with
11 additions
and
17 deletions
sumpy/qbx.py
+
0
−
10
View file @
02ce9094
...
@@ -75,16 +75,6 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper):
...
@@ -75,16 +75,6 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper):
from
pytools
import
single_valued
from
pytools
import
single_valued
sdr
=
SourceDerivativeRemover
()
sdr
=
SourceDerivativeRemover
()
tdr
=
TargetDerivativeRemover
()
tdr
=
TargetDerivativeRemover
()
if
source_kernels
is
None
and
target_kernels
is
None
:
from
warnings
import
warn
warn
(
"
A list for the second argument of the constructor is deprecated.
"
"
Use a single expansion and pass source_kernels and target_kernels
"
,
DeprecationWarning
,
stacklevel
=
2
)
source_kernel
=
single_valued
(
tdr
(
exp
.
kernel
)
for
exp
in
expansion
)
base_kernel
=
sdr
(
source_kernel
)
target_kernels
=
tuple
(
sdr
(
exp
.
kernel
)
for
exp
in
expansion
)
source_kernels
=
(
source_kernel
,)
expansion
=
expansion
[
0
].
copy
(
kernel
=
base_kernel
)
KernelComputation
.
__init__
(
self
,
ctx
=
ctx
,
target_kernels
=
target_kernels
,
KernelComputation
.
__init__
(
self
,
ctx
=
ctx
,
target_kernels
=
target_kernels
,
strength_usage
=
strength_usage
,
source_kernels
=
source_kernels
,
strength_usage
=
strength_usage
,
source_kernels
=
source_kernels
,
...
...
This diff is collapsed.
Click to expand it.
test/test_matrixgen.py
+
11
−
7
View file @
02ce9094
...
@@ -109,24 +109,28 @@ def test_qbx_direct(ctx_factory, factor, lpot_id):
...
@@ -109,24 +109,28 @@ def test_qbx_direct(ctx_factory, factor, lpot_id):
from
sumpy.kernel
import
LaplaceKernel
,
DirectionalSourceDerivative
from
sumpy.kernel
import
LaplaceKernel
,
DirectionalSourceDerivative
if
lpot_id
==
1
:
if
lpot_id
==
1
:
knl
=
LaplaceKernel
(
ndim
)
base_knl
=
LaplaceKernel
(
ndim
)
knl
=
base_knl
elif
lpot_id
==
2
:
elif
lpot_id
==
2
:
knl
=
LaplaceKernel
(
ndim
)
base_
knl
=
LaplaceKernel
(
ndim
)
knl
=
DirectionalSourceDerivative
(
knl
,
dir_vec_name
=
"
dsource_vec
"
)
knl
=
DirectionalSourceDerivative
(
base_
knl
,
dir_vec_name
=
"
dsource_vec
"
)
else
:
else
:
raise
ValueError
(
"
unknow lpot_id
"
)
raise
ValueError
(
"
unknow lpot_id
"
)
from
sumpy.expansion.local
import
LineTaylorLocalExpansion
from
sumpy.expansion.local
import
LineTaylorLocalExpansion
lknl
=
LineTaylorLocalExpansion
(
knl
,
order
)
expn
=
LineTaylorLocalExpansion
(
knl
,
order
)
from
sumpy.qbx
import
LayerPotential
from
sumpy.qbx
import
LayerPotential
lpot
=
LayerPotential
(
ctx
,
[
lknl
])
lpot
=
LayerPotential
(
ctx
,
expansion
=
expn
,
source_kernels
=
(
knl
,),
target_kernels
=
(
base_knl
,))
from
sumpy.qbx
import
LayerPotentialMatrixGenerator
from
sumpy.qbx
import
LayerPotentialMatrixGenerator
mat_gen
=
LayerPotentialMatrixGenerator
(
ctx
,
[
lknl
])
mat_gen
=
LayerPotentialMatrixGenerator
(
ctx
,
expansion
=
expn
,
source_kernels
=
(
knl
,),
target_kernels
=
(
base_knl
,))
from
sumpy.qbx
import
LayerPotentialMatrixBlockGenerator
from
sumpy.qbx
import
LayerPotentialMatrixBlockGenerator
blk_gen
=
LayerPotentialMatrixBlockGenerator
(
ctx
,
[
lknl
])
blk_gen
=
LayerPotentialMatrixBlockGenerator
(
ctx
,
expansion
=
expn
,
source_kernels
=
(
knl
,),
target_kernels
=
(
base_knl
,))
for
n
in
[
200
,
300
,
400
]:
for
n
in
[
200
,
300
,
400
]:
targets
,
sources
,
centers
,
expansion_radii
,
sigma
=
\
targets
,
sources
,
centers
,
expansion_radii
,
sigma
=
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment