espressopp.interaction.AngularPotential

Overview

espressopp.interaction.AngularCosineSquared
espressopp.interaction.AngularHarmonic
espressopp.interaction.Cosine

Details

Abstract class for angular potentials that only needed to be inherited from.

class espressopp.interaction.AngularPotential
computeEnergy(*args)
Parameters:*args
Return type:
computeForce(*args)
Parameters:*args
Return type:

espressopp.interaction.AngularCosineSquared

Calculates the Angular Cosine Squared potential as:

\[U = K [cos(\theta) - cos(\theta_{0})]^2,\]

where angle \(\theta\) is the planar angle formed by three binded particles (triplet or triple).

This potential is employed by:

class espressopp.interaction.AngularCosineSquared(K = 1.0, theta0 = 0.0)
Parameters:
  • K (real) – energy amplitude
  • theta0 (real) – angle in radians
Return type:

triple potential

A triple potential applied to every triple in the system creates an interaction. This is done via:

class espressopp.interaction.FixedTripleListAngularCosineSquared(system, fixed_triple_list, potential)
Parameters:
Return type:

interaction

Methods

getFixedTripleList()
Return type:A Python list of fixed triples (e.g., in the chains).
setPotential(type1, type2, potential)
Parameters:
  • type1
  • type2
  • potential

Example 1. Creating a fixed triple list by espressopp.FixedTripleList.

>>> # we assume a polymer solution of n_chains of the length chain_len each.
>>> # At first, create a list_of_triples for the system:
>>> N = n_chains * chain_len            # number of particles in the system
>>> list_of_tripples = []               # empty list of triples
>>> for n in range (n_chains):          # loop over chains
>>>     for m in range (chain_len):     # loop over chain beads
>>>         pid = n * chain_len + m
>>>         if (pid > 1) and (pid < N - 1):
>>>             list_of_tripples.append( (pid-1, pid, pid+1) )
>>>
>>> # create fixed triple list
>>> fixed_triple_list = espressopp.FixedTripleList(system.storage)
>>> fixed_triple_list.addTriples(list_of_triples)

Example 2. Employing an Angular Cosine Squared potential.

>>> # Note, the fixed_triple_list has to be generated in advance! (see Example 1)
>>>
>>> # set up the potential
>>> potAngCosSq = espressopp.interaction.AngularCosineSquared(K=0.5, theta0=0.0)
>>>
>>> # set up the interaction
>>> interAngCosSq = espressopp.interaction.FixedTripleListAngularCosineSquared(system, fixed_triple_list, potAngCosSq)
>>>
>>> # finally, add the interaction to the system
>>> system.addInteraction(interAngCosSq)

espressopp.interaction.AngularHarmonic

Calculates the Angular Harmonic potential as:

\[U = K (\theta - \theta_0)^2,\]

where angle \(\theta\) is the planar angle formed by three binded particles (triplet or triple). The usual coefficient of \(1/2\) is included in \(K\).

This potential is employed by:

class espressopp.interaction.AngularHarmonic(K = 1.0, theta0 = 0.0)
Parameters:
  • K (real) – energy amplitude
  • theta0 (real) – angle in radians
Return type:

triple potential

A triple potential applied to every triple in the system creates an interaction. This is done via:

class espressopp.interaction.FixedTripleListAngularHarmonic(system, fixed_triple_list, potential)
Parameters:
  • system (shared_ptr) – system object
  • fixed_triple_list (list) – a fixed list of all triples in the system
  • potential – triple potential (in this case, espressopp.interaction.AngularHarmonic).
Return type:

interaction

Methods

getFixedTripleList()
Return type:A Python list of fixed triples (e.g., in the chains).
setPotential(type1, type2, potential)
Parameters:
  • type1
  • type2
  • potential

Example 1. Creating a fixed triple list by espressopp.FixedTripleList.

>>> # we assume a polymer solution of n_chains of the length chain_len each.
>>> # At first, create a list_of_triples for the system:
>>> N = n_chains * chain_len            # number of particles in the system
>>> list_of_tripples = []               # empty list of triples
>>> for n in range (n_chains):          # loop over chains
>>>     for m in range (chain_len):     # loop over chain beads
>>>         pid = n * chain_len + m
>>>         if (pid > 1) and (pid < N - 1):
>>>             list_of_tripples.append( (pid-1, pid, pid+1) )
>>>
>>> # create fixed triple list
>>> fixed_triple_list = espressopp.FixedTripleList(system.storage)
>>> fixed_triple_list.addTriples(list_of_triples)

Example 2. Employing an Angular Harmonic potential.

>>> # Note, the fixed_triple_list has to be generated in advance! (see Example 1)
>>>
>>> # set up the potential
>>> potAngHarm = espressopp.interaction.AngularHarmonic(K=0.5, theta0=0.0)
>>>
>>> # set up the interaction
>>> interAngHarm = espressopp.interaction.FixedTripleListAngularHarmonic(system, fixed_triple_list, potAngHarm)
>>>
>>> # finally, add the interaction to the system
>>> system.addInteraction(interAngHarm)

espressopp.interaction.Cosine

Calculates the Cosine potential as:

\[U = K (1 + cos(\theta - \theta_0))\]
espressopp.interaction.Cosine(K, theta0)
Parameters:
  • K (real) – (default: 1.0)
  • theta0 (real) – (default: 0.0)
espressopp.interaction.FixedTripleListCosine(system, vl, potential)
Parameters:
  • system
  • vl
  • potential
espressopp.interaction.FixedTripleListCosine.getFixedTripleList()
Return type:A Python list of lists.
espressopp.interaction.FixedTripleListCosine.setPotential(potential)
Parameters:potential