Module viiaConnections

The relation between shapes are called the connections. In MRS or the connection can be rigid, hinged or free. In the NLTH the possibilities for connections are more extended. Refer to the UPR for more information on this topic. This module viiaConnections contains the functions to create connections.

Before you want to create connections, be sure that the shapes are all aligned. Use functions in module viiaShapeOperations first to set up the model in the right way. Then apply functions to connect the shapes on all points of the shapes (when in DIANA, this will be by imprinting functions).

Connect shapes

viiapackage.viiaConnections._viia_connect_shape(project: ViiaProject, shape: Shapes)[source]

This functions connects the shape with all shapes in the model. For surfaces, it finds lines which completely on the surface and add those lines to the surface as internal line. It also finds lines which are completely on the contour of a surface and add the points of the line to the contour. Besides it find nodes which are on the surface and add those as internal points or add them to the contour.

For lines, it finds nodes which are on the line and add those node as internal point.

Note

Function does not run in DIANA if model is created.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • shape (obj): Object reference of shape which should be connected.

Output:
  • All surface-shapes are updated with coordinates of other shapes which are on the contour of the surface-shape.

  • All surface-shapes are updated with shape-geometry lines of other shapes, which are in the plane of the surface-shape, as internal lines.

  • All surface-shapes are updated with shape-geometry nodes of other shapes, which are in the plane of the surface-shape, as internal points.

viiapackage.viiaConnections._viia_connect_all_shapes(project: ViiaProject, list_of_shapes: Union[str, List[Shapes]] = 'ALL')[source]

This functions connects all surface- and line-shapes with all volume-, surface-, line- and point-shapes. First, all lines and nodes in the project will be merged. For surfaces, it finds lines which completly on the surface and add those lines to the surface as internal line. It also finds lines which are completly on the contour of a surface and add the points of the line to the contour. Besides it find nodes which are on the surface and add those as internal points or add them to the contour. For lines, it finds nodes which are on the line and add those node as internal point.

Note

Function will only run in PY-editor, or if model is not created.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • list_of_shapes (list of Obj): List with object references of shapes that will be checked if they are connecting to the requested shape. Default value is ‘ALL’, indicating that all shapes present will be checked.

Output:
  • No more double Line(ShapeGeometries) and Node(ShapeGeometries) objects.

  • All shapes are connected.

Create connections

viiapackage.viiaConnections.viia_create_connection(project: ViiaProject, source: Union[Surfaces, Lines, str], target: Union[Surfaces, Lines, str], detail: str, is_linear=False, thickness_interface: Optional[float] = None, area_interface: Optional[float] = None, switch: bool = False, flip: bool = False, local_x_axis: Optional[list] = None, local_y_axis: Optional[list] = None, degrees_of_freedom: Optional[List[int]] = None)[source]

Function to connect two shapes with a certain detail as described in Basis of Design (UPR).

Note

Before using this function make sure the two shapes are connected. For this the project.viia_connect_shape function can be used.

Warning

Check your result in the model, as there are a lot of exceptions known to cause an error when applying the function, when meshing or running the model in DIANA.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • source (obj): Object reference of source shape. This might be a surface or line-shape and depends on the requested detail. Alternative (str): The name of the source shape can be provided.

  • target (obj): Object reference of target shape. This might be a surface or line-shape and depends on the requested detail. Alternative (str): The name of the target shape can be provided.

  • detail (str): Detail number as described in the Basis of Design (UPR). For example ‘D2.01’. For hinges, it should be specified as ‘HINGE-P’ for point hinges and as ‘HINGE-L’ for line hinges. D2.01C is the same as D2.01B but the support area is a half (e.g beam supported in perimeter wall).

  • is_linear (bool): Select to apply linear material properties, default value is False.

  • thickness_interface (float): Option to manually set interface thickness for line interfaces, in [m]. Required for: D3.03.

  • area_interface (float): Option to manually set interface area for point interfaces, in [m2].

  • switch (bool): Option to switch the source and target shapes. If True, shapes are switched. Unlike the flip, the switch is performed in the geometry model. Default value is false.

  • flip (bool): Option to flip the local z-axis of the interface. If neither local_x_axis nor local_y_axis are defined, then the flip is done after the local axes have been corrected after making the model. The flip is only performed after running viia_create_model(). Default value is False.

  • local_x_axis (list): Option for point interfaces to manually define the local x-axis of the interface. Conversely, it can also be used to specify the local x-axis for hinges. If for hinges, please also specify the next argument local_y_axis.

  • local_y_axis (list): Option for point and line interfaces to manually define the local y-axis of the interface. Required for: D3.03.. Conversely, it can be used to specify the local y-axis of a hinge. If for hinges, please also specify the argument local_x_axis.

  • degrees_of_freedom (list with 3 integers): List with the rotational degrees of freedom to be tied when creating a hinge. The list contains the rotational degrees of freedom or rotation about the local x-, y- and z-axes.

