Sample_class module

class Sample_class.Sample(type_sample)

Bases: object

make_atom(STL, lattice_str, lattice_par, material, orien_x, orien_y, orien_z, vertices, out_pre, ext_ato)

Creates an atom position file sample_with_atoms.lmp. This requires a .stl file with rough surfaces used as a stencil over a larger block of atoms from which out-of-the-mesh atoms are removed

Parameters:
  • type_sample (str) – Sample type

  • STL (str) – The stl file with an object that has surface roughness applied to it

  • lattice_str (str) – The lattice structure of the crystal

  • lattice_par (float) – The lattice parameter of the crystal in Angstrom

  • material (str) – The chemical symbol of the desired element

  • orien_x (list) – The orientation of the crystal in the x direction

  • orien_y (list) – The orientation of the crystal in the y direction

  • orien_z (list) – The orientation of the crystal in the z direction

  • vertices (array) – List of nodes

  • out_pre (str) – Prefix of the output files

make_atom_matrix(STL, length_x, length_y, length_z, lattice_str, lattice_par, material, orien_x, orien_y, orien_z)

Creates an orthogonal matrix made of atoms.

Parameters:
  • length_x (float) – Sample dimension

  • length_y (float) – Sample dimension

  • length_z (float) – Sample dimension

  • lattice_str (str) – The lattice structure of the crystal

  • lattice_par (float) – The lattice parameter of the crystal in Angstrom

  • material (str) – The chemical symbol of the desired element

  • orien_x (list) – The orientation of the crystal in the x direction

  • orien_y (list) – The orientation of the crystal in the y direction

  • orien_z (list) – The orientation of the crystal in the z direction

  • out_pre (str) – Prefix of the output files

make_precipitate(STL, lattice_str, lattice_par, material, orien_x, orien_y, orien_z, dim_mat_x, dim_mat_y, dim_mat_z)

Creates an atom position file sample_with_atoms.lmp. This requires a .stl file with rough surfaces used as a stencil over a larger block of atoms from which out-of-the-mesh atoms are removed

Parameters:
  • type_sample (str) – Sample type

  • STL (str) – The stl file with an object that has surface roughness applied to it

  • lattice_str (str) – The lattice structure of the crystal

  • lattice_par (float) – The lattice parameter of the crystal in Angstrom

  • material (str) – The chemical symbol of the desired element

  • orien_x (list) – The orientation of the crystal in the x direction

  • orien_y (list) – The orientation of the crystal in the y direction

  • orien_z (list) – The orientation of the crystal in the z direction

  • out_pre (str) – Prefix of the output files

  • dim_mat_x (float) – Dimensions of the matrix

make_stl(type_sample, eta, C1, RMS, N, M, radius, length, height, width, ns, alpha, raw_stl, nfaces, surfaces, energies, n_at, lattice_structure, lattice_parameter, material, orien_x, orien_z, out_pre, ext_fem)

Creates an stl file based on the parameters chosen by the user. Based on the type of sample entered, the code will sort through the options of type of samples and if true then the code under the type of sample will be executed. The type of sample affects the type of stl file returned. The code executed requires the parameters to create the object stl and to apply surface roughness onto the object. …; In continuation will add that a separate files will be stored if they want to redo the code.

Parameters:
  • type_sample (str) – Type of the sample

  • eta (float) – Roughness exponent

  • C1 (float) – Roughness normalization factor

  • RMS (float) – RMS

  • N (int) – Length of the random numbers matrix

  • M (int) – Length of the random numbers matrix

  • radius (float) – The radius of the nanowire or the sphere

  • length (float) – The length of the box

  • height (float) – The height of the box

  • width (float) – The width of the box

  • ns (float) – Mesh size

  • alpha (float) – Refine mesh factor

  • raw_stl (stl) – Input STL file

  • nfaces (int) – Number of faces in the case of a faceted wire

  • surfaces (list) – List of surfaces used for Wulff theory

  • energies (list) – List of energies for each associated surface

  • n_at (int) – Number of atoms in the case of a faceted NP

  • lattice_structure (str) – Crystallographic structure of the material

  • lattice_parameter (float) – Lattice parameter of the material

  • material (str) – Type of material

  • orien_x (list) – Orientation along x-axis

  • orien_z (list) – Orientation along z-axis

  • out_pre (str) – Prefix of the output files

  • ext_fem (list) – Output FEM formats list

Returns:

List of nodes and stl file name

put_prec_in_matrix(out_pre, ext_ato)

Introduce a cube/sphere/wulff precipitate into a matrix

Parameters:
  • out_pre_matrix (str) – Matrix sample

  • STL (str) – The stl file with an object that has surface roughness

  • out_pre (str) – Prefix of the output files

Sample_class.make_atom_grain(STL, lattice_structure1, lattice_parameter1, material1, orien_x1, orien_y1, orien_z1, lattice_structure2, lattice_parameter2, material2, orien_x2, orien_y2, orien_z2, vertices, out_pre, ext_ato)

Generates an atomic positions file for the grain object.

Parameters:
  • STL (str) – The stl file with an object that has surface roughness applied to it

  • lattice_structure1 (str) – The lattice structure of the crystal 1

  • lattice_parameter1 (float) – The lattice parameter of the crystal 1 in Angstrom

  • material1 (str) – The chemical symbol of the desired element 1

  • orien_x1 (list) – The orientation of the crystal 1 in the x direction

  • orien_y1 (list) – The orientation of the crystal 1 in the y direction

  • orien_z1 (list) – The orientation of the crystal 1 in the z direction

  • lattice_structure2 (str) – The lattice structure of the crystal 2

  • lattice_parameter2 (float) – The lattice parameter of the crystal 2 in Angstrom

  • material2 (str) – The chemical symbol of the desired element 2

  • orien_x2 (list) – The orientation of the crystal 2 in the x direction

  • orien_y2 (list) – The orientation of the crystal 2 in the y direction

  • orien_z2 (list) – The orientation of the crystal 2 in the z direction

  • vertices (array) – List of nodes

  • out_pre (str) – Prefix of output file

  • ext_ato (list) – Atomic position file format list

