Skip to content

Commit 8c65687

Browse files
committed
face_mass: materialize the input DOF array
1 parent 804df7e commit 8c65687

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

meshmode/array_context.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,27 @@ def _get_fake_numpy_namespace(self):
602602
def transform_dag(self, dag):
603603
from pytato.array import Einsum
604604

605+
# {{{ face_mass: materialize einsum args
606+
607+
def materialize_face_mass_vec(expr):
608+
if isinstance(expr, pt.Einsum):
609+
my_tag, = expr.tags_of_type(pt.tags.EinsumInfo)
610+
if my_tag.spec == "ifj,fej,fej->ei":
611+
mat, jac, vec = expr.args
612+
return pt.einsum("ifj,fej,fej->ei",
613+
mat,
614+
jac,
615+
vec.tagged(pt.tags
616+
.ImplementAs(pt.tags.ImplStored())))
617+
else:
618+
return expr
619+
else:
620+
return expr
621+
622+
dag = pt.transform.map_and_copy(dag, materialize_face_mass_vec)
623+
624+
# }}}
625+
605626
# {{{ materialize
606627

607628
nusers = pt.analysis.get_nusers(dag)

0 commit comments

Comments
 (0)