Output:
  • The connection is created in PY-memory.

For example: >>> viia_create_connection(Wall1, Floor1, ‘D2.01’) >>> viia_create_connection(Wall1, Floor1, ‘HINGE-L’)

viiapackage.viiaConnections.viia_create_tying(project: ViiaProject, source: Union[Surfaces, Lines, str], target: Union[Surfaces, Lines, str], source_node: Optional[Node] = None, target_node: Optional[Node] = None, degrees_of_freedom: Optional[List[List[float]]] = None, axes: Optional[List[Union[str, int, Direction]]] = None) List[Tying][source]

Function to connect two shapes with a tying. This is not a default approach in the VIIA workflow, but can be applied in specific situations after consultation with the lead engineer. This function needs to be used to comply to the naming convention, which is used in the phasing and result handling.

Note

Before using this function make sure the two shapes are connected (only in case you want to apply a tying on a coinciding node). For this the project.viia_connect_shape function can be used.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • source (obj): Object reference of source shape. This might be a surface or line-shape and depends on the requested detail. Alternative (str): The name of the source shape can be provided.

  • target (obj): Object reference of target shape. This might be a surface or line-shape and depends on the requested detail. Alternative (str): The name of the target shape can be provided.

  • source_node (obj): Object reference of source node for the tying. Default value is None, in which case the source node is retrieved based on the other inputs. For example if the shapes are connecting with a shared node or nodes, these nodes can be found automatically.

  • target_node (obj): Object reference of target node for the tying. Default value is None, in which case the target node is retrieved based on the other inputs (see also source node).

  • degrees_of_freedom (list of 2 lists with 3 integers): Lists with the translational and rotational degrees of freedom to be tied. The first list contains the translational degrees of freedom in the local x-, y- and z-axes. The second list contains the rotational degrees of freedom or rotation about the local x-, y- and z-axes. Default value is [[0, 0, 0], [1, 1, 1]].

  • axes (list of obj): List defining the local axes. The directions in the list are instances of the Direction class. The length of the list should be three in the order of local x, y, z-direction. Default value is None, which will generate default directions depending on connection type (point, line or surface connection).

Output:
  • Returns the created tying.

Handling connections

viiapackage.viiaConnections._viia_connections_get_mappings(project: ViiaProject, print_to_screen: bool = False)[source]

This function can be used to print a mapping corresponding between geometry pairs and unique ID of the connection. Function generates mappings for all connections in project.collections.connections that were named using the unique ID function.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • print_to_screen (bool, optional): bool specified if the mapping list should be printed to screen. Default value False.

Output:
  • Returns a dictionary. A dictionary with frozen sets of shape pairs in the connection as keys and dictionary as source, target names and unique IDs as values.

viiapackage.viiaConnections._viia_remove_connection(project: ViiaProject, connection: Connections)[source]

This function removes the Interface or Connection object from the ViiaProject. Function should be operated before creating model in DIANA. The name of the connection should be aligned with the VIIA name convention.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • connection (obj): The Connections object.

Output:
  • Returns a dictionary that contains the information which can be used to recreate the connection.

viiapackage.viiaConnections._viia_remove_floor_connections(project: ViiaProject, floor: Union['Floor', str])[source]

This function removes all interfaces of a Floor object completely in the ViiaProject. Function should be operated before creating model in DIANA. A list of dictionaries with all the removed interfaces will be returned.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • floor (obj): Object reference of floor for which the connections should be removed. Alternative: Name of the floor.

Output:
  • Returns a list of dictionaries containing the information which can be used to recreate the connections that were connecting to the floor.

viiapackage.viiaConnections._viia_restore_floor_connections(project: ViiaProject, connections: List[Dict])[source]

