tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

WIP: aste Replay Mode tutorial on elastic flap case

Open richahert opened this issue 4 years ago • 6 comments

This PR adds an tutorial for aste. From the OpenFOAM-FEniCS-FSI tutorial OpenFOAM is replaced with aste that sends previously exported results to FEniCS.

richahert avatar Mar 09 '20 12:03 richahert

Try to merge the develop branch into your branch https://github.com/richahert/tutorials/tree/aste. Then, the changes here should be easier to overlook. What is your overall plan, to create a new tutorial ASTE-OpenFOAM or to explain how to generate such a tutorial from OpenFOAM-FEniCS?

uekerman avatar Mar 10 '20 14:03 uekerman

Note @richahert: I can take care of applying the changes on my own. I just need some help with the --vectordata option.

The option seems to have been removed in https://github.com/richahert/aste/commit/94537d4bff9c0f389db37e70c8a8bfeabd4ec255. Whether we are dealing with scalar or vector data is detected automatically.

If I remove the --vectordata option, I run into a Segmentation Fault:

benjamin@benjamin-ThinkPad-X1-Yoga-2nd:~/tutorials/FSI/flap_perp/ASTE$ preciceMap -v -c precice-config.xml -p A --mesh preCICE-output/Solid-fenics
2020-05-08 15:35:47,693 VERBOSE-1 [default] Basename: preCICE-output/Solid-fenics
2020-05-08 15:35:47,693 DEBUG [default] [benjamin@unknown-host] [std::vector<std::__cxx11::basic_string<char> > getMeshes(std::__cxx11::string, int)] [/home/benjamin/aste/src/preciceMap.cpp:48] Meshes:
(0) 15:35:47 [impl::SolverInterfaceImpl]:120 in configure: This is preCICE version 2.0.2
(0) 15:35:47 [impl::SolverInterfaceImpl]:121 in configure: Revision info: v2.0.1-146-g15fb6857-dirty
(0) 15:35:47 [impl::SolverInterfaceImpl]:122 in configure: Configuring preCICE with configuration "precice-config.xml"
(0) 15:35:47 [impl::SolverInterfaceImpl]:123 in configure: I am participant "A"
[benjamin-ThinkPad-X1-Yoga-2nd:05121] *** Process received signal ***
[benjamin-ThinkPad-X1-Yoga-2nd:05121] Signal: Segmentation fault (11)
[benjamin-ThinkPad-X1-Yoga-2nd:05121] Signal code: Address not mapped (1)
[benjamin-ThinkPad-X1-Yoga-2nd:05121] Failing at address: (nil)
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f0d25207890]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 1] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv+0x0)[0x7f0d24a86470]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 2] preciceMap(_ZN2el4base14MessageBuilderlsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x1c)[0x55bfb106f1bc]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 3] preciceMap(_ZN2el4base6WriterlsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERS1_RKT_+0x33)[0x55bfb106ffab]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 4] preciceMap(_Z12readMainFileR4MeshRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x126)[0x55bfb10641b9]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 5] preciceMap(_Z8readMeshRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x60)[0x55bfb1064b30]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 6] preciceMap(main+0x3dd)[0x55bfb10650b4]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f0d24378b97]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] [ 8] preciceMap(_start+0x2a)[0x55bfb106364a]
[benjamin-ThinkPad-X1-Yoga-2nd:05121] *** End of error message ***
Segmentation fault (core dumped)

I think this is an error on my side, since the data is not provided correctly. I will try to debug this now and I might comment in https://github.com/precice/aste/pull/9 or open an issue in https://github.com/precice/aste. A Segmentation Fault should, of course, be avoided.

BenjaminRodenberg avatar May 08 '20 13:05 BenjaminRodenberg

I forgot converting the data using precice_to_aste.py. After doing this and removing the --vectordata option, everything worked perfectly :+1:

I will report the issue with the segmentation fault upstream. This is not related to this PR. edit: see https://github.com/precice/aste/issues/11

The only remaining point is whether or not (and where) FSI/cylinderFlap/OpenFOAM-FEniCS/Postprocessing/plot_tip.py should be deleted. Then this PR is ready to merge.

I would suggest to wait for https://github.com/precice/aste/pull/9 before merging this PR, since without the feature being implemented in aste this tutorial does not really help.

BenjaminRodenberg avatar May 08 '20 14:05 BenjaminRodenberg

This now would need to be adjusted to the new tutorials structure.

MakisH avatar Apr 15 '21 21:04 MakisH

I moved the files from the old structure to the new structure. This PR is currently not working. It might be helpful to go back to a7a3dd5 to see what the expected behavior is and to find out how paths, variable names etc. have to be mapped to the new structure.

BenjaminRodenberg avatar Jul 01 '21 07:07 BenjaminRodenberg

Since this PR is idle some time, here is a quick status update:

  • Currently ASTE is under a major revision, therefore this PR is waiting. Replay mode is still on the list of features that we would like to implement in the future.
  • We might implement replay mode by modifying this PR or by creating a new one (using a big part of this PR as a starting point). We should make sure that the contributions by @richahert also show up in the history of a new PR, if we crate one.
  • In the end, replay mode should work with any solid-* solver. Therefore, the only change that should be applied to the FEniCS solver, for example, is that a different configuration file should be used (not precice-config.xml but precice-config-aste.xml). I guess that the (many) code changes in solid.py (computation of stresses, removing checkpointing) were due to development. The adapter should be able to handle the correct treatment of checkpointing on its own. Computation of stresses is not required, if I understand it correctly.
  • @DavidSCN and @kursatyurt will take care of replay mode. I'm available for reviews, if needed.

BenjaminRodenberg avatar Dec 06 '21 08:12 BenjaminRodenberg