pyPENELOPE

util – Utilities for user geometries

Inheritance diagram of penelopetools.api.input.pengeom.usergeometry.util

class penelopetools.api.input.pengeom.usergeometry.util.Layer(thickness=-1, material_id=0)

Bases: misctools.base.Validable

Creates a new Layer. Layers are used by GrainBoundaries and MultiLayers. A layer is defined by a thickness and a material.

Parameters:
  • thickness – thickness of the layer (in cm).
  • material_id (int) – id of the material associated to the layer
ATTR_MATERIAL_ID = 'materialId'
ATTR_THICKNESS = 'thickness_cm'
TAG_NAME = 'layer'
classmethod from_xml(element)

Creates a Layer from a XML element.

Parameters:element – XML element
has_thickness()

Returns whether a thickness was specified by the user.

material_id

Id of the Material for this layer. The id shall correspond to the id of the material in Materials. The id must be positive.

thickness

Thickness of the layer (cm). The thickness must be greater than zero. If the attribute is deleted, the thickness is assumed to be infinite. The value is stored in a magnitude.Magnitude.

to_html(header_level=1)

Returns a HTML representation of this option.

to_xml()

Returns a XML representation of this option.

exception penelopetools.api.input.pengeom.usergeometry.util.LayerThicknessError(value)

Bases: exceptions.Exception

Exception raised when trying to delete a required layer.

exception penelopetools.api.input.pengeom.usergeometry.util.RequiredLayerError(value)

Bases: exceptions.Exception

Exception raised when trying to delete a required layer.