fcFEM - FEA from start to finish

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
HarryvL
Veteran
Posts: 1168
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

Jee-Bee wrote: Sat May 07, 2022 9:46 am You have to ping Bernd the last time bernd logedin was on 12 April
How do I do that :D
Jee-Bee
Veteran
Posts: 2386
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by Jee-Bee »

basically what you did now(most often the text is removed and the word ping is added).
I have see some people who can ping people from a macro but i don't where that one is coming from...
User avatar
Kunda1
Veteran
Posts: 12600
Joined: Thu Jan 05, 2017 9:03 pm

Re: fcFEM - FEA from start to finish

Post by Kunda1 »

Screenshot_20220507_093546.png
Screenshot_20220507_093546.png (110.37 KiB) Viewed 736 times
I like to use @TheMarkster's Pinger macro (it's in the addon manager under 'Macros')

Edit: As on this edit, @yorik enabled phpbb 'mentions', so all you need to ping someone is to prepend an @ in front of their forum usename. No need for pinger macro anymore :D
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
HarryvL
Veteran
Posts: 1168
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

If Bernd has not been active on the forum for a month then he will have a very good reason for that. I therefore don't want to bother him and am trying to understand the new input writer code on my own.

Bernd committed a major change to the FemInputWriterCcx on 19 February last year:

https://github.com/FreeCAD/FreeCAD/comm ... b8ba22117c

This affected 6 files with 29 additions and 155 deletions.

I can now locate the material data, but not yet the elements that go with that. I wrote a CCX input file to see if I can trace back where the element data comes from and how it is linked to the material in FC.

Now here is my latest challenge: Object ccxwriter gets passed around more than 100 times in 23+ files, but I cannot find the Class definition or any other declaration related to it.

Can somebody help me find it and/or give me some tips on how to unpick this Russian doll?
User avatar
PrzemoF
Veteran
Posts: 3387
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: fcFEM - FEA from start to finish

Post by PrzemoF »

I can't test that right now but git grep should get you to the definition quickly
User avatar
HarryvL
Veteran
Posts: 1168
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

Thanks, same search results as with PyCharm, but still no sign of an assignment or initiation of ccxwriter. I am at a loss how it is used everywhere without any import statements.
User avatar
PrzemoF
Veteran
Posts: 3387
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: fcFEM - FEA from start to finish

Post by PrzemoF »

Check src/Mod/Fem/femsolver/calculix/writer.py

Edit ccxwriter is used as a local variable (TBC)
User avatar
HarryvL
Veteran
Posts: 1168
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

Sorry, but I don’t see ccxwriter anywhere in that file. Also … if it is a local variable how does it get used in 22 other files without import of the relevant module?
User avatar
PrzemoF
Veteran
Posts: 3387
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: fcFEM - FEA from start to finish

Post by PrzemoF »

You won't see ccxwriter definition if it's used like that:

Code: Select all

src/Mod/Fem/femsolver/calculix/write_constraint_fixed.py:def write_meshdata_constraint(f, femobj, fix_obj, ccxwriter):
You have to check how to function is called:

Code: Select all

src/Mod/Fem/femsolver/writerbase.py:                con_module.write_meshdata_constraint(the_file, femobj, the_obj, self)
ccxwriter is self. Silly question, but are you familiar with python self?

https://www.geeksforgeeks.org/self-in-python-class/

I'll be away for a while, but if you post the part of the ccx input file I or someone else might try to help you. Element data is generated from mesh IIRC and how it's linked with the material - I'd check the CalculiX docs.
https://web.mit.edu/calculix_v2.7/Calcu ... index.html

https://web.mit.edu/calculix_v2.7/Calcu ... de113.html

https://web.mit.edu/calculix_v2.7/Calcu ... node7.html <- an example

"material is assigned to the element set Eall by means of the keyword card *SOLID SECTION. "

P.S. I found your question now. You want to extract material parameters from a ccx input file?
Material para,enters are written in: src/Mod/Fem/femsolver/calculix/write_femelement_material.py
Then the definition is used for elements - name of the material is the handle.
User avatar
HarryvL
Veteran
Posts: 1168
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

PrzemoF wrote: Wed May 11, 2022 9:20 pm You have to check how to function is called:
Thanks. That’s the bets Python tip so far.
PrzemoF wrote: Wed May 11, 2022 9:20 pm Silly question, but are you familiar with python self?
Not so silly. I am a FORTRAN guy and it shows.

I wrote fcFEM in Python (the FORTRANIC way) carefully avoiding objects and classes, but using list comprehension and other nifty Python tricks.

I read several books about Python, but still fell in the OOP trap.
Post Reply