OAT external force utilities documentation
Forces
Python data structures for all forces defined by oxDNA
|
A spring force that pulls a particle towards the position of another particle |
A linear force along a vector |
|
|
A linear potential well that traps a particle |
|
A harmonic trap that rotates in space with constant angular velocity |
|
A plane that forces the affected particle to stay on one side. |
|
A plane that pulls the affected particle towards it while staying on one side. |
|
A sphere that encloses the particle |
- oxDNA_analysis_tools.external_force_utils.forces.mutual_trap(particle: int, ref_particle: int, stiff: float, r0: float, PBC: bool, rate: float = 0, stiff_rate: float = 0) Dict
A spring force that pulls a particle towards the position of another particle
- Parameters:
particle (int) – the particle that the force acts upon
ref_particle (int) – the particle that the particle will be pulled towards
stiff (float) – the force constant of the spring (in simulation units)
r0 (float) – the equlibrium distance of the spring
PBC (0 or 1) – does the force calculation take PBC into account (almost always 1)
rate (float) – changes r0 by this much every time step
stiff_rate (float) – changes stiff by this much every time step
- oxDNA_analysis_tools.external_force_utils.forces.string(particle: int, f0: float, rate: float, direction: List[float]) Dict
A linear force along a vector
- oxDNA_analysis_tools.external_force_utils.forces.harmonic_trap(particle: int, pos0: List[float], stiff: float, rate: float, direction: List[float]) Dict
A linear potential well that traps a particle
- Parameters:
particle (int) – the particle that the force acts upon
pos0 ([float, float, float]) – the position of the trap at t=0
stiff (float) – the stiffness of the trap (force = stiff * dx)
rate (float) – the velocity of the trap (simulation units/time step)
direction ([float, float, float]) – the direction of movement of the trap
- oxDNA_analysis_tools.external_force_utils.forces.rotating_harmonic_trap(particle: int, pos0: List[float], stiff: float, rate: float, base: float, center: List[float], axis: List[float], mask: List[float]) Dict
A harmonic trap that rotates in space with constant angular velocity
- Parameters:
particle (int) – the particle that the force acts upon
pos0 ([float, float, float]) – the position of the trap at t=0
stiff (float) – the stiffness of the trap (force = stiff * dx)
rate (float) – the angular velocity of the trap (simulation units/time step)
base (float) – initial phase of the trap
axis ([float, float, float]) – the rotation axis of the trap
mask ([float, float, float]) – the masking vector of the trap (force vector is element-wise multiplied by mask)
- oxDNA_analysis_tools.external_force_utils.forces.repulsion_plane(particle: int, stiff: float, direction: List[float], position: List[float]) Dict
A plane that forces the affected particle to stay on one side.
- Parameters:
particle (int) – the particle that the force acts upon. -1 will act on whole system.
stiff (float) – the stiffness of the trap (force = stiff * distance below plane)
direction ([float, float, float]) – the normal vecor to the plane
position ([float, float, float]) – position of the plane (plane is d0*x + d1*y + d2*z + position = 0)
- oxDNA_analysis_tools.external_force_utils.forces.attraction_plane(particle: int, stiff: float, direction: List[float], position: List[float]) Dict
A plane that pulls the affected particle towards it while staying on one side.
- Parameters:
particle (int) – the particle that the force acts upon. -1 will act on whole system.
stiff (float) – the stiffness of the trap (force = stiff * distance below plane)
direction ([float, float, float]) – the normal vector to the plane
position ([float, float, float]) – position of the plane (plane is d0*x + d1*y + d2*z + position = 0)
Reader/Writer
Read and write oxDNA external force files
|
Read a force file into a list of force dictionaries. |
|
Write a list of forces out to a file. |
- oxDNA_analysis_tools.external_force_utils.force_reader.read_force_file(file: str) List[Dict]
Read a force file into a list of force dictionaries.
- oxDNA_analysis_tools.external_force_utils.force_reader.write_force_file(force_list, filename, mode='w+')
Write a list of forces out to a file.