fenics-adapter icon indicating copy to clipboard operation
fenics-adapter copied to clipboard

Restrictions on using adapter for 3D cases

Open IshaanDesai opened this issue 3 years ago • 7 comments

Functionality to handle 3D cases was introduced in the adapter with https://github.com/precice/fenics-adapter/pull/133, https://github.com/precice/fenics-adapter/pull/146 and https://github.com/precice/fenics-adapter/pull/147

However there are still several restrictions on the use of this functionality. The restrictions are:

  1. When quantities on the coupling boundaries are a set of PointSource objects, the adapter can used for 3D cases but it can only be run in serial. Parallel runs using MPI are forbidden. More information regarding this can be found in this Discourse post. It is expected that using FEniCS-X will resolve this problem.
  2. When quantities on the coupling boundaries are of the type of an Expression object, the adapter cannot be used in 3D. Only 2D cases are possible in this case. The main reason for this is the way in which we manually construct the interpolant. A more general strategy would help lift this restriction. Check out the issue: https://github.com/precice/fenics-adapter/issues/119 for one such idea.

IshaanDesai avatar Feb 06 '22 17:02 IshaanDesai

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/3d-coupling-of-fenics-watchpoint-function-of-output-forces-and-serial-coupling-procedure/1018/4

precice-bot avatar Apr 13 '22 07:04 precice-bot

I'm just providing a brief update on this from my current perspective today, because I just received a request by a user and I think it's useful to summarize this here:

Why is it complicated to do 3D cases in FEniCS with the adapter?

I think it might be complicated to set up a 3D case for several reasons:

  1. We currently don't have a lot of experience with 3D cases in FEniCS. There are also no corresponding tutorials.
  2. Parallelization might need updates to be able to handle 3D cases. Especially w.r.t mesh connectivity and the construction of ghost layers.
  3. Turning data that preCICE provides intro fuctions that FEniCS can use as boundary conditions might need some updates. Using data without mesh connectivity and, therefore, only simple mapping strategies should be relatively straightforward.

Generally I don't think there are a fundamental problem, but the actual implementation requires some work. For details on parallelization and data mapping see our FEniCS adapter paper.

BenjaminRodenberg avatar Feb 17 '23 07:02 BenjaminRodenberg

Added the "student" label, because I think it might be a nice thesis topic to actually create a 3D tutorial + extend the adapter correspondingly.

BenjaminRodenberg avatar Feb 17 '23 07:02 BenjaminRodenberg

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/capabilities-of-adapters-for-3d-cht/1310/3

precice-bot avatar Feb 27 '23 09:02 precice-bot

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/capabilities-of-adapters-for-3d-cht/1310/4

precice-bot avatar Feb 28 '23 09:02 precice-bot

Here is a rough plan on how someone could start working on this issue:

  • Comment out the assertions that enforce 2D and see where problems pop up. SegregatedRBFInterpolationExpression, for example, should work with minor modifications already in 3D.

  • Follow the test-driven-development path, if you want. At some point we need tests in any case and I think here it really helps to get started quickly. (For example, by creating a 3d version of the following test and see what happens: https://github.com/precice/fenics-adapter/blob/8a21819bd5c567854e809acfadcd1e75bf539640/tests/unit/test_adapter_core.py#L36-L81

  • What's also important: For testing we would need to come up with a simple 3D tutorial case. But I imagine one could start with a modified version of the flow-over-heated-plate tutorial.

BenjaminRodenberg avatar Oct 03 '23 13:10 BenjaminRodenberg

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/automatic-differentiation-of-coupled-system/1601/2

precice-bot avatar Oct 06 '23 07:10 precice-bot