From 9fc13b9048144784e3975eaeb8fd34fd14e7762e Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Wed, 29 Apr 2015 02:17:25 -0500 Subject: [PATCH] Make A and b in affine_map genuinely optional --- meshmode/mesh/processing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meshmode/mesh/processing.py b/meshmode/mesh/processing.py index 0c0a8e8d..cfdec7fa 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 -- GitLab