Bonds

mechanica.Bond

alias of mechanica.mechanica.MxBond

class mechanica.MxBond

Bonds apply a potential to a particular set of particles.

If you’re building a model, you should probably instead be working with a MxBondHandle.

static create(potential: MxPotential, i: MxParticleHandle, j: MxParticleHandle, half_life: double * = None, dissociation_energy: double * = None, flags: uint32_t = 0) MxBondHandle *

Construct a new bond handle and underlying bond.

Automatically updates when running on a CUDA device.

Parameters
  • potential (MxPotential) – bond potential

  • i (MxParticleHandle) – ith particle

  • j (MxParticleHandle) – jth particle

  • half_life (float) – bond half life

  • dissociation_energy (float) – dissociation energy

  • flags (int) – bond flags

toString() std::string

Get a JSON string representation

Return type

string

Returns

std::string

static fromString(str: std::string const &) MxBond *

Create from a JSON string representation.

The returned bond is not automatically registered with the engine.

Parameters

str (string) –

Return type

MxBond

Returns

MxBond*

__reduce__()

Helper for pickle.

mechanica.BondHandle

alias of mechanica.mechanica.MxBondHandle

class mechanica.MxBondHandle(*args)

Handle to a bond

This is a safe way to work with a bond.

Overload 1:

Construct a new bond handle and do nothing Subsequent usage will require a call to ‘init’


Overload 2:

Construct a new bond handle from an existing bond id

Parameters

id (int) – id of existing bond


Overload 3:

Construct a new bond handle and underlying bond.

Automatically updates when running on a CUDA device.

Parameters
  • potential (MxPotential) – bond potential

  • i (int) – id of ith particle

  • j (int) – id of jth particle

  • half_life (float) – bond half life

  • bond_energy (float) – bond energy

  • flags (int) – bond flags

property energy

bond energy

property parts

bonded particles

property potential

bond potential

property id

bond id

property dissociation_energy

bond dissociation energy

property half_life

bond half life

property active

active flag

property style

bond style

property age

bond age

__str__() mechanica.mechanica.MxBondHandle.str

Return str(self).

__getitem__(index: int)
get() MxBond *

Gets the underlying bond

Return type

MxBond

Returns

MxBond*

static pairwise(pot: MxPotential, parts: MxParticleList, cutoff: double const &, ppairs: vectorPairParticleType_ParticleType, half_life: double const &, bond_energy: double const &, flags: uint32_t) std::vector< MxBondHandle *,std::allocator< MxBondHandle * > > *

Apply bonds to a list of particles.

Automatically updates when running on a CUDA device.

Parameters
  • pot (MxPotential) – the potential of the created bonds

  • parts (MxParticleList) – list of particles

  • cutoff (float) – cutoff distance of particles that are bonded

  • ppairs (std::vector< std::pair< MxParticleType *,MxParticleType * > *,std::allocator< std::pair< MxParticleType *,MxParticleType * > * > >) – type pairs of bonds

  • half_life (float) – bond half life

  • bond_energy (float) – bond energy

  • flags (int) – bond flags

Return type

std::vector< MxBondHandle *,std::allocator< MxBondHandle * > >

Returns

std::vector<MxBondHandle*>*

destroy() HRESULT

Destroy the bond.

Automatically updates when running on a CUDA device.

Return type

int

Returns

HRESULT

static items() std::vector< MxBondHandle *,std::allocator< MxBondHandle * > >

Gets all bonds in the universe

Return type

std::vector< MxBondHandle *,std::allocator< MxBondHandle * > >

Returns

std::vector<MxBondHandle*>

decays() bool

Tests whether this bond decays

Return type

boolean

Returns

true when the bond should decay

mechanica.Angle

alias of mechanica.mechanica.MxAngle

class mechanica.MxAngle

A bond concerning an angle

If you’re building a model, you should probably instead be working with a MxAngleHandle.

static create(potential: MxPotential, p1: MxParticleHandle, p2: MxParticleHandle, p3: MxParticleHandle, flags: uint32_t = 0) MxAngleHandle *

Creates an angle bond.

Automatically updates when running on a CUDA device.

Parameters
Return type

MxAngleHandle

Returns

MxAngleHandle*

toString() std::string

Get a JSON string representation

Return type

string

Returns

std::string

static fromString(str: std::string const &) MxAngle *

Create from a JSON string representation.

The returned angle is not automatically registered with the engine.

Parameters

str (string) –

Return type

MxAngle

Returns

MxAngle*

__reduce__()

Helper for pickle.

mechanica.AngleHandle

alias of mechanica.mechanica.MxAngleHandle

class mechanica.MxAngleHandle(*args)

A handle to an angle bond

This is a safe way to work with an angle bond.

property energy

angle energy

property parts

bonded particles

property potential

angle potential

property id

angle id

property dissociation_energy

bond dissociation energy

property half_life

angle half life

property active

active flag

property style

angle style

property age

angle age

__str__() mechanica.mechanica.MxAngleHandle.str

Return str(self).

__getitem__(index: int)
get() MxAngle *

Gets the angle of this handle

Return type

MxAngle

Returns

MxAngle*

destroy() HRESULT

Destroy the angle.

Automatically updates when running on a CUDA device.

Return type

int

Returns

HRESULT

static items() std::vector< MxAngleHandle *,std::allocator< MxAngleHandle * > >

Gets all angles in the universe

Return type

std::vector< MxAngleHandle *,std::allocator< MxAngleHandle * > >

Returns

std::vector<MxAngleHandle*>

decays() bool

Tests whether this bond decays

Return type

boolean

Returns

true when the bond should decay

mechanica.Dihedral

alias of mechanica.mechanica.MxDihedral

class mechanica.MxDihedral

The dihedral structure

static create(potential: MxPotential, p1: MxParticleHandle, p2: MxParticleHandle, p3: MxParticleHandle, p4: MxParticleHandle) MxDihedralHandle *

Creates a dihedral bond

Parameters
Return type

MxDihedralHandle

Returns

MxDihedralHandle*

toString() std::string

Get a JSON string representation

Return type

string

Returns

std::string

static fromString(str: std::string const &) MxDihedral *

Create from a JSON string representation.

The returned dihedral is not automatically registered with the engine.

Parameters

str (string) –

Return type

MxDihedral

Returns

MxDihedral*

__reduce__()

Helper for pickle.

mechanica.DihedralHandle

alias of mechanica.mechanica.MxDihedralHandle

class mechanica.MxDihedralHandle(*args)

A handle to a dihedral bond

This is a safe way to work with a dihedral bond.

property energy

angle energy

property parts

bonded particles

property potential

angle potential

property id
property dissociation_energy

bond dissociation energy

property half_life

angle half life

property style

angle style

property age

angle age

get() MxDihedral *

Gets the dihedral of this handle

Return type

MxDihedral

Returns

MxDihedral*

__str__() mechanica.mechanica.MxDihedralHandle.str

Return str(self).

__getitem__(index: int)
destroy() HRESULT

Destroy the dihedral

Return type

int

Returns

HRESULT

static items() std::vector< MxDihedralHandle *,std::allocator< MxDihedralHandle * > >

Gets all dihedrals in the universe

Return type

std::vector< MxDihedralHandle *,std::allocator< MxDihedralHandle * > >

Returns

std::vector<MxDihedralHandle*>

decays() bool

Tests whether this bond decays

Return type

boolean

Returns

true when the bond should decay