Page 21 of 29

Re: fcFEM - FEA from start to finish

Posted: Sat May 07, 2022 10:05 am
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

Re: fcFEM - FEA from start to finish

Posted: Sat May 07, 2022 12:50 pm
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...

Re: fcFEM - FEA from start to finish

Posted: Sat May 07, 2022 1:36 pm
by Kunda1
Screenshot_20220507_093546.png
Screenshot_20220507_093546.png (110.37 KiB) Viewed 1670 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

Re: fcFEM - FEA from start to finish

Posted: Wed May 11, 2022 9:02 am
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?

Re: fcFEM - FEA from start to finish

Posted: Wed May 11, 2022 10:15 am
by PrzemoF
I can't test that right now but git grep should get you to the definition quickly

Re: fcFEM - FEA from start to finish

Posted: Wed May 11, 2022 1:20 pm
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.

Re: fcFEM - FEA from start to finish

Posted: Wed May 11, 2022 1:25 pm
by PrzemoF
Check src/Mod/Fem/femsolver/calculix/writer.py

Edit ccxwriter is used as a local variable (TBC)

Re: fcFEM - FEA from start to finish

Posted: Wed May 11, 2022 8:18 pm
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?

Re: fcFEM - FEA from start to finish

Posted: Wed May 11, 2022 9:20 pm
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.

Re: fcFEM - FEA from start to finish

Posted: Thu May 12, 2022 3:57 am
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.