FC becomes unusable after inserting an electrostatic potential constraint

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
uwestoehr
Posts: 696
Joined: Sun Jan 27, 2019 3:21 am

FC becomes unusable after inserting an electrostatic potential constraint

Postby uwestoehr » Sun Feb 03, 2019 3:17 pm

I found a bug in
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15780 (Git)
Build type: Release
Branch: master
Hash: f94e76c1116ec3b818961ff65131b3d86fa5b95e
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

To reproduce:
- create a new document, there create a simple body, e.g. a block
- create a new simulation
- now use the menu Model -> Electrostatic Contraint

result: In the report panel I get this error messages:
Traceback (most recent call last):
File "C:\Users\USti\Desktop\FreeCAD_0.18.15780_Conda_Py3QT5-WinVS2015_x64\Mod\Fem\femguiobjects\_ViewProviderFemConstraintElectrostaticPotential.py", line 52, in setEdit
task = _TaskPanel(vobj.Object)
File "C:\Users\USti\Desktop\FreeCAD_0.18.15780_Conda_Py3QT5-WinVS2015_x64\Mod\Fem\femguiobjects\_ViewProviderFemConstraintElectrostaticPotential.py", line 72, in __init__
self._mesh = FemUtils.getSingleMember(analysis, "Fem::FemMeshObject")
<class 'AttributeError'>: module 'femtools.femutils' has no attribute 'getSingleMember'

- now try to do something in the analysis e.g. double-click on "CalculiXccxTools"

result: you get the message that there is a dialog active: Image
But there is no active task and no open dialog.

result: Working with FEM becomes impossible.

workaround: right-click on the contraint in the model view and then chose "Finish Editing"

OK to report this as bug? It seems related to issue #3804 but is different I think.
User avatar
uwestoehr
Posts: 696
Joined: Sun Jan 27, 2019 3:21 am

Re: FC becomes unusable after inserting an electrostatic potential constraint

Postby uwestoehr » Sun Feb 03, 2019 3:23 pm

This bug also occurs when inserting these 2 constraints:

- ConstraintInitialFlowVelocity
- ConstraintFlowVelocity

The error messages are the same:
  • File "C:\Users\USti\Desktop\FreeCAD_0.18.15780_Conda_Py3QT5-WinVS2015_x64\Mod\Fem\femguiobjects\_ViewProviderFemConstraintInitialFlowVelocity.py", line 51, in setEdit
    task = _TaskPanel(vobj.Object)
    File "C:\Users\USti\Desktop\FreeCAD_0.18.15780_Conda_Py3QT5-WinVS2015_x64\Mod\Fem\femguiobjects\_ViewProviderFemConstraintInitialFlowVelocity.py", line 69, in __init__
    self._mesh = FemUtils.getSingleMember(analysis, "Fem::FemMeshObject")
    <class 'AttributeError'>: module 'femtools.femutils' has no attribute 'getSingleMember'
  • File "C:\Users\USti\Desktop\FreeCAD_0.18.15780_Conda_Py3QT5-WinVS2015_x64\Mod\Fem\femguiobjects\_ViewProviderFemConstraintFlowVelocity.py", line 52, in setEdit
    task = _TaskPanel(vobj.Object)
    File "C:\Users\USti\Desktop\FreeCAD_0.18.15780_Conda_Py3QT5-WinVS2015_x64\Mod\Fem\femguiobjects\_ViewProviderFemConstraintFlowVelocity.py", line 72, in __init__
    self._mesh = FemUtils.getSingleMember(analysis, "Fem::FemMeshObject")
    <class 'AttributeError'>: module 'femtools.femutils' has no attribute 'getSingleMember'
User avatar
bernd
Posts: 8352
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FC becomes unusable after inserting an electrostatic potential constraint

Postby bernd » Sun Feb 03, 2019 3:35 pm

:shock: ... I will have a look. I did the refactor in this regard some time ago. Seams I did forget something.
Jee-Bee
Posts: 1950
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: FC becomes unusable after inserting an electrostatic potential constraint

Postby Jee-Bee » Sun Feb 03, 2019 7:53 pm

uwestoehr wrote:
Sun Feb 03, 2019 3:23 pm
...
please use code tags (looks like </>) makes reading much easier and keeps indentiation.
User avatar
bernd
Posts: 8352
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FC becomes unusable after inserting an electrostatic potential constraint

Postby bernd » Sun Feb 03, 2019 8:03 pm

confirmed:

OS: Debian GNU/Linux buster/sid
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15780 (Git)
Build type: Unknown
Branch: master
Hash: f94e76c1116ec3b818961ff65131b3d86fa5b95e
Python version: 3.7.2
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)


BTW: these only work on Elmer solver AFAIK
User avatar
bernd
Posts: 8352
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FC becomes unusable after inserting an electrostatic potential constraint

Postby bernd » Sun Feb 03, 2019 8:04 pm

same for ElectrostaticPotential
User avatar
bernd
Posts: 8352
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FC becomes unusable after inserting an electrostatic potential constraint

Postby bernd » Sun Feb 03, 2019 8:06 pm

git commit 80f2ccc3 the code refactor
User avatar
uwestoehr
Posts: 696
Joined: Sun Jan 27, 2019 3:21 am

Re: FC becomes unusable after inserting an electrostatic potential constraint

Postby uwestoehr » Sun Feb 03, 2019 8:23 pm

Thanks for the quick fix.

In case it is important to keep the overview, I opened now this bug report: issue #3814
User avatar
bernd
Posts: 8352
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FC becomes unusable after inserting an electrostatic potential constraint

Postby bernd » Sun Feb 03, 2019 8:26 pm

uwestoehr wrote:
Sun Feb 03, 2019 8:23 pm
Thanks for the quick fix.

In case it is important to keep the overview, I opened now this bug report: issue #3814
changed commit message in this regard https://github.com/FreeCAD/FreeCAD/pull ... bc984a6515