This function restores all interfaces of a Floor object removed from the ViiaProject. Function should be operated before creating model in DIANA.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • connections (list of dictionaries): A list of the dictionaries used to recreate the connections.

Output:
  • No output. The interfaces will be created in the ViiaProject.

viiapackage.viiaConnections._viia_reconnect_floor_connecting_shapes(project: ViiaProject, connections: List[Dict])[source]

This function reconnects all the connecting shapes of a Floor object in the project. Function should be operated before creating model in DIANA.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • connections (list of dictionaries): A list of the dictionaries used to recreate the connections.

Output:
  • No output. Shapes will be connected in the ViiaProject.

Auto-functions for connections

viiapackage.connections.auto_hinges.viia_auto_hinges(project: ViiaProject, override_hinges: Optional[List[List[str]]] = None, disable_nodes: Optional[List[Union[Node, List[float, int]]]] = None, disable_hinges: Optional[List[List[str]]] = None, collection: Optional[List[Union[Beam, Column]]] = None)[source]

This function generates hinges for all columns and beams in project.collections. It checks if the members are continuous, if true it will create a fixed connection. This function only works on columns and beams.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • override_hinges (list of list of str): List of exceptions for the automatic algorithm. Default value is None, no overrides applied. e.g. [[‘source_shape_name’, ‘target_shape_name’, ‘hingetype’], [‘N2-BALKEN-STAAL-S235-HEA140-5’,’N2-BALKEN-STAAL-S235-SHS80x6-1’, ‘H_RRF’]]

  • disable_nodes (list of (nodes or lists of floats/ints)): List of nodes to disable auto hinge generation. The input for this argument can also be provided as a list of coordinates.

  • disable_hinges (list of list of str): List of list of source-target pairs for which the hinges need to be omitted. The order in which the elements are specified is not important. eg. [[‘N2-BALKEN-STAAL-S235-HEA140-5’,’N2-BALKEN-STAAL-S235-SHS80x6-1’]]

  • collection (list of shapes): A list of object references of Column or Beam class which are checked to apply hinges on. Default value is None, checking all shapes in the project.

Output:
  • Returns list of created hinges.

viiapackage.connections.auto_interfaces.viia_auto_interfaces(project: ViiaProject, is_linear: bool = False, override_connections: List[List[str]] = None, disable_connections: List[List[str]] = None, disable_interfaces: List[str] = None, replace_interfaces: Dict[str, Union[str, Any]] = None)[source]

This function generates interfaces in the model based on the BoD. It creates interfaces only between connecting shapes. The function uses the ‘viia_auto_connections_library.yaml’ in order to determine which connection type is to be applied. It does not create interfaces (hinges) between beams, therefore use the viia_auto_hinge function.

Currently implemented interfaces: ‘D2.01’, ‘D2.01a’, ‘D2.01b’, ‘D2.03’, ‘D2.07’, ‘D2.11’, ‘D2.14’ and ‘D4.02’.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • is_linear (bool): Boolean to apply linear or non-linear material properties for the interfaces. Default value is False, applying non-linear behaviour.

  • override_connections (list of list of str): List of lists of shape pairs to override automatic implementation. Input order for shapes is important and should follow definitions required for viia_create_connection(). e.g. [[‘source_shape_name’, ‘target_shape_name’, ‘detail’, kwargs(opt)], [‘N0-WANDEN-MW-KLEI<1945-100-2’,’N1-VLOEREN-LIN-HBV-PLANKEN-0.022-0.05-0.15-0.65-0’,’NOCON-L’], {‘flip’:True}]. Default value is None.

  • disable_connections (list of list of str): List of lists of shape pairs to disable automatic implementation. Input order for shapes is not important. Default value is None. e.g. [[‘source_shape_name’, ‘target_shape_name’], [‘N0-WANDEN-MW-KLEI<1945-100-2’,’N1-VLOEREN-LIN-HBV-PLANKEN-0.022-0.05-0.15-0.65-0’]].

  • disable_interfaces (list of str): List of interfaces to disable, e.g. [‘D2.01’, ‘D2.07’]. Default value is None. In that case, the following list is used: [‘D2.03’, ‘D2.07’, ‘D2.11’, ‘D2.14’, ‘D4.02’, ‘D2.01b’] This list is based on the current modelling strategy, and makes sure only the basic interfaces are applied. If no interfaces should be disabled, supply the following input value: [] .

  • replace_interfaces (dict): Dictionary of old to new interface mappings. Default value is None. e.g. {‘D2.01’: [‘D2.01’, {‘is_linear’: True}], ‘D2.07’: ‘D2.01’}.

