Help with testing - part 2

About the development of the FEM module/workbench.

Moderator: bernd

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

Help with testing - part 2

Post by PrzemoF »

I need help with testing some FEM changes. The changes are here:
https://github.com/PrzemoF/FreeCAD_sf_m ... ree/fem_v3
In brief:
1. Materials now are read from 3 locations:
- standard FreeCAD material directory
- a sub directory "Materials" in user settings directory, on linux it's i.e. "~/.FreeCAD/Materials"
- an user defined directory that can be set in FEM preferences
Each location has it's own icon assigned
2. Material description is show below Poisson ratio
3. Location of CalculiX ccx binary can be defined in FEM preferences. That location overrides the usual ccx location

Summary:
Przemo Firszt (8):
FEM: Add option to define ccx path in Preferences
FEM: Read materials from user settings directory
FEM: Rename dirname to sytem_mat_dir
FEM: Add option to define custom material directory
FEM: Add icons to materials
FEM: Use chooseMat directly set set initial value for material
FEM: Add function for adding materiales from a directory
FEM: Show material description below combo box

src/App/Application.h | 1 +
src/App/ApplicationPy.cpp | 11 +++
src/Gui/Icons/resource.qrc | 1 +
src/Gui/Icons/user.svg | 645 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/Mod/Fem/Gui/DlgSettingsFem.ui | 195 +++++++++++++++++++++++++++++++++---------
src/Mod/Fem/Gui/DlgSettingsFemImp.cpp | 4 +
src/Mod/Fem/MechanicalAnalysis.py | 19 +++--
src/Mod/Fem/MechanicalMaterial.py | 39 +++++++--
src/Mod/Fem/MechanicalMaterial.ui | 10 +++
9 files changed, 867 insertions(+), 58 deletions(-)
create mode 100644 src/Gui/Icons/user.svg

Please test! :D
Attachments
FreeCAD_FEM_ccx_and material_dir.png
FreeCAD_FEM_ccx_and material_dir.png (96.74 KiB) Viewed 2795 times
FreeCAD_FEM_material_description.png
FreeCAD_FEM_material_description.png (146.16 KiB) Viewed 2795 times
FreeCAD_FEM_material_icons.png
FreeCAD_FEM_material_icons.png (133.94 KiB) Viewed 2795 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Help with testing - part 2

Post by bernd »

Just tested your improvements on Debian Jessie. Works very well. Great I like them. found some small thing. It is possible to change the values for every material but the changed values are not taken for FEM. Allways the one from the material care are taken. Even for the none material. I would expect if i choose none and put in some values these values are taken. Same for all other materials. If it is possible to change the values one expects them to taken for the calculation.
User avatar
PrzemoF
Veteran
Posts: 3515
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 2

Post by PrzemoF »

Thanks for the feedback - I'll have to think how to handle it. I have a few ideas...
wmayer
Founder
Posts: 20074
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help with testing - part 2

Post by wmayer »

FEM: Add option to define ccx path in Preferences
Wouldn't it make more sense to fill the line edit with the default path of ccx. This way it's more obvious to the user from where ccx is used.
User avatar
PrzemoF
Veteran
Posts: 3515
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 2

Post by PrzemoF »

It certainly would. I can do it on linux, but I have no idea how to do for windows/mac.
wmayer
Founder
Posts: 20074
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help with testing - part 2

Post by wmayer »

Here you have the path to ccx https://github.com/FreeCAD/FreeCAD_sf_m ... is.py#L209
So, you only have to set this as the default in the preferences.
User avatar
PrzemoF
Veteran
Posts: 3515
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 2

Post by PrzemoF »

Thanks, I'll use it!
User avatar
sgrogan
Veteran
Posts: 6501
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help with testing - part 2

Post by sgrogan »

Thanks PrxemoF :D
Win 7 VS 12 2013 Debug x64 from fem_v3

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.4795 (Git)
Branch: fem_v3
Hash: 47deb848aaf4f857cf6406b9be92b57651458532
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
PrzemoF wrote:1. Materials now are read from 3 locations:
- standard FreeCAD material directory
- a sub directory "Materials" in user settings directory, on linux it's i.e. "~/.FreeCAD/Materials"
- an user defined directory that can be set in FEM preferences
Each location has it's own icon assigned
Works Perfectly (On Windows .../User/USERNAME/Appdata/Roaming/FreeCAD/Materials
PrzemoF wrote:3. Location of CalculiX ccx binary can be defined in FEM preferences. That location overrides the usual ccx location
Works perfectly
PrzemoF wrote:2. Material description is show below Poisson ratio
Works for default ABS material
Copying 1C22 to the user defined directory gives this error(after editing description)

Code: Select all

material data:
 Name = CalculiX
 YM = 210000 MPa
 PR = 0.3
Traceback (most recent call last):
  File "C:\Users\Chris\Desktop\Fem_v3\Mod\Fem\MechanicalMaterial.py", line 188, in chooseMat
    self.obj.Material = Material.importFCMat(str(name))
  File "C:\Users\Chris\Desktop\Fem_v3\Mod\Material\Material.py", line 60, in importFCMat
    Config.read(fileName)
  File "C:\Users\Chris\Desktop\Fem_v3\bin\lib\ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "C:\Users\Chris\Desktop\Fem_v3\bin\lib\ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: C:\Users\Chris\Documents\FreeCAD\User_Materials\1C22.FCMat, line: 1
'\xef\xbb\xbf; 1C22 - 1.0402 - EN 10083-1\n'
Contens of 1C22.FCMat after editing:

Code: Select all

; 1C22 - 1.0402 - EN 10083-1
; (c) 2014 M. Münch - GNU Lesser General Public License (LGPL)
; information about the content of this card can be found here:
; http://www.freecadweb.org/wiki/index.php?title=Material

[General]
Vendor=
Name=1C22
NameDE=C22
MaterialNumber=1.0402
Norm=EN 10083-1
KindOfMaterial=Heat-treatable steel
KindOfMaterialDE=Vergütungsstahl
SpecificPrice=
Father=Metal
ProductURL=
; Specific Weight - kg/m³
SpecificWeight=7800
Description: This is a Test of Material Description
DescriptionDE=kleiner Vergütungsdurchmesser, gut schweißbar

[Mechanical]
;Ultimate Tensile Strength - Rm - N/mm²
UltimateTensileStrength=400
; Yield Strength - Re - N/mm²
YieldStrength=230
CompressiveStrength=
; Youngs Modulus - E-Modul - N/mm²
YoungsModulus=210000 MPa
; ModulusOfShare - G-Modul - N/mm²
ModulusOfShare=81000
Elasticity=
FractureToughness=
; Ultimate Strain - Bruchdehnung - %
UltimateStrain=27
; Thermal Expansion Coefficient - Ausdehnungskoeffizient - 1/K
ThermalExpansionCoefficient=1,10E-05

[FEM]
; Poisson Ratio - Querkontraktionszahl
PoissonRatio=0.3
"fight the good fight"
User avatar
PrzemoF
Veteran
Posts: 3515
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 2

Post by PrzemoF »

Thanks for testing! That looks like a material parser error - I'm doing some fixes right now, so I'll ask you to test it again with the new version.
User avatar
sgrogan
Veteran
Posts: 6501
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help with testing - part 2

Post by sgrogan »

Whenever your ready :D

Did you notice you made the headlines? Great Job!

http://libregraphicsworld.org/blog/entr ... ty-funding
"fight the good fight"
Post Reply