Elmer module for Salomé

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

Re: Elmer module for Salomé

Post by RaJa » 18 Sep 2016, 17:02

Soo, I was busy over the weekend and managed to implement the DynamicEditor of Elmer. This one handles equation and solver settings as well as the material settings. There is no functionality yet, just the interface. The other windows seem to be easy as one can use the ui-files of Elmer again.

Big questions is still the I/O stuff. Maybe we put it all into the window handler I have created. As long as this object is in Salomes memory we should have access to it.

mzenker
Posts: 1917
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer module for Salomé

Post by mzenker » 19 Sep 2016, 13:51

Hi Rainer,

great that you continue to work on this project. I probably won't have any time to test it until the end of the month as I am really busy. I hope to be able to contribute more next month.

Cheers,

Matthias

RaJa
Posts: 60
Joined: 22 Oct 2014, 09:48
Antispam: Yes

Re: Elmer module for Salomé

Post by RaJa » 19 Sep 2016, 15:52

No worries :)
The current stuff is straight forward - convert C-Qt-code to PyQt-code. It is mainly copy&paste and replacing "->" by "." It will become more challenging when we start to add the necessary functionality. So I would suggest that you lean back and concentrate on your stuff and as soon as all the required windows are ready you put some more time into it.

mzenker
Posts: 1917
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer module for Salomé

Post by mzenker » 19 Sep 2016, 16:37

Sounds good... :)
Since I am just starting with Python (putting together scripts for Salomé to parametrize my models), my last C++ programming project is a really long time ago (> 10 years), and you seem to be more familiar with both, it will be easier for me to help debugging and adding more functionality when the framework is already there...

RaJa
Posts: 60
Joined: 22 Oct 2014, 09:48
Antispam: Yes

Re: Elmer module for Salomé

Post by RaJa » 09 Oct 2016, 20:19

Hi Matthias,

if you have some leisure time, you could check the following post in the Salome forum:
http://www.salome-platform.org/forum/forum_12/575675631

I am trying to get the dynamic salome menues implemented, but I am having problems with the salome plugins manager that seems to ignore my changes. So if you have some time, you might want to play around a bit.

thanks,
Rainer

mzenker
Posts: 1917
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer module for Salomé

Post by mzenker » 11 Oct 2016, 18:27

Hi Rainer,

there is a reply by Vadim to your problem. I didn't try it since I don't get the new version from git to run at all. Does it run for you?
I work with the method for path retrieval described in a previous post. Also there was a typo in "elmerWindowHandler" in both salome_plugins.py and elmer_window_handler.py. But I don't see the Elmer menu entry in the tools->plugins menu in Salomé at all. Instead I get a lengthy error message in the terminal. Any idea?

Matthias

RaJa
Posts: 60
Joined: 22 Oct 2014, 09:48
Antispam: Yes

Re: Elmer module for Salomé

Post by RaJa » 12 Oct 2016, 08:30

Could you post the error message? Or at least what Salome is complaining about? I will compare that with my local version in the evening. That one was working.

mzenker
Posts: 1917
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer module for Salomé

Post by mzenker » 12 Oct 2016, 11:29

Hi Rainer,

here is the error message:

Code: Select all

