Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pytential
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
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
pytential
Commits
8ca203b6
There was a problem fetching the pipeline mini graph.
Commit
8ca203b6
authored
7 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Hack gradient checking into the inteq test script
parent
a92d944b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!45
Parallel pyfmmlib
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_scalar_int_eq.py
+35
-1
35 additions, 1 deletion
test/test_scalar_int_eq.py
with
35 additions
and
1 deletion
test/test_scalar_int_eq.py
+
35
−
1
View file @
8ca203b6
...
...
@@ -253,7 +253,8 @@ def run_int_eq_test(cl_ctx, queue, case, resolution):
# {{{ error check
bound_tgt_op
=
bind
((
qbx
,
PointsTarget
(
test_targets
)),
points_target
=
PointsTarget
(
test_targets
)
bound_tgt_op
=
bind
((
qbx
,
points_target
),
op
.
representation
(
sym
.
var
(
"
u
"
)))
test_via_bdry
=
bound_tgt_op
(
queue
,
u
=
u
,
k
=
case
.
k
)
...
...
@@ -282,6 +283,36 @@ def run_int_eq_test(cl_ctx, queue, case, resolution):
print
(
"
rel_err_2: %g rel_err_inf: %g
"
%
(
rel_err_2
,
rel_err_inf
))
# {{{ test gradient
if
case
.
check_gradient
:
bound_grad_op
=
bind
((
qbx
,
points_target
),
op
.
representation
(
sym
.
var
(
"
u
"
),
map_potentials
=
lambda
pot
:
sym
.
grad
(
mesh
.
ambient_dim
,
pot
),
qbx_forced_limit
=
None
))
#print(bound_t_deriv_op.code)
grad_from_src
=
bound_grad_op
(
queue
,
u
=
u
,
**
concrete_knl_kwargs
)
grad_ref
=
(
bind
(
(
point_source
,
points_target
),
sym
.
grad
(
mesh
.
ambient_dim
,
pot_src
)
)(
queue
,
charges
=
source_charges_dev
,
**
concrete_knl_kwargs
)
)
grad_err
=
(
grad_from_src
-
grad_ref
)
rel_grad_err_inf
=
(
la
.
norm
(
grad_err
[
0
].
get
(),
np
.
inf
)
/
la
.
norm
(
grad_ref
[
0
].
get
(),
np
.
inf
))
print
(
"
rel_grad_err_inf: %g
"
%
rel_grad_err_inf
)
# }}}
# {{{ test tangential derivative
if
case
.
check_tangential_deriv
:
...
...
@@ -525,6 +556,7 @@ class CurveIntEqTestCase(IntEqTestCase):
fmm_backend
=
None
check_tangential_deriv
=
True
check_gradient
=
False
class
EllipseIntEqTestCase
(
CurveIntEqTestCase
):
...
...
@@ -570,6 +602,8 @@ class EllipsoidIntEqTestCase(Helmholtz3DIntEqTestCase):
inner_radius
=
0.4
outer_radius
=
5
check_gradient
=
True
class
MergedCubesIntEqTestCase
(
Helmholtz3DIntEqTestCase
):
resolutions
=
[
1.4
]
...
...
This diff is collapsed.
Click to expand it.
Andreas Klöckner
@inducer
mentioned in merge request
!30 (merged)
·
7 years ago
mentioned in merge request
!30 (merged)
mentioned in merge request !30
Toggle commit list
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