Cluster
- tool_create_cluster.add_basis(lat_pos, basis)
Add a crystal basis to a simple Bravais lattice
- tool_create_cluster.calc_cluster_langevin(eta, pos)
Compute the effective translational and rotational damping acting on a CM of a cluster of N particles
- tool_create_cluster.cluster_from_params(params)
Create cluster from parameters in dictionary.
Return xy positions
- tool_create_cluster.cluster_inhex_Nl(N1, N2, a1=array([4.45, 0. ]), a2=array([-2.225, 3.85381305]), clgeom_fname='input_pos.hex', cluster_f=<function create_cluster_circle>, X0=0, Y0=0)
Create a cluster from lattice details (equivalent to .hex file) and specific shape function.
The .hex file will be created and removed using tempfile. Returns only xy positions.
Default values relate to Xin/EP colloids [Nat. Phys 2019, PRE 2021] and circular shape
- tool_create_cluster.cluster_poly(polygon, params, direction=0)
Use a polygon (shapely object) to mask a lattice (defined in params).
Direction = 0: select the interior of the polygon (use bounds of polygon to define lattice big enough for mask) Direction = 1: select the exterior of the polygon (up to the N1 N2 in params)
Return xy pos
- tool_create_cluster.create_cluster(input_cluster, angle=0)
Create clusters taking as input the two primitive vectors a1 and a2 and the indices of lattice points. Put center of mass in zero.
- tool_create_cluster.create_cluster_circle(input_hex, outstream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, X0=0, Y0=0)
Circle cluster
The 6 dimensions are for backward compatibility with EP.
- tool_create_cluster.create_cluster_hex(input_hex, outstream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, X0=0, Y0=0)
Hexagonal cluster
The 6 dimensions are for backward compatibility with EP.
- tool_create_cluster.create_cluster_rect(input_hex, outstream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, X0=0, Y0=0)
Rectangular cluster
The 6 dimensions are for backward compatibility with EP.
- tool_create_cluster.create_cluster_special(input_hex, outstream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, X0=0, Y0=0)
Special-parall cluster. See paper on XXX.
The 6 dimensions are for backward compatibility with EP.
- tool_create_cluster.create_cluster_tri(input_hex, outstream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, X0=0, Y0=0)
Triangular cluster
The 6 dimensions are for backward compatibility with EP.
- tool_create_cluster.create_input_hex(N1, N2, clgeom_fname='in.hex', a1=array([4.45, 0.]), a2=array([-2.225, 3.85381305]))
Create input file in EP .hex format
Cluster is created from Bravais lattice a1 a2 with N1 repetition along a1 and N2 repetitions along N2. Default is Xin colloids: triangular with spacing 4.45
- tool_create_cluster.get_poly(points, scale=1, tho=0, c=[0, 0], shift=0, cm=False)
Get a polygon (Shapely obejct) from a set of points.
Optinally rotate, scale and shfit
- tool_create_cluster.get_rotomatr(angle)
Get ACW rotation matrix of an angle [degree]
- tool_create_cluster.load_cluster(input_hex, angle=0, center=False)
Load cluster form numpy file data. Optionally adjust CM and rotate.
- tool_create_cluster.load_input_hex(instream)
Load .hex file defining lattice and size
- tool_create_cluster.params_from_ASE(ase_geom, cut_z=0, tol=0.9)
Create JSON parameters to create clusters from ASE Atoms object.
Assume this is already a 2D surface oriented along z to extract 2x2 matrix: From:
a b 0 c d 0 0 0 1
- Take:
a b c d
Positions are flattend out: (x,y) from (x,y,z)
Return parameters dictionary and list of z coordinates considered
- tool_create_cluster.params_from_poscar(poscar_fname, cut_z=0)
Create JSON parameters to create clusters from POSCAR file.
Use ASE to read.
Return parameters file.
- tool_create_cluster.rotate(pos, angle, c=[0, 0])
Rotate positions pos of angle [degree] with respect to center c (default 0,0)
- tool_create_cluster.save_xyz(pos, outfname='cluster.xyz', elem='X')
Save cluster as xyz in given file (default ‘cluster.xyz’)