Polymerization

Polymerization model

class Polymerization(all_info, nlist, r_cut, seed)

The constructor of an object of polymerization.

Parameters:
  • all_info (AllInfo) – The system information.

  • nlist (NeighborList) – The neighbor list.

  • r_cut (float) – The cut-off radius.

  • seed (int) – The seed of random number generator.

class Polymerization(all_info, type, percent, nlist, r_cut, seed)

The constructor of an object of polymerization with a percent of initiator.

Parameters:
  • all_info (AllInfo) – The system information.

  • type (str) – The particle type of initiators.

  • percent (float) – The percent of initiators on target particle type.

  • nlist (NeighborList) – The neighbor list.

  • r_cut (float) – The cut-off radius.

  • seed (int) – The seed of random number generator

setPr(float prob)

specifies reaction probability.

setPr(string type1, string type2, float prob)

specifies reaction probability between particle type1 and type2.

setPrFactor(float prob_factor)

specifies the reaction probability factor of (factor)n where n is reaction times.

setPrFactor(cstring type1, string type2, float prob_factor)

specifies the reaction probability factor between particle type1and type2.

setExchangePr(string type1, string type2, string  type3, float probability)

specifies the reaction probability of replacing type3 by type1 in the connection to type 2. The init of type2 should be 1. This function will activate ExchMode

setInsertionPr(string type1, string type2, string  type3, float probability)

specifies the reaction probability of inserting type1 to type2-type3 and forming type2-type1-typ3. The init of type2 should be 1. This function will activate setInsertionMode.

setChangeTypeInReaction(string name_origin, string name_new)

specifies the type change in reaction in which the particle type will be changed from name_origin to name_new.

setInitInitReaction(bool reaction)

allows the reaction between particle i with init=1 and particle j with init=1.

setMaxCris(string type, unsigned int cris_max)

specifies the upper limit number of bonds generated by reaction. This function will activate SgapMode.

setNewBondType(string bondtype)

specifies the type of newly generated bonds by reaction.

setNewAngleType(string angletype)

specifies the type of newly generated angles by reaction.

setNewDihedralType(string dihedraltype)

specifies the type of newly generated dihedrals by reaction.

setNewBondTypeByPairs()

specifies the type of newly generated bonds by reaction named by the two particle types.

setNewAngleTypeByPairs()

specifies the type of newly generated angles by reaction named by the three particle types.

generateAngle(bool generate_angle)

switches on generating angles in reaction.

generateDihedral(bool generate_dihedral)

switches on generating dihedrals in reaction.

setFuncReactRule(bool switch, float K, float r_0, float b_0, float epsilon0, PolyFunc function)

switches the rule of the reaction according to energy and specifies the rule with spring constant K, the maximum length for FENE r_0, the equilibrium length of bond b_0, the energy to shift epsilon0, and bond potential type (the candidates are harmonic and FENE). Please refer to “Macromolecules 2016, 49, 7510−7524”.

setEnergyBar(float ebar)

specifies the energy bar for reaction instead of Pr.

setMinDisReactRule(bool switch)

switches the rule of the reaction only with the nearest particle.

setInitDieProb()

specifies the die probability of initiators.

initExPoint()

switches on initializing reactive point for exchange reaction.

setFrpMode()

specifies the mode of polymerization to be chain growth (such as free redical polymerization) in which the active site continuely moves to the head of chain in the chain growth. This is default mode.

setSgapMode()

specifies the mode of polymerization to be step growth (such as polycondensation and polyaddition). setMaxCris function will activate this mode.

setExchMode()

specifies the mode of polymerization to be chain exchange. setExchangePr function will activate this mode.

setInsertionMode()

specifies the mode of polymerization to be insertion. setInsertionPr function will activate this mode.

Example:

reaction = gala.Polymerization(all_info, neighbor_list, 1.12246 ,16361)
reaction.setFuncReactRule(True, 1250.000, 1.0,0.470, 10.0, gala.PolyFunc.harmonic)
reaction.setPr(0.002)
reaction.setMaxCris('B',3)
# sets the connected bond upper limited number.
reaction.setPeriod(50)
app.add(reaction)

Depolymerization model

class DePolymerization(all_info, T, seed)

The constructor of an object of depolymerization.

Parameters:
  • all_info (AllInfo) – The system information.

  • T (float) – The temperature.

  • seed (int) – The seed of random number generator

setParams(string type, float K, float r_0, float b_0, float epsilon0, float Pr, DePolyFunc function)

specifies the depolymerization probability with bond type, spring constant K, the maximum length for FENE r_0, the equilibrium length of bond b_0, the energy to shift epsilon0, and bond potential type (the candidates are harmonic, FENE, and NoFunc. For “NoFunc”, only probability works for the judgement of bond rupture).

setT(float T)

specifies the temperature with a fixed value.

setT(Variant vT)

specifies the temperature with a varying value by time step.

setCrisQualify()

switches on the checking on the cris value of two connected particles i and j. Only when the cris_i >0 or cris_j > 0, the bond will be judged for breaking.

setChangeTypeInReaction(string origin_type, string new_type)

The type of particle will be changed after depolymerization from origin_type to new_type.

setDegradeAngle()

swithes on the function of degrading angle.

setDegradeDihedral()

swithes on the function of degrading dihedral.

setCountUnbonds(int period)

swithes on the function of counting the number of broken bonds with a period for outputing the number.

Example:

reaction = gala.DePolymerization(all_info, 1.0, 16361)
reaction.setParams('sticky', 10.0, 1.5, 0.96, 10.0, 0.2, gala.DePolyFunc.harmonic)
# sets bondname, K, r_0, b_0, epsilon0, Pr, and function.
reaction.setPeriod(1)
# sets how many steps to react.
app.add(reaction)