Calculating the shear stress

I’m trying to calculate the shear stress and the normal stress imposed by a fluid flow on an arbitrary domain.

A simplified version of my problem would be to do the same in the Test problem 1(Poiseuille flow) of the tutorial

The closest post that I could find related to that was this but they have used fixed values for velocity components.

However, if we think about an arbitrary domain and we will not be able to do that. As far as I know, the shear stress is something like:
image

Where:
[t_x t_y] is the tangent vector and [n_x\; n_y] is the normal vector.
P is the pressure at the given location

Thus, if I’m thinking about an arbitrary domain and a location, I would need these vectors in each element (cell) in the mesh as well as the tress tensor (The 2\times 2 matrix)

So, can I please know whether we have a good way to compute those values. Or is the shear stress value calculation baked into the FEniCSx solver?.