From dd579ddbd4c93bde2fc9ddb9933aefa334d91697 Mon Sep 17 00:00:00 2001 From: rowanc1 Date: Tue, 15 Apr 2014 15:12:19 -0700 Subject: [PATCH] minor updates in interpolation in TensorMesh --- SimPEG/Mesh/TensorMesh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SimPEG/Mesh/TensorMesh.py b/SimPEG/Mesh/TensorMesh.py index 4d1b16a2..a8e29768 100644 --- a/SimPEG/Mesh/TensorMesh.py +++ b/SimPEG/Mesh/TensorMesh.py @@ -220,8 +220,12 @@ class BaseTensorMesh(BaseRectangularMesh): if type(loc) == list: loc = np.array(loc) assert type(loc) == np.ndarray, "must be a numpy array" + + if loc.size == self.dim: + loc = np.atleast_2d(loc) + if self.dim > 1: - assert loc.shape[1] == self.dim, "must be a column vector of shape (nPts, mesh.dim)" + assert loc.shape[1] == self.dim, "must be a column vector of shape (nPts, mesh.dim) not (%d,%d)" % loc.shape elif len(loc.shape) == 1: loc = loc[:,np.newaxis] else: