FEM doesn't work anymore[solved]

About the development of the FEM module/workbench.

Moderator: bernd

Jee-Bee
Posts: 1811
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: FEM doesn't work anymore

Postby Jee-Bee » Mon Jun 10, 2019 11:32 am

maybe this(https://wiki.qt.io/Qt_for_Python) is your answer
ElMastro
Posts: 24
Joined: Mon May 27, 2019 9:52 am

Re: FEM doesn't work anymore

Postby ElMastro » Mon Jun 10, 2019 2:57 pm

Sorry, I wrote the wrong question; what I intended was

Can anyone that runs Freecad on archlinux tell me what packages of Pyside2 does work?

In the improbable case that none will answer I will have to build the package from myself, which is probably a long and difficult way.
ElMastro
Posts: 24
Joined: Mon May 27, 2019 9:52 am

Re: FEM doesn't work anymore

Postby ElMastro » Tue Jun 11, 2019 9:46 am

All right, I've found the packages pyside2 and shiboken form the extra repository, these should be stable. I recompiled freecad. However now when I run the fem the output in the shell is

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/freecad/Mod/Fem/femguiobjects/_ViewProviderFemMeshGmsh.py", line 72, in setEdit
    taskd = _TaskPanelFemMeshGmsh(self.Object)
  File "/usr/lib/freecad/Mod/Fem/femguiobjects/_ViewProviderFemMeshGmsh.py", line 222, in __init__
    QtCore.QObject.connect(self.form.if_max, QtCore.SIGNAL("valueChanged(Base::Quantity)"), self.max_changed)
<class 'AttributeError'>: 'PySide2.QtWidgets.QWidget' object has no attribute 'if_max'
Perhaps there are others dependencies broken?
ElMastro
Posts: 24
Joined: Mon May 27, 2019 9:52 am

Re: FEM doesn't work anymore

Postby ElMastro » Wed Jun 12, 2019 3:40 pm

I'm starting to feel this will never be fixed:

[*] The problem depends on the package Pyside2, but the maintainer doesn't answer my mail
[*] On the archlinux forum posts have been deleted as Archbang (that is the only live archlinux distro working on my laptop) is not supported
[*] I would search on the archbang forum, but the forum isn't anymore, also appears as the archbang project has ceased to exist

I think I'll report it as a bug, which for me is strange as I feel to be the only one with this particular problem
mlampert
Posts: 1191
Joined: Fri Sep 16, 2016 9:28 pm

Re: FEM doesn't work anymore

Postby mlampert » Wed Jun 12, 2019 6:05 pm

The same symptoms seem to be present in BSD, issue #3984
Thanks to wmayer for making the connection.
ElMastro
Posts: 24
Joined: Mon May 27, 2019 9:52 am

Re: FEM doesn't work anymore

Postby ElMastro » Wed Jun 12, 2019 9:03 pm

I can say something to help, I hope:

Except for pyside2, I have different version of the other software:
my freecad is 0.18.16117-1,
Python is 3.7.3-1,
qt5-base is 5.12.3-2,
coin is 4.0.0a+11927+me74da184f75b-1,
don.t know what OCC is, probably has another name on my system.

My system is on an x86_64 archbang distro, based on archlinux. For what I know the packaging method/installation method should be different, so for me it could be a problem from one of the sources of the packages. I noted that the problems on my freecad were with other versions of pyside2 and shiboken (built from GIT), now I have the stable ones. I am confident that with previous version of freecad (could be 0.17) I used the meshing and material command and at that time it worked.

If someone think it could be useful, I could try to build freecad from a different GIT branch (say, 0.17) to confirm if there my module worked.
wmayer
Site Admin
Posts: 14287
Joined: Thu Feb 19, 2009 10:32 am

Re: FEM doesn't work anymore

Postby wmayer » Sun Jun 16, 2019 11:58 am

I have debugged my Python example on Windows and (re-)discovered the function createChildrenNameAttributes which is used to set the children of a widget as attributes of its Python wrapper.

The code originally was copied from PySide and can be found here: https://github.com/pyside/PySide/blob/m ... ui.cpp#L12

However, when comparing the code snippets then that of PySide2 slightly differs now. So, the question is whether this single line makes the difference or whether FreeCAD doesn't link against the PySide libs because in this case the function createChildrenNameAttributes effectively does nothing.

Therefore it would be good to also test this: https://forum.freecadweb.org/viewtopic. ... 10#p311997
If it works we can be quite sure that something with the function PythonWrapper::createChildrenNameAttributes is wrong, if it doesn't work then we can be quite sure the FreeCAD doesn't link the PySide libs. To be sure about this also run:

Code: Select all

ldd libFreeCADGui.so
denverh
Posts: 2
Joined: Tue May 28, 2019 12:25 pm

Re: FEM doesn't work anymore

Postby denverh » Sun Jun 16, 2019 3:26 pm

Hello,

I reported the similar problem with the Path workbench on FreeBSD to the port maintainer (cmt), who then created issue #3984. I can confirm that the same problem occurs with the FEM workbench on FreeBSD. I can also contribute the results of the ldd command on FreeBSD:

Code: Select all

ldd /usr/local/FreeCAD/lib/libFreeCADGui.so
/usr/local/FreeCAD/lib/libFreeCADGui.so:
        libhdf5-18.so.10 => /usr/local/lib/libhdf5-18.so.10 (0x802200000)
        libFreeCADApp.so => /usr/local/FreeCAD/lib/libFreeCADApp.so (0x802800000)
        libCoin.so.60 => /usr/local/lib/libCoin.so.60 (0x802e00000)
        libGL.so.1 => /usr/local/lib/libGL.so.1 (0x803861000)
        libXext.so.6 => /usr/local/lib/libXext.so.6 (0x803af0000)
        libSM.so.6 => /usr/local/lib/libSM.so.6 (0x803d01000)
        libICE.so.6 => /usr/local/lib/libICE.so.6 (0x803f08000)
        libX11.so.6 => /usr/local/lib/libX11.so.6 (0x804122000)
        libthr.so.3 => /lib/libthr.so.3 (0x804466000)
        libboost_filesystem.so.1.70.0 => /usr/local/lib/libboost_filesystem.so.1.70.0 (0x80468e000)
        libboost_program_options.so.1.70.0 => /usr/local/lib/libboost_program_options.so.1.70.0 (0x8048a7000)
        libboost_regex.so.1.70.0 => /usr/local/lib/libboost_regex.so.1.70.0 (0x804b08000)
        libboost_system.so.1.70.0 => /usr/local/lib/libboost_system.so.1.70.0 (0x804dbe000)
        libboost_thread.so.1.70.0 => /usr/local/lib/libboost_thread.so.1.70.0 (0x804fbf000)
        libboost_chrono.so.1.70.0 => /usr/local/lib/libboost_chrono.so.1.70.0 (0x8051d7000)
        libboost_date_time.so.1.70.0 => /usr/local/lib/libboost_date_time.so.1.70.0 (0x8053df000)
        libboost_atomic.so.1.70.0 => /usr/local/lib/libboost_atomic.so.1.70.0 (0x8055e9000)
        libQt5OpenGL.so.5 => /usr/local/lib/qt5/libQt5OpenGL.so.5 (0x8057eb000)
        libQt5PrintSupport.so.5 => /usr/local/lib/qt5/libQt5PrintSupport.so.5 (0x805a44000)
        libQt5Svg.so.5 => /usr/local/lib/qt5/libQt5Svg.so.5 (0x805cb4000)
        libQt5Network.so.5 => /usr/local/lib/qt5/libQt5Network.so.5 (0x805f09000)
        libFreeCADBase.so => /usr/local/FreeCAD/lib/libFreeCADBase.so (0x80629c000)
        libpython3.6m.so.1.0 => /usr/local/lib/libpython3.6m.so.1.0 (0x806800000)
        libxerces-c-3.2.so => /usr/local/lib/libxerces-c-3.2.so (0x806e00000)
        libz.so.6 => /lib/libz.so.6 (0x8073cd000)
        libQt5Xml.so.5 => /usr/local/lib/qt5/libQt5Xml.so.5 (0x8075e5000)
        libQt5Widgets.so.5 => /usr/local/lib/qt5/libQt5Widgets.so.5 (0x807a00000)
        libQt5Gui.so.5 => /usr/local/lib/qt5/libQt5Gui.so.5 (0x808400000)
        libQt5Core.so.5 => /usr/local/lib/qt5/libQt5Core.so.5 (0x808c00000)
        libc++.so.1 => /usr/lib/libc++.so.1 (0x809343000)
        libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x809611000)
        libm.so.5 => /lib/libm.so.5 (0x809830000)
        libgcc_s.so.1 => /usr/local/lib/gcc8/libgcc_s.so.1 (0x809a5d000)
        libc.so.7 => /lib/libc.so.7 (0x800823000)
        libdl.so.1 => /usr/lib/libdl.so.1 (0x809c74000)
        libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x809e75000)
        libxcb-dri3.so.0 => /usr/local/lib/libxcb-dri3.so.0 (0x80a09f000)
        libxcb-xfixes.so.0 => /usr/local/lib/libxcb-xfixes.so.0 (0x80a2a2000)
        libxcb-present.so.0 => /usr/local/lib/libxcb-present.so.0 (0x80a4a9000)
        libxcb-sync.so.1 => /usr/local/lib/libxcb-sync.so.1 (0x80a6ab000)
        libxshmfence.so.1 => /usr/local/lib/libxshmfence.so.1 (0x80a8b1000)
        libglapi.so.0 => /usr/local/lib/libglapi.so.0 (0x80aab2000)
        libXdamage.so.1 => /usr/local/lib/libXdamage.so.1 (0x80ad0c000)
        libXfixes.so.3 => /usr/local/lib/libXfixes.so.3 (0x80af0e000)
        libX11-xcb.so.1 => /usr/local/lib/libX11-xcb.so.1 (0x80b113000)
        libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x80b314000)
        libxcb-glx.so.0 => /usr/local/lib/libxcb-glx.so.0 (0x80b53d000)
        libxcb-dri2.so.0 => /usr/local/lib/libxcb-dri2.so.0 (0x80b758000)
        libXxf86vm.so.1 => /usr/local/lib/libXxf86vm.so.1 (0x80b95c000)
        libdrm.so.2 => /usr/local/lib/libdrm.so.2 (0x80bb61000)
        libicudata.so.64 => /usr/local/lib/libicudata.so.64 (0x80bd75000)
        libicui18n.so.64 => /usr/local/lib/libicui18n.so.64 (0x80c000000)
        libicuuc.so.64 => /usr/local/lib/libicuuc.so.64 (0x80c52f000)
        librt.so.1 => /usr/lib/librt.so.1 (0x80c91f000)
        libutil.so.9 => /lib/libutil.so.9 (0x80cb25000)
        libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x80cd39000)
        libharfbuzz.so.0 => /usr/local/lib/libharfbuzz.so.0 (0x80cf74000)
        libkvm.so.7 => /lib/libkvm.so.7 (0x80d246000)
        libprocstat.so.1 => /usr/lib/libprocstat.so.1 (0x80d454000)
        libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x80d65e000)
        libpcre2-16.so.0 => /usr/local/lib/libpcre2-16.so.0 (0x80d861000)
        libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x80dafc000)
        libXau.so.6 => /usr/local/lib/libXau.so.6 (0x80de13000)
        libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x80e016000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x80e21b000)
        libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x80e426000)
        libgraphite2.so.3 => /usr/local/lib/libgraphite2.so.3 (0x80e6e2000)
        libelf.so.2 => /lib/libelf.so.2 (0x80e90c000)
        libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x80eb23000)
        libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x80ee1e000)
        libbz2.so.4 => /usr/lib/libbz2.so.4 (0x80f0c0000)
