def METHOD_NAME(self, element_id=None):
    if element_id is None:
        n = self.n
        element_id = self.element_id
    else:
        n = len(element_id)
    material_id = full(n, nan, dtype='int32')
    self.model.log.debug('----get_material_id_by_element_id----')
    self.model.log.debug('element_id = %s' % element_id)
    etypes = self._get_types()
    eid_pid = self.get_element_id_property_id()
    i = argsort(eid_pid[:, 0])
    eid_pid = eid_pid[i, :]
    j = searchsorted(eid_pid[:, 0], element_id)
    pids = eid_pid[j, 1]
    upids = unique(pids)
    ptypes = [
        self.model.elements.properties_solid.psolid,
        self.model.elements.properties_solid.plsolid,
    ]
    nupid = len(upids)
    upid_mids = zeros((nupid, 2), dtype='int32')
    for ptype in ptypes:
        for pid in upids:
            if pid in ptype.property_id:
                i = where(pid == ptype.property_id)[0]
                mid = ptype.material_id[i][0]
                upid_mids[i] = mid
                j = where(pid == pids)[0]
                material_id[j] = mid
    self.model.log.debug('material_id = %s' % material_id)
    return material_id