precice / precice

A coupling library for partitioned multi-physics simulations, including, but not restricted to fluid-structure interaction and conjugate heat transfer simulations.
https://precice.org/
GNU Lesser General Public License v3.0
754 stars 184 forks source link

Support for hexahedral mesh primitives #1324

Open fsimonis opened 2 years ago

fsimonis commented 2 years ago

Please describe the problem you are trying to solve.

With the introduction of #1314, we get tetrahedral mesh primitives to describe volumes. However, many codes use hexahedral elements, so we are in a similar situation as #153.

Describe the solution you propose.

Extend the API to support hexahedra.

Similar to the quad-situation, we need to partition them into multiple tetrahedra without introducing additional vertices.

The easiest way is to split it into 5 tetrahedra: 4 corners + 1 centre.

The most difficult part is that we cannot make assumptions regarding the vertex order.

Describe alternatives you've considered

  1. Force the user to split hexahedral meshes into tetrahedra before passing them to preCICE. This is not that complicated, as they have the full information of the vertex order and can thus perform this split more efficiently.
  2. Add full support for hexahedral mesh primitives. For consistency, this should also be done for quads.
boris-martin commented 2 years ago

Are you sure you can split an hexaehedra into 5 tetra ? I'm bad at 3D geometry but I think you need 6 of them to split a cube. Can't we request in the API that the ordering is correct ? That's how it's done in CalculiX for instance.

Full support looks ideal in the long run, but that would be a significant work to adapt all the mappings, integrals, exporters, ... Also, the names of "BarycentricBaseMapping" and "LinearCellInterpolation" would become inappropariate, since mappingon a quad/hexa is not linear anymore.

fsimonis commented 2 years ago

Pick a diagonal and use it as a starting point to cut two corners off. Then flip, turn by 90 degrees and repeat the corner cutting. The remaining shape has 4 triangular faces and is the central tetrahedron.

uekerman commented 2 years ago

There is tons of literature on this, e.g. https://arxiv.org/pdf/1801.01288.pdf

fsimonis commented 2 years ago

@uekerman and I discussed this issue today and concluded to wait with this feature for user-requests.

For the time being

If you have a hexahedral mesh, then you simply need to split each hexahedron yourself. Generally, you will have more information about the vertex layout than preCICE and is thus easier (and cheaper) for you. This will become more efficient once we implement setMeshTetrahedra.