Elmer module for Salomé

Discussion about coding and new developments
RaJa
Posts: 77
Joined: 22 Oct 2014, 09:48
Antispam: Yes

Re: Elmer module for Salomé

Post by RaJa »

As far as I can overlook the current situtation, it should be easy the make my current approach available in FreeCAD too.

Why?

The current project is an almost-Python-clone of the freestanding Elmer-Version (in C). It lacks the graphical mesh-part of Elmer and derives that data from the superimposed application. Meshs are created via a call to ElmerGrid.
All windows and settings are created and referenced inside one single object which is the reference to the main-class. Windows are floating and are currently based on PyQt.
If FreeCAD can keep the main-object-reference in its own memorey-context than it should work. The module itself has no main-event-loop and requires something on a higher level as well as PyQt.
FreeCAD has to have the possibility to provide names of objects and the UNV-export has to maintain them. In this way they can be addressed directly in Elmer.
All mesh-manipulation is done in the superimposed application. The elmer-module just provides the settings windows of Elmer.

So imho we would just have to conceive the interface python moduls, for
  • Salome (working on that)
    FreeCAD
    FreeStanding
Wil
Posts: 72
Joined: 10 Jan 2014, 13:26
Antispam: Yes
Location: Austria

Re: Elmer module for Salomé

Post by Wil »

