### 6.4.1. MaterialData

`class compolyx.MaterialData`(graph, parent=None)

MaterialData manages all composite material data.

`copy`(source, on_duplicate_name='keep_both')

  copy a list of material data source, keeps track of all dependencies

  Parameters

  - source : a list of source of copy

  - on_duplicate_name

      action to take if source.name is already contained in self.fabrics

      keep_both : create a new instance with the same name (different id) overwrite : replace first instance with equal name in self with source keep_existing : ignore copy action, returns first existing instance in self with equal name

`copy_fabric`(source, on_duplicate_name='keep_both', memo=None)

  Copy a fabric

  Parameters

  - source : Source object to copy

  - on_duplicate_name

      action to take if source.name is already contained in self.fabrics

      keep_both : create a new instance with the same name (different id) overwrite : replace first instance with equal name in self with source keep_existing : ignore copy action, returns first existing instance in self with equal name

  - memo : a dict to collect copied items (for internal dependency tracking when copying stackups or sub-laminates)

  Returns

  New Instance of Fabric

`copy_material`(source, on_duplicate_name='keep_both', memo=None)

  Copy a material

  Parameters

  - source : Source object to copy

  - on_duplicate_name

      action to take if source.name is already contained in self.materials

      keep_both : create a new instance with the same name (different id) overwrite : replace first instance with equal name in self with source keep_existing : ignore copy action, returns first existing instance in self with equal name

  - memo : a dict to collect copied items (for internal dependency tracking when copying stackups or sub-laminates)

  Returns

  New instance of material

`copy_stackup`(source, on_duplicate_name='keep_both', memo=None)

  Copy a stackup

  Parameters

  - source : Source object to copy

  - on_duplicate_name

      action to take if source.name is already contained in self.stackups

      keep_both : create a new instance with the same name (different id) overwrite : replace first instance with equal name in self with source keep_existing : ignore copy action, returns first existing instance in self with equal name

  - memo : a dict to collect copied items

  Returns

  New Instance of Fabric

`copy_sub_laminate`(source, on_duplicate_name='keep_both', memo=None)

  Copy a sub lamiante

  Parameters

  - source : Source object to copy

  - on_duplicate_name

      action to take if source.name is already contained in self.sub_laminates

      keep_both : create a new instance with the same name (different id) overwrite : replace first instance with equal name in self with source keep_existing : ignore copy action, returns first existing instance in self with equal name

  - memo : a dict to collect copied items

  Returns

  New Instance of sub laminate

`create_fabric`(name, id=None, material=None, thickness=0.0, draping0=1.0, draping1=0.0, draping2=0.0, area_price=0.0, ignore_for_postprocessing=False, drop_off_material_handling='Global', cut_off_material_handling='Computed', drop_off_material=None, cut_off_material=None)

  Create a new fabric

  Parameters

  - name : Name for the Fabric

  - material : Material of the Fabric

  - thickness : Thickness of the Fabric

  - draping0 : Draping Parameter0

  - draping1 : Draping Parameter1

  - draping2 : Draping Parameter2

  - area_price : Area Price of the Fabric

  - ignore_for_postprocessing : Flag if this material is post-processed

  - drop_off_material_handling : Type defining how drop-off material is used in drop-off areas of the fabric

  - cut_off_material_handling : Type defining how cut-off material is used in cut-off areas of the fabric

  - drop_off_material : Material to use for 'Custom' drop-off material handling

  - cut_off_material : Material to use for 'Custom' cut-off material handling

  Returns

  The created Fabric

  Examples

      >>> material_data = db.models['beam'].material_data
      >>> fabric_1 = material_data.create_fabric(name='Fabric.1', material=material_data.materials['Material.1'], thickness=0.2, draping1=0.3, draping2=0.7)

`create_material`(name, id=None, ply_type='undefined', E1=0.0, E2=0.0, E3=0.0, G12=0.0, G31=0.0, G23=0.0, nu12=0.0, nu13=0.0, nu23=0.0, rho=0.0, locked=False, ext_id=None)

  Create a constant Material

  Parameters

  - name : Name of the new Material

  - ply_type : Type of the ply for the material. Allowed string values: regular , woven , orthotropic_homogeneous_core , isotropic_homogeneous_core , honeycomb_core , isotropic , undefined .

  - E1 - rho : Material parameters

  Returns

  New Instance of Material

