Hi ,guys!!
I am writing the output file to a csv file.
At first, I output u. bp4 file.
Import u.bp4 into Paraview, and then export it as u.csv using Paraview.
This is my first method of obtaining csv files.
The second method is to output directly in dolfinx
code are as follows:
WW = fem.functionspace(msh, (“Discontinuous Lagrange”, 2, (gdim,)))
dof_coordinates = WW.tabulate_dof_coordinates()
out = open(“u.csv”, “w”)
for x, val in zip(dof_coordinates, u_vis.x.array):
print(f"{x[0]},{x[1]},{x[2]},{val} ", file=out)
out.close()
But what format do I want:
X , Y , Z , u_x ,u_y , u_z
1 , 1 , 2 , 0.1 , 0.2 , 0.3
1 , 2 , 3 , 0.2 , 0.2 , 0.3
where u_x is x component of u.
How can I obtain the component of u?
I found that the number of coordinate points in the u. csv file obtained by method 1 is higher than method 2.
The visual results of the two are the same.This means that there are duplicate points being output, which is caused by DG.
Is there an explanation for this phenomenon?