Ccx writing .inp debugging

About the development of the FEM module/workbench.

Moderator: bernd

farahats9
Posts: 23
Joined: Tue Sep 22, 2020 12:13 am

Ccx writing .inp debugging

Post by farahats9 »

When using Calculix Solver in thermomechanical analysis the program completely freezes when I click write .inp file. I am assuming this could be because the mesh is big or the geometry has some error. What I want to know is there a way to know if it is still running or completely froze like a progress view or a log as I don't know if it will finish in a few minutes or a few hours or completely fail.
thschrader
Veteran
Posts: 3158
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Ccx writing .inp debugging

Post by thschrader »

Confirmed.
For ccx-solver and multimaterial. The inp-writing "hangs".
elmer solver: writing input files is 10-times faster.
See this thread, the "cup_FEM" file (last picture). I used elmer, ccx hangs.
https://forum.freecadweb.org/viewtopic.php?f=18&t=50543

At the moment we have solvers for mechanical, thermodynamic, cfd analysis.
Whats missing: a systematically comparison
I can do that in the next weeks.
Examples welcome.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Ccx writing .inp debugging

Post by bernd »

thschrader wrote: Sat Oct 10, 2020 6:45 pm Confirmed.
For ccx-solver and multimaterial. The inp-writing "hangs".
elmer solver: writing input files is 10-times faster.
See this thread, the "cup_FEM" file (last picture). I used elmer, ccx hangs.
https://forum.freecadweb.org/viewtopic.php?f=18&t=50543

At the moment we have solvers for mechanical, thermodynamic, cfd analysis.
Whats missing: a systematically comparison
I can do that in the next weeks.
Examples welcome.
elmer uses mesh groups to write the input file. if you activate experimental feature for group meshing and remesh, inp file writing for ccx takes less than 10 seconds. Searching in 250000 elements takes time. ATM for me 15 minutes have passed, but it could take hours on huge meshes ...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Ccx writing .inp debugging

Post by bernd »

after 30 minuten ... but

Code: Select all

...
21:39:11  Count finite elements as sum of constraints:   147650
21:39:11  Count finite elements of the finite element mesh: 150176
21:39:11  ERROR: femelement_table != count_femelements
21:39:11  Error in get_femelement_sets -- > femelements_count_ok() failed!
...
means either the mesh is wrong or retrieving the elements has some problems.
thschrader
Veteran
Posts: 3158
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Ccx writing .inp debugging

Post by thschrader »

bernd wrote: Sun Oct 11, 2020 7:05 pm ...
if you activate experimental feature for group meshing and remesh,...
OK, how must I do that? Using the button?
In preferences it seems activated as default.
I run on
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
mesh_groups.JPG
mesh_groups.JPG (132.52 KiB) Viewed 2515 times
ajdubas
Posts: 2
Joined: Fri Oct 16, 2020 4:28 pm

Re: Ccx writing .inp debugging

Post by ajdubas »

I had a similar issue of FreeCAD hanging while writing .inp files for ccx (not just taking a long time).
Eventually tracked it down to a call to time.clock raising an AttributeError as this function is not in Python 3.

A workaround that seems to work, though I am not sure it has equivalent functionality, is to enter the following in the Python console prior to writing the .inp for the calculation:
import time
time.clock = time.process_time

For reference this is in Version 0.18 Rev 14555. Should be an easy bugfix if it hasn't already been done.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ccx writing .inp debugging

Post by Kunda1 »

ajdubas wrote: Fri Oct 16, 2020 4:34 pm For reference this is in Version 0.18 Rev 14555. Should be an easy bugfix if it hasn't already been done.
JFYI, https://forum.freecadweb.org/viewtopic.php?f=18&t=12212
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
ajdubas
Posts: 2
Joined: Fri Oct 16, 2020 4:28 pm

Re: Ccx writing .inp debugging

Post by ajdubas »

Kunda1 wrote: Fri Oct 16, 2020 6:02 pm
ajdubas wrote: Fri Oct 16, 2020 4:34 pm For reference this is in Version 0.18 Rev 14555. Should be an easy bugfix if it hasn't already been done.
JFYI, https://forum.freecadweb.org/viewtopic.php?f=18&t=12212
Latest available release on flathub.org. Apologies if that is too far behind the curve.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ccx writing .inp debugging

