# Space elements order through numpy

• alecontri
• New Member
• 4 months 3 weeks ago - 4 months 3 weeks ago #4529
Hi,

I was doing a convergence test, feeding the elements of a numpy array as the parameter "order" in the space definition. I noticed that no matter the number I was giving, the convergence was as if order = 1. This is a simple example where I show the order before and after the space definition:

Code:
import numpy as np from ngsolve import * from netgen.geom2d import unit_square from netgen.geom2d import SplineGeometry geo = SplineGeometry() geo.AddRectangle( (0, 0), (1, 1), bcs = ("bottom", "right", "top", "left")) mesh = Mesh(unit_square.GenerateMesh(maxh=0.1)) mesh.Curve(1) order_n = np.array() print(order_n) V = H1(mesh, order=order_n, dirichlet="bottom|right|left|top") print(V.globalorder)

Is it a bug or is it supposed to be like this (of course writing
Code:
order=int(order_n)
solved the problem)?

Thanks a lot
Last edit: 4 months 3 weeks ago by alecontri.

• christopher
• Offline
• 