Functions for checking

viiapackage.viiaConnections.viia_node_data_diana(project: ViiaProject, view_nodes: List[Union[Node, List[float]]]) List[Path][source]

This function creates pdf documents containing the DIANA node/element and connection data at the location of nodes specified by the user.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • view_nodes (list of node objects or node coordinates): A list that can contain either objects of the class Node or a sublist containing 3 floats representing the node coordinates in [m] e.g. [1.20, 5.00, 3.50]. For each node a pdf document is created.

Output:
  • A folder called “Node Data” is created in the working folder which contains the pdfs (each pdf corresponding to each node), which contains the node/element data and connection data.

  • Returns list of all generated pdf-files.

Functions for disconnecting shape

viiapackage.viiaConnections.viia_disconnect_shape(project: ViiaProject, shape: Shapes, shapes_to_exclude: List[Union[Shapes, str]] = None)[source]

Function to apply NOCON connections to all connecting shapes.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • shape (obj): Shape that need to be disconnect from other shapes

  • shapes_to_exclude (list of str/obj): List with shapes that should stay connected to the shape. Can be given as name of the shape or object reference. Default is None.

Output:
  • The connections that are made

Detail class VIIA

class viiapackage.connections.details.Detail(detail_nr: str, geometry_type: str, source_shape_type: Optional[Type[Shapes]] = None, target_shape_type: Optional[Type[Shapes]] = None)[source]

Bases: object

This is the class with information from the UPR regarding the detail numbers for connections.

__init__(detail_nr: str, geometry_type: str, source_shape_type: Optional[Type[Shapes]] = None, target_shape_type: Optional[Type[Shapes]] = None)[source]
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’.

  • 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. Optional input, if not provided the type of class will not be checked.

  • 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. Optional input, if not provided the type of class will not be checked.

generate_name(project: ViiaProject, source: Shapes, target: Shapes, thickness: Optional[float] = None, area: Optional[float] = None) str[source]

Method of ‘Detail’ class to generate a name for the connection. It collects the properties requires to create a unique name, complying to VIIA standard.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • detail_nr (str): Name of the requested detail, see the Basis of Design (UPR).

Output:
  • Returns Detail object if detail is recognised.

get_connecting_shape_geometries(project: ViiaProject, source: Shapes, target: Shapes, nodes: Optional[Union[Node, List[Node]]] = None, lines: Optional[Union[Line, List[Line]]] = None) List[Union[Node, Line]][source]

Method of ‘Detail’ class to find the connecting shape geometries. Depending on the detail settings a point or line connection needs to be created. This method will try to find the requested connecting shape geometries. It can be overruled by providing specific shape geometries. These are checked versus the requirements of the 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.

  • nodes (list of nodes): List of object references for nodes (shape-geometries). This list is used to overrule the auto-function. This input will be ignored for line connections. Alternative single node.

  • lines (list of lines): List of object references for lines (shape-geometries). This list is used to overrule the auto-function. This input will be ignored for point connections. Alternative single line.

Output:
  • Returns the connecting shape geometries based on the geometry-type (point or line-connection) of the requested detail. This list is auto generated, but can be overruled by user.

static get_detail(project: ViiaProject, detail_nr: str)[source]

This method of ‘Detail’ class collects the detail info from the viia-constants yaml and returns an instance of Detail class with this info.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • detail_nr (str): Name of the requested detail, see the Basis of Design (UPR).

Output:
  • Returns Detail object if detail is recognised.

get_master_slave_relationship(project, shape_1: Shapes, shape_2: Shapes)[source]

This method of ‘Detail’ determines correct allocation of slave and master based on the detail library. Two shapes can be provided and if possible the master and the slave is determined.

Input:

project (Project): Project object. shape_1 (Shape): Shape object. shape_2 (Shape): Shape object.

Output:

(Shape): master shape (Shape): slave shape List[Node,Line]: if connection is applicable a list of connecting shapes is returned.

abstract name()[source]

Abstract method of ‘Detail’ to return the VIIA name for the connection.

