coupling with salome-meca 2019

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
seirov
Posts: 9
Joined: Tue Jul 07, 2015 6:42 pm

coupling with salome-meca 2019

Post by seirov »

Hello all,

From time to time, I try to install CS coupled with salome-meca, and always with no success :cry:

I am an aeronautical and mechanical engineer, using linux for years but no idea about python, so it would be great if saturne and salome-meca came already coupled together in one package, from a real developer...

In any case, I have tried it to do it myself, so first I edit the .configure and add

Code: Select all

--with-salome=/opt/salome_meca/V2019.0.3_universal
launch the compilation and it stops with

Code: Select all

  program name = '/usr/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python'
  sys.base_prefix = '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365'
  sys.base_exec_prefix = '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365'
  sys.executable = '/usr/bin/python'
  sys.prefix = '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365'
  sys.exec_prefix = '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365'
  sys.path = [
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Lxml-340/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_lm-07/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Otgui-v61/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_morris-05/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_svm-05/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/EUROPLEXUS_201901/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/EUROPLEXUS_201901/lib/python3.6/site-packages/salome',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Mfront-TFEL321/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_mixmod-07/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/SHAPER_V9_3_0/bin/salome',
    '/opt/salome_meca/V2019.0.3_universal/modules/SHAPER_V9_3_0/lib/salome',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Xlrd-120/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_wrapy-07_EDF/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Pillow-342/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Gnuplotpy-183k/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Zcracks-292p2/plugin',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Xlwt-130/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_pmml-16/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/H5py-280/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Cython-0252/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Xlutils-200/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_robopt-04/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/SMESH_V9_3_0/share/salome/plugins/smesh/Verima',
    '/opt/salome_meca/V2019.0.3_universal/modules/ASTERSTUDY_201903/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/modules/ASTERSTUDY_201903/lib/python3.6/site-packages/salome',
    '/opt/salome_meca/V2019.0.3_universal/tools/Code_aster_frontend-20190/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Medcoupling-V9_3_0/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Medfichier-400/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Code_aster_frontend-20190/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Adao-V9_3_0_0/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Paraview-v560p1/lib/paraview-5.6/site-packages/vtkmodules',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Paraview-v560p1/lib/paraview-5.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Paraview-v560p1/lib/paraview-5.6',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorbpy-422/lib/python3.6/site-packages/omniidl_be',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorbpy-422/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/tools/Libbatch-V2_4_1/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_fftw-06/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Openturns_tool-112/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Jinja-273/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Docutils-012/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Scipy-0191/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Nlopt-242/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Matplotlib-222/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Pyqt-590/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Numpy-1151/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Pygments-202/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorb-422/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Sip-4193/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/site-packages',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python38.zip',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8',
    '/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f275807eb80 (most recent call first):
<no Python frame>
make[4]: *** [Makefile:1101: CFDSTUDY_GenSK.cc] Error 1
make[4]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome/cfd_study/idl'
make[3]: *** [Makefile:640: all-recursive] Error 1
make[3]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome/cfd_study'
make[2]: *** [Makefile:641: all-recursive] Error 1
make[2]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome'
make[1]: *** [Makefile:1595: all-recursive] Error 1
make[1]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5'
make: *** [Makefile:1039: all] Error 2
==> ERROR: Se produjo un fallo en build().
    Cancelando...
error compilando: code_saturne
So, these weird 3 last lines of the "sys.path" make me think that it is looking for python3.8, so I do

Code: Select all

ln -s /opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8 /opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6 
When I try again, it moves forward until I get

Code: Select all

usr/bin/python /opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorb-422/bin/omniidl -bcxx -Wba -nf -I/opt/salome_meca/V2019.0.3_universal/prerequisites/Omniorb-422/idl -I/opt/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0/idl/salome -I/opt/salome_meca/V2019.0.3_universal/modules/GUI_smeca_gui/idl/salome CFDSTUDY_Gen.idl
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
  File "/opt/salome_meca/V2019.0.3_universal/prerequisites/Lxml-340/lib/python3.6/site-packages/site.py", line 73, in <module>
    __boot()
  File "/opt/salome_meca/V2019.0.3_universal/prerequisites/Lxml-340/lib/python3.6/site-packages/site.py", line 26, in __boot
    import imp  # Avoid import loop in Python >= 3.3
  File "/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8/imp.py", line 19, in <module>
    from importlib._bootstrap import _ERR_MSG, _exec, _load, _builtin_from_name
  File "/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.8/importlib/__init__.py", line 51, in <module>
    _w_long = _bootstrap_external._w_long
AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'
make[4]: *** [Makefile:1101: CFDSTUDY_GenSK.cc] Error 1
make[4]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome/cfd_study/idl'
make[3]: *** [Makefile:640: all-recursive] Error 1
make[3]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome/cfd_study'
make[2]: *** [Makefile:641: all-recursive] Error 1
make[2]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5/salome'
make[1]: *** [Makefile:1595: all-recursive] Error 1
make[1]: se sale del directorio '/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5'
make: *** [Makefile:1039: all] Error 2
==> ERROR: Se produjo un fallo en build().
    Cancelando...
error compilando: code_saturne
Reading some posts, it seems that there is a conflict between python versions. I tried different combinations of exporting PYHTONPATH, but it doesn't matter what I write, it always answers:

Code: Select all

checking for PyQt5 version >= 5.0... ./configure: line 22998: 2895843 Segmentation fault      (core dumped) ${PYTHON} -c "${prog}"
no
checking for PyQt4 version >= 4.5... no
configure: error: in `/home/casa/.cache/yay/code_saturne/src/code_saturne-6.0.5':
configure: error: cannot find PyQt5 support (>= 5.0) or PyQt4 support (>= 4.5), Graphical User Interface cannot be installed
See `config.log' for more details
==> ERROR: Se produjo un fallo en build().
    Cancelando...
error compilando: code_saturne
Is it really a problem of python versions? What shoud I write for PYTHONPATH then?

Some other help would be really apreciated. Thanks.

P.S. My system runs Manjaro, python3.8 and salome-meca 2019 and CS 6.0.5 (compilation without coupling works perfectly).
Yvan Fournier
Posts: 3424
Joined: Mon Feb 20, 2012 3:25 pm

Re: coupling with salome-meca 2019

Post by Yvan Fournier »

Hello,

To avoid Python issues, if your Salome_meca install uses a separate Python install from the system default, you should do force that version for code_saturne install.

You can do this by installing cofe_saturne from within "salome shell". To avoid needing the full Salome environnement when using code_saturne, you could source only the part of the environnement required, and use the --with-shell-env configure option.
But I recommend trying the simplest opt ok n first.

If you check some posts from several months ago, you may see we have not managed to run the coupling test case with salome_meca 2019. It works with the 2017 version, and has not been tested with the 2018 version. The install works, but one code_aster command fails. Maybe an expert code_aster user would know how to adapt it.

Starting with code_saturne 6.1, the code_aster coupling has been rewritten, as it was fragile and would have been broken by the HPC version of code_aster. The work is not finished on the code_aster side (i.e. there is no example) but I could guide an advanced code_aster user through the necessary steps.

Best regards,

Yvan
seirov
Posts: 9
Joined: Tue Jul 07, 2015 6:42 pm

Re: coupling with salome-meca 2019

Post by seirov »

Hi,

I have tried what you indicated (although already warned that might be useless), so:

Code: Select all

$ salome shell
>>> ./configure --with-hdf5=/usr --with-cgns=/usr --with-med=/usr --without-metis --without-scotch PYTHON=/usr/bin/python --with-salome=/opt/salome_meca/V2019.0.3_universal --with-shell-env
and it answers:

Code: Select all

checking whether /usr/bin/python version is >= "2.6"... no
configure: error: Python interpreter is too old
Due to fact that I am using built-in python, I removed the option "PYTHON=/usr/bin/python" from configure. Then it went on, so when finished I typed

Code: Select all

make
make install
Note: For the last command, I had to login as root, and then enter in the "salome shell".

So, installation is completed :mrgreen: however, I have realised that commands "code_saturne gui" or "code_saturne salome" from a terminal results in:

Code: Select all

/opt/salome_meca/V2019.0.3_universal/prerequisites/Python-365/bin/python: error while loading shared libraries: libpython3.6.so.1.0: cannot open shared object file: No such file or directory
but if I enter in "salome shell" and execute code_saturne from there they both work. Is this the expected behaviour?

Now I have to try some calculation. Does anyone have any easy case to try the coupling?

Thanks.
Yvan Fournier
Posts: 3424
Joined: Mon Feb 20, 2012 3:25 pm

Re: coupling with salome-meca 2019

Post by Yvan Fournier »

Hello,

You need to log in as root for "make install" only if you install to a system folder. By default, this us the case (/usr/local), but if you specify --prefix at onfigure time, with a user directory to which you have write access as a regula user, root is not necessary. This is independent of Salome.

The reason why you need to load the salome environment is so the the library search path for the Python installed with salome is found. Using LD_LIBRARY_PATH and just that pathe would be sufficient, though is is simpler to just load everything.

And there is a test case here : viewtopic.php?f=12&t=2583.

Regards,

Yvan
seirov
Posts: 9
Joined: Tue Jul 07, 2015 6:42 pm

Re: coupling with salome-meca 2019

Post by seirov »

Hello, thanks for your answer. Using the LD_LIBRARY_PATH tip worked like a charm.

Regarding the calculation, first I have tried a saturne case
http://code-saturne.org/cms/sites/defau ... tyFlow.pdf
and it worked... more or less. I couldn't create a case from salome, a pop-up window said

Code: Select all

/home/user/saturne/study1 must be a directory
which I don't understand because I was trying to create this directory. In any case, I could launch "code_saturne gui", create the case, go back to salome and open it, and go on in salome.

However, when I wanted to try the FSI case, I realised that when launching

Code: Select all

code_saturne salome
I get the typical salome window with the icon for code saturne, but no icon for code aster (I expected to have both, as my salome flavour is salome_meca). Does it mean that coupling is not done (as you already warned)?

Thanks.
Yvan Fournier
Posts: 3424
Joined: Mon Feb 20, 2012 3:25 pm

Re: coupling with salome-meca 2019

Post by Yvan Fournier »

Hello,

No, this is simply the way the virtual application run with "code_saturne salome" works. Salome does not provide for an easy way to add applications inside an existing version without modifying it's build scripts.

The FSI coupling works in script mode, so you need to run "salome shell" only first.

Regards,

Yvan
seirov
Posts: 9
Joined: Tue Jul 07, 2015 6:42 pm

Re: coupling with salome-meca 2019

Post by seirov »

Hello, during last days I have been testing saturne, I have followed tutorial fsi

http://code-saturne.org/cms/sites/defau ... action.pdf

and I got the solution using the option "Boundary conditions ->fluid solid interaction -> internal coupling", as indicated in the tutorial. However, I have seen a tab "external coupling with aster" but I don't know how it works. By using this option, how can I transfer the fluid solution to aster? Should I use yacs?

Thanks.
Yvan Fournier
Posts: 3424
Joined: Mon Feb 20, 2012 3:25 pm

Re: coupling with salome-meca 2019

Post by Yvan Fournier »

Hello,

The presence of this tab is actually a bit "optimistic" (we should hide it in the current versions). Coupling with code_aster was operational (though installation was tricky) up to a code_saturne v6.0/salome_meca 2017 combination.
It might work (not tested) with salome_meca 2018, but is broken by changes in code_aster in salome_meca 2019.
In that case the tab allows setting the related code_saturne options.

Starting with code_saturne 6.1, the coupling is modified, so as to be able to prepare for changes on the code_aster side (and be simpler to set up) but the code_aster side of things had not been done yet (though everything should be feasible in a user setup, so an advanced code_aster user could handle it with a bit of support on this forum, and proovide a first working example).

If you simply need to transfer static/steady code_saturne results to code_aster, exporting the boundary postprocessing output (including pressure / surface stresses) in MED format should allow reading them from code_aster.

Regards,

Yvan
Post Reply