Boundary face pts

Hello,

how is it possible to access the face points that are on a boundary interface?
I tried looking into _scal_lhs in the BC class but it has the face pts of all the sides of the element while I’m interested in getting only those of the boundary side.

Is this something already implemented?

Best regards

Yes, you want to use the _scal_lhs view that is part of the relevant BC instance. It only contains references to flux points which are on that boundary.

Regards, Freddie.

It actually contains all the element in the mesh and has shape (nfpts, nvars, neles). I was looking only for the boundary elements and only the fpts of the boundary (nfpts / 4 in the case of a quad for example). Extracting boundary elements is straightforward but I’m stuck on extracting only the fpts of the boundary

Best regards

No, it does not. It only contains the flux point information for the points on the boundary (obviously; otherwise how would boundary conditions even function!?!).

The variable comes from here:

which ends up calling:

which in turn calls:

where one can clearly see the fidx argument which indicates the face number on the boundary. Applying this to get_scal_fpts_for_inter we have:

which determines the number of flux points on that particular face for that particular element and returns their indices. The _view method then glues all of this together into one big list of flux points after applying any required permutations.

Regards, Freddie.

1 Like

Hi @fdw,

thanks a lot for the very explanatory answer, I definitely believe that my mistake is in how I access those informations: namely self._scal_lhs._mats[0].get() but it returns (nfpts, nvars, neles) which is the full fpts array.
What is the correct way?

Best regards

The array itself is a View and so only contains pointers to the underlying data arrays. When you call get on a view all you obtain are the indices into the actual data arrays.

Regards, Freddie.

Could you provide a MWE to access the fpts for a given boundary?

Best regards

There is no direct means of accomplishing this from the Python side. On the kernel side of things you can look at any of the interface kernels, basically any kernel which takes a view as an argument.

Regards, Freddie.

1 Like