validate_input(project: ViiaProject, source: Union[str, Shapes], target: Union[str, Shapes]) Tuple[Shapes, Shapes][source]

Method of ‘Detail’ to validate if the provided source and target shape match the requested classes for the specified detail. It will also convert shapes provided as string to the object reference based on the name. It will raise an error if any input is not valid.

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. Alternative the name can be provided as string.

  • target (obj): Object reference of the target shape for the detail. Alternative the name can be provided as string.

Output:
  • Returns a tuple with the source and target shape. These are object references for the instances in Shapes class, which are valid for this detail.

class viiapackage.connections.interface_detail.InterfaceDetail(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)[source]

Bases: Detail

This is the class with information from the UPR regarding the detail numbers for connections.

__init__(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)[source]
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.

static check_local_axis_into_shape(shape: Union[Lines, Surfaces], node: Node, local_axis: List[float])[source]

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.

create_data(project: ViiaProject, is_linear: bool = False) Data[source]

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.

create_geometry(project: ViiaProject, name: str, thickness: Optional[float] = None, area: Optional[float] = None) Geometry[source]

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.

create_material(project: ViiaProject, is_linear: bool = False) Material[source]

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.

get_area_interface(source: Shapes, target: Shapes) float[source]

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.

get_line_interface_local_axes(source: Union[Lines, Surfaces], target: Union[Lines, Surfaces], connecting_line: Line) Tuple[List[float], List[float]][source]

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.

get_local_axes(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][source]

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.

get_point_interface_axes(source: Union[Lines, Surfaces], target: Union[Lines, Surfaces], connecting_node: Node) Tuple[List[float], List[float]][source]

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.

get_point_interface_local_x_axis(source: Union[Lines, Surfaces], target: Union[Lines, Surfaces]) List[float][source]

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).

get_point_interface_local_y_axis(source: Union[Lines, Surfaces], target: Union[Lines, Surfaces], connecting_node: Node) List[float][source]

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).

get_thickness_interface(source: Shapes, target: Shapes) float[source]

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.

property name

Method of ‘InterfaceDetail’ to return the VIIA name for the interface connection detail.

validate_specific_input(source: Shapes, target: Shapes)[source]

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.

class viiapackage.connections.no_connection_detail.NoConnectionDetail(detail_nr: str, geometry_type: str, source_shape_type: Optional[Type[Shapes]] = None, target_shape_type: Optional[Type[Shapes]] = None)[source]

Bases: Detail

This is the class with information from the UPR regarding the detail numbers for no-connection details.

__init__(detail_nr: str, geometry_type: str, source_shape_type: Optional[Type[Shapes]] = None, target_shape_type: Optional[Type[Shapes]] = None)[source]
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’.

  • 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.

create(project: ViiaProject, connecting_shapes: List[Dict[str, any]]) List[NoConnection][source]

Method of ‘NoConnectionDetail’ class to create the no-connection detail.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • connecting_shapes (list): List of dictionaries with the connecting shapes (see ‘NoConnection’ class in rhdhv_fem repository documentation).

Output:
  • Returns list of instances of NoConnection class created and added to project.

property name

Method of ‘NoConnectionDetail’ to return the VIIA name for the no-connection detail.

class viiapackage.connections.unite_detail.UniteDetail(detail_nr: str, geometry_type: str)[source]

Bases: Detail

This is the class with information from the UPR regarding the detail numbers for unite details.

__init__(detail_nr: str, geometry_type: str)[source]
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’.

create(project: ViiaProject, connecting_shapes: List[Dict[str, any]]) List[Unite][source]

Method of ‘UniteDetail’ class to create the unite detail.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • connecting_shapes (list): List of dictionaries with the connecting shapes (see ‘Unite’ class in rhdhv_fem repository documentation).

Output:
  • Returns list of instances of Unite class created and added to project.

property name

Method of ‘InterfaceDetail’ to return the VIIA name for the unite connection detail.

Helper-functions

viiapackage.connections.get_dimensions.viia_get_thickness_from_geometry_model(shape: Shapes) float[source]

Function to get the thickness or height of a geometry model.

Input:
  • shape (obj): Shape for which the thickness should be retrieved.

Output:
  • Returns the thickness as float, in [m].

viiapackage.connections.get_dimensions.viia_get_timberfloor_dimensions(shape: Shapes) Dict[str, float][source]

