pyPENELOPE

grainboundaries – Grain boundaries geometry

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

class penelopetools.api.input.pengeom.usergeometry.grainboundaries.GrainBoundaries(left_material_id=0, right_material_id=0, title='Grain-Boundary', filename='grainboundary.geo', surfaces=None, modules=None)

Bases: penelopetools.api.input.pengeom.usergeometry._UserGeometry

Creates a new GrainBoundaries geometry. A grain boundaries is defined by vertical layers of different thicknesses. The surfaces and modules of the geometry are automatically generated when the build is called. The surfaces and modules arguments are therefore optional.

The value of the depth is 3.0 cm. Unless specified, the diameter is automatically generated from the thickness of the vertical layers. By default, no rotation and no shift is imposed on the geometry.

Parameters:
  • left_material_id – id of the material of the left side substrate
  • right_material_id – id of the material of the right side substrate
  • title – title of the geometry
  • filename – filename of the GEO file
DEPTH = (3.000000000000 +- 0.000000000000) cm
build(options)

Build the surfaces and modules of the geometry according to the information stored.

classmethod from_xml(element, grainboundaries=None)
get_parameters(prefix)
layers

Vertical layers of the grain-boundaries. The layers can be added and removed from this attribute.

to_html(header_level=1)

Returns a HTML representation of this option.

to_xml()

Returns a XML representation of this geometry.

validate()
class penelopetools.api.input.pengeom.usergeometry.grainboundaries.MaximumStepLengthsHook

Bases: penelopetools.api.input.penelope.hook.Hook

post_build(options)
class penelopetools.api.input.pengeom.usergeometry.grainboundaries.PhotonDetectorsHook(takeoffangle, energy_low=0.0, energy_high=1000000.0)

Bases: penelopetools.api.input.penelope.hook.Hook

Creates default photon detectors for a GrainBoundaries geometry. Detectors with an polar opening of 2 to 20 degrees are created from a specified take-off angle. The azimuthal opening is 60 deg. Detectors are positioned to be perpendicular and parallel to the boundaries.

Parameters:
  • takeoffangle – take off angle (deg)
  • energy_low – lower limit of the energy window (eV)
  • energy_high – upper limit of the energy window (eV)
pre_build(options)
class penelopetools.api.input.pengeom.usergeometry.grainboundaries.VerticalLayers(leftlayer, rightlayer)

Bases: penelopetools.api.input.pengeom.usergeometry.util._Layers

Creates a new VerticalLayers to store the layers definition of a GrainBoundaries geometry. The class is a list of Layer.

For this geometry, there is a substrate layer on the left and right of the other layers. By definition, these layers must have an infinite thickness. They cannot be deleted, can only be modified by another layer with an infinite thickness.

Parameters:
  • leftlayer (Layer) – layer for the left side. It must have a infinite thickness.
  • rightlayer (Layer) – layer for the right side. It must have a infinite thickness.
assert_add_layer(layer)

Asserts that no new layer should have an infinite thickness.

assert_add_position(position)

Asserts that no layer can be added after the left or right substrate.

assert_delete(position)

Asserts that the left or right substrate layer cannot be deleted.

assert_update(position, layer)

Asserts that the left or right substrate layer can only be updated by a layer with an infinite thickness. Asserts also that no other layer should have an infinite thickness except the substrate layer.

classmethod from_xml(element)

Creates a VerticalLayers from a XML element.

Parameters:element – XML element