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
52a97236
There was a problem fetching the pipeline mini graph.
Commit
52a97236
authored
7 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Fix direct-QBX for rscale
parent
5a15a2c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!46
Scale expansion coefficients with expansion radius
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sumpy/qbx.py
+11
-5
11 additions, 5 deletions
sumpy/qbx.py
with
11 additions
and
5 deletions
sumpy/qbx.py
+
11
−
5
View file @
52a97236
...
@@ -61,7 +61,9 @@ def stringify_expn_index(i):
...
@@ -61,7 +61,9 @@ def stringify_expn_index(i):
def
expand
(
expansion_nr
,
sac
,
expansion
,
avec
,
bvec
):
def
expand
(
expansion_nr
,
sac
,
expansion
,
avec
,
bvec
):
coefficients
=
expansion
.
coefficients_from_source
(
avec
,
bvec
)
rscale
=
sym
.
Symbol
(
"
rscale
"
)
coefficients
=
expansion
.
coefficients_from_source
(
avec
,
bvec
,
rscale
)
assigned_coeffs
=
[
assigned_coeffs
=
[
sym
.
Symbol
(
sym
.
Symbol
(
...
@@ -71,7 +73,7 @@ def expand(expansion_nr, sac, expansion, avec, bvec):
...
@@ -71,7 +73,7 @@ def expand(expansion_nr, sac, expansion, avec, bvec):
for
i
in
expansion
.
get_coefficient_identifiers
()]
for
i
in
expansion
.
get_coefficient_identifiers
()]
return
sac
.
assign_unique
(
"
expn%d_result
"
%
expansion_nr
,
return
sac
.
assign_unique
(
"
expn%d_result
"
%
expansion_nr
,
expansion
.
evaluate
(
assigned_coeffs
,
bvec
))
expansion
.
evaluate
(
assigned_coeffs
,
bvec
,
rscale
))
# {{{ layer potential computation
# {{{ layer potential computation
...
@@ -101,6 +103,7 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper):
...
@@ -101,6 +103,7 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper):
return
"""
return
"""
<> a[idim] = center[idim,itgt] - src[idim,isrc] {dup=idim}
<> a[idim] = center[idim,itgt] - src[idim,isrc] {dup=idim}
<> b[idim] = tgt[idim,itgt] - center[idim,itgt] {dup=idim}
<> b[idim] = tgt[idim,itgt] - center[idim,itgt] {dup=idim}
<> rscale = expansion_radii[itgt]
"""
"""
def
get_src_tgt_arguments
(
self
):
def
get_src_tgt_arguments
(
self
):
...
@@ -111,6 +114,7 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper):
...
@@ -111,6 +114,7 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper):
shape
=
(
self
.
dim
,
"
ntargets
"
),
order
=
"
C
"
),
shape
=
(
self
.
dim
,
"
ntargets
"
),
order
=
"
C
"
),
lp
.
GlobalArg
(
"
center
"
,
None
,
lp
.
GlobalArg
(
"
center
"
,
None
,
shape
=
(
self
.
dim
,
"
ntargets
"
),
order
=
"
C
"
),
shape
=
(
self
.
dim
,
"
ntargets
"
),
order
=
"
C
"
),
lp
.
GlobalArg
(
"
expansion_radii
"
,
None
,
shape
=
"
ntargets
"
),
lp
.
ValueArg
(
"
nsources
"
,
None
),
lp
.
ValueArg
(
"
nsources
"
,
None
),
lp
.
ValueArg
(
"
ntargets
"
,
None
),
lp
.
ValueArg
(
"
ntargets
"
,
None
),
]
]
...
@@ -242,7 +246,8 @@ class LayerPotential(LayerPotentialBase):
...
@@ -242,7 +246,8 @@ class LayerPotential(LayerPotentialBase):
for
iknl
in
range
(
len
(
self
.
expansions
))
for
iknl
in
range
(
len
(
self
.
expansions
))
]
]
def
__call__
(
self
,
queue
,
targets
,
sources
,
centers
,
strengths
,
**
kwargs
):
def
__call__
(
self
,
queue
,
targets
,
sources
,
centers
,
strengths
,
expansion_radii
,
**
kwargs
):
"""
"""
:arg strengths: are required to have area elements and quadrature weights
:arg strengths: are required to have area elements and quadrature weights
already multiplied in.
already multiplied in.
...
@@ -253,7 +258,8 @@ class LayerPotential(LayerPotentialBase):
...
@@ -253,7 +258,8 @@ class LayerPotential(LayerPotentialBase):
for
i
,
dens
in
enumerate
(
strengths
):
for
i
,
dens
in
enumerate
(
strengths
):
kwargs
[
"
strength_%d
"
%
i
]
=
dens
kwargs
[
"
strength_%d
"
%
i
]
=
dens
return
knl
(
queue
,
src
=
sources
,
tgt
=
targets
,
center
=
centers
,
**
kwargs
)
return
knl
(
queue
,
src
=
sources
,
tgt
=
targets
,
center
=
centers
,
expansion_radii
=
expansion_radii
,
**
kwargs
)
# }}}
# }}}
...
@@ -283,7 +289,7 @@ class LayerPotentialMatrixGenerator(LayerPotentialBase):
...
@@ -283,7 +289,7 @@ class LayerPotentialMatrixGenerator(LayerPotentialBase):
for
iknl
in
range
(
len
(
self
.
expansions
))
for
iknl
in
range
(
len
(
self
.
expansions
))
]
]
def
__call__
(
self
,
queue
,
targets
,
sources
,
centers
,
**
kwargs
):
def
__call__
(
self
,
queue
,
targets
,
sources
,
centers
,
expansion_radii
,
**
kwargs
):
knl
=
self
.
get_optimized_kernel
()
knl
=
self
.
get_optimized_kernel
()
return
knl
(
queue
,
src
=
sources
,
tgt
=
targets
,
center
=
centers
,
return
knl
(
queue
,
src
=
sources
,
tgt
=
targets
,
center
=
centers
,
...
...
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