RAMaterialCollection#

class ansys.rocky.app.ra_materials_collection.RAMaterialCollection(id: str, model_id: str | None = None)#

Bases: ansys.rocky.app.ra_list.RAList

Rocky PrePost Scripting wrapper for the collection of materials in a project.

This wrapper corresponds to the “Materials” item on the project’s data tree. Retrieve the RAMaterialCollection from a RAStudy via:

material_collection = study.GetMaterialCollection()

Instances of the RAMaterialCollection class act as regular Python lists and can be iterated on, individual materials accessed and deleted via index, etc:

material_1 = material_collection.AddSolidMaterial()
material_2 = material_collection.AddFluidMaterial()
material_2 = material_collection[3]
del material_collection[2]

Items in this list are of type RASolidMaterial and RAFluidMaterial.

Overview#

Remove

Remove an item from the list.

Clear

Remove all items from the list.

New

Deprecated: Use Add{Solid, Fluid}Material() instead.

AddSolidMaterial

AddFluidMaterial

GetDefaultSolidMaterials

Get a list with the default solid materials, in order of Particle, Belt and Boundary.

GetDefaultParticleMaterial

GetDefaultBeltMaterial

GetDefaultBoundaryMaterial

GetSolidMaterial

Get the solid material with the given name.

GetDefaultFluidMaterial

GetFluidMaterial

Get the fluid material with the given name.

GetMaterialsInteractionCollection

Get the study’s Materials Interaction Collection.

GetBulkSolidFraction

Get the value of “Bulk Solid Fraction”.

SetBulkSolidFraction

Set the value of “Bulk Solid Fraction”.

Import detail#

from ansys.rocky.app.ra_materials_collection import RAMaterialCollection

Method detail#

classmethod RAMaterialCollection.GetWrappedClass() type[rocky30.models.material.material.MaterialCollection]#
classmethod RAMaterialCollection.GetClassName() str#
RAMaterialCollection.__delitem__(index: int) None#
RAMaterialCollection.Remove(item: ansys.rocky.app.api_element_item.ApiElementItem) None#

Remove an item from the list.

RAMaterialCollection.__len__() int#
RAMaterialCollection.__iter__() ansys.rocky.app.api_element_item.ApiElementItem#
RAMaterialCollection.__getitem__(index: int) ansys.rocky.app.api_element_item.ApiElementItem#
RAMaterialCollection.Clear() None#

Remove all items from the list.

RAMaterialCollection.New() ansys.rocky.app.ra_solid_material.RASolidMaterial#

Deprecated: Use Add{Solid, Fluid}Material() instead.

RAMaterialCollection.AddSolidMaterial(name: str | None = None) ansys.rocky.app.ra_solid_material.RASolidMaterial#
RAMaterialCollection.AddFluidMaterial(name: str | None = None) ansys.rocky.app.ra_fluid_material.RAFluidMaterial#
RAMaterialCollection.GetDefaultSolidMaterials() list[ansys.rocky.app.ra_solid_material.RASolidMaterial]#

Get a list with the default solid materials, in order of Particle, Belt and Boundary.

RAMaterialCollection.GetDefaultParticleMaterial() ansys.rocky.app.ra_solid_material.RASolidMaterial#
RAMaterialCollection.GetDefaultBeltMaterial() ansys.rocky.app.ra_solid_material.RASolidMaterial#
RAMaterialCollection.GetDefaultBoundaryMaterial() ansys.rocky.app.ra_solid_material.RASolidMaterial#
RAMaterialCollection.GetSolidMaterial(material_name: str) ansys.rocky.app.ra_solid_material.RASolidMaterial#

Get the solid material with the given name.

RAMaterialCollection.GetDefaultFluidMaterial() ansys.rocky.app.ra_fluid_material.RAFluidMaterial#
RAMaterialCollection.GetFluidMaterial(material_name: str) ansys.rocky.app.ra_fluid_material.RAFluidMaterial#

Get the fluid material with the given name.

RAMaterialCollection.GetMaterialsInteractionCollection() ansys.rocky.app.ra_materials_interaction_collection.RAMaterialsInteractionCollection#

Get the study’s Materials Interaction Collection.

RAMaterialCollection.GetBulkSolidFraction() float#

Get the value of “Bulk Solid Fraction”.

RAMaterialCollection.SetBulkSolidFraction(value: str | float) None#

Set the value of “Bulk Solid Fraction”.

Parameters:

value – The value to set. This value can be an expression with input variables or float type.