Returns:

Sample_class.make_box(type_sample, B, C1, RMS, N, M, length, height, width, ns, alpha, raw_stl, out_pre, ext_fem)

Creates an stl file of a rough box

Parameters:
  • type_sample (str) – The name of the sample

  • B (float) – The degree the roughness is dependent on

  • C1 (float) – Roughness normalization factor

  • RMS (float) – RMS

  • N (int) – Scaling cartesian position

  • M (int) – Scaling cartesian position

  • length (float) – Length of the box

  • height (float) – Height of the box

  • width (float) – Width of the box

  • ns (int) – The number of segments desired

  • alpha (float) – Refine mesh factor

  • raw_stl (str) – Name of the input stl file

  • out_pre (str) – Prefix of the output files

  • ext_fem (list) – List of FEM extension files

Returns:

List of nodes and STL file name

Sample_class.make_cube(type_sample, B, C1, RMS, N, M, length, ns, alpha, raw_stl, out_pre, ext_fem)

Creates an stl file of a cubic NP

Parameters:
  • type_sample (str) – The name of the sample

  • B (float) – The degree the roughness is dependent on

  • C1 (float) – Roughness normalization factor

  • RMS (float) – RMS

  • N (int) – Scaling cartesian position

  • M (int) – Scaling cartesian position

  • length (float) – Dimension of the cube

  • ns (int) – The number of segments desired

  • alpha (float) – Refine mesh factor

  • raw_stl (str) – Name of the input stl file

  • out_pre (str) – Prefix of the output files

  • ext_fem (list) – List of FEM extension files

Returns:

List of nodes and STL file name

Sample_class.make_poly(type_sample, B, C1, RMS, N, M, length, nfaces, radius, ns, alpha, raw_stl, out_pre, ext_fem)

Creates an stl file of a rough faceted wire

Parameters:
  • type_sample (str) – The name of the sample

  • B (float) – The degree the roughness is dependent on

  • C1 (float) – Roughness normalization factor

  • RMS (float) – RMS

  • N (int) – Scaling cartesian position

  • M (int) – Scaling cartesian position

  • length (float) – Length of the wire

  • nfaces (int) – Number of faces of the wire

  • radius (float) – Radius of the wire

  • ns (int) – The number of segments desired

  • alpha (float) – Refine mesh factor

  • raw_stl (str) – Name of the input stl file

  • out_pre (str) – Prefix of the output files

  • ext_fem (list) – List of FEM extension files

Returns:

List of nodes and STL file name

Sample_class.make_sphere(type_sample, B, C1, N, radius, ns, alpha, raw_stl, out_pre, ext_fem)

Creates an stl file of a rough sphere

Parameters:
  • type_sample (str) – The name of the sample

  • B (float) – The degree the roughness is dependent on

  • C1 (float) – Roughness normalization factor

  • N (int) – Scaling cartesian position

  • radius (float) – Radius of the sphere

  • ns (int) – The number of segments desired

  • alpha (float) – Refine mesh factor

  • raw_stl (str) – Name of the input stl file

  • out_pre (str) – Prefix of the output files

  • ext_fem (list) – List of FEM extension files

Returns:

List of nodes and STL file name

Sample_class.make_wire(type_sample, B, C1, RMS, N, M, radius, length, ns, alpha, raw_stl, out_pre, ext_fem)

Creates an stl file of a rough wire

Parameters:
  • type_sample (str) – The name of the sample

  • B (float) – The degree the roughness is dependent on

  • C1 (float) – Roughness normalization factor

  • RMS (float) – RMS

  • N (int) – Scaling cartesian position

  • M (int) – Scaling cartesian position

  • radius (float) – Radius of the wire

  • length (float) – Length of the box

  • ns (int) – The number of segments desired

  • alpha (float) – Refine mesh factor

  • raw_stl (str) – Name of the input stl file

  • out_pre (str) – Prefix of the output files

  • ext_fem (list) – List of FEM extension files

Returns:

List of nodes and STL file name

Sample_class.make_wulff(type_sample, B, C1, RMS, N, M, surfaces, energies, n_at, ns, alpha, raw_stl, lattice_structure, lattice_parameter, material, orien_x, orien_z, out_pre, ext_fem)

Creates an stl file of a rough Wulff-shaped nanoparticle

Parameters:
  • type_sample (str) – The name of the sample

  • B (float) – The degree the roughness is dependent on

  • C1 (float) – Roughness normalization factor

  • RMS (float) – RMS

  • N (int) – Scaling cartesian position

  • M (int) – Scaling cartesian position

  • surfaces (list) – Orientation of surfaces used for Wulff theory

  • energies (list) – Energies of associated surfaces for Wulff theory

  • n_at (int) – Number of atoms

  • ns (int) – The number of segments desired

  • alpha (float) – Refine mesh factor

  • raw_stl (str) – Name of the input stl file

  • lattice_structure (str) – The lattice structure of the crystal

  • lattice_parameter (float) – The lattice parameter of the crystal in Angstrom

  • material (str) – The chemical symbol of the desired element

  • orien_x (list) – Orientation along x-axis

  • orien_z (list) – Orientation along z-axis

  • out_pre (str) – Prefix for output files

  • ext_fem (list) – List of FEM extension files

Returns:

List of nodes and STL file name