@@ -6626,7 +6626,7 @@ def _write_geom_particle_flags(self, fp: typing.IO[Any], settings: D3plotWriterS
66266626 # only the first byte to the ascii char code
66276627 fmt_string = "{0:" + str (settings .wordsize ) + "}"
66286628 for name , _ in nlist_names_typecodes :
6629- name_formatted = fmt_string .format (name ).encode ("ascii " )
6629+ name_formatted = fmt_string .format (name ).encode ("utf-8 " )
66306630 for ch in name_formatted :
66316631 barray = bytearray (settings .wordsize )
66326632 barray [0 ] = ch
@@ -6842,16 +6842,17 @@ def _write_geom_user_ids(self, fp: typing.IO[Any], settings: D3plotWriterSetting
68426842 n_bytes_written += fp .write (settings .pack (nsrtd ))
68436843
68446844 if ArrayType .part_ids in self .arrays :
6845- # some lsdyna material pointer
6846- nsrma = info .ptr_material_ids
6847- n_bytes_written += fp .write (settings .pack (nsrma ))
6845+ # some lsdyna material pointer - Used by LS-Prepost in labelling materials
68486846
6849- # some lsdyna material pointer
6850- nsrmu = info .ptr_material_ids_defined_order
6851- n_bytes_written += fp .write (settings .pack (nsrmu ))
6847+ # Unsorted material ID pointer
6848+ nsrmu = nsrt + settings .header ["nelth" ]
6849+ # Sorted material ID pointer
6850+ nsrma = nsrmu + settings .header ["nmmat" ]
6851+ # Mapping array between sorted and unsorted
6852+ nsrmp = nsrma + settings .header ["nmmat" ]
68526853
6853- # some lsdyna material pointer
6854- nsrmp = info . ptr_material_ids_crossref
6854+ n_bytes_written += fp . write ( settings . pack ( nsrma ))
6855+ n_bytes_written += fp . write ( settings . pack ( nsrmu ))
68556856 n_bytes_written += fp .write (settings .pack (nsrmp ))
68566857
68576858 # "Total number of materials (parts)"
@@ -7382,7 +7383,7 @@ def _write_header_part_contact_interface_titles(
73827383 max_len = 18 * title_wordsize
73837384 fmt_name = "{0:" + str (max_len ) + "}"
73847385 for pid , title in zip (part_titles_ids , part_titles ):
7385- title = title .decode ("ascii " )
7386+ title = title .decode ("utf-8 " )
73867387 n_bytes_written += fp .write (settings .pack (pid ))
73877388
73887389 formatted_title = fmt_name .format (title [:max_len ])
0 commit comments