Hello,
I am writing a python script to generate my model and write the input file. The problem is I have 1000 elements in my mesh and I want to assign different material properties to each element. I was able to create the 1000 material constants and was able to create 1000 solid section. However, I don't know how to link a solid section to an element in the mesh. Usually in Abaqus CAE using the graphical interface the material is created well before creating the mesh.
Below are my code for creating the material and sections and link them together.
Should I create the mesh first then try to assign sections to elements by label?
I also tried to record my steps in macro but the problem is if I go to property the mesh disappear and I cannot assign sections to elements there
Below are my code for creating the material and sections and link them together.
for el in range (1,ele+1):
mdb.models['Model-%d' %(q)].Material(name='M%d' %(el))
mdb.models['Model-%d' %(q)].materials['M%d' %(el)].UserMaterial(mechanicalConstants=M[i])
mdb.models['Model-%d' %(q)].materials['M%d' %(el)].Depvar(n=700)
mdb.models['Model-%d' %(q)].HomogeneousSolidSection(material='M%d' %(el), name= 'Section-%d' %(el), thickness=None)