febid.Structure.Structure#

class Structure(precursor_empty=0.0, precursor_full=1.0, deposit_empty=0.0, deposit_full_substrate=-2.0, deposit_full_deponat=-1.0)[source]#

Bases: object

Represents the discretized space of the simulation volume and keeps the current state of the structure.

Set values to mark empty and full cells for precursor and deposit arrays.

STUB: These values are used in MC module as well to read the structure and has to be conveniently pipelined there

Parameters:
  • precursor_empty

  • precursor_full

  • deposit_empty

  • deposit_full_substrate

  • deposit_full_deponat

Methods

create_from_parameters

Frame initializer.

define_ghosts

Determining ghost shell wrapping the surface This is crucial for the diffusion to work if rolling method is used.

define_semi_surface

Determining semi-surface of the initial structure

define_surface

Determining surface of the initial structure

define_surface_neighbors

Find solid cells that are n-closest neighbors to the surface cells.

fill_surface

Covers surface of the deposit with initial precursor density

flush_structure

Resets and prepares initial state of the grid.

load_from_vtk

Frame initializer.

max_z

Get the height of the structure.

resize_structure

Resize the data framework.

save_to_vtk

update_shape

Read the shape of the data and set shape and absolute shape of the class.

create_from_parameters(cell_dim=5, width=50, length=50, height=100, substrate_height=4, nr=0)[source]#

Frame initializer. Create a discretized simulation volume framework from parameters.

Parameters:
  • cell_dim – size of a cell, nm

  • width – width of the simulation chamber (along X-axis), number of cells

  • length – length of the simulation chamber (along Y-axis), number of cells

  • height – height of the simulation chamber (along Z-axis), number of cells

  • substrate_height – thickness of the substrate along Z-axis, number of cells

  • nr – initial precursor density, normalized

Returns:

define_ghosts()[source]#

Determining ghost shell wrapping the surface This is crucial for the diffusion to work if rolling method is used.

Returns:

define_semi_surface()[source]#

Determining semi-surface of the initial structure

Semi-surface cell is a concept that enables diffusion on the steps of the structure. These cells take part neither in the deposition process, nor in adsorption/desorption.

If semi-surface cell turns into a regular surface cell, the precursor density in it is preserved.

Returns:

define_surface()[source]#

Determining surface of the initial structure

Returns:

define_surface_neighbors(n=0, deposit=None, surface=None, neighbors=None)[source]#

Find solid cells that are n-closest neighbors to the surface cells. If deposit, surface and neighbors are provided, nearest neighbors are defined for them.

Parameters:

n – order of nearest neighbor, if 0, then index all the solid cells

Returns:

fill_surface(nr)[source]#

Covers surface of the deposit with initial precursor density

Parameters:

nr (float) – initial precursor density

Returns:

flush_structure()[source]#

Resets and prepares initial state of the grid.

Parameters:
  • substrate – 3D precursor density array

  • deposit – 3D deposit array

  • init_density – initial precursor density on the surface

  • init_deposit – initial deposit on the surface, can be a 2D array with the same size as deposit array along 0 and 1 dimensions

  • volume_prefill – initial deposit in the volume, can be a predefined structure in an 3D array same size as deposit array (constant value is virtual and used for code development)

Returns:

load_from_vtk(vtk_obj, add_substrate=4)[source]#

Frame initializer. Load structure from a .vtk file.

A vtk object can either represent only a single solid structure array or a result of a deposition process with the full set of arrays.

Important requirement: vtk data must be a UniformGrid with ‘spacing’ attribute.

Parameters:
  • vtk_obj (DataSet) – a vtk object from file

  • add_substrate – if a value is specified, a substrate with such height will be created for simple vtk files. 0 or False otherwise. If the value is not a multiple of the ‘spacing’ attribute, it will be rounded down.

max_z()[source]#

Get the height of the structure. :return: 0-axis index of the highest cell

resize_structure(delta_z=0, delta_y=0, delta_x=0)[source]#

Resize the data framework. The specified lengths are attached along the axes.

If any of the data is referenced, only a warning is shown and data is resized anyway.

Changing dimensions along y and x axes should be done mindful, because if these require extension in the negative direction, that data has to be centered after the resizing.

Parameters:
  • delta_z – increment for the z-axis, nm

  • delta_y – increment for the y-axis, nm

  • delta_x – increment for the x-axis, nm

Returns:

update_shape()[source]#

Read the shape of the data and set shape and absolute shape of the class. :return: