Skip to content

Commit 8fe25b2

Browse files
committed
[wip]: Adds a failing test needed for grudge
1 parent 55901b0 commit 8fe25b2

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

test/test_transform.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
__copyright__ = "Copyright (C) 2024 Kaushik Kulkarni"
2+
3+
__license__ = """
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
THE SOFTWARE.
21+
"""
22+
23+
import pytato as pt
24+
import numpy as np
25+
26+
27+
def test_push_indirections_on_dg_flux_terms():
28+
nel = 1000
29+
ndof = 35 # we love 3D-P4 cells
30+
n_intface = 2800
31+
n_facedof = 20
32+
n_face = 4
33+
34+
u1 = pt.make_placeholder("u1", (nel, ndof))
35+
u2 = pt.make_placeholder("u2", (nel, ndof))
36+
u = u1 + u2
37+
from_el_indices = pt.make_placeholder("from_el_indices",
38+
n_intface,
39+
np.int32)
40+
dof_pick_list_indices = pt.make_placeholder("dof_pick_list_indices",
41+
n_intface,
42+
np.int32)
43+
dof_pick_lists = pt.make_placeholder("dof_pick_lists",
44+
(n_face, n_facedof),
45+
np.int32)
46+
result = u[from_el_indices.reshape(-1, 1),
47+
dof_pick_lists[dof_pick_list_indices]]
48+
transformed = pt.push_axis_indirections_towards_materialized_nodes(result)
49+
assert transformed == (u1[from_el_indices.reshape(-1, 1),
50+
dof_pick_lists[dof_pick_list_indices]]
51+
+ u2[from_el_indices.reshape(-1, 1),
52+
dof_pick_lists[dof_pick_list_indices]])

0 commit comments

Comments
 (0)