structures.structure
¶
Classes
|
-
class
udkm1Dsim.structures.structure.
Structure
(name)¶ Bases:
object
The structure class can hold various sub_structures. Each sub_structure can be either a layer of \(N\) UnitCell or AmorphousLayer objects or a structure by itself. Thus it is possible to recursively build up 1D structures.
- Parameters
name (str) – name of the sample.
- Attributes
name (str) – name of sample.
sub_structures (list[AmorphousLayer, UnitCell, Structure]) – list of structures in sample.
substrate (Structure) – structure of the substrate.
num_sub_systems (int) – number of subsystems for heat and phonons (electronic, lattice, spins, …).
-
visualize
(unit='nm', fig_size=[20, 1])¶ Simple visualization of the structure.
- Parameters
unit (str) – SI unit of the distance of the Structure. Defaults to ‘nm’.
fig_size (list[float]) – figure size of the visualization plot. Defaults to [20, 1].
-
get_hash
(**kwargs)¶ Create an unique hash from all layer IDs in the correct order in the structure as well as the corresponding material properties which are given by the kwargs.
- Parameters
**kwargs (list[str]) – types of requested properties..
- Returns
hash (str) – unique hash.
-
add_sub_structure
(sub_structure, N=1)¶ Add a sub_structure of \(N\) layers or sub-structures to the structure.
- Parameters
sub_structure (AmorphousLayer, UnitCell, Structure) – amorphous layer, unit cell, or structure to add as sub-structure.
N (int) – number or repetitions.
-
add_substrate
(sub_structure)¶ Add a structure as static substrate to the structure.
- Parameters
sub_structure (Structure) – substrate structure.
-
get_number_of_sub_structures
()¶ This methods does not return the number of all layers in the structure, see
get_number_of_layers()
.- Returns
N (int) – number of all sub structures.
-
get_number_of_layers
()¶ - Returns
L (int) – number of all layers in the structure.
-
get_number_of_unique_layers
()¶ - Returns
N (int) – number of unique layers in the structure.
-
get_thickness
(units=True)¶ - Parameters
units (boolean, optional) – whether units should be returned or not. Defaults to True.
- Returns
thickness (float, Quantitiy) – the thickness from surface to bottom of the structure.
-
get_unique_layers
()¶ The uniqueness is determined by the handle of each layer instance.
- Returns
(tuple) –
layer_ids (list[str]) - ids of all unique layers instances in the structure.
layer_handles (list[AmorphousLayer, UnitCell, Structure]) - handles of all unique layers instances in the structure.
-
get_layer_vectors
(*args)¶ Returns three lists with the numeric index of all layers in a structure given by the get_unique_layers() method and addidionally vectors with the ids and Handles of the corresponding layer instances. The list and order of the unique layers can be either handed as an input parameter or is requested at the beginning.
- Parameters
layers (Optional[list]) – list of unique layers including ids and handles
- Returns
(tuple) –
indices (list[int]) - numeric index of all layers in a structure.
layer_ids (list[str]) - ids of all unique layers instances in the structure.
layer_handles (list[AmorphousLayer, UnitCell, Structure]) - handles of all unique layers instances in the structure.
-
get_all_positions_per_unique_layer
()¶ - Returns
pos (dict{ndarray[int]}) – position indices for each unique layer in the structure.
-
get_distances_of_layers
(units=True)¶ Returns a vector of the distance from the surface for each layer starting at 0 (dStart) and starting at the end of the first layer (dEnd) and from the center of each layer (dMid).
- Parameters
units (boolean, optional) – whether units should be returned or not. Defaults to True.
- Returns
(tuple) –
d_start (ndarray[float, Quantity]) - distances from the surface of each layer starting at 0.
d_end (ndarray[float, Quantity]) - distances from the bottom of each layer.
d_mid (ndarray[float, Quantity]): distance from the middle of each layer.
-
get_distances_of_interfaces
(units=True)¶ - Parameters
units (boolean, optional) – whether units should be returned or not. Defaults to True.
- Returns
res (ndarray[float, Quantity]) – distances from the surface of each interface of the structure.
-
interp_distance_at_interfaces
(N, units=True)¶ - Parameters
N (int) – number of point of interpolation at interface
units (boolean, optional) – whether units should be returned or not. Defaults to True.
- Returns
(tuple) –
dist_interp (ndarray[float, Quantity]) - distance array of the middle of each layer interpolated by an odd number \(N\) at the interfaces
original_indicies (ndarray[int]) - indicies of the original distances in the interpolated array
-
get_layer_property_vector
(property_name)¶ Returns a vector for a property of all layers in the structure. The property is determined by the propertyName and returns a scalar value or a function handle.
- Parameters
property_name (str) – name of property to return as array
- Returns
prop (ndarray[float, @lambda]) – array of a property for all layers in the structure.
-
get_layer_handle
(i)¶ - Parameters
i (int) – index of the layer to return.
- Returns
handle (AmorphousLayer, UnitCell) – handle to the layer at position i in the structure.