Materials dialogue problem

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Posts: 8041
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Materials dialogue problem

Postby bernd » Wed Nov 01, 2017 1:55 pm

git commit c309ea41

BTW: Wilfried you are an official FreeCAD developer now :)
HoWil
Posts: 831
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Materials dialogue problem

Postby HoWil » Fri Nov 03, 2017 9:25 am

bernd wrote:
Wed Nov 01, 2017 1:55 pm
git commit c309ea41

BTW: Wilfried you are an official FreeCAD developer now :)
THX for your support, patience and persistence!
BR,
Wilfried
User avatar
bernd
Posts: 8041
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Materials dialogue problem

Postby bernd » Wed Jan 03, 2018 10:25 am

@HoWil: Is issue #3167 solved ?
wmayer
Site Admin
Posts: 14444
Joined: Thu Feb 19, 2009 10:32 am

Re: Materials dialogue problem

Postby wmayer » Thu Jan 04, 2018 10:30 am

bernd wrote:
Wed Jan 03, 2018 10:25 am
@HoWil: Is issue #3167 solved ?
As far as I can see the issues are all fixed now. There was one thing left with the truncated numbers which is actually correct behaviour but the InputField class didn't make this transparent to the user. A quantity uses by default the precision set in the user settings under the Units tab when showing a user string. Now the InputField allows the user to enter any text but doesn't validate the input on-the fly wrt precision. This led to the impression that it allows arbitrary precision but it does not. As soon as it reads out the "quantityString" property it retrieves the truncated value.

This has been improved recently. As soon as the InputField loses focus it displays the truncated value.

Now if you want quantities with higher precision then you have two options:
1. increase the number in the user settings to e.g. to 5. This is a global change and affects all quantities

2. increase the precision of an individual quantity or InputField. A quantity has the attribute Format which is a tuple of two values. The first value is the precision, the second one the display format (e.g. scientific) which supports the characters e (=scientific), f (=fixed) or g. So, to change the precision set the format before assigning to an InputField. Unfortunately, in Python a quantity cannot be assigned directly to an InputField and therefore you can use an alternative way by setting the precision property of an existing InputField.

Code: Select all

q=App.Units.Quantity()
q.Format=(7,'f')
ui=Gui.UiLoader()
f=ui.createWidget("Gui::InputField")
f.setProperty("quantityString", q.UserString) # doesn't respect precision of the quantity
f.setProperty("quantity", q) # doesn't work due to some PySide limitations but works in C++
f.setProperty("precision", q.Format[0])
f.show()
HoWil
Posts: 831
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Materials dialogue problem

Postby HoWil » Fri Jan 05, 2018 6:47 pm

Hi Bernd, Hi Werner,

@Werner: First of all thanks for this detailed explanation.
Basically almost all original issues seem to have gone/have been solved.
But.... I did some tests and do still see some problems... unfortunately I do not have the time to investigate a bit more on this. Maybe simply the dialogue is not implemented correctly (thats my tip).

Please try this:
Create a new document
Switch to FEM-wb
Add an analysis
Create a FEM-materials for fluids
Select 'Air' as material
Look at the value for Kinematic viscosity (it should say "15,1 mm^2/s")
Press OK
Reopen the material dialogue
Now the value is set to "1000 mm^2/s" :!:

BR,
HoWil

Tested on:
OS: Ubuntu 16.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12920 (Git)
Build type: None
Branch: master
Hash: 8faa9f38bb70a598afc2bc39ea1645d416ab057e
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
wmayer
Site Admin
Posts: 14444
Joined: Thu Feb 19, 2009 10:32 am

Re: Materials dialogue problem

Postby wmayer » Fri Jan 05, 2018 9:22 pm

Select 'Air' as material
In my dialog Air doesn't appear!?
UR_
Posts: 861
Joined: Tue Jan 03, 2017 8:42 pm

Re: Materials dialogue problem

Postby UR_ » Fri Jan 05, 2018 11:05 pm

wmayer wrote:
Fri Jan 05, 2018 9:22 pm
In my dialog Air doesn't appear!?
FEM material fluid.png
FEM material fluid.png (11.58 KiB) Viewed 487 times

Air.png
Air.png (12.18 KiB) Viewed 487 times
Christoph
Posts: 51
Joined: Fri Jul 08, 2016 9:02 pm

Re: Materials dialogue problem

Postby Christoph » Fri Jan 05, 2018 11:22 pm

HoWil wrote:
Fri Jan 05, 2018 6:47 pm

Please try this:
Create a new document
Switch to FEM-wb
Add an analysis
Create a FEM-materials for fluids
Select 'Air' as material
Look at the value for Kinematic viscosity (it should say "15,1 mm^2/s")
Press OK
Reopen the material dialogue
Now the value is set to "1000 mm^2/s" :!:
I can confirm this behavour, tested on:

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12920 (Git)
Build type: Release
Branch: master
Hash: 8faa9f38bb70a598afc2bc39ea1645d416ab057e
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
wmayer
Site Admin
Posts: 14444
Joined: Thu Feb 19, 2009 10:32 am

Re: Materials dialogue problem

Postby wmayer » Sat Jan 06, 2018 12:37 am

UR_ wrote:
Fri Jan 05, 2018 11:05 pm
wmayer wrote:
Fri Jan 05, 2018 9:22 pm
In my dialog Air doesn't appear!?
Ah, I looked into the wrong material dialog :roll:

EDIT: Problem confirmed. It also happens that the value isn't updated when changing to None or Water and then back.
Jee-Bee
Posts: 1916
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Materials dialogue problem

Postby Jee-Bee » Sat Mar 17, 2018 7:33 pm

I have noticed that there still some problems with material dialoge or maybe in my case the material database (or both)...
When i use Aluminium 6061-T6 the material data sheet give (not all but) the basic information. However When i load the material the material dialog is empty...

It gives the following message in report view:
SolidMaterial has empty References.