Model.specialelements#
- Model.specialelements(DestinationComp, CreatePropMat, sourceCollection=Collection(), targetCollection=Collection(), ElemSize=0, NumLayers=0)#
Creates special elements like gasket elements between a source and target, or updates penta/hexa elements to special elements like gasket elements.
- Parameters:
DestinationComp (unsigned int) –
The component to which the special elements will be organized. This is a mandatory option. Valid values are:
0 - New component
1 - Current component
2 - Surface component
CreatePropMat (unsigned int) –
Properties and materials will be assigned to the created elements. This is a mandatory option. Valid values are:
0 - New property
1 - Existing property
sourceCollection (Collection) – The collection containing the source entities. Valid entities are surfaces, elements and faces.
targetCollection (Collection) – The collection containing the target entities. Valid entities are surfaces, elements and faces.
ElemSize (int) – The element size to use when the entities contained in the
sourceCollectionare surfaces.NumLayers (unsigned int) – The number of layers to create.
Examples#
Create special elements between surfaces with IDs 4 and 2 , with size 10 and 3 layers#import hm import hm.entities as ent model = hm.Model() model.specialelements( DestinationComp=1, CreatePropMat=1, sourceCollection=hm.Collection(model, ent.Surface, [4]), targetCollection=hm.Collection(model, ent.Surface, [2]), ElemSize=10, NumLayers=3, )
Update penta / hexa elements with IDs 101 - 110 to special elements#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the elements with IDs 101-110 filter_elements = hm.FilterByEnumeration(ent.Element, list(range(101, 111))) elements_collection = hm.Collection(model, filter_elements) model.specialelements( sourceCollection=elements_collection, targetCollection=hm.Collection(model, ent.Element, populate=False), DestinationComp=0, CreatePropMat=0, )