### ===================================================================================================================
### Function to collect the class for the material based on VIIA naming conventions
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# No import required
### ===================================================================================================================
### 2. Get material-group based on material-name
### ===================================================================================================================
[docs]def viia_get_material_class(material_group: str, material_name: str) -> str:
"""
Function gets the subclass of the Material object which should be used.
Input:
- material_group (str): Name of the material group (determines the material being used).
- material_name (str): Name of the material.
Output:
- Returns the material subclass as string.
"""
if any(sub_str in material_name for sub_str in (
'BETON', 'LEWIS', 'KPV', 'COMBI', 'DUMMY', 'MPV', 'RIB', 'HVBP', 'SANDWICH', 'COSTEEL')) and \
'LIN-TROG-HOUT' not in material_name:
return 'Concrete'
elif any(sub_str in material_name for sub_str in ('STAAL', 'STDAK', 'GOLF')):
return 'Steel'
elif any(sub_str in material_name for sub_str in ('MW', 'NEHOBO')):
return 'Masonry'
elif any(sub_str in material_name for sub_str in ('CFRP-QUAKESHIELD', 'CFRPMESH', 'WAP')):
return 'ReinforcementSteel'
elif any(sub_str in material_name for sub_str in (
'LIN-HOUT', 'HSB', 'PLANKEN', 'PLATEN', 'HVBP-HOUTWOL', 'LIN-TROG-HOUT', 'UNIDEK')):
return 'Timber'
elif 'IF' in material_name:
return 'Interface'
elif 'MASSA' in material_name:
if 'Truss' in material_group:
return 'Steel'
return 'DiscreteMass'
elif 'USRDEF' in material_name:
return 'UserSuppliedSubroutine'
elif any(sub_str in material_name for sub_str in ('CAVITY-ANCHOR', 'SPOUWANKER-', 'ROTVEER-')):
return 'Spring'
raise ValueError(f"ERROR: Not able to recognise the material subclass of {material_name}.")
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================