Hello
I have difficulties to recover a flow vector following the normal order of coordinates numbering of the nodes
numElems = 1
l = 1
mesh = RectangleMesh(Point(0,0),Point(l,l), numElems, numElems,"left")
Q_heat = 0.4e3
g = Expression('Q_heat', degree=1, Q_heat=Constant(Q_heat))
x = SpatialCoordinate(mesh)
class Left_bottom(SubDomain):
def inside(self, x, on_boundary):
return on_boundary and (abs(x[0] - 0.) < DOLFIN_EPS) or (abs(x[1] - 0) < DOLFIN_EPS)
vertical = Left_bottom()
tdim = mesh.topology().dim()
boundaries = MeshFunction('size_t', mesh, tdim-1)
boundaries.set_all(0)
vertical.mark(boundaries, 1)
dsB = Measure("ds", subdomain_id=1, subdomain_data=boundaries)
V = FunctionSpace(mesh, "CG", 1)
v = TestFunction(V)
flux = g*v*dsB
Flux = assemble(flux)
print(Flux.get_local())
the value I must have is
Flux0 =[400, 200 ,200, 0.0 ]
while recovering it and saving it in excel file, I have
Flux0 =(np.array(Flux))
Flux0 =[0.0, 200 ,200, 400 ]
This does not follow the order of the coordinates of the nodes of the mesh
My question is which function to use to recover it ?