def get_continuous_object(grid_func,
xmin=LOCAL_XMIN,xmax=LOCAL_XMAX,
c2s=None):
"""
Maps the grid function grid_func, which is any field defined
on the colocation points to a continuous function that can
be evaluated.
Parameters
----------
xmin -- the minimum value of the domain
xmax -- the maximum value of the domain
c2s -- The Vandermonde matrix that maps the colocation representation
to the spectral representation
Returns
-------
An numpy polynomial object which can be called to be evaluated
"""
order = len(grid_func)-1
if c2s == None:
s2c,c2s = get_vandermonde_matrices(order)
spec_func = np.dot(c2s,grid_func)
my_interp = poly(spec_func,domain=[xmin,xmax])
return my_interp
# ======================================================================
# ======================================================================
# A convenience class that generates everything and can be called
# ======================================================================
评论列表
文章目录