Assemblies

class assemblies.GenericComponentAssembly(*args: Any, **kwargs: Any)

Generic assembly to store components

find_parent_component(geometry: hypnos.generic_classes.CubitInstance)

If this assembly contains given geometry, return owning component. Else return None.

Parameters

geometry (CubitInstance) – Child geometry

Returns

Parent component | None

Return type

SimpleComponent | None

get_all_components() list[hypnos.components.SimpleComponent]

Return all simple components stored in this assembly recursively

Returns

list of simple components

Return type

list[SimpleComponent]

get_components() list

Return components stored in this assembly at the top-level, i.e. SimpleComponents and GenericComponentAssemblys, if any.

Returns

list of components

Return type

list

get_components_of_class(classes: list) list

Find components of with given classnames. Searches through assemblies recursively.

Parameters

classes (list) – list of component classes

Returns

list of components

Return type

list

get_geometries_from(class_list: list[str]) list[hypnos.generic_classes.CubitInstance]

Get list of geometries with given classnames

Parameters

class_list (list[str]) – list of classnames

Returns

list of geometries

Return type

list[CubitInstance]

class assemblies.CreatedComponentAssembly(*args: Any, **kwargs: Any)

Assembly to handle components created natively. Takes a list of required classnames to set up a specific assembly. Instantiating will fail without at least one component of the given classnames.

check_for_overlaps()

Raise an error if any overlaps exist between children volumes

check_sanity()

Check whether geometrical parameters are physical on the assembly level.

enforce_structure()

Make sure an instance of this class contains the required components. This looks at the classnames specified in the json file

setup_assembly()

Instantiate components in cubit

Functions in this file:

assemblies.construct(json_object: dict, *args)

Instantiate component in python and cubit

Parameters

json_object (dict) – json input for component

Returns

Instantiated python class

Return type

SimpleComponent | GenericComponentAssembly