FEniCS / ufl

UFL - Unified Form Language
https://fenicsproject.org
GNU Lesser General Public License v3.0
97 stars 64 forks source link

Add Numpy-like functions #280

Open bleyerj opened 4 months ago

bleyerj commented 4 months ago

I found it sometimes painful to use UFL when reshaping matrix/vectors, etc.

It would be useful to have UFL functions mimicking numpy like behavior such as: flatten, reshape, vstack, hstack, concatenate, etc.

I would be happy to make a proposal if we agree on this

dham commented 4 months ago

Presumably all of these are syntactic sugar for combinations of indexing on the one hand, and as_vector and as_tensor on the other. That being the case, this seems fairly unobjectionable.