diff --git a/meshmode/mesh/processing.py b/meshmode/mesh/processing.py index 0c0a8e8db429224488ec483e322821dcaa4470ab..cfdec7fa4a32255def70473e7175186bcebbaff2 100644 --- a/meshmode/mesh/processing.py +++ b/meshmode/mesh/processing.py @@ -273,9 +273,15 @@ def merge_dijsoint_meshes(meshes, skip_tests=False): # {{{ affine map -def affine_map(mesh, A=None, b=None): +def affine_map(mesh, A=None, b=None): # noqa """Apply the affine map *f(x)=Ax+b* to the geometry of *mesh*.""" + if A is None: + A = np.eye(mesh.ambient_dim) # noqa + + if b is None: + b = np.zeros(A.shape[0]) + vertices = np.einsum("ij,jv->iv", A, mesh.vertices) + b[:, np.newaxis] # {{{ assemble new groups list