Post by Kunda1 »

ajdubas wrote: Fri Oct 16, 2020 8:20 pm Latest available release on flathub.org. Apologies if that is too far behind the curve.
The have a beta branch
https://github.com/flathub/org.freecadw ... 9973a6576f
So you should use that one
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
froli78
Posts: 12
Joined: Sat Nov 28, 2020 7:21 pm
Location: Budapest

Re: Ccx writing .inp debugging

Post by froli78 »

Hi!

I have the same problem with a complex compsolid.

(Sorry if I'm incompetent or hard to understand what I want to tell in details. I start use the FreeCAD nearly a week ago, and I have poor english knowledge.)

My sys info:
OS: Ubuntu 20.04.1 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23074 (Git) AppImage
Build type: Release
Branch: master
Hash: 74b866ed3022fd1452c534dae31a721bcc668f2f
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Hungarian/Hungary (hu_HU)

Gmsh version: 3.0.6

Before I start to make the whole thing I tested the mesh and analysis on the part of it and it worked well:

Image

This was a simplier model but it was a compsolid which built up from four body part with two different (light and normal) concrete material.

Later I build the complex model.
(This is a balcony node model)

(And I struggled a lot of with mesh generation that I found was caused by touching curved surfaces so I purged those and after of it I could make a G-mesh. I think the compsolid model have no problematic parts now.)


Gmsh mesh create raise only a warning: "Warning : Surface mesh: worst distortion = -0.118564 (avg = 0.999805, 2 elements with jac."
(Later to check what cause the main problem I run the gmsh (3.0.6) on the exported .brep and with gmsh run the defult 3D mesh generation on it without any problem [no errors, or warns] and then import the result mesh back into FreeCAD in .inp format but this not solved the main problem.)

And now when I try to write the Thermo mechanical .inp file I get nothing but a "freezed" rotating wheel mouse pointer and the above mentioned element count not equal error. (Precisely the Thermo mechanical .inp file created in the temporary dictionary but the process fails.)

Error output:

Code: Select all

 Count finite elements as sum of constraints:   36252
    Count finite elements of the finite element mesh: 40434
    ERROR: femelement_table != count_femelements
    Error in get_femelement_sets -- > femelements_count_ok() failed!
    Unexpected error when writing CalculiX input file: <class 'KeyError'>
    Traceback (most recent call last):
     File "/tmp/.mount_FreeCAsLJw4k/usr/Mod/Fem/femtaskpanels/task_solver_ccxtools.py", line 307, in write_input_file_handler
      self.fea.write_inp_file()
     File "/tmp/.mount_FreeCAsLJw4k/usr/Mod/Fem/femtools/ccxtools.py", line 379, in write_inp_file
      self.inp_file_name = inp_writer.write_calculix_input_file()
     File "/tmp/.mount_FreeCAsLJw4k/usr/Mod/Fem/femsolver/calculix/writer.py", line 126, in write_calculix_input_file
      self.write_calculix_input()
     File "/tmp/.mount_FreeCAsLJw4k/usr/Mod/Fem/femsolver/calculix/writer.py", line 152, in write_calculix_input
      self.write_element_sets_material_and_femelement_type(inpfileMain)
     File "/tmp/.mount_FreeCAsLJw4k/usr/Mod/Fem/femsolver/calculix/writer.py", line 1400, in write_element_sets_material_and_femelement_type
      self.get_ccx_elsets_multiple_mat_solid()
     File "/tmp/.mount_FreeCAsLJw4k/usr/Mod/Fem/femsolver/calculix/writer.py", line 1740, in get_ccx_elsets_multiple_mat_solid
      ccx_elset["ccx_mat_name"] = mat_obj.Material["Name"]
    KeyError: 'Name'
I'll be glad if you can give some advise how to solve this!

Thanks!
Last edited by froli78 on Wed Dec 09, 2020 10:11 am, edited 1 time in total.
Post Reply