calculix / CalculiX-Examples

CalculiX examples by Prof. Martin Kraska from Brandenburg University of Applied Sciences. Excellent starting point to master parametric modelling with CGX and CCX.
MIT License
299 stars 92 forks source link

CGX crash with swep #13

Closed mkraska closed 7 years ago

mkraska commented 7 years ago

This code crashes CGX 2.12 with elemChecker.c enabled (should that matter here? No elements generated so far)

valu ri 10
seto ind
  pnt pk0 0 0 0
  pnt pkx ri 0 0
  pnt pky 0 ri 0
  pnt pkz 0 0 ri
  #line lxy pkx pky pk0 8
  #line lyz pky pkz pk0 8
  line lzx pkz pkx pk0 8
  swep ind inds rot z 90 10 n

This is part of the CGX output

bug.fbd opened
 reading file
   #line lxy pkx pky pk0 8
   #line lyz pky pkz pk0 8
X: 0.000000 Y: 0.000000 Z: 10.000000
X: 1.950903 Y: 0.000000 Z: 9.807853
X: 3.826834 Y: 0.000000 Z: 9.238795
X: 5.555702 Y: 0.000000 Z: 8.314696
X: 7.071068 Y: 0.000000 Z: 7.071068
X: 8.314696 Y: 0.000000 Z: 5.555702
X: 9.238795 Y: 0.000000 Z: 3.826834
X: 9.807853 Y: 0.000000 Z: 1.950903
X: 10.000000 Y: 0.000000 Z: 0.000000
fitting B-Spline...BSpline fitting ... done
Error: 0.00131488 after 12-iterations
 --> Done
N001 DEFINE COMPACT 3 2 11 9 15 12
*** buffer overflow detected ***: /home/user/A_Inst_Calculix/CalculiX/cgx_2.12/src/cgx terminated
mkraska commented 7 years ago

bugfix by Pascal Mossier (author of the cgx code for the new option -n):

I corrected both bugs with minor changes in the source files:

copyEntity.c uselibSNL.cpp

With the altered files, the test case worked, and the goemetry could be meshed with tr3. Tr6u failed due to ambigious points.

cgx sweping issue.zip