FEM: add FEM Mesh Type to the CalculiX elementset up to date only solid is supported

This commit is contained in:
Bernd Hahnebach 2015-09-11 18:16:42 +02:00
parent bab3ec689a
commit c7ab1fd98b
3 changed files with 10 additions and 12 deletions

View File

@ -55,15 +55,12 @@ class inp_writer:
f.write('** Element sets for materials\n')
f.write('** written by {} function\n'.format(sys._getframe().f_code.co_name))
for m in self.material_objects:
mat_obj = m['Object']
mat_obj_name = mat_obj.Name[:80]
f.write('*ELSET,ELSET=' + mat_obj_name + '\n')
if len(self.material_objects) == 1:
f.write('*ELSET,ELSET=MaterialSolidElements\n')
f.write('Eall\n')
else:
if mat_obj_name == 'MechanicalMaterial':
f.write('Eall\n')
print 'material object count: ', len(self.material_objects)
FreeCAD.Console.PrintError('Multiple materials are not yet supported!\n')
def write_fixed_node_sets(self, f):
f.write('\n***********************************************************\n')
@ -142,10 +139,11 @@ class inp_writer:
f.write('{0:.3e}, \n'.format(density_in_tone_per_mm3))
# write element properties
if len(self.material_objects) == 1:
f.write('*SOLID SECTION, ELSET=' + mat_obj_name + ', MATERIAL=' + mat_name + '\n')
f.write('*SOLID SECTION, ELSET=MaterialSolidElements, MATERIAL=' + mat_name + '\n')
else:
if mat_obj_name == 'MechanicalMaterial':
f.write('*SOLID SECTION, ELSET=' + mat_obj_name + ', MATERIAL=' + mat_name + '\n')
f.write('*SOLID SECTION, ELSET=MaterialSolidElements, MATERIAL=' + mat_name + '\n')
def write_step_begin(self, f):
f.write('\n***********************************************************\n')

View File

@ -391,7 +391,7 @@
***********************************************************
** Element sets for materials
** written by write_material_element_sets function
*ELSET,ELSET=MechanicalMaterial
*ELSET,ELSET=MaterialSolidElements
Eall
***********************************************************
@ -455,7 +455,7 @@ Eall
0.360
*DENSITY
1.000e-09,
*SOLID SECTION, ELSET=MechanicalMaterial, MATERIAL=Test Material
*SOLID SECTION, ELSET=MaterialSolidElements, MATERIAL=Test Material
***********************************************************
** One step is needed to calculate the mechanical analysis of FreeCAD

View File

@ -391,7 +391,7 @@
***********************************************************
** Element sets for materials
** written by write_material_element_sets function
*ELSET,ELSET=MechanicalMaterial
*ELSET,ELSET=MaterialSolidElements
Eall
***********************************************************
@ -455,7 +455,7 @@ Eall
0.360
*DENSITY
1.000e-09,
*SOLID SECTION, ELSET=MechanicalMaterial, MATERIAL=Test Material
*SOLID SECTION, ELSET=MaterialSolidElements, MATERIAL=Test Material
***********************************************************
** One step is needed to calculate the mechanical analysis of FreeCAD