Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
grudge
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
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
grudge
Commits
735b7240
Commit
735b7240
authored
3 years ago
by
Thomas Gibson
Browse files
Options
Downloads
Patches
Plain Diff
Remove all sym/bind/symbolic grudge computations from new tests
parent
95d4f70d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_new_world_grudge.py
+19
-11
19 additions, 11 deletions
test/test_new_world_grudge.py
with
19 additions
and
11 deletions
test/test_new_world_grudge.py
+
19
−
11
View file @
735b7240
...
@@ -33,7 +33,7 @@ import meshmode.mesh.generation as mgen
...
@@ -33,7 +33,7 @@ import meshmode.mesh.generation as mgen
import
grudge.operators
as
op
import
grudge.operators
as
op
from
grudge
import
DiscretizationCollection
,
sym
,
bind
from
grudge
import
DiscretizationCollection
import
grudge.dof_desc
as
dof_desc
import
grudge.dof_desc
as
dof_desc
import
pytest
import
pytest
...
@@ -232,9 +232,9 @@ def test_mass_surface_area(actx_factory, name):
...
@@ -232,9 +232,9 @@ def test_mass_surface_area(actx_factory, name):
dd
=
dof_desc
.
DD_VOLUME
dd
=
dof_desc
.
DD_VOLUME
ones_volm
=
volume_discr
.
zeros
(
actx
)
+
1
ones_volm
=
volume_discr
.
zeros
(
actx
)
+
1
mass_weights
=
op
.
mass_operator
(
dcoll
,
dd
,
ones_volm
)
flattened_
mass_weights
=
flatten
(
op
.
mass_operator
(
dcoll
,
dd
,
ones_volm
)
)
approx_surface_area
=
np
.
dot
(
actx
.
to_numpy
(
flatten
(
ones_volm
)),
approx_surface_area
=
np
.
dot
(
actx
.
to_numpy
(
flatten
(
ones_volm
)),
actx
.
to_numpy
(
flatten
(
mass_weights
))
)
actx
.
to_numpy
(
flatten
ed_
mass_weights
))
logger
.
info
(
"
surface: got {:.5e} / expected {:.5e}
"
.
format
(
logger
.
info
(
"
surface: got {:.5e} / expected {:.5e}
"
.
format
(
approx_surface_area
,
surface_area
))
approx_surface_area
,
surface_area
))
...
@@ -242,8 +242,12 @@ def test_mass_surface_area(actx_factory, name):
...
@@ -242,8 +242,12 @@ def test_mass_surface_area(actx_factory, name):
# }}}
# }}}
h_max
=
bind
(
dcoll
,
sym
.
h_max_from_volume
(
dcoll
.
ambient_dim
,
# {{{ compute h_max using mass weights
dim
=
dcoll
.
dim
,
dd
=
dd
))(
actx
)
h_max
=
actx
.
np
.
max
(
flattened_mass_weights
)
**
(
1
/
dcoll
.
dim
)
# }}}
eoc
.
add_data_point
(
h_max
,
area_error
)
eoc
.
add_data_point
(
h_max
,
area_error
)
# }}}
# }}}
...
@@ -300,21 +304,25 @@ def test_surface_mass_operator_inverse(actx_factory, name):
...
@@ -300,21 +304,25 @@ def test_surface_mass_operator_inverse(actx_factory, name):
dcoll
,
op
.
mass_operator
(
dcoll
,
dd
,
f_volm
)
dcoll
,
op
.
mass_operator
(
dcoll
,
dd
,
f_volm
)
)
)
inv_error
=
actx
.
np
.
linalg
.
norm
(
res
-
f_volm
,
ord
=
2
)
# }}}
# }}}
inv_error
=
bind
(
dcoll
,
# {{{ compute h_max from mass weights
sym
.
norm
(
2
,
sym
.
var
(
"
x
"
)
-
sym
.
var
(
"
y
"
))
/
sym
.
norm
(
2
,
sym
.
var
(
"
y
"
)))(
actx
,
x
=
res
,
y
=
f_volm
)
ones_volm
=
volume_discr
.
zeros
(
actx
)
+
1
flattened_mass_weights
=
flatten
(
op
.
mass_operator
(
dcoll
,
dd
,
ones_volm
))
h_max
=
actx
.
np
.
max
(
flattened_mass_weights
)
**
(
1
/
dcoll
.
dim
)
# }}}
h_max
=
bind
(
dcoll
,
sym
.
h_max_from_volume
(
dcoll
.
ambient_dim
,
dim
=
dcoll
.
dim
,
dd
=
dd
))(
actx
)
eoc
.
add_data_point
(
h_max
,
inv_error
)
eoc
.
add_data_point
(
h_max
,
inv_error
)
# }}}
# }}}
logger
.
info
(
"
inverse mass error
\n
%s
"
,
str
(
eoc
))
logger
.
info
(
"
inverse mass error
\n
%s
"
,
str
(
eoc
))
assert
eoc
.
max_error
()
<
1.0
e-1
4
assert
eoc
.
max_error
()
<
5
e-1
3
# }}}
# }}}
...
...
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