CylMesh interpolation tests.

This commit is contained in:
rowanc1
2014-04-16 12:28:40 -07:00
parent 3a0942e616
commit a48808f58a
4 changed files with 117 additions and 26 deletions
+15
View File
@@ -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::