libMesh / libmesh

libMesh github repository
http://libmesh.github.io
GNU Lesser General Public License v2.1
651 stars 285 forks source link

Variable defined on sides #2175

Open YaqiWang opened 5 years ago

YaqiWang commented 5 years ago

We have an application requires to store quantities defined on element sides. These quantities are discontinuous on the two side of the sides and can be discontinuous on the node (2D) or edge (3D). It is very painful to manage these quantities on our own especially with MPI (not mentioning adaptive mesh refinement).

I have an idea to let framework support this: We have a normal mesh (d-dimensional), from which we can optionally derive a secondary d-1 dimensional mess containing all the side elements. From the primal mesh with an element and a local side ID, we can retrieve the element on the secondary mesh, and from an element of the secondary mesh, we can obtain the primal element and local side. Then we can define variables on this secondary mesh. We can support bunch of operations from primal variables to secondary variables or vice versa, like a trace operation.

roystgnr commented 5 years ago

It'd be ideal to have an FE type for side-defined quantities. (Probably two types while we're at it; there are other use cases where you want the quantities to be continuous from one side to the other) That way you could use it in coupled solves, not just for decoupled data storage, and even in the decoupled case you wouldn't have to worry so much about keeping a second mesh in sync.

How urgent is this? I'm still going to be a while catching up on things I'd postponed while I was out.

YaqiWang commented 5 years ago

Not urgent. @loganharbour wants to have this for his research. We can have some workaround for this, like using multiple (the number of maximum sides of all elements on the mesh) standard variables to store the quantities. This is something we would love to have in a long run. If we can avoid refactoring later, it will be great, but we can live with it.

jwpeterson commented 4 years ago

@YaqiWang I was looking through the tickets and came across this. I added support for sideset data to the Exodus reader in #2233, maybe you would find that useful.

YaqiWang commented 4 years ago

Thanks for letting me know @jwpeterson ;-)

lindsayad commented 3 years ago

I would be interested in the continuous variety

roystgnr commented 3 years ago

Not sure how the discussion didn't make it into this ticket, but for future reference/archival:

This would be fairly easy to do in cases where users are only going to evaluate the side variables on the interiors of sides, away from sides-of-sides (edges in 3D, vertices in 2D), which seems to be the only evaluation points we have any current user interest in. On sides-of-sides, though, the solutions, even for continuous-between-element-and-neighbor versions of side variables, become discontinuous-between-side-and-adjoining-side. Our best short term solution there will be to scream and die if anyone tries to evaluate a point within TOLERANCE (in master space) of a side-of-side. And in the long term we'll need a special case in fe_boundary.C, to evaluate these solutions at different points depending on which side we're evaluating them from (e.g. translating the points in master space outward by 0.001 times the normal), so that the FE implementations can distinguish between e.g. edge points evaluated from one side sharing the edge and edge points evaluated from the other.