API¶
Support Functions¶
-
magcolloids.
initial_setup
(n_of_particles, packing=0.3, height=4, radius=1.4)[source]¶ This function returns an array of initial positions for confined particles, and a region where these particles are enclosed with a packing fraction “packing” The particles are initially set in a square array, as far from each other as possible.
-
magcolloids.
animate_trj
(trj, sim=None, region=None, radius=None, framerate=None, ax=False, verb=False, start=0, end=False, step=1, speedup=1, preserve_limits=False, time_index='frame', color_field='z', color_label='$z [\\mu{m}]$', clim=None, cmap=None)[source]¶ This function animates the trajectory resulting from a confined dimer simulation. It displays the z direction as a colormap and the particles in the x and y direction. The simulation is required as argument to obtain parameters like the region size and the particles radius. Optional parameters are: * ax: an axis object to use for creating the plot. * start: start time of the simulation if not the whole time is required. The default is 0. * end: end time of the simulation. The default is the total simulation time. * step = 1. The framerate, so to speak. * verb = False. If verb = True, the routine prints indicators that is running. * speedup allows us to do faster videos. Default is 1, which means normal ratio. todo: Fix for bidisperse particles. Take draw_trj as example.
Parameter Classes¶
-
class
magcolloids.
particles
(positions, atoms_id=None, atom_type=0, radius=<Quantity(2, 'micrometer')>, susceptibility=1, drag=<Quantity(4000000.0, 'piconewton * second / micrometer')>, diffusion=None, temperature=None, density=<Quantity(1000.0, 'kilogram / meter ** 3')>, susceptibility_spread=0)[source]¶ A type of particle to be simulated
-
class
magcolloids.
field
(magnitude=<Quantity(10, 'millitesla')>, frequency=<Quantity(0, 'hertz')>, angle=<Quantity(0, 'degree')>, phase=<Quantity(0, 'degree')>, fieldx=None, fieldy=None, fieldz=None, multibody_iter=0)[source]¶
-
class
magcolloids.
world
(particles, traps=None, temperature=<Quantity(300, 'kelvin')>, region=<Quantity([200 200 20], 'micrometer')>, boundaries=['s', 's', 'p'], walls=[False, False, True], dipole_cutoff=<Quantity(200, 'micrometer')>, lj_cutoff=1, lj_parameters=[<Quantity(0.01, 'micrometer ** 2 * picogram / microsecond ** 2')>, 0.8908987181403393], gravity=<Quantity(9.8, 'meter / second ** 2')>, enforce2d=False, ext_force=None)[source]¶
Simulation Class¶
-
class
magcolloids.
sim
(file_name='test', dir_name='', stamp_time=False, particles=None, traps=None, world=None, field=None, timestep=<Quantity(0.001, 'second')>, framerate=<Quantity(30, 'hertz')>, total_time=<Quantity(60, 'second')>, output=['x', 'y', 'z'], processors=1)[source]¶ -
generate_scripts
()[source]¶ This method generates the input script for the lammps simulation. It accepts some options, which for now include: * (future) input_file: boolean, (False) which specifies if the input file is stored separatelly from the main script.
This icreases readibility for large amounts of particles
-