Oasys.D3PLOT.Material class

Properties

property Material.include(read only): integer

The include file number in the model that the material is in

property Material.index(read only): integer

The internal index for the material in D3PLOT (starting at 0)

property Material.label(read only): integer

The Ansys LS-DYNA label for the material

property Material.model(read only): Model

The Model that the material is in

property Material.name(read only): string

The name for the material type (e.g. *MAT_RIGID)

property Material.title(read only): string

The title for the material (or None if no title)

property Material.type(read only): constant

The type for the material (will be Type.MATERIAL)

Static methods

classmethod Material.First(model)

Returns the first material in the model (or None if there are no materials in the model)

Parameters:

model (Model) – Model to get first material in

Returns:

Material object

Return type:

Material

Example

To get the first material in model m:

m = Oasys.D3PLOT.Material.First(m)
classmethod Material.FlagAll(model, flag)

Flags all of the materials in the model with a defined flag

Parameters:
  • model (Model) – Model that all the materials will be flagged in

  • flag (Flag) – Flag (see AllocateFlag) to set on the materials

Returns:

No return value

Return type:

None

Example

To flag all of the materials with flag f in model m:

Oasys.D3PLOT.Material.FlagAll(m, f)
classmethod Material.GetAll(model, property=Oasys.gRPC.defaultArg)

Returns a list of Material objects or properties for all of the materials in the model. If the optional property argument is not given then a list of Material objects is returned. If the property argument is given, that property value for each material is returned in the list instead of a Material object

Parameters:
  • model (Model) – Model that all the materials are in

  • property (string) – Optional. Name for property to get for all materials in the model

Returns:

List of Material objects or properties

Return type:

list

Example

To get all of the materials in model m:

m = Oasys.D3PLOT.Material.GetAll(m)

To return a list containing the value of property ‘foo’ (for example ‘label’ for a material) for each material in model m:

a = Oasys.D3PLOT.Material.GetAll(m, 'foo');
classmethod Material.GetFlagged(model, flag, property=Oasys.gRPC.defaultArg)

Gets all of the materials in the model flagged with a defined flag. If the optional property argument is not given then a list of Material objects is returned. If the property argument is given, that property value for each material is returned in the list instead of a Material object

Parameters:
  • model (Model) – Model that the flagged materials are in

  • flag (Flag) – Flag (see AllocateFlag) set on the materials to get

  • property (string) – Optional. Name for property to get for all flagged materials in the model

Returns:

List of Material objects or properties

Return type:

list

Example

To get all of the materials flagged with flag f in model m:

Oasys.D3PLOT.Material.GetFlagged(m, f)

To return a list containing the value of property ‘foo’ (for example ‘label’ for a node) for all materials flagged with flag f in model m:

a = Oasys.D3PLOT.Material.GetFlagged(m, f, 'foo');
classmethod Material.GetFromID(model, label)

Returns the Material object for material in model with label (or None if it does not exist)

Parameters:
  • model (Model) – Model to get material in

  • label (integer) – The Ansys LS-DYNA label for the material in the model

Returns:

Material object

Return type:

Material

Example

To get the material in model m with label 1000:

m = Oasys.D3PLOT.Material.GetFromID(m, 1000)
classmethod Material.GetFromIndex(model, index)

Returns the Material object for material in model with index (or None if it does not exist)

Parameters:
  • model (Model) – Model to get material in

  • index (integer) – The D3PLOT internal index in the model for material, starting at 0

Returns:

Material object

Return type:

Material

Example

To get the 51st material in model m:

m = Oasys.D3PLOT.Material.GetFromIndex(m, 50)
classmethod Material.Last(model)

Returns the last material in the model (or None if there are no materials in the model)

Parameters:

model (Model) – Model to get last material in

Returns:

Material object

Return type:

Material

Example

To get the last material in model m:

m = Oasys.D3PLOT.Material.Last(m)
classmethod Material.Total(model)

Returns the total number of materials in the model

Parameters:

model (Model) – Model to get total in

Returns:

The number of materials

Return type:

integer

Example

To get the number of materials in model m:

total = Oasys.D3PLOT.Material.Total(m)
classmethod Material.UnflagAll(model, flag)

Unsets a defined flag on all of the materials in the model

Parameters:
  • model (Model) – Model that the defined flag for all materials will be unset in

  • flag (Flag) – Flag (see AllocateFlag) to unset on the materials

Returns:

No return value

Return type:

None

Example

To unset flag f on all of the materials in model m:

Oasys.D3PLOT.Material.UnflagAll(m, f)

Instance methods

Material.ClearFlag(flag)

Clears a flag on a material

Parameters:

flag (Flag) – Flag (see AllocateFlag) to clear on the material

Returns:

No return value

Return type:

None

Example

To clear flag f on material m:

m.ClearFlag()
Material.Flagged(flag)

Checks if the material is flagged or not

Parameters:

flag (Flag) – Flag (see AllocateFlag) to test on the material

Returns:

True if flagged, False if not

Return type:

boolean

Example

To check if material m has flag f set on it:

if m.Flagged(f):
    do_something..
Material.Next()

Returns the next material in the model (or None if there is not one)

Returns:

Material object

Return type:

Material

Example

To get the next material after material m:

m = m.Next()
Material.Previous()

Returns the previous material in the model (or None if there is not one)

Returns:

Material object

Return type:

Material

Example

To get the previous material before material m:

m = m.Previous()
Material.SetFlag(flag)

Sets a flag on a material

Parameters:

flag (Flag) – Flag (see AllocateFlag) to set on the material

Returns:

No return value

Return type:

None

Example

To set flag f on material m:

m.SetFlag(f)