Get the dimensions for the timber floors with joists (modelled with equivalent plates).

Input:
  • shape (obj): Shape for which the thickness should be retrieved.

Output:
  • Returns dictionary with thickness as float, in [m].

viiapackage.connections.get_dimensions.viia_get_width_from_geometry_model(shape: Shapes) float[source]

Get the width a geometry model.

Input:
  • shape (obj): Shape for which the width should be retrieved.

Output:
  • Returns the width as float, in [m].

viiapackage.connections.helper_functions.viia_create_hinge_connection(project: ViiaProject, source: Union[Surfaces, Lines, str], target: Union[Surfaces, Lines, str], detail: str, local_x_axis: Optional[list] = None, local_y_axis: Optional[list] = None, degrees_of_freedom: Optional[List[int]] = None)[source]

Function to connect two shapes with a hinged connection.

Note

Before using this function make sure the two shapes are connected. For this the project.viia_connect_shape function can be used.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • source (obj): Object reference of source shape. This might be a surface or line-shape and depends on the requested detail. Alternative (str): The name of the source shape can be provided.

  • target (obj): Object reference of target shape. This might be a surface or line-shape and depends on the requested detail. Alternative (str): The name of the target shape can be provided.

  • detail (str): Detail number as described in the Basis of Design (UPR). For example ‘D2.01’. For hinges, it should be specified as ‘HINGE-P’ for point hinges and as ‘HINGE-L’ for line hinges.

  • local_x_axis (list): Option to specify the local x-axis for hinges. If for hinges, please also specify the next argument local_y_axis.

  • local_y_axis (list): Option to specify the local y-axis of a hinge. If for hinges, please also specify the argument local_x_axis.

  • degrees_of_freedom (list with 3 integers): List with the rotational degrees of freedom to be tied when creating a hinge. The list contains the rotational degrees of freedom or rotation about the local x-, y- and z-axes.

Output:
  • The connection is created in PY-memory.

For example: >>> viia_create_connection(Wall1, Floor1, ‘HINGE-L’)

viiapackage.connections.helper_functions.viia_create_non_hinge_connection(project: ViiaProject, source: Union[Surfaces, Lines, str], target: Union[Surfaces, Lines, str], detail: str, is_linear=False, thickness_interface: Optional[float] = None, area_interface: Optional[float] = None, switch: bool = False, flip: bool = False, local_x_axis: Optional[list] = None, local_y_axis: Optional[list] = None) List[Connections][source]

Function to connect two shapes with a certain detail as described in Basis of Design (UPR).

Note

Before using this function make sure the two shapes are connected. For this the project.viia_connect_shape function can be used.

Warning

Check your result in the model, as there are a lot of exceptions known to cause an error when applying the function, when meshing or running the model in DIANA.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • source (obj): Object reference of source shape. This might be a surface or line-shape and depends on the requested detail. Alternative (str): The name of the source shape can be provided.

  • target (obj): Object reference of target shape. This might be a surface or line-shape and depends on the requested detail. Alternative (str): The name of the target shape can be provided.

  • detail (str): Detail number as described in the Basis of Design (UPR). For example ‘D2.01’. For hinges, it should be specified as ‘HINGE-P’ for point hinges and as ‘HINGE-L’ for line hinges.

  • is_linear (bool): Select to apply linear material properties, default value is False.

  • thickness_interface (float): Option to manually set interface thickness for line interfaces, in [m]. Required for: D3.03.

  • area_interface (float): Option to manually set interface area for point interfaces, in [m2].

  • switch (bool): Option to switch the source and target shapes. If True, shapes are switched. Unlike the flip, the switch is performed in the geometry model. Default value is false.

  • flip (bool): Option to flip the local z-axis of the interface. If neither local_x_axis nor local_y_axis are defined, then the flip is done after the local axes have been corrected after making the model. The flip is only performed after running viia_create_model(). Default value is False.

  • local_x_axis (list): Option for point interfaces to manually define the local x-axis of the interface.

  • local_y_axis (list): Option for point and line interfaces to manually define the local y-axis of the interface. Required for: D3.03..

Output:
  • The connection is created in PY-memory.

For example: >>> viia_create_connection(Wall1, Floor1, ‘D2.01’)

viiapackage.connections.helper_functions.viia_get_existing_connections(project: ViiaProject) Set[FrozenSet[str]][source]

