Sample_class module

class Sample_class.Sample(type_sample)

Bases: object

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

Creates sample_with_atoms.lmp which is an atomic position file. This requires the stl of the object that already has surface roughness applied to it. It adds then atoms in it.

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 cristal
  • lattice_par (float) – The lattice parameter of the cristal in Angstrom
  • material (str) – The chemical symbol of the desired element
  • orien_x (list) – The orientation of the cristal in the x direction
  • orien_y (list) – The orientation of the cristal in the y direction
  • orien_z (list) – The orientation of the cristal in the z direction
  • vertices (array) – List of nodes
  • out_pre (str) – Prefix of the output files
make_stl(type_sample, H, 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_y, 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 excuted. 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
  • H (float) – Hurst 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_y (list) – Orientation along y-axis
  • orien_z (list) – Orientation along z-axis
  • out_pre (str) – Prefix of the ouput files
  • ext_fem (list) – Output FEM formats list
Returns:

List of nodes and stl file name

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 cristal 1
  • lattice_parameter1 (float) – The lattice parameter of the cristal 1 in Angstrom
  • material1 (str) – The chemical symbol of the desired element 1
  • orien_x1 (list) – The orientation of the cristal 1 in the x direction
  • orien_y1 (list) – The orientation of the cristal 1 in the y direction
  • orien_z1 (list) – The orientation of the cristal 1 in the z direction
  • lattice_structure2 (str) – The lattice structure of the cristal 2
  • lattice_parameter2 (float) – The lattice parameter of the cristal 2 in Angstrom
  • material2 (str) – The chemical symbol of the desired element 2
  • orien_x2 (list) – The orientation of the cristal 2 in the x direction
  • orien_y2 (list) – The orientation of the cristal 2 in the y direction
  • orien_z2 (list) – The orientation of the cristal 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 ouput 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 ouput 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 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 ouput 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, RMS, 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
  • RMS (float) – RMS
  • 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 ouput 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 ouput 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_y, orien_z, out_pre, ext_fem)

Creates an stl file of a Wulff-shaped 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
  • 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 cristal
  • lattice_parameter (float) – The lattice parameter of the cristal in Angstrom
  • material (str) – The chemical symbol of the desired element
  • orien_x (list) – Orientation along x-axis
  • orien_y (list) – Orientation along y-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