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 » Mon Oct 19, 2015 11:10 am

I'm not a professional in git either. It's just the way I would do it. There might be other ways too.

on github
- log into github
- go to https://github.com/FreeCAD/FreeCAD
- click on fork (it is below sign in)
- you will have a new repository in your github account (it should be named FreeCAD)

on your local windows machine start Git Bash

Code: Select all

cd into_the_directory_where_you_would_like_to_save_your_fc_source
git clone git://github.com/yourusername/FreeCAD/   fc_source
cd fc_source
# you should have the whole FreeCAD source code in there

# checkout a new branch for your development (bb05d17is commitID from revision 5560)
git checkout -b predeformation  bb05d17
git status
# it shows you are on the new branch  predeformation, nothing is to commit

# push the branch to github
git push https://github.com/yourusername/FreeCAD.git   predeformation
# you may need to add an ssh key before: https://github.com/settings/ssh
# you could check your github account. A new branch should have been created

# copy the scource code files you had changed into fc_source/Mod/Fem
git status
#it shows you are on  branch predeformation and there are changes to commit
# all the file you have copied

# add all changes to the index
git add .

# commit your changes
git commit -m "put_your_commit_message_here“

# push the changes to github
git push  # if it does not work use the adress
git push https://github.com/yourusername/FreeCAD.git
check on github → here we are your first own FreeCAD branch on github
post the github link here
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 » Mon Oct 19, 2015 11:43 am

Thanks for the great detailed response and description !
I would have taken about a week to figure that out

https://github.com/makkemal/FreeCAD/tree/predeformation
Last edited by makkemal on Mon Oct 19, 2015 2:16 pm, edited 1 time in total.
wmayer
Site Admin
Posts: 16854
Joined: Thu Feb 19, 2009 10:32 am

Re: Prescribed Displacement Testing and Advice

Postby wmayer » Mon Oct 19, 2015 12:38 pm

It is bb05d1759614b55a2e8832f8628bce6add609ad4
That's strange. My logic works until around line 520 which is 1b58ec8bb7d83e96d7511dfdcf9e2a8532a272c8 and correctly gives 5240. 519 is 36249a64ce3059915229c0ba3ff846df0f8aa668 and gives 5241 but then suddenly line 518 which is 9e9cbfb1a7ade25849c539193ffb86d1a0749a17 gives 5236.

So we have two hashes 9e9cbfb1a7ade25849c539193ffb86d1a0749a17 in line 518 and 0b1da873029c399c4df3f20d10deb9d339a2d4b6 in line 524 both gives the revision number 5236. How is this possible?

Code: Select all

git rev-list 9e9cbfb1a7ade25849c539193ffb86d1a0749a17 | wc -l
git rev-list 0b1da873029c399c4df3f20d10deb9d339a2d4b6 | wc -l
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 » Mon Oct 19, 2015 2:26 pm

makkemal wrote:I did not compile anything. I gave up on compiling a few weeks ago, a way to steep learning curve.
...
Compiling FreeCAD yourself would make life much more easy for you, if you like to develop something and if you would like to get it into master. I can not gide you on windows. But on debian jessie or ubuntu I would help you as long as you fail in compiling FreeCAD :D It's FreeCAD it's not CalcuilX ;)
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 » Mon Oct 19, 2015 4:06 pm

wmayer wrote:...

Code: Select all

git rev-list 9e9cbfb1a7ade25849c539193ffb86d1a0749a17 | wc -l
git rev-list 0b1da873029c399c4df3f20d10deb9d339a2d4b6 | wc -l
Yeah both return revision nr 5236 :shock: I wouldn't belive it though It's even visible on github:

https://github.com/FreeCAD/FreeCAD/tree ... d1a0749a17
https://github.com/FreeCAD/FreeCAD/tree ... d339a2d4b6
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 » Tue Oct 20, 2015 5:13 am

Ok I'm sorry but I have no idea what you are telling me.
This is my first attempt at python and not only Freecad, I accept that it has work to be done to fit in.
If the code has problems I will fix it but please guide me on what to do.

