parameters: (self, inst, logger)
return_statement: return facet_evaluation(
              self.value in materials,
              self.message % {"value": "'/'".join(materials), "location": self.location_msg},
          )
docstring: Validate an ifc instance against that material facet.
  
          :param inst: IFC entity element
          :type inst: IFC entity
          :param logger: Logging object
          :type logger: logging
          :return: result of the validation as bool and message
          :rtype: facet_evaluation(bool, str)
docstring_summary: Validate an ifc instance against that material facet.
docstring_tokens: Validate an ifc instance against that material facet .
function: def __call__(self, inst, logger):
          """Validate an ifc instance against that material facet.
  
          :param inst: IFC entity element
          :type inst: IFC entity
          :param logger: Logging object
          :type logger: logging
          :return: result of the validation as bool and message
          :rtype: facet_evaluation(bool, str)
          """
  
          self.location = self.node["@location"]
  
          instance_material_rel = [rel for rel in inst.HasAssociations if rel.is_a("IfcRelAssociatesMaterial")]
          if ifcopenshell.util.element.get_type(inst):
              type_material_rel = [
                  rel
                  for rel in ifcopenshell.util.element.get_type(inst).HasAssociations
                  if rel.is_a("IfcRelAssociatesMaterial")
              ]
          else:
              type_material_rel = []
  
          if self.location == "instance":
              material_relations = list(instance_material_rel)
          elif self.location == "type" and type_material_rel:
              material_relations = list(type_material_rel)
          elif self.location == "any" and (instance_material_rel or type_material_rel):
              material_relations = instance_material_rel + type_material_rel
          else:
              material_relations = []
  
          materials = []
          for rel in material_relations:
              if rel.RelatingMaterial.is_a() == "IfcMaterial":
                  materials.append(rel.RelatingMaterial.Name)
              elif rel.RelatingMaterial.is_a() == "IfcMaterialMaterialList":  # DEPRECATED in IFC4
                  [materials.append(mat.Name) for mat in rel.RelatingMaterial]
              elif rel.RelatingMaterial.is_a() == "IfcMaterialConstituentSet":
                  [materials.append(mat.Material.Name) for mat in rel.RelatingMaterial.MaterialConstituents]
              elif rel.RelatingMaterial.is_a() == "IfcMaterialLayerSet":
                  [materials.append(mat.Name) for mat in rel.RelatingMaterial.MaterialLayers]
              elif rel.RelatingMaterial.is_a() == "IfcMaterialLayerSetUsage":
                  layers = rel.RelatingMaterial.ForLayerSet.MaterialLayers
                  [materials.append(layer.Material.Name) for layer in layers]
              elif rel.RelatingMaterial.is_a() == "IfcMaterialProfileSet":
                  [materials.append(mat.Material.Name) for mat in rel.RelatingMaterial.MaterialProfiles]
              elif rel.RelatingMaterial.is_a() == "IfcMaterialProfileSetUsage":
                  profileSets = rel.RelatingMaterial.ForProfileSet.MaterialProfiles
                  [materials.append(pset.Material.Name) for pset in profileSets]
              else:
                  raise Exception("IfcRelAssociatesMaterial not implemented")
  
          if not materials:
              materials.append("UNDEFINED")
  
          self.location_msg = location[self.location]
  
          return facet_evaluation(
              self.value in materials,
              self.message % {"value": "'/'".join(materials), "location": self.location_msg},
          )
function_tokens: def __call__ ( self , inst , logger ) : self . location = self . node [ "@location" ] instance_material_rel = [ rel for rel in inst . HasAssociations if rel . is_a ( "IfcRelAssociatesMaterial" ) ] if ifcopenshell . util . element . get_type ( inst ) : type_material_rel = [ rel for rel in ifcopenshell . util . element . get_type ( inst ) . HasAssociations if rel . is_a ( "IfcRelAssociatesMaterial" ) ] else : type_material_rel = [ ] if self . location == "instance" : material_relations = list ( instance_material_rel ) elif self . location == "type" and type_material_rel : material_relations = list ( type_material_rel ) elif self . location == "any" and ( instance_material_rel or type_material_rel ) : material_relations = instance_material_rel + type_material_rel else : material_relations = [ ] materials = [ ] for rel in material_relations : if rel . RelatingMaterial . is_a ( ) == "IfcMaterial" : materials . append ( rel . RelatingMaterial . Name ) elif rel . RelatingMaterial . is_a ( ) == "IfcMaterialMaterialList" : # DEPRECATED in IFC4 [ materials . append ( mat . Name ) for mat in rel . RelatingMaterial ] elif rel . RelatingMaterial . is_a ( ) == "IfcMaterialConstituentSet" : [ materials . append ( mat . Material . Name ) for mat in rel . RelatingMaterial . MaterialConstituents ] elif rel . RelatingMaterial . is_a ( ) == "IfcMaterialLayerSet" : [ materials . append ( mat . Name ) for mat in rel . RelatingMaterial . MaterialLayers ] elif rel . RelatingMaterial . is_a ( ) == "IfcMaterialLayerSetUsage" : layers = rel . RelatingMaterial . ForLayerSet . MaterialLayers [ materials . append ( layer . Material . Name ) for layer in layers ] elif rel . RelatingMaterial . is_a ( ) == "IfcMaterialProfileSet" : [ materials . append ( mat . Material . Name ) for mat in rel . RelatingMaterial . MaterialProfiles ] elif rel . RelatingMaterial . is_a ( ) == "IfcMaterialProfileSetUsage" : profileSets = rel . RelatingMaterial . ForProfileSet . MaterialProfiles [ materials . append ( pset . Material . Name ) for pset in profileSets ] else : raise Exception ( "IfcRelAssociatesMaterial not implemented" ) if not materials : materials . append ( "UNDEFINED" ) self . location_msg = location [ self . location ] return facet_evaluation ( self . value in materials , self . message % { "value" : "'/'" . join ( materials ) , "location" : self . location_msg } , )