Prescribed Displacement Testing and Advice

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

Re: Prescribed Displacement Testing and Advice

Postby bernd » Tue Nov 03, 2015 5:12 pm

I rebased it on master and included the way other objects are depelopt. It's not finished yet. On long term the file FemPrescribedDisplacement.py should be splitted. But is something Przemo introduces so his input is needed here.

FemPrescribedDisplacement.py
- _CommandPrescribedDisplacement.py
- _FemPrescribedDisplacement.py
- _ViewProviderFemPrescribedDisplacement.py

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

It works great. It really makes fun to deform the structures ... But the workflow is different from the other constraints like fix and force. We should make them work the same way. In your object a shape has to be selected. In all other constraints and in shellthickness and in beamsection and in the multiple materials the object could be created without selecting a shape. In your object one has to select a shape at creation.

@sgrogan: would you provide win builts for makkemal to work with and for testing for others?

PS: You should really consider compiling FreeCAD yourself. It really is not a big deal and makes it much more easier ...

EDIT: phabricator for adding comments: http://pha.geofinder.eu/D27
User avatar
sgrogan
Posts: 6207
Joined: Wed Oct 22, 2014 5:02 pm

Re: Prescribed Displacement Testing and Advice

Postby sgrogan » Tue Nov 03, 2015 5:34 pm

bernd wrote:@sgrogan: would you provide win builts for makkemal to work with and for testing for others?
Most certainly. I will need a few hours before I can get to it.
@makkemal
If you want we can find a time and I can walk you through step by step. Compiling on win is easier than git :)
"fight the good fight"
User avatar
PrzemoF
Posts: 3076
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Prescribed Displacement Testing and Advice

Postby PrzemoF » Tue Nov 03, 2015 5:48 pm

I'm looking at the code right now. I don't like some of the names, but that's a trivial fix. If it works (I didn't test it yet) we should get it in the master and split/rename/improve later. I can try to make a patch to split it/migrate to _FemCommand

It could be the next big thing in FEM wb after 2D structures :-)
User avatar
sgrogan
Posts: 6207
Joined: Wed Oct 22, 2014 5:02 pm

Re: Prescribed Displacement Testing and Advice

Postby sgrogan » Tue Nov 03, 2015 10:28 pm

makkemal wrote:Holding thumbs I got it right now, I redid everything about 10 times
bernd wrote: @sgrogan: would you provide win builts for makkemal to work with and for testing for others?
win builds here:
https://github.com/sgrogan/FreeCAD/rele ... .16-femdev
@makkemal
Can you post a typical/example test file?
I get a FEM test error at comparing to .imp file (as expected)
"fight the good fight"
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: Prescribed Displacement Testing and Advice

Postby makkemal » Wed Nov 04, 2015 5:41 am

Thanks for everyone for helping em get this up to standard. :D
A test file attached that seems to work fine on compiled version. (@sprogan I don't know what error you are referring to )
Bernd I will look at what you did to fit into the standard and make sure I do it correctly next time.

I get what you are saying about consistency on how it works, now to git my git-hub onto your branch and fix it....

Thanks again
Michael
Attachments
test_disp.FCStd
(54.77 KiB) Downloaded 35 times
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Prescribed Displacement Testing and Advice

Postby bernd » Wed Nov 04, 2015 6:39 am

@makkemal:

Ahh some more hints:
- you may have a look at Przemo's comments too. See http://pha.geofinder.eu/D27
- TestFem needs to be fixed
- we should allow to do an static calculation without force constraint if a prescribed constraint is in the analysis (FemTools.py)

I did not say thanks for the development you did already Michael :)
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: Prescribed Displacement Testing and Advice

Postby makkemal » Thu Nov 05, 2015 7:03 am

- you may have a look at Przemo's comments too. See http://pha.geofinder.eu/D27
Thanks very helpful, but can you explain to me why is is better to split in three files ?
FemPrescribedDisplacement.py
- _CommandPrescribedDisplacement.py
- _FemPrescribedDisplacement.py
- _ViewProviderFemPrescribedDisplacement.py

I'm not sure which part should be in what file and why this is a better practise ?
TestFem needs to be fixed
I have no idea what need to be fixed here ?
we should allow to do an static calculation without force constraint if a prescribed constraint is in the analysis (FemTools.py)
I think this should stay as is, with only a single prescribed displacement the fem model is not fully constrained, typical symmetry problem
User avatar
PrzemoF
Posts: 3076
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Prescribed Displacement Testing and Advice

Postby PrzemoF » Thu Nov 05, 2015 8:21 am

The main reason for splitting is that we have 4-5 active developers in FEM wb code and keeping everything splitted makes it a bit easier for everybody to rebase theis current work on top of the master branch. Keeping one class per file makes it easier to work with the code especially if there are functions with the same names in different classes like "update" or "GetResources". When you search for "update" you don't have to check if that's the "update" you want - you just know it, because there is no other "update" in the file.

Use one file for one class unless there is good reason to keep 2 classes together. Name that file after the class name.

I guess that "TestFem needs to be fixed" means that your code changes introduce changes in the .inp file and it causes our internal tests to fail. The tests are designed to catch problems by comparing a generated .inp file with a template file. To run the tests start "FreeCAD -t 0" from command line or go to Test workbench and start them manually.

Edit: Updating test files: viewtopic.php?f=18&t=12552&p=100612
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Prescribed Displacement Testing and Advice

Postby bernd » Thu Nov 05, 2015 8:31 am

makkemal wrote:...
TestFem needs to be fixed
I have no idea what need to be fixed here ?
PrzemoF wrote:I guess that "TestFem needs to be fixed" means that your code changes introduce changes in the .inp file and it causes our internal tests to fail. The tests are designed to catch problems by comparing a generated .inp file with a template file. To run the tests start "FreeCAD -t 0" from command line or go to Test workbench and start them manually.
change to Workbench Test framework --> click on Self-test --> choose TestFem --> click on Start --> to see the errors in the *.inp files

EDIT: per python:

Code: Select all

import unittest
suite = unittest.TestSuite()
suite.addTest(unittest.defaultTestLoader.loadTestsFromName("TestFem"))
r = unittest.TextTestRunner()
r.run(suite)
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Prescribed Displacement Testing and Advice

Postby bernd » Sat Nov 07, 2015 4:20 pm

makkemal wrote: Thanks very helpful, but can you explain to me why is is better to split in three files ?
FemPrescribedDisplacement.py
- _CommandPrescribedDisplacement.py
- _FemPrescribedDisplacement.py
- _ViewProviderFemPrescribedDisplacement.py
Have a look at this commit in master https://github.com/FreeCAD/FreeCAD/comm ... diff=split This is how the file looked before https://github.com/FreeCAD/FreeCAD/blob ... ickness.py

Or as przemo suggestet, leave all in one module and we split it later. What I saw is you only have a class MakePrescribedDisplacement. Would you splitt this class in class makePrescribedDisplacement and _PrescribedDisplacement. see https://github.com/FreeCAD/FreeCAD/blob ... ickness.py