New Object FemElementType opinions and help

About the development of the FEM module/workbench.

Moderator: bernd

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

New Object FemElementType opinions and help

Postby bernd » Tue Jun 02, 2015 5:46 am

EDIT2: check out viewtopic.php?f=18&t=12387
EDIT: latest branch is https://github.com/berndhahnebach/FreeC ... hellbeam19 August, 17th 12015
-------------------------------------------------------------------------------------------------------------------------------------------------------

Since the ViewProvider for beam and shell elements is implemented and the writeAbaqus() is able to write shell and beam meshes it's time to attrach the CalculiX part of the story. Here is what I come up with. A new FemObject FemElementType to store the ElementProperties. It supports Mechanical Solid, Shell and Beam elements. It could be extended to fluids electrodynamics or what ever elements our solver, mesher end exporter supports.

In current implementation the thickness for shell and the crosssection for beam elements are properties of the new FemElementType.

There is no gui and no drag and drop yet. If you guys like it I wouls add a little gui to choose the elementtype.

You can add Objects by python:

Code: Select all

import FemElementType

# Solid
FemElementType.makeFemElementType('FemElementType', 'Solid')
App.activeDocument().MechanicalAnalysis.Member = App.activeDocument().MechanicalAnalysis.Member + [App.ActiveDocument.FemElementType]


#Shell
FemElementType.makeFemElementType('FemElementType', 'Shell')
App.activeDocument().MechanicalAnalysis.Member = App.activeDocument().MechanicalAnalysis.Member + [App.ActiveDocument.FemElementType]


#BeamRect
FemElementType.makeFemElementType('FemElementType', 'BeamRect')
App.activeDocument().MechanicalAnalysis.Member = App.activeDocument().MechanicalAnalysis.Member + [App.ActiveDocument.FemElementType]


#BeamCirc
FemElementType.makeFemElementType('FemElementType', 'BeamCirc')
App.activeDocument().MechanicalAnalysis.Member = App.activeDocument().MechanicalAnalysis.Member + [App.ActiveDocument.FemElementType]

Find attached the famous CalculiX cantilever modelled by volume, shell and beam elements. The files include the new object allready. The results are very similar. Results for beam and shell are only possible as min/max text. There are still some issues with the colors and deformed mesh in beam and shell elements.

deformations in mm

in force direction:
87.20 volume C3D10
88.23 shell S6
88.13 beam B31
87.7 calculated by beam theory formula

normal to force direction and normal to shape axis:
0.297 volume
0.278 shell
0.275 beam

normal to force direction and in shape axis:
8.14 volume
8.21 shell
8.20 beam

Some problems I had. Some properties are read only but after save and reopen the document these properties are no longer read only. ViewProvider does not really work. The idea was to use the same ViewProvider for all classes. But even if I delete the ViewProvider at all the objects are displayed in the tree but greyed.

Since it is my first App::FeaturePython from scatch the code is may be not of good quality at all. Any hints are very welcome.

brunch:
https://github.com/berndhahnebach/FreeC ... hellbeam02

commit:
https://github.com/berndhahnebach/FreeC ... df052aa9d0

Have Fun!
Attachments
cantilever-beamelements--B31.fcstd
(11.58 KiB) Downloaded 29 times
cantilever-shellelements--S6.fcstd
(12.03 KiB) Downloaded 31 times
cantilever-volumeelements--C3D10.fcstd
(83.89 KiB) Downloaded 27 times
Last edited by bernd on Tue Sep 08, 2015 6:03 am, edited 3 times in total.
User avatar
yorik
Site Admin
Posts: 12146
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: New Object FemElementType opinions and help

Postby yorik » Tue Jun 02, 2015 3:48 pm

I cannot judge much of the pertinence of your proposed change, but the code looks okay... I cannot see a reason why some properties are readonly...
As for the view provider, indeed you can create document objects without a view provider, and indeed in that case the default behaviour is that the object is greyed in the tree.

If you don't want to use your own python view provider, you should use this:

Code: Select all

obj.ViewObject.Proxy = 0
which will then use the default C++ view provider of App::FeaturePython objects
wmayer
Site Admin
Posts: 16857
Joined: Thu Feb 19, 2009 10:32 am

Re: New Object FemElementType opinions and help

Postby wmayer » Tue Jun 02, 2015 6:31 pm

bernd wrote:brunch:
Where is the food? :lol:
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: New Object FemElementType opinions and help

Postby bernd » Wed Jun 03, 2015 5:55 am

Upps :o But do you really wanne eat a git ?! :D
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: New Object FemElementType opinions and help

Postby bernd » Tue Jun 23, 2015 6:51 pm

Changed the data model to a dictionary and added a gui to choose the FemElement from. Standard will be solid FemElement. Geometry for shell and beam elements can be choosen by gui and are used for all FemElements. Ahh the icon is really poor.

branch:
https://github.com/berndhahnebach/FreeC ... hellbeam11

Two problems still resists in the view provider:
- the object is grey in tree view
- the object does not open on double click

Attached the cantilever files modeled with solid, shell and beam elements
cantilever-volumeelements--C3D10.fcstd
(84.2 KiB) Downloaded 28 times
cantilever-shellelements--S3.fcstd
(21.02 KiB) Downloaded 26 times
cantilever-beamelements--B31.fcstd
(11.82 KiB) Downloaded 25 times
EDIT: latest branch is https://github.com/berndhahnebach/FreeC ... hellbeam19 August, 17th 12015
Last edited by bernd on Mon Aug 17, 2015 8:09 am, edited 4 times in total.
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: New Object FemElementType opinions and help

Postby bernd » Tue Jun 23, 2015 6:57 pm

Forgot the screen ...
Attachments
screen2.jpg
screen2.jpg (172.08 KiB) Viewed 960 times