mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-09 11:34:26 +08:00
CylMesh interpolation tests.
This commit is contained in:
@@ -144,6 +144,21 @@ def dependentProperty(name, value, children, doc):
|
||||
setattr(self, name, val)
|
||||
return property(fget=fget, fset=fset, doc=doc)
|
||||
|
||||
|
||||
def asArray_N_x_Dim(pts, dim):
|
||||
if type(pts) == list:
|
||||
pts = np.array(pts)
|
||||
assert type(pts) == np.ndarray, "pts must be a numpy array"
|
||||
|
||||
if dim > 1:
|
||||
pts = np.atleast_2d(pts)
|
||||
elif len(pts.shape) == 1:
|
||||
pts = pts[:,np.newaxis]
|
||||
|
||||
assert pts.shape[1] == dim, "pts must be a column vector of shape (nPts, %d) not (%d, %d)" % ((dim,)+pts.shape)
|
||||
|
||||
return pts
|
||||
|
||||
def requires(var):
|
||||
"""
|
||||
Use this to wrap a funciton::
|
||||
|
||||
Reference in New Issue
Block a user