### ===================================================================================================================
### Function to create the material-model for VIIA models
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, Dict, List, Optional, Union
# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.materials import MaterialModel, MaterialAspect, RayleighDamping, NoTensionConstantShearStiffness, \
Line3D2ShearDiagramNonLinearInterfaceModel, NoInterfaceOpening, GappingInterfaceOpening, BrittleGapModel, \
Point3DInterfaceType, Line3D2NormalInterfaceType, Line3D2ShearInterfaceType, Surface3DInterfaceType, \
LinearElasticityTranslationalSpringBehaviourMaterialModel, LinearElasticityRotationalSpringBehaviourMaterialModel, \
ForceElongationDiagramSpringBehaviourMaterialModel, DistributedMassModel, IsotropicTranslationalMassDamping, \
OrthotropicTranslationalMassDamping, PlasticStrainYieldStressHardeningModel, IsotropicHardening, VC1993LC, \
NoConfinement, ParabolicCSC, RotatingTSCM, RotsCBW, GovindjeeCBW, HordijkTSC, ExplicitHJF, BondSlipModel
# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
from viiapackage.viiaStatus import ViiaProject
### ===================================================================================================================
### 2. Create the material-model based on collected properties
### ===================================================================================================================
[docs]def viia_create_material_model(
project: ViiaProject, material_group: str, material_group_properties: Dict[str, Union[str, float, int]],
material_name: str, material_model_properties: Dict[str, Union[str, float, int, List[float]]])\
-> Optional[MaterialModel]:
"""
Function to create a material model for FEM model in VIIA project.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_group (str): Name of the materialgroup.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- material_name (str): Name of the material.
- material_group_properties (dict): Dictionary with all the needed material group parameters.
Output:
- Ceates and returns the requested material model object.
"""
# Create all the aspects objects and add those to the aspect list
aspects = []
if 'aspects' in material_group_properties.keys():
if 'rayleigh damping' in material_group_properties['aspects']:
aspects.append(RayleighDamping(
mass_factor=material_model_properties['rayleigh damping parameters'][0],
stiffness_factor=material_model_properties['rayleigh damping parameters'][1]))
# If no aspects are needed return None instead of an empty list
if len(aspects) == 0:
aspects = None
# Create the material model with their respecitive functions
material_model = material_group_properties['model']
if material_model == 'linear elastic isotropic' or material_model == 'linear elastic isotropic steel':
return _viia_create_linear_elastic_isotropic_model(project, material_model_properties, aspects)
elif material_model == 'linear elastic orthotropic':
return _viia_create_linear_elastic_orthotropic_model(project, material_model_properties, aspects)
elif material_model == 'linear elastic reinforcement':
return _viia_create_linear_elastic_isotropic_model(project, material_model_properties, aspects)
elif material_model == 'bond-slip reinforcement':
return _viia_create_bond_slip_reinforcement_model(project, material_model_properties, aspects)
elif material_model == 'direct stiffness matrix for flat shells':
return _viia_create_direct_stiffness_matrix_model(project, material_model_properties, aspects)
elif material_model == 'total strain based crack model':
return _viia_create_total_strain_crack_model(project, material_model_properties, aspects)
elif material_model == 'engineering masonry model':
return _viia_create_engineering_masonry_model(project, material_model_properties, aspects)
elif material_model == 'von mises and tresca plasticity':
return _viia_create_von_mises_plasticity_model(project, material_model_properties, aspects)
elif material_model == 'linear elasticity interface':
return _viia_create_linear_elastic_interface_model(project, material_name, material_model_properties, aspects)
elif material_model == 'coulomb friction':
return _viia_create_coulomb_friction_interface_model(project, material_name, material_model_properties, aspects)
elif material_model == 'nonlinear elasticity':
return _viia_create_non_linear_elastic_interface_model(
project, material_name, material_model_properties, aspects)
elif material_model == 'point mass':
return _viia_create_point_mass_material_model(project, material_model_properties, aspects)
elif material_model == 'line mass 3d':
return _viia_create_line_mass_material_model(project, material_model_properties, aspects)
elif material_model == 'surface mass':
return _viia_create_surface_mass_material_model(project, material_model_properties, aspects)
elif material_model == 'translational spring-dashpot':
return _viia_create_translational_spring_model(project, material_group, material_model_properties, aspects)
elif material_model == 'rotational spring-dashpot':
return _viia_create_rotational_spring_model(project, material_group, material_model_properties, aspects)
elif material_model == 'user supplied subroutine':
return None
# Else the material model is not recognised
raise NotImplementedError(
f"ERROR: Missing material model with group: '{material_group} and name: '{material_name}'.")
### ===================================================================================================================
### 3. Create the specific material-model based on collected properties including VIIA settings
### ===================================================================================================================
[docs]def _viia_create_linear_elastic_isotropic_model(project: 'ViiaProject', material_model_properties: Dict,
aspects: List[MaterialAspect]):
"""
Function to create a linear elastic isotropic material model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a LinearElasticIsotropicModel material object with VIIA settings.
"""
return project.create_linear_elastic_isotropic_model(
youngs_modulus=material_model_properties['youngs modulus'],
poissons_ratio=material_model_properties['poissons ratio'],
aspects=aspects)
[docs]def _viia_create_bond_slip_reinforcement_model(
project: 'ViiaProject', material_model_properties: Dict, aspects: List[MaterialAspect],
reinforcement_steel_type: str = 'linear elastic', bond_slip_interface_type: str = 'multi linear') \
-> BondSlipModel:
"""
Function to create a bond-slip reinforcement material model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
- reinforcement_steel_type (str): Type of material model for the steel reinforcement. Currently only 'linear
elastic' is available (default value).
- bond_slip_interface_type (str): Type of interface behaviour. Currently only 'multi linear' is available
(default value).
Output:
- Returns a Bonslip reinforcement material object with VIIA settings.
"""
# Check if the reinforcement steel type is available
if reinforcement_steel_type not in ['linear elastic']:
raise NotImplementedError(
"ERROR: This nponlinea material model for reinforcement steel is not been added to this functionality.")
# Check if the bond slip interface is available
if bond_slip_interface_type not in ['multi linear']:
raise NotImplementedError('This material model for bond slip has not been added to this functionality')
# Create the reinforcement steel and bond slip material models
nonlinear_reinforcement_model = None
if reinforcement_steel_type == 'linear elastic':
nonlinear_reinforcement_model = project.create_no_nonlinear_reinforcement_model()
bond_slip_interface_material_model = None
if bond_slip_interface_type == 'multi linear':
bond_slip_interface_material_model = project.create_multi_linear_bsi(
diagram=material_model_properties['bond slip diagram'],
restate_on_material_change=material_model_properties['RESETU'])
# Create the bond-slip material model
return project.create_bond_slip_material_model(
youngs_modulus=material_model_properties['youngs modulus'],
normal_stiffness=material_model_properties['normal stiffness'],
shear_stiffness=material_model_properties['shear stiffness'],
bond_slip_interface_failure_model=bond_slip_interface_material_model,
nonlinear_reinforcement_model=nonlinear_reinforcement_model,
poissons_ratio=material_model_properties['poissons ratio'],
aspects=aspects)
[docs]def _viia_create_linear_elastic_orthotropic_model(project: 'ViiaProject', material_model_properties: Dict,
aspects: List[MaterialAspect]):
"""
Function to create a linear elastic orthotropic material model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a LinearElasticOrthotropicModel material object with VIIA settings.
"""
return project.create_linear_elastic_orthotropic_model(
youngs_moduli=material_model_properties['youngs modulus'],
poissons_ratios=material_model_properties['poissons ratio'],
shear_moduli=material_model_properties['shear modulus'],
aspects=aspects)
[docs]def _viia_create_direct_stiffness_matrix_model(
project: 'ViiaProject', material_model_properties: Dict, aspects: List[MaterialAspect]):
"""
Function to create a direct stiffness matrix material model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a DirectStiffnessMatrixModel material model object with VIIA settings.
"""
membrane_stiffness_matrix = material_model_properties['matrix a - membrane stiffness']
bending_stiffness_matrix = material_model_properties['matrix d - bending stiffness']
shear_stiffness_matrix = material_model_properties['matrix e - shear stiffness']
if isinstance(membrane_stiffness_matrix, list):
membrane_stiffness_matrix = {
'a11': membrane_stiffness_matrix[0],
'a12': membrane_stiffness_matrix[1],
'a13': membrane_stiffness_matrix[2],
'a22': membrane_stiffness_matrix[3],
'a23': membrane_stiffness_matrix[4],
'a33': membrane_stiffness_matrix[5]}
if isinstance(bending_stiffness_matrix, list):
bending_stiffness_matrix = {
'd11': bending_stiffness_matrix[0],
'd12': bending_stiffness_matrix[1],
'd13': bending_stiffness_matrix[2],
'd22': bending_stiffness_matrix[3],
'd23': bending_stiffness_matrix[4],
'd33': bending_stiffness_matrix[5]}
if isinstance(shear_stiffness_matrix, list):
shear_stiffness_matrix = {
'e11': shear_stiffness_matrix[0],
'e12': shear_stiffness_matrix[1],
'e22': shear_stiffness_matrix[2]}
return project.create_direct_stiffness_matrix_model(
membrane_stiffness_matrix=membrane_stiffness_matrix,
bending_stiffness_matrix=bending_stiffness_matrix,
shear_stiffness_matrix=shear_stiffness_matrix,
aspects=aspects)
[docs]def _viia_create_total_strain_crack_model(project: 'ViiaProject', material_model_properties: Dict,
aspects: List[MaterialAspect]):
"""
Function to create a total strain crack model material model.
.. note:: VIIA uses only a specific material pattern with the following characteristics:
- Total strain based crack model: rotating
- Tensile curve: hordijk
- Reduction model: damaged based
- Compression curve: parabolic
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a TotalStrainCrackModel material model object with VIIA settings.
"""
tensile_curve = HordijkTSC(
tensile_strength=material_model_properties['tensile strength'],
tensile_fracture_energy=material_model_properties['mode-i tensile fracture energy'],
tensile_rest_strength=material_model_properties['residual tensile strength'],
poisson_reduction=material_model_properties['poissons ratio reduction model'],
crack_bandwidth=GovindjeeCBW())
compressive_curve = ParabolicCSC(
compressive_strength=material_model_properties['compressive strength'],
compressive_fracture_energy=material_model_properties['compressive fracture energy'],
compressive_rest_strength=material_model_properties['residual tensile strength'],
lateral_cracking=VC1993LC(lowerbound_reduction=material_model_properties['lower bound reduction curve']),
confinement=NoConfinement(),
crack_bandwidth=GovindjeeCBW())
return project.create_total_strain_crack_model(
youngs_modulus=material_model_properties['youngs modulus'],
total_strain_crack_model=RotatingTSCM(),
poissons_ratio=material_model_properties['poissons ratio'],
tensile_curve=tensile_curve,
compressive_curve=compressive_curve,
aspects=aspects)
[docs]def _viia_create_engineering_masonry_model(
project: 'ViiaProject', material_model_properties: Dict, aspects: List[MaterialAspect]):
"""
Function to create an engineering masonry material model.
.. note:: VIIA uses only a specific material pattern with the following characteristics:
- Head-joint failure type: direct input head-joint tensile strength.
- Crack bandwidth specification: Rots.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns an EngineeringMasonryModel material model object with VIIA settings.
"""
# Check if the compressive fracture energy is provided
if 'fracture energy in compression' in material_model_properties.keys():
compressive_fracture_energy = material_model_properties['fracture energy in compression']
else:
compressive_fracture_energy = material_model_properties['gc025x025']
# Get the settings for the head joint failure model
bed_joint_strength, head_joint_strength = material_model_properties['tensile strength']
return project.create_engineering_masonry_model(
youngs_modulus=material_model_properties['youngs modulus'],
shear_modulus=material_model_properties['shear modulus'],
tensile_fracture_energy=material_model_properties['fracture energy in tension'],
compressive_strength=material_model_properties['compressive strength'],
compressive_fracture_energy=compressive_fracture_energy,
factor_to_strain_at_compressive_strength=material_model_properties['factor to strain at compressive strength'],
cohesion=material_model_properties['cohesion'],
friction_angle=material_model_properties['friction angle'],
head_joint_failure_model=ExplicitHJF(bed_joint_strength, head_joint_strength),
shear_fracture_energy=material_model_properties['fracture energy in shear'],
compressive_unloading_factor=material_model_properties['unloading factor, 1=secant, 0=linear'],
tensile_rest_strength=material_model_properties['residual tensile strength'],
out_of_plane_shear_failure=material_model_properties['out of plane shear failure'],
crack_bandwidth=RotsCBW(),
aspects=aspects)
[docs]def _viia_create_von_mises_plasticity_model(project: 'ViiaProject', material_model_properties: Dict,
aspects: List[MaterialAspect]):
"""
Function to create a von mises plasticity material model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_name (str): Name of the material.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns VonMisesPlasticityModel material model object with VIIA settings.
"""
# Create the hardening model for the material model
plastic_hardening_model = PlasticStrainYieldStressHardeningModel(
strain_stress_diagram=material_model_properties['strain-stress diagram'],
hardening_hypothesis=material_model_properties['hardening hypothesis'],
hardening_type=IsotropicHardening())
return project.create_von_mises_plasticity_model(
youngs_modulus=material_model_properties['youngs modulus'],
poissons_ratio=material_model_properties['poissons ratio'],
plastic_hardening_model=plastic_hardening_model,
aspects=aspects)
[docs]def _viia_create_linear_elastic_interface_model(
project: 'ViiaProject', material_name: str, material_model_properties: Dict, aspects: List[MaterialAspect]):
"""
Function to create a linear elastic interface model.
Supported interface types:
- '3d line interface (2 shear, 1 normal)'
- '3d line interface (2 normal, 1 shear)',
- '3d point interface'
- '3D surface interface'
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_name (str): Name of the material.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a LinearElasticInterfaceModel material model object with VIIA settings.
"""
# Select the interface type by name of the material (VIIA naming convention)
if 'PUNT' in material_name:
interface_type_name = '3d point interface'
elif 'LIJN' in material_name:
normal_occurences = [item for item in material_model_properties.keys() if 'normal stiffness' in item.lower()]
if len(normal_occurences) == 1:
interface_type_name = '3d line interface (2 shear, 1 normal)'
else:
interface_type_name = '3d line interface (2 normal, 1 shear)'
elif 'VLAK' in material_name:
interface_type_name = '3d surface interface'
else:
# No valid interface type found
raise NotImplementedError(
f"Linear elastic interface model '{material_name}', the interface type is not implemented yet.")
interface_type = None
if interface_type_name == '3d point interface':
interface_type = Point3DInterfaceType(
normal_stiffness_modulus_x=material_model_properties['normal stiffness modulus-x'],
shear_stiffness_modulus_y=material_model_properties['shear stiffness modulus-y'],
shear_stiffness_modulus_z=material_model_properties['shear stiffness modulus-z'])
elif interface_type_name == '3d line interface (2 shear, 1 normal)':
interface_type = Line3D2ShearInterfaceType(
normal_stiffness_modulus_y=material_model_properties['normal stiffness modulus-y'],
shear_stiffness_modulus_x=material_model_properties['shear stiffness modulus-x'],
shear_stiffness_modulus_z=material_model_properties['shear stiffness modulus-z'])
elif interface_type_name == '3d line interface (2 normal, 1 shear)':
interface_type = Line3D2NormalInterfaceType(
normal_stiffness_modulus_y=material_model_properties['normal stiffness modulus-y'],
normal_stiffness_modulus_z=material_model_properties['normal stiffness modulus-z'],
shear_stiffness_modulus_x=material_model_properties['shear stiffness modulus-x'])
elif interface_type_name == '3d surface interface':
interface_type = Surface3DInterfaceType(
normal_stiffness_modulus_z=material_model_properties['normal stiffness modulus-z'],
shear_stiffness_modulus_x=material_model_properties['shear stiffness modulus-x'],
shear_stiffness_modulus_y=material_model_properties['shear stiffness modulus-y'])
return project.create_linear_elastic_interface_model(interface_type, aspects)
[docs]def _viia_create_non_linear_elastic_interface_model(project: 'ViiaProject', material_name: str,
material_model_properties: Dict, aspects: List[MaterialAspect]):
"""
Function to create a non-linear elastic interface model.
Supported interface types:
- '3d line interface (2 shear, 1 normal)'
Supported nonlinear elasticity:
- 'No-tension with constant shear stiffness'
- 'Diagrams'
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_name (str): Name of the material.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a NonLinearElasticInterfaceModel material model object with VIIA settings.
"""
# For now only 3d line interface with 2 shear and 1 normal stiffnesses can be used
normal_occurences = [item for item in material_model_properties.keys() if 'normal stiffness' in item.lower()]
if 'LIJN' not in material_name or len(normal_occurences) != 1:
raise NotImplementedError(
f"Non-linear elastic interface model '{material_name}', the interface type is not implemented yet.")
# Create the interface type
interface_type = Line3D2ShearInterfaceType(
normal_stiffness_modulus_y=material_model_properties['normal stiffness modulus-y'],
shear_stiffness_modulus_x=material_model_properties['shear stiffness modulus-x'],
shear_stiffness_modulus_z=material_model_properties['shear stiffness modulus-z'])
# Select the nonlinear model
if 'no tension parameters' in material_model_properties:
# No-tension with constant shear stiffness
critical_interface_opening, normal_stiffness_reduction_factor = \
material_model_properties['no tension parameters']
nonlinear_model = NoTensionConstantShearStiffness(
critical_interface_opening=critical_interface_opening,
normal_stiffness_reduction_factor=normal_stiffness_reduction_factor)
else:
# Diagrams for 3d line interface with 2 shear and 1 normal stiffnesses
nonlinear_model = Line3D2ShearDiagramNonLinearInterfaceModel(
normal_direction_y=material_model_properties['normal direction-y'],
shear_direction_x=material_model_properties['shear direction-x'],
shear_direction_z=material_model_properties['shear direction-z'])
return project.create_non_linear_elastic_interface_model(
interface_type=interface_type, nonlinear_model=nonlinear_model, aspects=aspects)
[docs]def _viia_create_coulomb_friction_interface_model(project: 'ViiaProject', material_name: str,
material_model_properties: Dict, aspects: List[MaterialAspect]):
"""
Function to create a coulomb friction interface model.
Supported interface types:
- '3d point interface'
- '3d line interface (2 shear, 1 normal)'
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_name (str): Name of the material.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a LinearElasticInterfaceModel material model object with VIIA settings.
"""
# For now only 3d line interface with 2 shear and 1 normal stiffnesses can be used
normal_occurences = [item for item in material_model_properties.keys() if 'normal stiffness' in item.lower()]
if 'PUNT' in material_name:
interface_type_name = '3d point interface'
elif 'LIJN' in material_name and len(normal_occurences) == 1:
interface_type_name = '3d line interface (2 shear, 1 normal)'
else:
raise NotImplementedError(
f"Non-linear elastic interface model '{material_name}', the interface type is not implemented yet.")
interface_type = None
if interface_type_name == '3d point interface':
interface_type = Point3DInterfaceType(
normal_stiffness_modulus_x=material_model_properties['normal stiffness modulus-x'],
shear_stiffness_modulus_y=material_model_properties['shear stiffness modulus-y'],
shear_stiffness_modulus_z=material_model_properties['shear stiffness modulus-z'])
elif interface_type_name == '3d line interface (2 shear, 1 normal)':
interface_type = Line3D2ShearInterfaceType(
normal_stiffness_modulus_y=material_model_properties['normal stiffness modulus-y'],
shear_stiffness_modulus_x=material_model_properties['shear stiffness modulus-x'],
shear_stiffness_modulus_z=material_model_properties['shear stiffness modulus-z'])
# Select the gapping model
if 'tensile strength' in material_model_properties:
# The gapping model is used
opening_model = GappingInterfaceOpening(
gap_value=material_model_properties['tensile strength'],
gap_model=BrittleGapModel())
else:
# No opening
opening_model = NoInterfaceOpening()
return project.create_coulomb_friction_interface_model(
interface_type=interface_type,
cohesion=material_model_properties['cohesion'],
friction_angle=material_model_properties['friction angle'],
dilatancy_angle=material_model_properties['dilatancy angle'],
hardening_diagram_cohesion=material_model_properties['hardening diagram cohesion'],
hardening_diagram_friction=material_model_properties['hardening diagram friction'],
opening_model=opening_model,
aspects=aspects)
[docs]def _viia_create_point_mass_material_model(project: 'ViiaProject', material_model_properties: Dict,
aspects: List[MaterialAspect]):
"""
Function to create a point mass material model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a PointMassMaterialModel material model object with VIIA settings.
"""
# By default the damp coefficient(s) are zero, do not take them into account
mass_bebaviour_properties = material_model_properties['MASS']
if len(mass_bebaviour_properties) == 1:
mass_damping_behaviour = IsotropicTranslationalMassDamping(concentrated_mass=mass_bebaviour_properties[0])
else:
# By default three values are expected
concentrated_mass_x, concentrated_mass_y, concentrated_mass_z = mass_bebaviour_properties
mass_damping_behaviour = OrthotropicTranslationalMassDamping(
concentrated_mass_x=concentrated_mass_x,
concentrated_mass_y=concentrated_mass_y,
concentrated_mass_z=concentrated_mass_z)
return project.create_point_mass_material_model(
mass_damping_behaviour=mass_damping_behaviour,
aspects=aspects)
[docs]def _viia_create_line_mass_material_model(project: 'ViiaProject', material_model_properties: Dict,
aspects: List[MaterialAspect]):
"""
Function to create a line mass material model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a LineMassMaterialModel material model object with VIIA settings.
"""
(distributed_mass_tangential_direction,
distributed_mass_first_normal_direction,
distributed_mass_second_normal_direction) = material_model_properties['distributed mass']
return project.create_line_mass_material_model(
distributed_mass_tangential_direction=distributed_mass_tangential_direction,
distributed_mass_first_normal_direction=distributed_mass_first_normal_direction,
distributed_mass_second_normal_direction=distributed_mass_second_normal_direction,
aspects=aspects)
[docs]def _viia_create_surface_mass_material_model(project: 'ViiaProject', material_model_properties: Dict,
aspects: List[MaterialAspect]):
"""
Function to create a surface mass material model.
.. note:: VIIA uses only surface material model with distributed mass model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a SurfaceMassMaterialModel material model object with VIIA settings.
"""
# For now only the distributed mass model be taken into account.
tangentional_x_direction, tangentional_y_direction, normal_direction = material_model_properties['MASSSU']
return project.create_surface_mass_material_model(
mass_distribution_model=DistributedMassModel(
tangential_x_direction=tangentional_x_direction,
tangential_y_direction=tangentional_y_direction,
normal_direction=normal_direction),
aspects=aspects)
[docs]def _viia_create_translational_spring_model(
project: 'ViiaProject', material_group: str, material_model_properties: Dict, aspects: List[MaterialAspect]):
"""
Function to create a translational spring model.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- material_group (str): Name of the materialgroup.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a TranslationalSpring material model object with VIIA settings.
"""
# Create linear spring behaviour
if 'linear' in material_group.lower():
spring_behaviour = LinearElasticityTranslationalSpringBehaviourMaterialModel()
else:
# Non linear spring with diagram
if 'elongation-force' in material_model_properties:
force_elongation_diagram = material_model_properties['elongation-force']
spring_behaviour = ForceElongationDiagramSpringBehaviourMaterialModel(
force_elongation_diagram=force_elongation_diagram)
else:
raise NotImplementedError(
"Translational spring model, the spring behaviour 'Ultimate forces' is not implemented yet")
constant_damping_coefficient = 0
if 'constant damping coefficient' in material_model_properties:
constant_damping_coefficient = material_model_properties['constant damping coefficient']
return project.create_translational_spring_model(
spring_stiffness=material_model_properties['spring stiffness'],
spring_behaviour=spring_behaviour,
constant_damping_coefficient=constant_damping_coefficient,
aspects=aspects)
[docs]def _viia_create_rotational_spring_model(
project: 'ViiaProject', material_group: str, material_model_properties: Dict,
aspects: Optional[List[MaterialAspect]] = None):
"""
Function to create a rotational spring model.
Input:
- project (obj): Project object containing collections of fem objects and project variables.
- material_group (str): Name of the materialgroup.
- material_model_properties (dict): Dictionary with all the needed material model parameters.
- aspects (list): List with all the aspect objects of the models.
Output:
- Returns a TranslationalSpring material model object with VIIA settings.
"""
# Create linear spring behaviour
if 'linear' in material_group.lower():
spring_behaviour = LinearElasticityRotationalSpringBehaviourMaterialModel()
else:
raise NotImplementedError
constant_damping_coefficient = 0
if 'constant damping coefficient' in material_model_properties:
constant_damping_coefficient = material_model_properties['constant damping coefficient']
return project.create_rotational_spring_model(
spring_stiffness=material_model_properties['spring stiffness'],
spring_behaviour=spring_behaviour,
constant_damping_coefficient=constant_damping_coefficient,
aspects=aspects)
### ===================================================================================================================
### 4. End of script
### ===================================================================================================================