# discretize.CylindricalMesh.get_interpolation_matrix#

CylindricalMesh.get_interpolation_matrix(loc, location_type='cell_centers', zeros_outside=False, **kwargs)[source]#

Construct interpolation matrix from mesh

This method allows the user to construct a sparse linear-interpolation matrix which interpolates discrete quantities from mesh centers, nodes, edges or faces to an arbitrary set of locations in 3D space. Locations are defined in cylindrical coordinates; i.e. $$(r, \phi, z)$$.

Parameters
loc(n_pts, dim) numpy.ndarray

Location of points to interpolate to in cylindrical coordinates ; i.e. $$(r, \phi, z)$$

location_typestr

What discrete quantity on the mesh you are interpolating from. Options are:

• ‘Ex’, ‘edges_x’ -> x-component of field defined on x edges

• ‘Ey’, ‘edges_y’ -> y-component of field defined on y edges

• ‘Ez’, ‘edges_z’ -> z-component of field defined on z edges

• ‘Fx’, ‘faces_x’ -> x-component of field defined on x faces

• ‘Fy’, ‘faces_y’ -> y-component of field defined on y faces

• ‘Fz’, ‘faces_z’ -> z-component of field defined on z faces

• ‘N’, ‘nodes’ -> scalar field defined on nodes

• ‘CC’, ‘cell_centers’ -> scalar field defined on cell centers

• ‘CCVx’, ‘cell_centers_x’ -> x-component of vector field defined on cell centers

• ‘CCVy’, ‘cell_centers_y’ -> y-component of vector field defined on cell centers

• ‘CCVz’, ‘cell_centers_z’ -> z-component of vector field defined on cell centers

zeros_outsidebool

If False , nearest neighbour is used to compute the value for locations outside the mesh. If True , values outside the mesh will be equal to zero.

Returns
(n_pts, n_loc_type) scipy.sparse.csr_matrix

The interpolation matrix