Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FEM: Cut material name to 80 characters
CalculiX documentation tells that maximum alowed material name length
is 80 characters, so we have to respect that. Also ccx quietly fails if
that limit is not honoured.

Reported-by: bernd
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Apr 23, 2015
1 parent 1e026ac commit c5850e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Mod/Fem/MechanicalAnalysis.py
Expand Up @@ -510,17 +510,18 @@ def write_calculix_input_file(self):
print 'YM = ', YM
PR = float(MaterialObject['Object'].Material['PoissonRatio'])
print 'PR = ', PR
material_name = MaterialObject['Object'].Material['Name'][:80]
# write material properties
inpfile.write('*MATERIAL, NAME=' + MaterialObject['Object'].Material['Name'] + '\n')
inpfile.write('*MATERIAL, NAME=' + material_name + '\n')
inpfile.write('*ELASTIC \n')
inpfile.write('{0:.3f}, '.format(YM.Value * 1E-3))
inpfile.write('{0:.3f}\n'.format(PR))
# write element properties
if len(self.MaterialObjects) == 1:
inpfile.write('*SOLID SECTION, ELSET=' + MaterialObject['Object'].Name + ', MATERIAL=' + MaterialObject['Object'].Material['Name'] + '\n\n')
inpfile.write('*SOLID SECTION, ELSET=' + MaterialObject['Object'].Name + ', MATERIAL=' + material_name + '\n\n')
else:
if MaterialObject['Object'].Name == 'MechanicalMaterial':
inpfile.write('*SOLID SECTION, ELSET=' + MaterialObject['Object'].Name + ', MATERIAL=' + MaterialObject['Object'].Material['Name'] + '\n\n')
inpfile.write('*SOLID SECTION, ELSET=' + MaterialObject['Object'].Name + ', MATERIAL=' + material_name + '\n\n')

# write step beginn
inpfile.write('\n\n\n\n***********************************************************\n')
Expand Down

0 comments on commit c5850e5

Please sign in to comment.