 # Local heat flux numerical values

I solved a heat diffusion problem and get a temperature distribution.
I calculate the heat flux at each node and save it to a pvd file with:

``````n = FacetNormal(mesh)
V = VectorFunctionSpace(mesh, 'P', 1)
vtkfile_q << qw
``````

However the in Paraview I do not have access to the x, y and z components of the heat flux. How can I get them?
Also, I get the local heat flux on one boundary with

``````qb =  dot(n, qw) * ds_bc(association_table["base"])
``````

and I would like to get the numerical values of qb in an array for further processing.
However, the dot product has neither vector() or get_local() methods.
How could I achieve this?

The solution was:

``````V = VectorFunctionSpace(mesh, 'P', 1)
qw_x, qw_y, qw_z = qw.split(deepcopy=True)  # extract components
Heat_Flux_z = Function(V, name='Heat_Flux_z')
Heat_Flux_z.assign(qw_z)

# Unique vertices of the line (by indices)
V = FunctionSpace(mesh, 'P', 1)
vs = list(set(sum((f.entities(0).tolist() for f in SubsetIterator(boundaries, association_table["htc"])), [])))
# Get degrees of freedom associated to vertices (by indices)
v2d = vertex_to_dof_map(V)
d = v2d[vs]
nd = V.dim()
dim = mesh.geometry().dim()
coordinates = V.tabulate_dof_coordinates()
coordinates.resize((nd, dim))
xyz = coordinates[d]
# Dof values
qw_z_array = np.array(qw_z.vector())[d]
``````