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
5b54cc25
Unverified
Commit
5b54cc25
authored
4 years ago
by
Andreas Klöckner
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #9 from inducer/eager-norm-support-obj-array
Eager norm support obj array
parents
4349e299
af898f13
No related branches found
No related tags found
No related merge requests found
Pipeline
#52305
passed
4 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grudge/eager.py
+12
-0
12 additions, 0 deletions
grudge/eager.py
with
12 additions
and
0 deletions
grudge/eager.py
+
12
−
0
View file @
5b54cc25
...
@@ -166,6 +166,18 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries):
...
@@ -166,6 +166,18 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries):
return
bind
(
self
,
sym
.
norm
(
p
,
sym
.
var
(
"
arg
"
)),
local_only
=
True
)
return
bind
(
self
,
sym
.
norm
(
p
,
sym
.
var
(
"
arg
"
)),
local_only
=
True
)
def
norm
(
self
,
vec
,
p
=
2
):
def
norm
(
self
,
vec
,
p
=
2
):
if
(
isinstance
(
vec
,
np
.
ndarray
)
and
vec
.
dtype
.
char
==
"
O
"
and
not
isinstance
(
vec
,
DOFArray
)):
if
p
==
2
:
return
sum
(
self
.
norm
(
vec
[
idx
])
**
2
for
idx
in
np
.
ndindex
(
vec
.
shape
))
**
0.5
elif
p
==
np
.
inf
:
return
max
(
self
.
norm
(
vec
[
idx
])
for
idx
in
np
.
ndindex
(
vec
.
shape
))
else
:
raise
ValueError
(
"
unsupported norm order
"
)
return
self
.
_norm
(
p
)(
arg
=
vec
)
return
self
.
_norm
(
p
)(
arg
=
vec
)
@memoize_method
@memoize_method
...
...
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