Since I was very far along the route when the viewtopic.php?f=18&t=12833 coding standard came out I will have to do some more work to get it up to Specs.
But adding a constraint in python is easier to understand than C++ (after 3 months of trying C++ I gave up the learning curve is just to steep for me).

Maybe the coding standard should include a template for adding constraints using python ?
The hard work was getting the FEM WB to select nodes or elements for a particular boundary conditions and this has been done
We are still not using a large number of constraints supported by Calculix
http://web.mit.edu/calculix_v2.7/Calcul ... de160.html

To add any of these constraints you need a UI that doe the following
1. Select a geometric entity
2. Input some value for the constraint
Then the value have to be written in the ccxInpWriter at the correct location.
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 Oct 20, 2015 6:24 am

To keep the work of the core devs as less as possible you should get your code rebased on master.

First update your github repo to current master:

Code: Select all

# in your FreeCAD source directory
# change to your master branch
git checkout master

git remote add fcmaster  git://github.com/FreeCAD/FreeCAD/

# fetch the changes from github
git fetch fcmaster

# make your master branch follow the fetched master
git branch --set-upstream-to=remotes/fcmaster/master master

# pull the changes
git pull

# push the current master to your github
git push https://github.com/makkemal/FreeCAD.git

Code: Select all

# in future you only need to do the following to update your master branch on github (may be it works by leaving git fetch out too.)
git checkout master
git fetch fcmaster
git pull
git push https://github.com/makkemal/FreeCAD.git
Now you need to rebase your code on current master. Means your code base should not be revision 5560 but HEAD of master instead (https://github.com/FreeCAD/FreeCAD, currently on 5793). For this it would be much more simpler for you if you would compile FreeCAD yourself. You do not need to know any of C++ for this. But it works without compiling FreeCAD yourself too. since you are not common with git I would not recomend usining git rebase for an automatic rebase. Means you need to do it by yourself.

# download the latest windows binary from https://github.com/FreeCAD/FreeCAD/releases This is the base you should your code get rebased too. You will spend some time in coding to get your code to running on your new FreeCAD. If your code runs on the up to date FreeCAD you should push it on github again on exact the revision you are working with.


Up to date revisionID for windows dev is 5764. Start FreeCAD --> Help --> about --> click on copy to clipboard. Copy to an editor. The number behind hash is the commitID. The one we need to checkout in git, because it is the version your FreeCAD is based on. For an checkout you only need the first 7 character. For 5764 it should be eff2799

Code: Select all

# in your FreeCAD source directory
# make sure you are on master
git checkout master
# test the commitID by
git rev-list  eff2799 | wc -l 
# should be 5764

# checkout a new branch 
git checkout -b predeformation2 eff2799

git status
# on branch predeformation2 nothing to commit

# now you just need to do what you did for before
# copy your code to the FreeCAD git source

git status
# on branch predeformation2 lots of canges to commit, all the stuff you changed

# add to index, commit and push to github
git add .
git commit -m "your_commit_message"
git push https://github.com/makkemal/FreeCAD.git   predeformation2
Hope that helps. YEAH again lots of stuff, but I promise as soon as you are used to git you will be happy. Learning git is not that easy. But we all have been thought this

BTW: There have been changes in FEM resently. If I where you I would not take revision 5764 and waiting for the next Windows dev instead.
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 » Tue Oct 20, 2015 7:52 am

Hi Bernd
Tanks for the detailed description, I will wait for the next release and the include my update and resubmit to github

Regards
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 » Wed Oct 28, 2015 12:39 pm

Ok did I do things correctly this time ?

https://github.com/makkemal/FreeCAD/tre ... formation2
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 Oct 28, 2015 12:47 pm

makkemal wrote:Ok did I do things correctly this time ?

https://github.com/makkemal/FreeCAD/tre ... formation2
your commit on top of predeformation2 seams missing. The last commit on predeformation2 is from wmayer ?!