-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add perpendicular-flap case solid-solids4foam and solid-openfoam #286
Conversation
perpendicular-flap/solid-solids4foam/constant/mechanicalProperties
Outdated
Show resolved
Hide resolved
perpendicular-flap/solid-solids4foam/constant/physicsProperties
Outdated
Show resolved
Hide resolved
Co-authored-by: Gerasimos Chourdakis <[email protected]>
Co-authored-by: Gerasimos Chourdakis <[email protected]>
…idProperties and mechanicalProperties
… D, DD, pointD, ...) as used by solids4foam
…with fluid-openfoam
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for adding a solid-openfoam
case as well! I had some trouble getting the case to run, even though it compiled successfully with v2012 and v2206. Looks also like you accidentally pushed some build artifacts.
perpendicular-flap/solid-openfoam/constant/mechanicalProperties
Outdated
Show resolved
Hide resolved
...ysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C.dep
Outdated
Show resolved
Hide resolved
...ndicular-flap/solid-openfoam/solidDisplacementFoamForce/Make/darwin64ClangDPInt32Opt/options
Outdated
Show resolved
Hide resolved
...lap/solid-openfoam/solidDisplacementFoamForce/solidDisplacementFoamForceFvPatchVectorField.C
Outdated
Show resolved
Hide resolved
...lap/solid-openfoam/solidDisplacementFoamForce/solidDisplacementFoamForceFvPatchVectorField.H
Outdated
Show resolved
Hide resolved
perpendicular-flap/solid-openfoam/solidDisplacementFoamForce/Make/options
Outdated
Show resolved
Hide resolved
...lap/solid-openfoam/solidDisplacementFoamForce/solidDisplacementFoamForceFvPatchVectorField.C
Outdated
Show resolved
Hide resolved
Co-authored-by: Gerasimos Chourdakis <[email protected]>
Co-authored-by: Gerasimos Chourdakis <[email protected]>
Co-authored-by: Gerasimos Chourdakis <[email protected]>
…ementFoamForce/Make/options
…placementFoamForce
…lacementFoamForce on tractionDisplacement
I currently have a very strange issue running the Logs: https://gist.github.com/MakisH/26342b40980ea0c3260ef90110a15295 This run was with:
Other tutorial cases work normally (e.g., the I know that one can ask solids4foam to use the global Eigen installation. I did so by setting @solids4foam did you have any such issues? @fsimonis any clue what could be wrong here, if any, in preCICE? |
Co-authored-by: Gerasimos Chourdakis <[email protected]>
@MakisH This definitely looks like conflicting versions. The callback of the tag uses an instance of Can you somehow see which version of Eigen OpenFOAM is actually using (build logs, compiler invocations or similar maybe?) Alternatively, you could build preCICE with the Eigen version used by OpenFOAM. This sounds like a shorter compilation time. 🥵 |
As Eigen is a header-only library, I am surprised that it is causing a conflict since it is only looked up during compilation, not at run-time (e.g., as like a dynamic library). By the way, can you check if solids4foam works on its own, e.g. run |
FYI, I have tried the following, and it works for me:
I have also tried (and it works):
I wonder if the debug mode of preCICE catches something that gets missed in the optimised version. |
The Debug vs Release mode sounds indeed like something relevant. Building in Release mode, preCICE is initialized normally, but then breaks the next time it uses Eigen. This output is without PETSc, as the error handling seems to obfuscate issues, which also makes the RBF mapping use Eigen. But even building in Release mode with PETSc gives again a segfault. Same situation when solids4foam is built with its own Eigen copy. solids4foam by itself runs fine.
I will try to reproduce the first environment here, but to me this sounds like an actual issue that others will eventually also face. |
Update: the case does run in the preCICE Demo VM, with OpenFOAM v2012. It completes without any issues and I get reasonable results. I would suggest that:
|
It is almost definitely an ODR issue with various versions of Eigen.
The preCICE shared library exports all symbols, which is bad. We are working to change in the future. This means that the linker will treat both versions of Eigen as equal. This consequently leads to the observable issues with the destructor. OpenFOAM downloads Eigen 3.3.7, while preCICE uses the system installation of Eigen. Note that we most likely violate the ODR even with identical versions of Eigen, as we conditionally enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, I don't have any more comments to add, rather than that this was a really nice contribution and review! 😄 Thanks a lot!
@raynoldtan Same issue. You need to tell solid4foam to use the system/spack eigen. https://solids4foam.github.io/installation/installFromSource.html#eigen This needs to point to the same version used by spack. Use |
Hi fsimonis, we have already did this before the compilation of solids4Foam. We have used export EIGEN_DIR=/home/raynoldtan/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.4.0/eigen-3.4.0-4k2lkyslxqecxkljs4yh6t7rcbrsvh7d which points the EIGEN_DIR to where the eigen3.4.0 was installed with spack. This is the same version of eigen that was used to install precice 2.4.0. After the compilation of solids4Foam, we verified that by looking into: /home/raynoldtan/solids4foam-release/ThirdParty/eigen3/share/pkgconfig/eigen3.pc. It shows the path of the eigen library being used. prefix=/home/raynoldtan/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.4.0/eigen-3.4.0-4k2lkyslxqecxkljs4yh6t7rcbrsvh7d Name: Eigen3 But the issue still remains. |
@raynoldtan The EIGEN_DIR is expected to point to the include directory of Eigen. The Eigen repo follows an unusual directory structure. 😉 So you need to append
|
Thanks for letting me know. I changed the export command to now append the /include into the path. export EIGEN_DIR=/home/raynoldtan/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.4.0/eigen-3.4.0-4k2lkyslxqecxkljs4yh6t7rcbrsvh7d/include And then I recompiled the solids4Foam. After that I go to ThirdParty folder to check, It seems correct now. Then I tried to rerun the perpendicular flap case again. But it still give the same issue as:
I not sure if the version of precice used affect this? or the eigen version used will affect this? Raynold |
@raynoldtan The path is still incorrect. It has to look like this The following file must exist: I would manually remove the |
I have removed the eigen3 folder. Then, I set the env variable using the following path: export EIGEN_DIR=/home/raynoldtan/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.4.0/eigen-3.4.0-4k2lkyslxqecxkljs4yh6t7rcbrsvh7d/include/eigen3 After that, I recompiled solids4Foam. Then I get the same directory path for eigen 3 as described by you above: ~/solids4foam-release/ThirdParty/eigen3/Eigen where the file Core is located. Then I tried to rerun the case again. But I still get the same error as above. |
Ok, so there is something else going on. |
Ok thanks for your help anyway. I have included the link below. |
(description by @MakisH)
This adds two solid participant cases in the perpendicular flap tutorial:
solid-openfoam
(using the standard OpenFOAM solver solidDisplacementFoam)solid-solids4foam
(using the solids4Foam solver of solids4foam)Note that this depends on precice/openfoam-adapter#236 and in the nextRelease development line of solids4foam.