Source code for viiapackage.connections.interface_detail

### ===================================================================================================================
###   InterfaceDetail class
### ===================================================================================================================
# Copyright ©VIIA 2024

### ===================================================================================================================
###   1. Import modules
### ===================================================================================================================

# General imports
from __future__ import annotations
from warnings import warn
from typing import TYPE_CHECKING, Optional, Type, Tuple, List, Union

# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.general import Direction
from rhdhv_fem.shapes import Shapes, Surfaces, Lines
from rhdhv_fem.shape_geometries import Node, Line
from rhdhv_fem.fem_math import fem_unit_vector, fem_cross_product_vector, fem_compare_values, fem_flip_vector,\
    fem_point_on_line, fem_point_in_surface
from rhdhv_fem.materials import Material
from rhdhv_fem.geometries import Geometry, PerimeterILG, FlatLIST
from rhdhv_fem.data import Data

# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
    from viiapackage.viiaStatus import ViiaProject
from viiapackage.connections.details import Detail
from viiapackage.connections.get_dimensions import viia_get_thickness_from_geometry_model, \
    viia_get_timberfloor_dimensions, viia_get_width_from_geometry_model
from viiapackage.connections.helper_functions import _get_shape_direction


### ===================================================================================================================
###   2. Class InterfaceDetail
### ===================================================================================================================

