From 309e7f84cfe360280f7f78433a11d97b2144860d Mon Sep 17 00:00:00 2001 From: seogi_macbook Date: Fri, 25 Sep 2015 23:29:17 -0700 Subject: [PATCH] fix poly map --- SimPEG/Maps.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/SimPEG/Maps.py b/SimPEG/Maps.py index c96bc827..15504094 100644 --- a/SimPEG/Maps.py +++ b/SimPEG/Maps.py @@ -752,18 +752,18 @@ class PolyMap(IdentityMap): raise(Exception("Input for normal = X or Y or Z")) #3D elif self.mesh.dim == 3: - # X = self.mesh.gridCC[:,0] - # Y = self.mesh.gridCC[:,1] - # Z = self.mesh.gridCC[:,1] - # if self.normal =='X': - # f = polynomial.polyval2d(Y, Z, c.reshape((self.order[0]+1,self.order[1]+1))) - X - # elif self.normal =='Y': - # f = polynomial.polyval2d(X, Z, c.reshape((self.order[0]+1,self.order[1]+1))) - Y - # elif self.normal =='Z': - # f = polynomial.polyval2d(X, Y, c.reshape((self.order[0]+1,self.order[1]+1))) - Z - # else: - # raise(Exception("Input for normal = X or Y or Z")) - # else: + X = self.mesh.gridCC[:,0] + Y = self.mesh.gridCC[:,1] + Z = self.mesh.gridCC[:,2] + if self.normal =='X': + f = polynomial.polyval2d(Y, Z, c.reshape((self.order[0]+1,self.order[1]+1))) - X + elif self.normal =='Y': + f = polynomial.polyval2d(X, Z, c.reshape((self.order[0]+1,self.order[1]+1))) - Y + elif self.normal =='Z': + f = polynomial.polyval2d(X, Y, c.reshape((self.order[0]+1,self.order[1]+1))) - Z + else: + raise(Exception("Input for normal = X or Y or Z")) + else: raise(Exception("Only supports 2D"))