`create_stackup`(name, id=None, fabrics=None, draping0=1.0, draping1=0.0, draping2=0.0, area_price=0.0, symmetry='No Symmetry', layup_sequence='Top-Down', drop_off_material_handling='Global', cut_off_material_handling='Computed', drop_off_material=None, cut_off_material=None)

  Create a new Stackup

  Parameters

  - name : Name for the Stackup

  - fabrics : Fabrics of the Stackup

  - draping0 : Draping Parameter0

  - draping1 : Draping Parameter1

  - draping2 : Draping Parameter2

  - area_price : Area Price of the Stackup

  - symmetry : Symmetry the Stackup can be 'No Symmetry', 'Even Symmetry' or 'Odd Symmetry'

  - layup_sequence : Layup sequence of the Stackup can be 'Top-Down' or 'Bottom-Up'

  - drop_off_material_handling : Type defining how drop-off material is used in drop-off areas of the stackup

  - cut_off_material_handling : Type defining how cut-off material is used in cut-off areas of the stackup

  - drop_off_material : Material to use for 'Custom' drop-off material handling

  - cut_off_material : Material to use for 'Custom' cut-off material handling

  Returns

  The created Stackup

  Examples

      >>> material_data = db.models['beam'].material_data
      >>> stackup_1 = material_data.create_stackup(name='Stackup.1', fabrics=(material_data.fabrics['Fabric.1'],), draping1=0.3, draping2=0.7)

`create_sub_laminate`(name, id=None, fabrics=None, symmetry='No Symmetry', layup_sequence='Top-Down')

  Create a new SubLaminate

  Parameters

  - name : Name for the Sub Laminate

  - fabrics : Fabrics of the Sub Laminate

  - symmetry : Symmetry the Sub Laminate can be 'No Symmetry', 'Even Symmetry' or 'Odd Symmetry'

  - layup_sequence : Layup sequence of the Sub Laminate can be 'Top-Down' or 'Bottom-Up'

  Returns

  The created SubLaminate

  Examples

      >>> material_data = db.models['beam'].material_data
      >>> sublaminate_1 = material_data.create_sub_laminate(name='SubLaminate.1', fabrics=(material_data.fabrics['Fabric.1'],material_data.stackups['Stackup.1']))

`enabled`

  Whether MaterialData is currently enabled or not.

`export_matml`(path, unit_system=None)

  Export materials to ANSYS Engineering Data MatML format.

  Parameters

  - path : Path to file to write.

  - unit_system

      Convert all quantities into this unit system. The units

      will be stored in the file written. The default is the unit system of the model.

`fabrics`

  Dictionary with all fabrics defined.

`find_materials`(**properties)

  Find materials with the given properties or property ranges

  Parameters

  - properties : Arbitrary material properties which must be matched.

      Note that a single property value can be given as string, number or min-max range

  Returns

  A list with materials which match the given properties. If nothing matches an empty list is returned.

  Examples

      >>> material_data = db.models['model.1'].material_data
      >>> materials = material_data.find_materials(E1=100000.0, nu12=0.3)
      >>> materials = material_data.find_materials( name='1')
      >>> materials = material_data.find_materials(E1=[200000.0, 220000.0], nu12=0.3, G12=[4500.0,5500.0])

`import_matml`(path, material_apdl_path='')

  Import material data from MatML file as provided by Workbench Engineering Data.

  Parameters

  - path : File to read from.

  - unit_system

      Created materials will be converted into this

      unit system.

  - material_apdl_path

      Specify the APDL file containing the

      ANSYS Engineering Data material definitions.

`material_apdl_path`

  Optional path to file with APDL material definitions to be used in the CDB export.

`materials`

  Dictionary with all materials defined.

`matml_path`

  Path to MatML file as provided by Workbench EngineeringData

`name`

  Currently a name is needed for every object in the db tree.

`serialize`()

  Serialize to Python string

`stackups`

  Dictionary with all stack ups defined.

`sub_laminates`

  Dictionary with all sub laminates defined.

`unit_system`

  Unit system of material data, propagated from model

Release 18.2 - © ANSYS, Inc. All rights reserved.