[docs]class InterfaceDetail(Detail): """ This is the class with information from the UPR regarding the detail numbers for connections."""
[docs] def __init__( self, detail_nr: str, geometry_type: str, interface_type: str, source_shape_type: Type[Shapes], target_shape_type: Type[Shapes], thickness_dependency: Optional[str] = None, interface_thickness: Optional[float] = None, area_dependency: Optional[str] = None, y_axis_dependency: Optional[str] = None, local_x_axis: Optional[str] = None, local_y_axis: Optional[str] = None, only_linear: Optional[bool] = None): """ Input: - detail_nr (str): Name of the requested detail, see the Basis of Design (UPR). - geometry_type (str): The type of geometry for the no-connection detail. Select from 'point' or 'line'. - interface_type (str): Type of interface, select from '3d point interface', '3d line interface (2 shear 1 normal)' or '3d line interface (2 normal 1 shear)'. - source_shape_type (cls): Class for the source shape-type. The provided source shape will be checked if it is an instance of this class. Available are classes that inherit from Shapes. - target_shape_type (cls): Class for the target shape-type. The provided target shape will be checked if it is an instance of this class. Available are classes that inherit from Shapes. - thickness_dependency (str): Select the method to determine the thickness parameter for line-interface. This value is required for line-interfaces and set to None for point-interfaces, any input is then neglected. - interface_thickness (float): If the thickness_dependency is set to 'user' the interface-thickness parameter is used to set a value for the thickness for the interface. In any other case this input is neglected. - area_dependency (str): Select the method to determine the area parameter for point-interface. This value is required for point-interfaces and set to None for line-interfaces, any input is then neglected. - y_axis_dependency (str): Select the method to determine the direction of the local y-axis for line- interfaces. Set to None for point-interfaces, any input is neglected. - local_x_axis (str): Select the method to determine the direction of the local x-axis for point-interfaces. Set to None for line-interfaces, any input is neglected. - local_y_axis (str): Select the method to determine the direction of the local y-axis for point-interfaces. Set to None for line-interfaces, any input is neglected. - only_linear (bool): If the detail is only available with linear material properties this option should be set to True. Default value is False. """ # __init__ method of Detail class is carried out Detail.__init__( self, detail_nr=detail_nr, geometry_type=geometry_type, source_shape_type=source_shape_type, target_shape_type=target_shape_type) # Set interface specific settings # See property methods self.interface_type = interface_type self.thickness_dependency = thickness_dependency self.y_axis_dependency = y_axis_dependency self.area_dependency = area_dependency self.interface_thickness = interface_thickness self.local_x_axis = local_x_axis self.local_y_axis = local_y_axis self.only_linear = only_linear
@property def interface_type(self): return self.__interface_type @interface_type.setter def interface_type(self, new_interface_type: str): if new_interface_type.lower() not in [ '3d point interface', '3d line interface (2 shear, 1 normal)', '3d line interface (2 normal, 1 shear)']: raise ValueError( "ERROR: The detail should have a interface-type of '3d point interface', '3d line interface " "(2 shear 1 normal)' or '3d line interface (2 normal 1 shear)'.") self.__interface_type = new_interface_type.lower() @property def thickness_dependency(self): return self.__thickness_dependency @thickness_dependency.setter def thickness_dependency(self, new_thickness_dependency: Optional[str] = None): if self.geometry_type == 'point': self.__thickness_dependency = None else: validate_list = [ 'source_thickness', 'source_name', 'source_width', 'target_thickness', 'target_width', 'target_name_and_source_width', 'source_name_and_target_thickness', 'target_name_and_source_thickness', 'minimum_thickness', 'user'] if not isinstance(new_thickness_dependency, str) or new_thickness_dependency.lower() not in validate_list: raise ValueError( f"ERROR: The thickness dependency setting '{new_thickness_dependency}' of detail " f"'{self.detail_nr}' was not recognised. Please select from {', '.join(validate_list)}. " f"Input provided: {new_thickness_dependency}.") self.__thickness_dependency = new_thickness_dependency.lower() @property def interface_thickness(self): return self.__interface_thickness @interface_thickness.setter def interface_thickness(self, new_interface_thickness: float): if self.thickness_dependency != 'user': self.__interface_thickness = None else: if not isinstance(new_interface_thickness, (float, int)): raise ValueError( f"ERROR: The interface-thickness for detail '{self.detail_nr}' with thickness dependency 'user' " f"should be provided as float.") self.__interface_thickness = float(new_interface_thickness) @property def area_dependency(self): return self.__area_dependency @area_dependency.setter def area_dependency(self, new_area_dependency: Optional[str] = None): if self.geometry_type == 'line': self.__area_dependency = None else: validate_list = [ 'source_width_and_source_thickness', 'target_width_and_target_height', 'source_width_and_source_height', 'half_source_width_and_target_thickness', 'half_source_thickness_and_target_width', 'source_thickness_and_target_width', 'source_thickness_and_target_width', 'half_target_width_and_source_thickness', 'source_width_and_target_width', 'target_width_and_source_width'] if not isinstance(new_area_dependency, str) or new_area_dependency.lower() not in validate_list: raise ValueError( f"ERROR: The area dependency setting '{new_area_dependency}' of detail '{self.detail_nr}' " f"was not recognised. Please select from {', '.join(validate_list)}.") self.__area_dependency = new_area_dependency.lower() @property def local_x_axis(self): return self.__local_x_axis @local_x_axis.setter def local_x_axis(self, new_local_x_axis: Optional[str] = None): validate_list = [ 'source_x_axis', 'source_y_axis', 'source_z_axis', 'target_x_axis', 'target_y_axis', 'target_z_axis', 'target_z_axis_negative', 'vertical'] if self.geometry_type == 'line': self.__local_x_axis = None else: if isinstance(new_local_x_axis, str) and new_local_x_axis in validate_list: self.__local_x_axis = new_local_x_axis else: raise ValueError( f"ERROR: Point-connections {self.detail_nr} requires input for local x-axis from " f"{', '.join(validate_list)}. Input provided: {new_local_x_axis}.") @property def local_y_axis(self): return self.__local_y_axis @local_y_axis.setter def local_y_axis(self, new_local_y_axis: Optional[str] = None): validate_list = [ 'source_x_axis', 'source_y_axis', 'source_z_axis', 'target_x_axis', 'target_y_axis', 'target_z_axis', 'source_to_target_x_axis', 'source_to_target_x_axis_horizontal', 'source_to_target_y_axis'] if self.geometry_type == 'line': self.__local_y_axis = None else: if isinstance(new_local_y_axis, str) and new_local_y_axis in validate_list: self.__local_y_axis = new_local_y_axis else: raise ValueError( f"ERROR: Point-connections {self.detail_nr} requires input for local y-axis from " f"{', '.join(validate_list)}. Input provided: {new_local_y_axis}.") @property def only_linear(self): return self.__only_linear @only_linear.setter def only_linear(self, new_only_linear: Optional[bool] = None): if isinstance(new_only_linear, bool) and new_only_linear: self.__only_linear = True else: self.__only_linear = False @property def name(self): """ Method of 'InterfaceDetail' to return the VIIA name for the interface connection detail.""" if self.geometry_type == 'point': return 'PUNT-IF' else: return 'LIJN-IF'
[docs] def validate_specific_input(self, source: Shapes, target: Shapes): """ Method of 'InterfaceDetail' to validate if the provided source or target shape requires timber floor with joists. Input: - source (obj): Object reference of the source shape for the detail. - target (obj): Object reference of the target shape for the detail. Output: - Returns an error in case the source or target shape doesn't comply to the thickness_dependency. """ # Check for timber floors if self.thickness_dependency is not None: if self.thickness_dependency in ['source_name', 'source_name_and_target_thickness']: if 'PLATEN' not in source.name and 'PLANKEN' not in source.name: raise ValueError( f"ERROR: The detail {self.detail_nr} requires a source shape to be a timber floor with joists. " f"Provided was {source.name}.") elif self.thickness_dependency in ['target_name', 'target_name_and_target_thickness']: if 'PLATEN' not in target.name and 'PLANKEN' not in target.name: raise ValueError( f"ERROR: The detail {self.detail_nr} requires a target shape to be a timber floor with joists. " f"Provided was {source.name}.")
[docs] def get_thickness_interface(self, source: Shapes, target: Shapes) -> float: """ Method of 'Detail' class to calculate the thickness for the line interface. The way to calculate the thickness is determined by the setting for thickness-dependency. Settings are default for VIIA project, set in the constants file. Input: - source (obj): Object reference of the source shape for the detail. - target (obj): Object reference of the target shape for the detail. Output: - Returns the value of the thickness for the line interface as float, in [m]. - If no thickness-dependcy is set an error will be raised. """ if self.thickness_dependency == 'source_thickness': return viia_get_thickness_from_geometry_model(shape=source) elif self.thickness_dependency == 'source_name': for item in ['PLANKEN', 'PLATEN']: if item in source.name: timber_floor = viia_get_timberfloor_dimensions(shape=source) return round( timber_floor['joist_width'] * viia_get_thickness_from_geometry_model(shape=target) / timber_floor['joist_ctc'], 3) elif self.thickness_dependency == 'source_width': return viia_get_width_from_geometry_model(shape=source) elif self.thickness_dependency == 'target_thickness': return viia_get_thickness_from_geometry_model(shape=target) elif self.thickness_dependency == 'target_width': return viia_get_width_from_geometry_model(shape=target) elif self.thickness_dependency == 'target_name_and_source_width': for item in ['PLANKEN', 'PLATEN']: if item in target.name: timber_floor = viia_get_timberfloor_dimensions(shape=target) return round( timber_floor['joist_width'] * viia_get_width_from_geometry_model(shape=source) / timber_floor['joist_ctc'], 3) elif self.thickness_dependency == 'source_name_and_target_thickness': for item in ['PLANKEN', 'PLATEN']: if item in source.name: timber_floor = viia_get_timberfloor_dimensions(shape=source) return round( timber_floor['joist_width'] * viia_get_thickness_from_geometry_model(shape=target) / timber_floor['joist_ctc'], 3) elif self.thickness_dependency == 'target_name_and_source_thickness': for item in ['PLANKEN', 'PLATEN']: if item in target.name: timber_floor = viia_get_timberfloor_dimensions(shape=target) return round( timber_floor['joist_width'] * viia_get_thickness_from_geometry_model(shape=source) / timber_floor['joist_ctc'], 3) elif self.thickness_dependency == 'minimum_thickness': return min(viia_get_thickness_from_geometry_model(shape=source), viia_get_thickness_from_geometry_model(shape=target)) # All variants based on user definition elif self.thickness_dependency == 'user': warn(f"WARNING: Check thickness of connection detail {self.detail_nr}. It should match with width of the " f"support.") return self.interface_thickness else: raise NotImplementedError(f"ERROR: The interface thickness for {self.detail_nr} could not be retrieved.")
[docs] def get_area_interface(self, source: Shapes, target: Shapes) -> float: """ Method of 'Detail' class to calculate the area for the point interface. The way to calculate the area is determined by the setting for area-dependency. Settings are default for VIIA project, set in the constants file. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - source (obj): Object reference of the source shape for the detail. - target (obj): Object reference of the target shape for the detail. Output: - Returns the value of the area for the point interface as float, in [m2]. - If no area-dependency is set an error will be raised. """ if self.area_dependency == 'source_width_and_source_thickness': return viia_get_width_from_geometry_model(source) * viia_get_thickness_from_geometry_model(source) elif self.area_dependency == 'target_width_and_target_height': return viia_get_width_from_geometry_model(target) * viia_get_thickness_from_geometry_model(target) elif self.area_dependency == 'source_width_and_source_height': return viia_get_width_from_geometry_model(source) * viia_get_thickness_from_geometry_model(source) elif self.area_dependency == 'half_source_width_and_target_thickness': return 0.5 * viia_get_width_from_geometry_model(source) * viia_get_thickness_from_geometry_model(target) elif self.area_dependency == 'half_source_thickness_and_target_width': return 0.5 * viia_get_thickness_from_geometry_model(source) * viia_get_width_from_geometry_model(target) elif self.area_dependency == 'source_thickness_and_target_width': return viia_get_thickness_from_geometry_model(source) * viia_get_width_from_geometry_model(target) elif self.area_dependency == 'half_target_width_and_source_thickness': return 0.5 * viia_get_width_from_geometry_model(target) * viia_get_thickness_from_geometry_model(source) elif self.area_dependency in ['source_width_and_target_width', 'target_width_and_source_width']: return viia_get_width_from_geometry_model(source) * viia_get_width_from_geometry_model(target) else: raise NotImplementedError( f"ERROR: The area dependency is not set for detail {self.detail_nr}, please check the procedure.")
[docs] def get_local_axes( self, project: ViiaProject, source: Union[Lines, Surfaces], target: Union[Lines, Surfaces], connecting_node: Optional[Node] = None, connecting_line: Optional[Line] = None, local_x_axis: Optional[List[float]] = None, local_y_axis: Optional[List[float]] = None) -> List[Direction]: """ Method of 'InterfaceDetail' class to get the local axes for the line-interface. It accepts overruling input and converts the axes to directions, which are added to the project (if they do not yet exist in the project). Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - source (obj): Object reference of the source shape for the detail. - target (obj): Object reference of the target shape for the detail. - connecting_node (obj): Object reference of node that is the connecting shape geometry for the connection Input is ignored for line-interfaces. Default value is None. - connecting_line (obj): Object reference of line that is the connecting shape geometry for the connection. Input is ignored for point-interfaces. Default value is None. - local_x_axis (list of 3 floats): Vector representing the local x-axis direction, overruling the auto function. Input is ignored for line-interface (you cannot set the x-direction of a line interface). Default value is None. - local_y_axis (list of 3 floats): Vector representing the local y-axis direction, overruling the auto function. Input can be used for point and line-interfaces. Default value is None. Output: - Returns a list of 3 instances of Direction class. These directions are added to the project. """ if self.geometry_type == 'point': if local_x_axis and local_y_axis: x = local_x_axis y = local_y_axis else: if not connecting_node: connecting_node = \ self.get_connecting_shape_geometries(project=project, source=source, target=target)[0] x, y = self.get_point_interface_axes(source=source, target=target, connecting_node=connecting_node) else: if not connecting_line: connecting_line = \ self.get_connecting_shape_geometries(project=project, source=source, target=target)[0] if local_y_axis: # Use the user defined input for local y-axis x = connecting_line.get_direction().vector y = local_y_axis else: x, y = self.get_line_interface_local_axes(source=source, target=target, connecting_line=connecting_line) return [ project.create_direction(fem_unit_vector(x)), project.create_direction(fem_unit_vector(y)), project.create_direction(fem_unit_vector(fem_cross_product_vector(x, y)))]
[docs] def get_line_interface_local_axes( self, source: Union[Lines, Surfaces], target: Union[Lines, Surfaces], connecting_line: Line) \ -> Tuple[List[float], List[float]]: """ Method of 'InterfaceDetail' class to get the local axes for the line-interface detail. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - source (obj): Object reference of the source shape for the detail. - target (obj): Object reference of the target shape for the detail. - connecting_line (obj): Object reference of line that is the connecting shape geometry for the connection. Output: - Returns a tuple with 2 vectors (list of 3 floats). These vectors represent the local x-axis and the local y-axis. """ local_x_axis = connecting_line.get_direction().vector if self.y_axis_dependency == 'source_up_to_target': if fem_compare_values(local_x_axis[2], 0.0): return local_x_axis, [0., 0., 1.] else: return local_x_axis, fem_cross_product_vector(fem_unit_vector( fem_cross_product_vector(local_x_axis, [0, 0, 1])), local_x_axis) elif self.y_axis_dependency == 'horizontal_normal_to_interface': return local_x_axis, fem_unit_vector(fem_cross_product_vector([0., 0., 1.], local_x_axis)) elif self.y_axis_dependency == 'source_to_horizontal_target': if not fem_compare_values(local_x_axis[2], 0.0): raise ValueError( f"WARNING: {target.name} is not oriented horizontally. The local axes of the interface between " f"{target.name} and {source.name} could not be determined") return local_x_axis, self.check_local_axis_into_shape( shape=target, node=connecting_line.get_ref_point(), local_axis=fem_unit_vector(fem_cross_product_vector([0., 0., 1.], local_x_axis))) elif self.y_axis_dependency == 'source_to_target_x_axis': return local_x_axis, self.check_local_axis_into_shape( shape=target, node=connecting_line.get_ref_point(), local_axis=_get_shape_direction(target)) elif self.y_axis_dependency == 'manual': warn(f"WARNING: The local axes of detail {self.detail_nr} must be defined manually. " f"The local y-axis should point from the wall towards to the column.") return local_x_axis, [0., 0., 0.] raise NotImplementedError(f"Can't find specified y_axis_dependency for {self.detail_nr}.")
[docs] def get_point_interface_axes( self, source: Union[Lines, Surfaces], target: Union[Lines, Surfaces], connecting_node: Node) \ -> Tuple[List[float], List[float]]: """ Method of 'InterfaceDetail' class to get the local axes for the point-interface detail. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - source (obj): Object reference of the source shape for the detail. - target (obj): Object reference of the target shape for the detail. - connecting_node (obj): Object reference of node that is the connecting shape geometry for the connection. Output: - Returns a tuple with 2 vectors (list of 3 floats). These vectors represent the local x-axis and the local y-axis. """ return \ self.get_point_interface_local_x_axis(source=source, target=target), \ self.get_point_interface_local_y_axis(source=source, target=target, connecting_node=connecting_node)
[docs] def get_point_interface_local_x_axis( self, source: Union[Lines, Surfaces], target: Union[Lines, Surfaces]) -> List[float]: """ Method of 'InterfaceDetail' class to get the local x-axis for the point-interface detail. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - source (obj): Object reference of the source shape for the detail. - target (obj): Object reference of the target shape for the detail. Output: - Returns a vector representing the local x-axis for the point-interface (list of 3 floats). """ if self.local_x_axis == 'source_x_axis': if isinstance(source, Lines): return source.contour.get_direction().vector else: return _get_shape_direction(source) elif self.local_x_axis == 'source_y_axis': return source.y_axis_direction().vector elif self.local_x_axis == 'source_z_axis': return source.z_axis_direction().vector elif self.local_x_axis == 'target_x_axis': if isinstance(target, Lines): return target.contour.get_direction().vector else: return _get_shape_direction(target) elif self.local_x_axis == 'target_y_axis': return target.y_axis_direction().vector elif self.local_x_axis == 'target_z_axis': return target.z_axis_direction().vector elif self.local_x_axis == 'target_z_axis_negative': return fem_flip_vector(target.z_axis_direction().vector) elif self.local_x_axis == 'vertical': return [0., 0., 1.]
[docs] def get_point_interface_local_y_axis( self, source: Union[Lines, Surfaces], target: Union[Lines, Surfaces], connecting_node: Node) -> List[float]: """ Method of 'InterfaceDetail' class to get the local y-axis for the point-interface detail. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - source (obj): Object reference of the source shape for the detail. - target (obj): Object reference of the target shape for the detail. - connecting_node (obj): Object reference of node that is the connecting shape geometry for the connection. Output: - Returns a vector representing the local y-axis for the point-interface (list of 3 floats). """ if self.local_y_axis == 'source_x_axis': if isinstance(source, Lines): return source.contour.get_direction().vector elif isinstance(source, Surfaces): return _get_shape_direction(source) elif self.local_y_axis == 'source_y_axis': return source.y_axis_direction().vector elif self.local_y_axis == 'source_z_axis': return source.z_axis_direction().vector elif self.local_y_axis == 'target_x_axis': if isinstance(target, Lines): return target.contour.get_direction().vector elif isinstance(target, Surfaces): return _get_shape_direction(target) elif self.local_y_axis == 'target_y_axis': return target.y_axis_direction().vector elif self.local_y_axis == 'target_z_axis': return target.z_axis_direction().vector elif self.local_y_axis == 'source_to_target_x_axis': return self.check_local_axis_into_shape( shape=target, node=connecting_node, local_axis=target.contour.get_direction().vector) elif self.local_y_axis == 'source_to_target_x_axis_horizontal': local_y_axis = self.check_local_axis_into_shape( shape=target, node=connecting_node, local_axis=target.contour.get_direction().vector) # If the beam is vertical, x-axis is vertical and y-axis is in global y-direction if fem_compare_values(local_y_axis[2], 1.) or fem_compare_values(local_y_axis[2], -1.): return [0., 1., 0.] # Otherwise, y-axis points into the direction of the beam projected on the horizontal plane else: local_y_axis[2] = 0. return local_y_axis elif self.local_y_axis == 'source_to_target_y_axis': return self.check_local_axis_into_shape( shape=target, node=connecting_node, local_axis=target.y_axis_direction().vector) raise ValueError("ERROR: The local y-axis for the point interface could not be retrieved.")
[docs] @staticmethod def check_local_axis_into_shape(shape: Union[Lines, Surfaces], node: Node, local_axis: List[float]): """ Method of 'InterfaceDetail' class to check whether a given axis is pointing into a shape in order to determine if it must be flipped or not. Input: - shape (obj): Object reference of shape towards which the local_axis should point. - node (obj): Object reference of node in which the check is performed. - local_axis (list of floats): Vector that contains the direction of the local axis. Output: - If the given local axis at the node points into the shape, the same axis is returned, otherwise the flipped axis is returned. """ trial_point = [node[i] + local_axis[i] * 0.01 for i in range(0, len(node))] if isinstance(shape, Lines): if fem_point_on_line(point=trial_point, line_points=shape.contour.get_points()): return local_axis else: return fem_flip_vector(local_axis) elif isinstance(shape, Surfaces): if fem_point_in_surface(point=trial_point, surface=shape.contour.get_points()): return local_axis else: return fem_flip_vector(local_axis) else: raise ValueError( f"ERROR: The type of shape {shape.name} is not supported in the method to check if the local axis " f"is pointing in the correct direction. Contact the automation team.")
[docs] def create_material(self, project: ViiaProject, is_linear: bool = False) -> Material: """ Method of 'InterfaceDetail' class to create the material for the interface connection. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - is_linear (bool): Select to apply linear material properties. Default set to False. Output: - Returns the material object reference, which is added to the project. """ if is_linear or self.only_linear: if self.geometry_type == 'point': return project.viia_materials(f'LIN-PUNT-IF-{self.detail_nr}') return project.viia_materials(f'LIN-LIJN-IF-{self.detail_nr}') if self.geometry_type == 'point': return project.viia_materials(f'PUNT-IF-{self.detail_nr}') return project.viia_materials(f'LIJN-IF-{self.detail_nr}')
[docs] def create_geometry( self, project: 'ViiaProject', name: str, thickness: Optional[float] = None, area: Optional[float] = None) -> Geometry: """ Method of 'InterfaceDetail' class to create the geometry for the interface connection. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - thickness (float): The thickness of the line-interface, in [m]. Input is ignored for point-interface. Default value is None. - area (float): The area of the point-interface, in [m2]. Input is ignored for line-interface. Default value is None. Output: - Returns the geometry object reference, which is added to the project. """ if self.interface_type == '3d line interface (2 shear, 1 normal)': axis_orientation = 'parallel' if project.rhdhvDIANA.diana_version and \ float(project.rhdhvDIANA.diana_version.replace('diana ', '')) < 10.5: axis_orientation = 'normal' return project.create_user_defined_geometry( name=name, geometry_model=project.create_line_interface( line_interface_type=project.create_two_shear_one_normal_LIT( thickness=thickness, shape_definition=FlatLIST(axis_orientation=axis_orientation)))) elif self.interface_type == '3d line interface (2 normal, 1 shear)': return project.create_user_defined_geometry( name=name, geometry_model=project.create_line_interface( line_interface_type=project.create_two_normal_one_shear_LIT( line_geometry=PerimeterILG(perimeter=thickness)))) elif self.interface_type == '3d point interface': return project.create_user_defined_geometry( name=name, geometry_model=project.create_point_interface( area=area))
[docs] def create_data(self, project: 'ViiaProject', is_linear: bool = False) -> Data: """ Method of 'Detail' class to create data model for connection. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - is_linear (bool): Select if non-linear or linear material model is applied, this will set different number of integration points. Default value is False. Output: - Returns the created data object, which is added to the project. """ if is_linear or self.only_linear: return project.viia_create_datas(data_names=['INTERFACE-LIN']) return project.viia_create_datas(data_names=['INTERFACE'])
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================