Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we create Expression / function representation for boundary conditions properly? #4

Closed
BenjaminRodenberg opened this issue Oct 19, 2018 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@BenjaminRodenberg
Copy link
Member

Our FEniCS adapter uses Expressions to define Dirichlet and Neumann boundary conditions. Since preCICE only provides nodal data, we implemented the class CustomExpression to be able to create a functional representation (an Expression) from nodal data.

In our implementation RBFs are used for interpolation (see eval function). However, this approach is not ideal when considering the whole coupled simulation from a broader perspective:

preCICE already uses interpolation to map data from the coupling partner's mesh to the FEniCS mesh (if the meshes are not matching). However, the interpolant is hidden in preCICE and, therefore, we have to perform an additional interpolation step on the FEniCS side to create an interpolant that may be used by FEniCS for defining boundary conditions.

Some first ideas:

  • Does FEniCS allow defining boundary conditions / expressions from nodal data instead of functions?
  • Can we directly access the interpolant inside preCICE to avoid the additional interpolation step?
@BenjaminRodenberg BenjaminRodenberg added the question Further information is requested label Oct 19, 2018
@BenjaminRodenberg
Copy link
Member Author

BenjaminRodenberg commented Nov 29, 2018

If we take a look at https://github.com/precice/tutorials/issues/13#issuecomment-443029988, we see that RBF functions are not necessarily the ideal choice for interpolation.

If we use linear interpolation instead, we need connectivity information and we have to generalize the implementation in f69a016 to support arbitrary coupling interfaces. Currently only straight boundaries that are parallel to the y-axis are supported.

Using linear interpolation with connectivity information allows us to use the nearest projection mapping, in the end. This will be helpful for working on https://github.com/precice/tutorials/issues/11.

@uekerman
Copy link
Member

uekerman commented Dec 5, 2018

Can we directly access the interpolant inside preCICE to avoid the additional interpolation step?

Not really. Also, another problem then would be how to convert this interpolant to a description that FEniCS understands.

Does FEniCS allow defining boundary conditions / expressions from nodal data instead of functions?

Can we ask on a FEniCS mailing list? This should be a quite natural feature. Also needed if you want to read boundary conditions from a file etc., so others should also have this problem.

This should not be something to implement in the adapter, but directly in FEniCS.

@BenjaminRodenberg
Copy link
Member Author

BenjaminRodenberg commented Jun 3, 2019

Another possible approach for creating an interpolant from point data: use (generalized) moving least squares. See work of Paul Kuberry for more details. Compadre toolkit offers a Python Interface and might be useful.

@BenjaminRodenberg
Copy link
Member Author

If we create a piecewise linear interpolant (like e.g. here), this has a major problem: The FEniCS solver always "sees" a piecewise linear function, even if the point data that we interpolate does not originate from such a function. If we, for example, use a second or higher order function space as finite element basis (see here), this will lead to problems like an incorrect flux computation. We should use higher order interpolation instead (see here) to avoid problems.

@BenjaminRodenberg
Copy link
Member Author

In Nutils, we can simply use the Gauss Points of the function. This completely avoids an additional interpolation step inside the adapter. See here.

@BenjaminRodenberg
Copy link
Member Author

The fenics-adapter now provides means for the user to choose between the two strategies RBF interpolation and polynomial interpolation (7afb0e0).

@BenjaminRodenberg
Copy link
Member Author

BenjaminRodenberg commented Aug 14, 2019

In #38 FEniCS' PointSource has been used for correctly dealing with point sources (e.g. nodal forces) that are mapped in a conservative fashion. This is an alternative strategy to the interpolation of point data as explained above. Note that the approach based on interpolation gave wrong results and the approach using a PointSource is the correct one.

More details on this will follow in the thesis of @richahert

@BenjaminRodenberg
Copy link
Member Author

This issue is closed by #83. @richahert 's thesis can be found here: https://mediatum.ub.tum.de/node?id=1520579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants