collection of material issues

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

collection of material issues

Post by uwestoehr »

This thread is intended to sort out and fix the different material issues.

List of issues:

1. in the material dialog one cannot load all existing material cards. For example we have already many cards for steel, but they don't appear in the dropdown list. One can also not load them via the material editor because they are not listed anywhere.
-> fixed with https://github.com/FreeCAD/FreeCAD/pull/4646

2. in the material dialog one cannot load a custom/own material card
-> Workaround: Call the material editor from within the material dialog and click there on the button 'Open...'
-> WONTFIX: https://forum.freecadweb.org/viewtopic. ... 12#p532854

3. when you use the material editor and save the data as material card, it is not saved as Unicode. Therefore opening the just created file shows you no content. Here is an example of such a file: https://forum.freecadweb.org/download/f ... ?id=147542
-> fixed by https://github.com/FreeCAD/FreeCAD/commit/cfcf8df4cee1
-> Note: old material cards containing Unicode-only characters can now not be opened anymore as they are. To fix this, open the material cards in a text editor, convert the file to Unicode and save it.

4. in the material editor load an existing standard material like e.g. "PET-generic" you get in the author field "PET-Generic" but in the card it is "(c) 2019 Uwe Stöhr (CC-BY 3.0)"
-> fixed by git commit cfcf8df4cee1

5. call the material editor from the material dialog and load an existing card. Close the editor and see that you don't see the card name in the material dialog. There you see "_transient_material" in the field "Material card"
-> commit that fixed this is unknown

6. call the material editor from the material dialog. Then close the material editor with Cancel, finally close the material dialog with OK.
result: FreeCAD is now in a state in which it thinks there is still a task dialog open. So you cannot reopen the material dialog.

fixed by: git commit 011cef1e7bab

7. Select in the material dialog a material. Then call the material editor from the material dialog and Click on the button "Open".
result: the folder of the already load material is not opened but always this folder "*\data\Mod\Material"

fixed for FreeCAD 0.20.3 by: https://github.com/FreeCAD/FreeCAD/pull/8542

8. Create a fluid material and select as Material card "None". Then change the card to "Air". Now open the material editor from within the material dialog
result: the displayed card is empty

fixed for FreeCAD 0.20.3 by: https://github.com/FreeCAD/FreeCAD/pull/8539

9. Create a fluid material and select as Material card "Nitrogen".
result: you don't get the parameters stored in the Nitrogen.FCMat file

-> fixed by git commit 0afa4bd3441a

10. Launch the material card editor and open the existing Air.FCMat material card. Double-click in the card e.g. on the electric conductivity.
result: the value changes to "0,000000001000 mS/m". Double-click now e.g. an the relative permittivity and this value changes to "100059,000000000000"
This bug only occurs when the FC locale is one in which the comma is the decimal sign.

-> fixed by https://github.com/FreeCAD/FreeCAD/pull/8592
Last edited by uwestoehr on Tue Sep 14, 2021 10:59 am, edited 11 times in total.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of material issues

Post by uwestoehr »

bernd wrote: Sun Mar 21, 2021 10:22 pm - load your file
- open material
- edit with material editor
- it is not empty for me

am I missing something?
- I load my file:
Crucible-heating.FCStd
(613.24 KiB) Downloaded 89 times
- I get directly this error:

Code: Select all

Error on reading card data. The card data will be empty for card:
G:/FreeCAD-Simu\Graphite.FCMat
Maybe the path is wrong because I am on Windows so either the path is G:\FreeCAD-Simu\Graphite.FCMat or G:/FreeCAD-Simu/Graphite.FCMat

Here is a screencast with the bug:
Attachments
10lbV6WSdK.gif
10lbV6WSdK.gif (872.91 KiB) Viewed 4591 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of material issues

Post by uwestoehr »

Here is the material card file I try to load:
Graphite.txt
rename to Graphite.FCMat
(551 Bytes) Downloaded 89 times

Here is the error message from the above screencast:

Code: Select all

01:38:05  -1
01:38:05  Card path: G:/FreeCAD-Simu/Graphite.FCMat not found in known cards.The material parameter only are loaded.
01:38:05  Traceback (most recent call last):
01:38:05    File "D:\FreeCAD-build\Mod\Material\MaterialEditor.py", line 526, in openfile
01:38:05      d = read(self.card_path)
01:38:05    File "D:\FreeCAD-build\Mod\Material\importFCMat.py", line 117, in read
01:38:05      for ln, line in enumerate(f):
01:38:05    File "D:\FreeCAD-build\bin\lib\codecs.py", line 322, in decode
01:38:05      (result, consumed) = self._buffer_decode(data, self.errors, final)
01:38:05  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 20: invalid start byte
It tells me "G:/FreeCAD-Simu/Graphite.FCMat not found in known cards" but I have it in my material preferences:
FreeCAD_UdYQ7ayz5z.png
FreeCAD_UdYQ7ayz5z.png (23.1 KiB) Viewed 4589 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

uwestoehr wrote: Sun Mar 21, 2021 8:32 pm 2. in the material dialog one cannot load a custom/own material card
this is not an issue. Editing the material directly inside the task panel is deprecated anyway. The material editor is the prefered way to edit all kind of material data.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

uwestoehr wrote: Sun Mar 21, 2021 8:32 pm This thread is intended to sort out and fix the different material issues.

List of issues:

1. in the material dialog one cannot load all existing material cards. For example we have already many cards for steel, but they don't appear in the dropdown list. One can also not load them via the material editor because they are not listed anywhere.
-> Will be fixed with https://github.com/FreeCAD/FreeCAD/pull/4646
AFAIR: we added not all cards to the rolling dev version. But at the release all cards should be available without this commit. AFAIK
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of material issues

Post by uwestoehr »

bernd wrote: Mon Mar 22, 2021 9:17 am this is not an issue. Editing the material directly inside the task panel is deprecated anyway. The material editor is the prefered way to edit all kind of material data.
What I mean is that I e.g. have a card named "Methanol". Since I want to simulate the flow of methanol, I add a liquid material but then cannot load my card. The only way is to load the material editor and there open my card. This is unintuitive because one does not want to edit something, just to load an existing card. Therefore there should be a button to load a custom card in the material dialog.

bernd wrote: Mon Mar 22, 2021 9:21 am
uwestoehr wrote: Sun Mar 21, 2021 8:32 pm -> Will be fixed with https://github.com/FreeCAD/FreeCAD/pull/4646
AFAIR: we added not all cards to the rolling dev version. But at the release all cards should be available without this commit. AFAIK
The steels are in the release but I expect most FEM users to use the rolling release. For example I have to use now the rolling 0.20 release always to benefit from the recent fixes and the Gmsh improvements.
Therefore I don't see a good reason why we have the steel materials only in major releases of FC.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: collection of material issues

Post by RatonLaveur »

I may be on the wrong topic to suggest this, but is there a reason we don't make the cards simply .txt and edit them outside of FreeCAD? (i.e. with an automatic opening of Notepadd++ or the user's preferred text editor selected in the FEM --> Materials preference). The properties would be "searched" by the modules instead of pre-parsed in the GUI and the system would be a lot more flexible.

Don't hesitate to ignore this if you want to keep discussing on pure "material issues".
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

I have never use the material edittor to edit the cards either. An simple editor does the job very well for me.

You do not need to change the file ending for this. Just tell your operating system it should open fcmat files with your favorite editor.

The parsing is just for the ability to change them very fast for your need. May be to play with them or whatever. For my work analysises I only use swiss standard code materials for structural steel an concrete.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of material issues

Post by uwestoehr »

I checked out master with my new material cards for nitrogen and argon and I found 2 new bugs:

8. Create a fluid material and select "None". Then change the card to "Air". Now open the material editor from within the material dialog
result: the displayed card is empty

9. Create a fluid material and select "Nitrogen".
result: you don't get the parameters stored in the Nitrogen.FCMat file

Here a screencast showing both issues:
caS3ySpCvW.gif
caS3ySpCvW.gif (118.91 KiB) Viewed 4487 times
Last edited by uwestoehr on Mon Mar 22, 2021 2:47 pm, edited 1 time in total.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of material issues

Post by uwestoehr »

bernd wrote: Mon Mar 22, 2021 2:35 pm I have never use the material edittor to edit the cards either. An simple editor does the job very well for me.
It should but there is obviously a bug with the material card importer, parser and/or the saving. Otherwise we should not see bug 3. and 9.
Post Reply