Jee-Bee wrote:I want (finaly) add some functionality to FreeCAD FEM module.
To start not to difficult i want add a buckling function...
very good idea
Jee-Bee wrote:I have this example code from
https://github.com/FreeCAD/FreeCAD/blob ... alculix.py
Code: Select all
obj.addProperty("App::PropertyFloatConstraint", "EigenmodeLowLimit", "Fem", "Low frequency limit for eigenmode calculations")
ell = ccx_prefs.GetFloat("EigenmodeLowLimit", 0.0)
obj.EigenmodeLowLimit = (ell, 0.0, 1000000.0, 10000.0)
my question is ... what does this part of code does.
just try it in python console ...
it adds a new property to the plain solver object and reads the CalculiX prefs for this property and sets the property with the read property
code
Code: Select all
obj = FreeCAD.ActiveDocument.addObject("Fem::FemSolverObjectPython", 'MyOwnSolverType')
obj.PropertiesList # select new solver, check propery editor
obj.addProperty("App::PropertyFloatConstraint", "EigenmodeLowLimit", "Fem", "Low frequency limit for eigenmode calculations")
obj.PropertiesList # select new solver, check propery editor
obj.EigenmodeLowLimit # 0.0
ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx")
ell = ccx_prefs.GetFloat("EigenmodeLowLimit", 0.0)
obj.EigenmodeLowLimit = (ell, 0.0, 1000000.0, 10000.0)
obj.EigenmodeLowLimit # depending on your Calculix FEM ccx_prefs
output
Code: Select all
>>> obj = FreeCAD.ActiveDocument.addObject("Fem::FemSolverObjectPython", 'MyOwnSolverType')
>>> obj.PropertiesList # select new solver, check propery editor
['ExpressionEngine', 'Label', 'Proxy']
>>> obj.addProperty("App::PropertyFloatConstraint", "EigenmodeLowLimit", "Fem", "Low frequency limit for eigenmode calculations")
<Document object>
>>> obj.PropertiesList # select new solver, check propery editor
['EigenmodeLowLimit', 'ExpressionEngine', 'Label', 'Proxy']
>>> obj.EigenmodeLowLimit # 0.0
0.0
>>>
>>> ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx")
>>> ell = ccx_prefs.GetFloat("EigenmodeLowLimit", 0.0)
>>> obj.EigenmodeLowLimit = (ell, 0.0, 1000000.0, 10000.0)
>>> obj.EigenmodeLowLimit # depending on your Calculix FEM ccx_prefs
1.0
>>>
Jee-Bee wrote:second question buckling modes uses also number of modes. but i don't think it is a good idea to reuse the modes of frequency...
Do they create the same parameter in the input file? If they do, I would use the once from frequency.