Is there any obvious way in numpy to replace something like:
for x in X:
xi, xj = meshgrid(x, x, indexing='ij')
with a single (and possibly more efficient) operation like:
Xi, Xj = multi_meshgrid(X, X, indexing='ij')
The example of X is the following:
X = np.array([[0,1,2,3,4,5], [5,6,7,8,9,10], [11,12,13,14,15], ...])
The main problem is that i can have tens and hundreds of thousands of entries in X and possibly operation is often repeated.
The problem arises from assembling global stiffness matrix K in finite element method. For each entry in X of length n i have a matrix "n x n" which i have to inscribe into this global matrix. This matrix is in scipy.sparse coordinate format.
Regards, Marek