←[01;34mC:\ProgrammePlus\SALOME-7.8.0-WIN64\MODULES\GUI\RELEASE\GUI_INSTALL\lib\
python2.7\site-packages\salome\salome_pluginsmanager.py:285: DeprecationWarning:
 Call to deprecated function fatal of module salome.kernel.logger (called from i
mportPlugins).
  Deprecated since version 5.1.5. Please replace with Logger.critical(message)
  logger.fatal("Error while loading plugins from file %s"%plugins_file)
←[00mCRITICAL [PluginsManager] : Error while loading plugins from file C:\Progra
mmePlus\SALOME-7.8.0-WIN64\MODULES\GUI\RELEASE\GUI_INSTALL\share/salome/plugins\
gui\Elmer\salome_plugins.py
Traceback (most recent call last):
  File "C:\ProgrammePlus\SALOME-7.8.0-WIN64\MODULES\GUI\RELEASE\GUI_INSTALL\lib\
python2.7\site-packages\salome\salome_pluginsmanager.py", line 283, in importPlu
gins
    execfile(plugins_file,globals(),{})
  File "C:\ProgrammePlus\SALOME-7.8.0-WIN64\MODULES\GUI\RELEASE\GUI_INSTALL\shar
e/salome/plugins\gui\Elmer\salome_plugins.py", line 27, in <module>
    main = ewh.elmerWindowHandler()
  File "C:\ProgrammePlus\SALOME-7.8.0-WIN64\MODULES\GUI\RELEASE\GUI_INSTALL\shar
e/salome/plugins\gui\Elmer\ElmerSalome\elmer_window_handler.py", line 34, in __i
nit__
    self.xmlMerge(path_edfs)
  File "C:\ProgrammePlus\SALOME-7.8.0-WIN64\MODULES\GUI\RELEASE\GUI_INSTALL\shar
e/salome/plugins\gui\Elmer\ElmerSalome\elmer_window_handler.py", line 157, in xm
lMerge
    data = et.parse(xml_file).getroot()
  File "C:\ProgrammePlus\SALOME-7.8.0-WIN64\PRODUCTS\python-2.7.10\Lib\xml\etree
\ElementTree.py", line 1182, in parse
    tree.parse(source, parser)
  File "C:\ProgrammePlus\SALOME-7.8.0-WIN64\PRODUCTS\python-2.7.10\Lib\xml\etree
\ElementTree.py", line 656, in parse
    parser.feed(data)
  File "C:\ProgrammePlus\SALOME-7.8.0-WIN64\PRODUCTS\python-2.7.10\Lib\xml\etree
\ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "C:\ProgrammePlus\SALOME-7.8.0-WIN64\PRODUCTS\python-2.7.10\Lib\xml\etree
\ElementTree.py", line 1506, in _raiseerror
    raise err
ParseError: not well-formed (invalid token): line 310, column 142
I have made small modifications to two files in the latest version from your git repository, you find them in the attachment.
It works with the files I downloaded on 5th September, with the same modification in salome_plugins.py.
BTW I am under Windoze 7 here, but I experienced similar problems on my Linux box at home.

Cheers,
Matthias
Attachments
salome_plugins.zip
(2.92 KiB) Downloaded 71 times

RaJa
Posts: 60
Joined: 22 Oct 2014, 09:48
Antispam: Yes

Re: Elmer module for Salomé

Post by RaJa » 12 Oct 2016, 15:34

Hi,

okay, the typo you have already corrected.

The lengthy error massage is related to the xml-structure of the edf files. Some weeks ago I played around with them and realized that one of the files is "not well-formed" (this problem has to be tackled later). I have moved it from the "edf"-folder to the "edf-extra"-folder. However, at the moment I cannot remember which file it was. But I know that it was not "heatequation" and not "navier-stokes". It might have been "helmoltz". I will check that in the evening.

Reason for the error:
I have included a preparation function that runs through all of the edf files and merges them into a temperorary file (as Elmer is doing it during startup). This file is than provided to a XML-like-Qtobject. The error occurs in my merging-algorithm when parsing the file to extract the xml-tree-structure. One of this edf-files has a small deviation that is not recognized by the parser, hence it raises an error.

Ciao,
Rainer

mzenker
Posts: 1917
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer module for Salomé

Post by mzenker » 12 Oct 2016, 17:07

Hmmm...
I don't know how git repositories work. Are you working directly with the files in the repository? In that case, would it be possible to organise the repository so that others (e.g. me ;) ) can see which is the last version known to work, and which is "work in progress"?

Thanks,

Matthias

Post Reply