View Issue Details

IDProjectCategoryView StatusLast Update
0002420FreeCADBugpublic2016-02-17 18:40
Reporterjouke Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version0.16 
Summary0002420: error with ccx_2.9
DescriptionLaunching CalculiX does not work when using version ccx_2.9
Steps To Reproducelaunch ccx
Additional InformationThe problem is related to the line in the ccx file defining Material parameters. If I change f.write('{\n}, '.format(YM_in_MPa)) to f.write('{}, '.format(YM_in_MPa)) on line 204 in ccxInpWriter.py all is well.
Not sur if this would work with older versions of ccx.

Cheers
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2016-01-26 15:10

administrator   ~0006757

A line f.write('{\n}, '.format(YM_in_MPa)) never existed in ccxInpWriter.py. Or do you mean you changed line 204 from:
 f.write('{}, '.format(YM_in_MPa))
to
 f.write('{\n}, '.format(YM_in_MPa))
?
But '{\n}'.format is invalid and raises a key error in Python.

jouke

2016-01-27 08:01

reporter   ~0006760

You're right, sorry, I commented by head. This is what I did to make it work:
diff --git a/src/Mod/Fem/ccxInpWriter.py b/src/Mod/Fem/ccxInpWriter.py
index 2ca3258..dba8cf7 100644
--- a/src/Mod/Fem/ccxInpWriter.py
+++ b/src/Mod/Fem/ccxInpWriter.py
@@ -202,7 +202,7 @@ class inp_writer:
             # write material properties
             f.write('*MATERIAL, NAME=' + mat_name + '\n')
             f.write('*ELASTIC \n')
- f.write('{}, \n'.format(YM_in_MPa))
+ f.write('{}, '.format(YM_in_MPa))
             f.write('{0:.3f}\n'.format(PR))
             density = FreeCAD.Units.Quantity(mat_obj.Material['Density'])
             density_in_tone_per_mm3 = float(density.getValueAs('t/mm^3'))

wmayer

2016-01-27 10:40

administrator   ~0006761

First the code was as you suggested and the newline was added later for no obvious reason.

The commit that changed this is:
https://github.com/FreeCAD/FreeCAD/commit/d380187ef319d5475d97f3f627e1647e4612c3b6#diff-11a4664f2e3b82ce921288e8c5fe9708L125

Related Changesets

FreeCAD: master 2f2e6e8f

2016-02-17 17:52:29

Bernd Hahnebach


Committer: wmayer Details Diff
FEM: infile fix, youngs modulus and poisons ratio

have to be in one line for ccx 2.9
Affected Issues
0002420
mod - src/Mod/Fem/ccxInpWriter.py Diff File

Issue History

Date Modified Username Field Change
2016-01-26 13:05 jouke New Issue
2016-01-26 15:10 wmayer Note Added: 0006757
2016-01-26 15:10 wmayer Status new => feedback
2016-01-27 08:01 jouke Note Added: 0006760
2016-01-27 08:01 jouke Status feedback => new
2016-01-27 10:40 wmayer Note Added: 0006761
2016-02-17 18:39 wmayer Changeset attached => FreeCAD Master master 2f2e6e8f
2016-02-17 18:40 wmayer Status new => closed
2016-02-17 18:40 wmayer Resolution open => fixed
2016-02-17 18:40 wmayer Fixed in Version => 0.16