### ===================================================================================================================
### Create flexbase shallow foundations
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, List
# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.shapes import Surfaces
from rhdhv_fem.materials import InterfaceBehaviour
from rhdhv_fem.supports import SupportSet
# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
from viiapackage.viiaStatus import ViiaProject
### ===================================================================================================================
### 2. Function to create shallow foundation flexbase
### ===================================================================================================================
[docs]def viia_create_shallow_foundation_flexbase(
project: ViiaProject, supported_shapes: List[Surfaces], material: InterfaceBehaviour, support_set: SupportSet,
counter: int = 1):
"""
Function to create the flexbase shallow foundation.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- supported_shapes (list with obj): List with object references of surface shapes that are supported.
- material (obj): Object reference of material for the interface behaviour of the flexbase shallow foundation.
- support_set (obj): Object reference of support-set for the supports of the flexbase shallow foundation.
- counter (int): Counter to use for the names of the supports and the interfaces.
Output:
- Returns list of created surface supports and interfaces.
"""
# Create the axes
axes = [project.create_direction(name='X'), project.create_direction(name='Y'), project.create_direction(name='Z')]
# Create supports and boundary interfaces
collected = []
for i, shape in enumerate(supported_shapes):
if isinstance(shape, Surfaces):
support_object = project.create_surfacesupport(
name=f'{project.viia_settings.support_type}Support-{i + counter}',
support_set=support_set,
axes=axes,
degrees_of_freedom=[[1, 1, 1], [0, 0, 0]],
connecting_shapes=[{
'connecting_shape': shape,
'shape_geometry': shape.contour}])
collected.append(support_object)
collected.append(project.create_boundary_interface(
name=f'F-VLAK-IF-FOS-{i + counter}',
connecting_shapes={
'source_connecting_shape': shape,
'source_shape_geometry': shape.contour},
material=material,
geometry=project.viia_geometries('FOS'),
data=None,
support=support_object))
# Return the created objects
return collected
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================