RaJa wrote:The current project is an almost-Python-clone of the freestanding Elmer-Version (in C). It lacks the graphical mesh-part of Elmer and derives that data from the superimposed application. Meshs are created via a call to ElmerGrid.
All windows and settings are created and referenced inside one single object which is the reference to the main-class. Windows are floating and are currently based on PyQt.
If FreeCAD can keep the main-object-reference in its own memorey-context than it should work. The module itself has no main-event-loop and requires something on a higher level as well as PyQt.
FreeCAD has to have the possibility to provide names of objects and the UNV-export has to maintain them. In this way they can be addressed directly in Elmer.
All mesh-manipulation is done in the superimposed application. The elmer-module just provides the settings windows of Elmer.
I can only answer the point regarding 'provide names of objects': yes FC does provide the names of the constraints in the .unv (see also http://forum.freecadweb.org/viewtopic.php?f=18&t=18829).
For the rest it would be good to start a topic in the freecad-FEM forum (see also http://forum.freecadweb.org/viewtopic.p ... 0&start=20)

BR,
Wil
RaJa
Posts: 77
Joined: 22 Oct 2014, 09:48
Antispam: Yes

Re: Elmer module for Salomé

Post by RaJa »

Wil wrote: I can only answer the point regarding 'provide names of objects': yes FC does provide the names of the constraints in the .unv...
Well, that is a good start. That way ElmerGrid should be able to create the respective files. So we now have to find somebody, who writes the interface to FreeCAD. As I figured in the other forum, they try to integrate the ElmerSolver directly into FreeCAD. That would make our approach kind of obselete.
Wil
Posts: 72
Joined: 10 Jan 2014, 13:26
Antispam: Yes
Location: Austria

Re: Elmer module for Salomé

Post by Wil »

RaJa wrote:As I figured in the other forum, they try to integrate the ElmerSolver directly into FreeCAD. That would make our approach kind of obselete.
No, they always (for calculix and z88) run the solver outside of Freecad and "just" create the input files for the solver and read back the results.
See an equal explanation for the fenics silver here... http://forum.freecadweb.org/viewtopic.p ... 20#p146366

So, to my understanding this is exactly what your script is also doing. So let's combine it.
BR
Wil
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer module for Salomé

Post by mzenker »

Hi,

FYI: I plan to attack the sif file writer over the Christmas holidays.

Matthias
Wil
Posts: 72
Joined: 10 Jan 2014, 13:26
Antispam: Yes
Location: Austria

Re: Elmer module for Salomé

Post by Wil »

Great to read! :D
Looking forward to help testing.
Br,
Wil
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Elmer module for Salomé

Post by annier »

Hi Matthias and Rainer, I downloaded the salome plugin for Elmer from https://github.com/physici/ElmerSalomeModule
and put the contents in $GUI_ROOT_DIR/share/salome/plugins/gui/Elmer
and tried to open tools -->> Plugins
I cannot find the Elmer related plugins.
The error log is

Code: Select all

/home/ma-haitao/salome/appli_V7_8_0/lib/python2.7/site-packages/salome/salome_pluginsmanager.py:285: DeprecationWarning: Call to deprecated function fatal of module salome.kernel.logger (called from importPlugins).
  Deprecated since version 5.1.5. Please replace with Logger.critical(message)
  logger.fatal("Error while loading plugins from file %s"%plugins_file)
CRITICAL [PluginsManager] : Error while loading plugins from file /home/ma-haitao/salome/appli_V7_8_0/share/salome/plugins/gui/Elmer/salome_plugins.py
Traceback (most recent call last):
  File "/home/ma-haitao/salome/appli_V7_8_0/lib/python2.7/site-packages/salome/salome_pluginsmanager.py", line 283, in importPlugins
    execfile(plugins_file,globals(),{})
  File "/home/ma-haitao/salome/appli_V7_8_0/share/salome/plugins/gui/Elmer/salome_plugins.py", line 27, in <module>
    sys.exit("No Elmer module found")
SystemExit: No Elmer module found
/home/ma-haitao/salome/appli_V7_8_0/lib/python2.7/site-packages/salome/salome_pluginsmanager.py:285: DeprecationWarning: Call to deprecated function fatal of module salome.kernel.logger (called from importPlugins).
  Deprecated since version 5.1.5. Please replace with Logger.critical(message)
  logger.fatal("Error while loading plugins from file %s"%plugins_file)
CRITICAL [PluginsManager] : Error while loading plugins from file /home/ma-haitao/salome/appli_V7_8_0/share/salome/plugins/gui/Elmer/salome_plugins.py
Traceback (most recent call last):
  File "/home/ma-haitao/salome/appli_V7_8_0/lib/python2.7/site-packages/salome/salome_pluginsmanager.py", line 283, in importPlugins
    execfile(plugins_file,globals(),{})
  File "/home/ma-haitao/salome/appli_V7_8_0/share/salome/plugins/gui/Elmer/salome_plugins.py", line 27, in <module>
    sys.exit("No Elmer module found")
SystemExit: No Elmer module found
/home/ma-haitao/salome/appli_V7_8_0/lib/python2.7/site-packages/salome/salome_pluginsmanager.py:285: DeprecationWarning: Call to deprecated function fatal of module salome.kernel.logger (called from importPlugins).
  Deprecated since version 5.1.5. Please replace with Logger.critical(message)
  logger.fatal("Error while loading plugins from file %s"%plugins_file)
CRITICAL [PluginsManager] : Error while loading plugins from file /home/ma-haitao/salome/appli_V7_8_0/share/salome/plugins/gui/Elmer/salome_plugins.py
Traceback (most recent call last):
  File "/home/ma-haitao/salome/appli_V7_8_0/lib/python2.7/site-packages/salome/salome_pluginsmanager.py", line 283, in importPlugins
    execfile(plugins_file,globals(),{})
  File "/home/ma-haitao/salome/appli_V7_8_0/share/salome/plugins/gui/Elmer/salome_plugins.py", line 27, in <module>
    sys.exit("No Elmer module found")
SystemExit: No Elmer module found
/home/ma-haitao/salome/appli_V7_8_0/lib/python2.7/site-packages/salome/salome_pluginsmanager.py:285: DeprecationWarning: Call to deprecated function fatal of module salome.kernel.logger (called from importPlugins).
  Deprecated since version 5.1.5. Please replace with Logger.critical(message)
  logger.fatal("Error while loading plugins from file %s"%plugins_file)
CRITICAL [PluginsManager] : Error while loading plugins from file /home/ma-haitao/salome/appli_V7_8_0/share/salome/plugins/gui/Elmer/salome_plugins.py
Traceback (most recent call last):
  File "/home/ma-haitao/salome/appli_V7_8_0/lib/python2.7/site-packages/salome/salome_pluginsmanager.py", line 283, in importPlugins
    execfile(plugins_file,globals(),{})
  File "/home/ma-haitao/salome/appli_V7_8_0/share/salome/plugins/gui/Elmer/salome_plugins.py", line 27, in <module>
    sys.exit("No Elmer module found")
SystemExit: No Elmer module found
In fact, I am even not able to open demo plugins of Salome (no such plugins in the Salome GUI).
The corresponding error when i go to tools>>plugins>>salome shell session (no other options for demo) is

Code: Select all

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Current thread 0x00007fe6f180b700 (most recent call first):
Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer module for Salomé

Post by mzenker »

Hi Anil,

the Plugin in git does not work under Linux yet. I will try to commit a fix this weekend. Anyway, you cannot use it for a simulation yet. Rainer has implemented most of the dialogs from ElmerGUI, but without any functionality yet. I will join him as soon as I can, hopefully starting this weekend and continuing in the Christmas holidays.

Matthias
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Elmer module for Salomé

Post by annier »

Hi Matthias,
Thank you for the reply and information.

Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Wil
Posts: 72
Joined: 10 Jan 2014, 13:26
Antispam: Yes
Location: Austria

Re: Elmer module for Salomé

Post by Wil »

Dear Matthias, Dear Rainer,
how is your project evolving? Are your scripts/modules working in salome?
Edit:
mzenker wrote:Hi Anil,
the Plugin in git does not work under Linux yet. I will try to commit a fix this weekend. Anyway, you cannot use it for a simulation yet. Rainer has implemented most of the dialogs from ElmerGUI, but without any functionality yet. I will join him as soon as I can, hopefully starting this weekend and continuing in the Christmas holidays.
Matthias
I do not know if the scripts should run under linux now but I tried to use them under Ubuntu1604 and got the following error messages. Maybe it is of help since Rainer asked? for testing on his github page (https://github.com/physici/ElmerSalomeModule/issues/11):
'About' and 'Gerneral' do not work or do nothing at the moment.

When I set an equation like 'Electrostatics' 'Active', I get the following Error message in the terminal:
################
Traceback (most recent call last):
File "/home/user/salomev780/Salome-V7_8_0-public/plugins/ElmerSalome/dynamiceditor.py", line 360, in _lSlot
q = QtGui.QObject.sender().property("dom address").toString()
AttributeError: 'module' object has no attribute 'QObject'
################

Clicking on 'Edit Solver Settings' gives:
################
Traceback (most recent call last):
File "/home/user/salomev780/Salome-V7_8_0-public/plugins/ElmerSalome/elmer_window_handler.py", line 650, in _editNumericalMethods
self._solverParameterEditor.append(solverparameters.SolverParameterEditor(path_forms))
AttributeError: 'module' object has no attribute 'SolverParameterEditor'
################

Inserting material paramter in the 'Material' dialog gives:
################
Traceback (most recent call last):
File "/home/user/salomev780/Salome-V7_8_0-public/plugins/ElmerSalome/dynamiceditor.py", line 394, in _textChangedSlot
q = QtGui.QObject.sender().property("dom address").toString()
AttributeError: 'module' object has no attribute 'QObject'
################


BR,
Wil
Post Reply