This function parses existing connection definitions so the pairs can be quickly checked. Any connection that does not contain a target (or source) connecting shape is omitted in the returned set.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

Output:
  • Returns set of frozensets of pairs of connecting shape names of the connection (source and target).

viiapackage.connections.helper_functions.viia_get_input_for_hinges(project: ViiaProject, source: Union[str, Shapes], target: Union[str, Shapes]) Tuple[Shapes, Shapes][source]

Function to get the source and target shapes for generation of a hinge. It will also convert shapes provided as string to the object reference based on the name. It will raise an error if any input is not valid.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • source (obj): Object reference of the source shape for the hinge. Alternative the name can be provided as string.

  • target (obj): Object reference of the target shape for the hinge. Alternative the name can be provided as string.

Output:
  • Returns a tuple with the source and target shape. These are object references for the instances in Shapes class.

viiapackage.connections.helper_functions.viia_load_connections_library(project: ViiaProject) Tuple[Any, Dict[FrozenSet[str], Dict[str, Union[int, Any]]]][source]

This function loads the yaml database with description of the interfaces in UPR. It processes the database for fast lookup.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

Output:
  • Returns dictionary of strings for fast connection lookup.

viiapackage.connections.helper_functions.viia_unique_id_from_names(source: Shapes, target: Shapes) str[source]

Takes list of strings and generates unique ID.

Input:
  • list_of_names (list of str): List of strings.

Output:
  • Returns unique string.

viiapackage.connections.node_data_diana.create_node_data_pdf(project: ViiaProject, image_path: Path, node_data: Dict, connection_data: Dict, node_name: str, pdf_path: Path) Path[source]

This function is used to generate a pdf document from the node-data and connection-data. It contains the image highlighting the node, a table consisting of node-data and another table consisting of connection data.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • image_path (Path): Folder path where the image of the model highlighting the node is saved.

  • node_data (dict): A dictionary containing the node data. The keys are the DIANA node ids as string and the corresponding value is a list containing the names of the element sets containing the corresponding DIANA node.

  • connection_data (dict): A dictionary containing the connection data. The keys are the names of the connections and the corresponding value is a list of names of the sources and the target shapes of the corresponding connection.

  • node_name (str): A string of the name of the node that is being viewed. Name can be the name of the rhdhv node object followed by its coordinates, or only the coordinates in case it is not a node object. Only used in the title of the report.

  • pdf_path (Path): The folder path where the generated pdf-file needs to be saved.

Output:
  • Creates a pdf-file with the node information from DIANA.

  • Returns the path of the pdf-file.

viiapackage.connections.node_data_diana.get_connection_data(project: ViiaProject, node: Node) Dict[str, List[str]][source]

This function takes a node object and gets the connection information at that node from the python memory and returns the information in a dictionary.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • node (obj): Object reference of Node to be checked.

Output:
  • A dictionary containing the connection data. The keys are the names of the connections and the corresponding value is a list of names of the sources and the target shapes of the corresponding connection.

viiapackage.connections.node_data_diana.get_connection_data_diana(project: ViiaProject, node: List[float]) Dict[str, List[str]][source]

This function takes the coordinates of a node and checks whether a DIANA node is present at that coordinate and retrieves the connection information at the coordinate location and returns the information in a dictionary.

Note

Function should be executed in DIANA, otherwise no info will be collected.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • node (List): A list containing the coordinates of a node in DIANA.

Output:
  • Returns a dictionary containing the connection data from DIANA. The keys are the names of the connections and the corresponding value is a list of names of the sources and the target shapes of the corresponding connection.

viiapackage.connections.node_data_diana.get_node_data_diana(project: ViiaProject, node: Union[Node, List[float]], image_path: Path) Dict[str, List[str]][source]

This function takes a node object and looks in DIANA for mesh-nodes that share the same coordinates as the node object. It then looks for element sets that contain the mesh nodes and stores this information in a dictionary. This function also saves the image highlighting the selected node in the model.

Input:
  • project (obj): VIIA project object containing collections of fem objects and project variables.

  • node (obj or list): A Node object or a list containing 3 floats representing the coordinates of the node

  • image_path (Path): Path where the image will be stored.

Output:
  • A dictionary with keys as the DIANA node IDs as strings and their values as the list of names of the element sets containing the corresponding node.