So, assuming I have a flattened list (with length = 135) where:
matrix_e = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, ...]
I'd like to write the elements of the list above into a text file, but I can only have a maximum of 16 elements per line. The output should look like this in the text file:
*Elset, elset = matrix
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
17,18,19,20,21,22,23,24,25,26,27,28,29,30,34,35,
36,37,38,
For context I am creating a mesh to be analyzed in Abaqus, and apparently you are only allowed 16 elements per line in the mesh file.
Is it possible to set a while condition when using the ','.join method?
Any ideas?