Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7a9c6cbc authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

genfem: fix python

parent 4c85745e
Branches
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ def nodes(shape, **kwargs):
if imin > imax:
return np.array([], dtype=np.integer, ndmin=len(shape))
# computing the indices
node = np.zeros([imax+1-imin for imin, imax in lim], dtype=np.integer)
node = np.zeros([imax+1-imin for imin, imax in lim], dtype=np.int64)
grid = np.ix_(*[range(imin, imax+1) for imin, imax in lim])
node += grid[0]
for g, l in zip(grid[1:], np.cumprod(shape)):
......@@ -160,10 +160,10 @@ def mesh_rect(shape, **kwargs):
"""
shape = np.array(shape, ndmin=1).tolist()
# in each direction, nElem = nNode-1
node = nodes(shape, **kwargs)[[np.s_[:-1]]*len(shape)].ravel()
node = nodes(shape, **kwargs)[tuple(slice(None, -1) for _ in shape)].ravel()
# the nodes of element e are N(e) = e+N(0)
neighbors = nodes(shape, lim=[[0, 1]]*len(shape)).ravel()
return np.vstack(node+v for v in neighbors)
return np.vstack([node+v for v in neighbors])
# Then, we compute the element matrix
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment