How to get the result of the FEM analysis ?(I spend the calculation without Gui)

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
anastassia
Posts: 5
Joined: Mon Dec 03, 2018 9:03 am

How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by anastassia »

Code: Select all

docpath = FreeCAD.ConfigGet("AppHomePath") + "data/examples/itogZ.FCStd"
doc = FreeCAD.open(docpath)
Importing project files......
for o in doc.Objects:
      print(o.Name)
SBORKA1228
Analysis
CalculiXccxTools
FEMMeshNetgen
ConstraintSelfWeight
SolidMaterial
FemConstraintInitialTemperature
FemConstraintPressure
FemConstraintDisplacement
FemConstraintDisplacement001
FemConstraintDisplacement002
FemConstraintDisplacement003
FemConstraintDisplacement004
FemConstraintTemperature

analysis = doc.Analysis
solver = doc.CalculiXccxTools
from femtools import ccxtools
fea = ccxtools.FemToolsCcx(analysis, solver, test_mode=True)
error = fea.check_prerequisites()
fea.update_objects()
fea.check_prerequisites()
fea.reset_all()
fea.update_objects()
fea.run()

Running CalculiX ccx......
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\FreeCAD 0.17\Mod\Fem\femtools\ccxtools.py", line 684, in run
    ret_code = self.start_ccx()
  File "C:\Program Files\FreeCAD 0.17\Mod\Fem\femtools\ccxtools.py", line 648, in start_ccx
    p = subprocess.Popen([self.ccx_binary, "-i ", f.baseName()],
AttributeError: 'FemToolsCcx' object has no attribute 'ccx_binary'
File .inp with geometry recorded, but the result of the calculation of thermomechanical analysis is not
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by DeepSOIC »

From the error message, I see that calculix (the solver) could not be launched. I have no clue why, sorry, maybe FEM people come in and help.
Please post your FreeCAD info, as described here: https://forum.freecadweb.org/viewtopic.php?f=3&t=2264 It's likely really important with this particular problem.


And please put your script in [code][/code] tags for viewing pleasure ;)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by bernd »

DeepSOIC wrote: Mon Dec 03, 2018 2:51 pm And please put your script in tags for viewing pleasure ;)
+1 I changed the post in this regard.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by bernd »

You should put in your FreeCAD info.

As DeepSoic stated, it seams Calculix binary is not found. Are you able to run the FEM 3D example from Start work bench with FreeCAD Gui?
anastassia
Posts: 5
Joined: Mon Dec 03, 2018 9:03 am

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by anastassia »

bernd wrote: Tue Dec 04, 2018 2:38 pm You should put in your FreeCAD info.

As DeepSoic stated, it seams Calculix binary is not found. Are you able to run the FEM 3D example from Start work bench with FreeCAD Gui?
Performing calculations using FreeCad Gui, I get a .frd file with the results.


OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Last edited by anastassia on Tue Dec 04, 2018 3:35 pm, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by Kunda1 »

Prob. move this to FEM subforum ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by bernd »

done
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by bernd »

would you provide your FreeCAD file or some Python code to reproduce your problem.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by bernd »

best would be if you could show the problem with the FreeCAD FEM 3D example from Start WB.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: How to get the result of the FEM analysis ?(I spend the calculation without Gui)

Post by bernd »

see https://forum.freecadweb.org/viewtopic.php?f=18&t=29729 it works for me with 3D FEM example from Start WB and latest dev version.
Post Reply