Skip to content

Commit

Permalink
FEM: Use local variable to avoid long strings in write_material_eleme…
Browse files Browse the repository at this point in the history
…nt_sets

print material_object['Object'].Name, ':  ', material_object['Object'].Material['Name']

becomes this:

print mat_obj_name, ':  ', mat_name

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed May 1, 2015
1 parent a99a897 commit d7ae64f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Mod/Fem/ccxInpWriter.py
Expand Up @@ -37,13 +37,17 @@ def write_calculix_input_file(self):
def write_material_element_sets(self, f):
f.write('\n\n***********************************************************\n')
f.write('** element sets for materials\n')
for material_object in self.material_objects:
print material_object['Object'].Name, ': ', material_object['Object'].Material['Name']
f.write('*ELSET,ELSET=' + material_object['Object'].Name + '\n')
for m in self.material_objects:
mat_obj = m['Object']
mat_obj_name = mat_obj.Name
mat_name = mat_obj.Material['Name']

print mat_obj_name, ': ', mat_name
f.write('*ELSET,ELSET=' + mat_obj_name + '\n')
if len(self.material_objects) == 1:
f.write('Eall\n')
else:
if material_object['Object'].Name == 'MechanicalMaterial':
if mat_obj_name == 'MechanicalMaterial':
f.write('Eall\n')
f.write('\n\n')

Expand Down

0 comments on commit d7ae64f

Please sign in to comment.