Help with testing - part 2

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 2

Post by PrzemoF »

wmayer wrote:when showing the result and playing with the entries in Colors one get this exception when switching back to None:

Code: Select all

Traceback (most recent call last):
  File "C:\Projects\FreeCAD-git\x64\Mod\Fem\MechanicalAnalysis.py", line 652, in typeChanged
    self.form.lineEdit_Max.setText(str(max))
UnboundLocalError: local variable 'max' referenced before assignment
and the wait cursor doesn't switch back to normal cursor.
Works fine for me. What are your language settings? There is a check that should prevent the crash, but I'm not sure if it works if "None" has been translated: https://github.com/FreeCAD/FreeCAD_sf_m ... is.py#L634

BTW I don't think it's related to my changes
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 2

Post by PrzemoF »

My 2c: material cannot be part of the Analysis if we want to have mutliple materials in the analysis or multiple elements in an analysis. Material should be a propery of mesh or object. Multiple meshes for an analysis are a must-have otherwise we won't be able to test anything, but a simpliest cases. I'm also going to add a Rigid Body material (Young's modulus = infinite) that will need a special key in ccx input file [1].

[1] http://web.mit.edu/calculix_v2.7/Calcul ... de236.html
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 2

Post by PrzemoF »

The FEM results values can be modified using up/down arrows. On top of that Von Mises stress defaults to [mm] as units - it's a bug.

ccx input file might have values that are not accepted by ccx:

Code: Select all

FemConstraintForce,2,1.5966711853290134e-18
but ccx is ok with this format:

Code: Select all

FemConstraintForce,2,1.5966711853e-18
I'm not sure where is the limit - we have to find out where is the limit and make sure we don't write thing ccx doesn't handle.
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help with testing - part 2

Post by wmayer »

@werner Isn't the broken command you removed exactly what we need
Yes, we need a command that creates an FEM mesh but doesn't automatically add to the analysis object.
You would like to add an EXISTING FEMobject (in your case a mesh) to an active MechanicalAnalysis. This is possible by python only but should be possible by the gui too (I totaly agree with you!). It could be implemented independent from the FemObject type. (EDIT: May be a Mouse Action in Treeview the way it is done moving a Part::Shape into a FreeCADGroupObject)
This would be the most convenient way for the user.
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help with testing - part 2

Post by wmayer »

Works fine for me. What are your language settings? There is a check that should prevent the crash, but I'm not sure if it works if "None" has been translated: https://github.com/FreeCAD/FreeCAD_sf_m ... is.py#L634

BTW I don't think it's related to my changes
It seems to happen with every language where "None" has been translated. It's easy to test. After opening the "Show result" panel select a color different to None and switch back.

The correct way to handle this is by using setItemData of a QComboBox and make sure that data you put there does not go through the translation system. When you changed the current item you query the user data with combobox.itemData(combobox.currrentIndex()).
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 2

Post by PrzemoF »

Solution below. That's not the final verion, because I want to use a list instead of a dict, but that's a minor change.

https://github.com/PrzemoF/FreeCAD_sf_m ... 76fb1d9c6d
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help with testing - part 2

Post by wmayer »

drei wrote:
bernd wrote: What we would need is some new button for adding a MeshObject to an MechanicalAnalysis. The gui doesn't support that workflow?!? In python it is allready possible to do.
This^
Can we please add this functionality? Locking up the user by only allowing a meshing from the GUI would be bad, personally I cannot get a mesh through the GUI so I use gmsh as a separate mesher.
It is possible now to add an fem object to the analysis object. It works by drag and drop.
Post Reply