If it would be helpful to try earlier versions of any of the components, I might be able to do that.

Regards,

Denver
ElMastro
Posts: 24
Joined: Mon May 27, 2019 9:52 am

Re: FEM doesn't work anymore

Postby ElMastro » Mon Jun 17, 2019 10:08 am

from PySide2 import QtCore, QtGui, QtWidgets
ui=FreeCADGui.UiLoader()
dialog=ui.load("/tmp/dialog.ui")
dialog.buttonBox
Gives as result

Code: Select all

 dialog=ui.load("/tmp/dialog.ui")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
RuntimeError: Cannot open file
>>> dialog.buttonBox
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'dialog' is not defined
When I run
from PySide2 import QtCore, QtGui, QtWidgets
import FreeCADGui
loader = FreeCADGui.UiLoader()
form = loader.load(FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/MeshGmsh.ui")

print (dir(form)) # post this output please
the output is

Code: Select all

['DrawChildren', 'DrawWindowBackground', 'IgnoreMask', 'PaintDeviceMetric', 'PdmDepth', 'PdmDevicePixelRatio', 'PdmDevicePixelRatioScaled', 'PdmDpiX', 'PdmDpiY', 'PdmHeight', 'PdmHeightMM', 'PdmNumColors', 'PdmPhysicalDpiX', 'PdmPhysicalDpiY', 'PdmWidth', 'PdmWidthMM', 'RenderFlag', 'RenderFlags', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'acceptDrops', 'accessibleDescription', 'accessibleName', 'actionEvent', 'actions', 'activateWindow', 'addAction', 'addActions', 'adjustSize', 'autoFillBackground', 'backgroundRole', 'backingStore', 'baseSize', 'blockSignals', 'changeEvent', 'childAt', 'childEvent', 'children', 'childrenRect', 'childrenRegion', 'clearFocus', 'clearMask', 'close', 'closeEvent', 'colorCount', 'connect', 'connectNotify', 'contentsMargins', 'contentsRect', 'contextMenuEvent', 'contextMenuPolicy', 'create', 'createWinId', 'createWindowContainer', 'cursor', 'customContextMenuRequested', 'customEvent', 'deleteLater', 'depth', 'destroy', 'destroyed', 'devType', 'devicePixelRatio', 'devicePixelRatioF', 'devicePixelRatioFScale', 'disconnect', 'disconnectNotify', 'dragEnterEvent', 'dragLeaveEvent', 'dragMoveEvent', 'dropEvent', 'dumpObjectInfo', 'dumpObjectTree', 'dynamicPropertyNames', 'effectiveWinId', 'emit', 'ensurePolished', 'enterEvent', 'event', 'eventFilter', 'find', 'findChild', 'findChildren', 'focusInEvent', 'focusNextChild', 'focusNextPrevChild', 'focusOutEvent', 'focusPolicy', 'focusPreviousChild', 'focusProxy', 'focusWidget', 'font', 'fontInfo', 'fontMetrics', 'foregroundRole', 'frameGeometry', 'frameSize', 'geometry', 'getContentsMargins', 'grab', 'grabGesture', 'grabKeyboard', 'grabMouse', 'grabShortcut', 'graphicsEffect', 'graphicsProxyWidget', 'hasFocus', 'hasHeightForWidth', 'hasMouseTracking', 'hasTabletTracking', 'height', 'heightForWidth', 'heightMM', 'hide', 'hideEvent', 'inherits', 'initPainter', 'inputMethodEvent', 'inputMethodHints', 'inputMethodQuery', 'insertAction', 'insertActions', 'installEventFilter', 'internalWinId', 'isActiveWindow', 'isAncestorOf', 'isEnabled', 'isEnabledTo', 'isEnabledToTLW', 'isFullScreen', 'isHidden', 'isLeftToRight', 'isMaximized', 'isMinimized', 'isModal', 'isRightToLeft', 'isSignalConnected', 'isTopLevel', 'isVisible', 'isVisibleTo', 'isWidgetType', 'isWindow', 'isWindowModified', 'isWindowType', 'keyPressEvent', 'keyReleaseEvent', 'keyboardGrabber', 'killTimer', 'layout', 'layoutDirection', 'leaveEvent', 'locale', 'logicalDpiX', 'logicalDpiY', 'lower', 'mapFrom', 'mapFromGlobal', 'mapFromParent', 'mapTo', 'mapToGlobal', 'mapToParent', 'mask', 'maximumHeight', 'maximumSize', 'maximumWidth', 'metaObject', 'metric', 'minimumHeight', 'minimumSize', 'minimumSizeHint', 'minimumWidth', 'mouseDoubleClickEvent', 'mouseGrabber', 'mouseMoveEvent', 'mousePressEvent', 'mouseReleaseEvent', 'move', 'moveEvent', 'moveToThread', 'nativeEvent', 'nativeParentWidget', 'nextInFocusChain', 'normalGeometry', 'objectName', 'objectNameChanged', 'overrideWindowFlags', 'overrideWindowState', 'paintEngine', 'paintEvent', 'painters', 'paintingActive', 'palette', 'parent', 'parentWidget', 'physicalDpiX', 'physicalDpiY', 'pos', 'previousInFocusChain', 'property', 'raise_', 'receivers', 'rect', 'redirected', 'registerUserData', 'releaseKeyboard', 'releaseMouse', 'releaseShortcut', 'removeAction', 'removeEventFilter', 'render', 'repaint', 'resize', 'resizeEvent', 'restoreGeometry', 'saveGeometry', 'scroll', 'sender', 'senderSignalIndex', 'setAcceptDrops', 'setAccessibleDescription', 'setAccessibleName', 'setAttribute', 'setAutoFillBackground', 'setBackgroundRole', 'setBaseSize', 'setContentsMargins', 'setContextMenuPolicy', 'setCursor', 'setDisabled', 'setEnabled', 'setFixedHeight', 'setFixedSize', 'setFixedWidth', 'setFocus', 'setFocusPolicy', 'setFocusProxy', 'setFont', 'setForegroundRole', 'setGeometry', 'setGraphicsEffect', 'setHidden', 'setInputMethodHints', 'setLayout', 'setLayoutDirection', 'setLocale', 'setMask', 'setMaximumHeight', 'setMaximumSize', 'setMaximumWidth', 'setMinimumHeight', 'setMinimumSize', 'setMinimumWidth', 'setMouseTracking', 'setObjectName', 'setPalette', 'setParent', 'setProperty', 'setShortcutAutoRepeat', 'setShortcutEnabled', 'setSizeIncrement', 'setSizePolicy', 'setStatusTip', 'setStyle', 'setStyleSheet', 'setTabOrder', 'setTabletTracking', 'setToolTip', 'setToolTipDuration', 'setUpdatesEnabled', 'setVisible', 'setWhatsThis', 'setWindowFilePath', 'setWindowFlag', 'setWindowFlags', 'setWindowIcon', 'setWindowIconText', 'setWindowModality', 'setWindowModified', 'setWindowOpacity', 'setWindowRole', 'setWindowState', 'setWindowTitle', 'sharedPainter', 'show', 'showEvent', 'showFullScreen', 'showMaximized', 'showMinimized', 'showNormal', 'signalsBlocked', 'size', 'sizeHint', 'sizeIncrement', 'sizePolicy', 'stackUnder', 'startTimer', 'staticMetaObject', 'statusTip', 'style', 'styleSheet', 'tabletEvent', 'testAttribute', 'thread', 'timerEvent', 'toolTip', 'toolTipDuration', 'topLevelWidget', 'tr', 'underMouse', 'ungrabGesture', 'unsetCursor', 'unsetLayoutDirection', 'unsetLocale', 'update', 'updateGeometry', 'updateMicroFocus', 'updatesEnabled', 'visibleRegion', 'whatsThis', 'wheelEvent', 'width', 'widthMM', 'winId', 'window', 'windowFilePath', 'windowFlags', 'windowHandle', 'windowIcon', 'windowIconChanged', 'windowIconText', 'windowIconTextChanged', 'windowModality', 'windowOpacity', 'windowRole', 'windowState', 'windowTitle', 'windowTitleChanged', 'windowType', 'x', 'y']
wmayer
Site Admin
Posts: 14287
Joined: Thu Feb 19, 2009 10:32 am

Re: FEM doesn't work anymore

Postby wmayer » Mon Jun 17, 2019 11:36 am

Gives as result
Of course you must create the file dialog.ui again as explained a few posts above.
I reported the similar problem with the Path workbench on FreeBSD to the port maintainer (cmt), who then created issue #3984. I can confirm that the same problem occurs with the FEM workbench on FreeBSD. I can also contribute the results of the ldd command on FreeBSD:
Thanks. The missing link dependency to shiboken/PySide must be the problem because in this case the function createChildrenNameAttributes is empty and thus the attribute creation is not done.