Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
meshmode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Alexandru Fikl
meshmode
Commits
f1825d0b
Commit
f1825d0b
authored
4 years ago
by
Matt Wala
Browse files
Options
Downloads
Patches
Plain Diff
ndofs_per_element_per_group => ndofs_per_element_by_group
parent
e4e1d320
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
meshmode/dof_array.py
+6
-6
6 additions, 6 deletions
meshmode/dof_array.py
with
6 additions
and
6 deletions
meshmode/dof_array.py
+
6
−
6
View file @
f1825d0b
...
...
@@ -208,7 +208,7 @@ def flatten(ary: np.ndarray) -> np.ndarray:
def
unflatten
(
actx
:
ArrayContext
,
discr
:
"
_Discretization
"
,
ary
,
ndofs_per_element_
per
_group
:
Optional
[
Iterable
[
int
]]
=
None
)
->
np
.
ndarray
:
ndofs_per_element_
by
_group
:
Optional
[
Iterable
[
int
]]
=
None
)
->
np
.
ndarray
:
r
"""
Convert a
'
flat
'
array returned by :func:`flatten` back to a :class:`DOFArray`.
Vectorizes over object arrays of :class:`DOFArray`\ s.
...
...
@@ -218,7 +218,7 @@ def unflatten(actx: ArrayContext, discr: "_Discretization", ary,
and
not
isinstance
(
ary
,
DOFArray
)):
return
obj_array_vectorize
(
lambda
subary
:
unflatten
(
actx
,
discr
,
subary
,
ndofs_per_element_
per
_group
),
actx
,
discr
,
subary
,
ndofs_per_element_
by
_group
),
ary
)
@memoize_in
(
actx
,
(
unflatten
,
"
unflatten_prg
"
))
...
...
@@ -228,14 +228,14 @@ def unflatten(actx: ArrayContext, discr: "_Discretization", ary,
"
result[iel, idof] = ary[grp_start + iel*ndofs_per_element + idof]
"
,
name
=
"
unflatten
"
)
if
ndofs_per_element_
per
_group
is
None
:
ndofs_per_element_
per
_group
=
[
if
ndofs_per_element_
by
_group
is
None
:
ndofs_per_element_
by
_group
=
[
grp
.
nunit_dofs
for
grp
in
discr
.
groups
]
group_sizes
=
[
grp
.
nelements
*
ndofs_per_element
for
grp
,
ndofs_per_element
in
zip
(
discr
.
groups
,
ndofs_per_element_
per
_group
)]
in
zip
(
discr
.
groups
,
ndofs_per_element_
by
_group
)]
if
ary
.
size
!=
sum
(
group_sizes
):
raise
ValueError
(
"
array has size %d, expected %d
"
...
...
@@ -254,7 +254,7 @@ def unflatten(actx: ArrayContext, discr: "_Discretization", ary,
for
grp_start
,
grp
,
ndofs_per_element
in
zip
(
group_starts
,
discr
.
groups
,
ndofs_per_element_
per
_group
)])
ndofs_per_element_
by
_group
)])
def
flat_norm
(
ary
:
DOFArray
,
ord
=
2
):
...
...
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