Molecule¶
- class openfts.molecule.Bead(label=None, bead_species=None, volume_frac=None, ncopies=None)¶
Molecule Bead
- Parameters:
label (string) – label for this molecule, defaults to molX
bead_species (string) – Species type of bead
volume_frac (float) – Volume fraction of moleculeX in the simulation. Must be 0-1.
ncopies (float) – number of copies of moleculeX in the simulation. Note that either volume_frac or ncopies can be specified, not both.
Example (python):
fts.add_molecule(type='Bead',bead_species='A',volume_frac=0.5)
Example (json):
"molecule0": { "bead_species": "A", "type": "Bead", "volume_frac": 0.5 },
- class openfts.molecule.PolymerLinearContinuous(label=None, volume_frac=None, ncopies=None, nblocks=None, block_species=None, block_fractions=None, alpha=None, ds=None)¶
Molecule Polymer Linear (continuous)
- Parameters:
label (string) – label for this molecule
alpha (float) – Relative length of molecule. \(\alpha = N / N_{ref}\)
ds (float) – Contour step size
volume_frac (float) – Volume fraction of molecule in the simulation. Must be 0-1.
ncopies (float) – number of copies of molecule in the simulation. Note that either volume_frac or ncopies can be specified, not both.
nblocks (int) – Number of blocks in polymer
block_species (list string) – the species of each block. Length is nblocks. Must corresponds to a label entry in Species.
block_fractions (list float) – fractional length of each block. Length is nblocks, must sum to 1.
Example (python):
fts.molecules.append(openfts.molecule.PolymerLinearContinuous(alpha=1.0,ds=0.01,nblocks=2,block_fractions=[0.5, 0.5],block_species=['A', 'B'],volume_frac=1.0))
Example (json):
"molecules": { "molecule0": { "alpha": 1.0, "ds": 0.01, "nblocks": 2, "block_fractions": [0.5, 0.5], "block_species": ["A","B"], "type": "PolymerLinear", "chain_type": "continuous", "volume_frac": 1.0 }, "nmolecule": 1 },
- class openfts.molecule.PolymerLinearDiscrete(label=None, volume_frac=None, ncopies=None, nblocks=None, block_species=None, block_fractions=None, nbeads=None, monomer_sequence=None)¶
Molecule Polymer Linear (discrete)
- Parameters:
label (string) – label for this molecule
nbeads (int) – Number of beads in discrete chain
volume_frac (float) – Volume fraction of molecule in the simulation. Must be 0-1.
ncopies (float) – number of copies of molecule in the simulation. Note that either volume_frac or ncopies can be specified, not both.
- There are two options to initialize the polymer sequence
- Initialize by block
nblocks (int) - Number of blocks in polymer
block_species (list string) - the species of each block. Length is nblocks. Must corresponds to a label entry in Species.
block_fractions (list float) - fractional length of each block. Length is nblocks, must sum to 1.
Example (python):
# a block polymer fts.add_molecule(nbeads=100,nblocks=2,block_fractions=[0.5, 0.5],block_species=['A', 'B'],type='PolymerLinear',chain_type='discrete',volume_frac=1.0) # sequence defined polymer seq = "AABAAAAAABAAABAABBAAABABBABBABAABBABBBBBBBBBBBBAAA" fts.add_molecule(nbeads=50,type='PolymerLinear',chain_type='discrete',volume_frac=1.0,monomer_sequence=sv20)
Example (json):
# block polmer "molecules": { "molecule0": { "nbeads": 100, "nblocks": 2, "block_fractions": [0.5, 0.5], "block_species": ["A","B"], "type": "PolymerLinear", "chain_type": "discrete", "volume_frac": 1.0 }, "nmolecule": 1 }, # sequence defined polymer "molecules": { "molecule0": { "chain_type": "discrete", "monomer_sequence": "AABAAAAAABAAABAABBAAABABBABBABAABBABBBBBBBBBBBBAAA", "nbeads": 50, "type": "PolymerLinear", "volume_frac": 1.0 }, "nmolecule": 1 },
- class openfts.molecule.PolymerCombContinuous(label=None, volume_frac=None, backbone=None, **kwargs)¶
Molecule Polymer Comb (continuous)
- Parameters:
label (string) – label for this molecule
volume_frac (float) – Volume fraction of moleculeX in the simulation. Must be 0-1.
backbone (json object or dict) – Backbone chain information. Required arguments depend on chain_type specified earlier. For example, if chain_type=discrete the arguments nbeads, nblocks, block_species, block_fractions (or monomer_sequence) must be specified. See
molecule.PolymerLinearContinuous
andmolecule.PolymerLinearDiscrete
for required arguments.sidechainX (json object) – Sidechain information of sidechainX where X starts at 1. In each sidechainX object, all information of the corresponding chain_type must be specified (see backbone argument above). Additionally, the following argument must also be specified:
graft_locations (list int) – the indicies of backbone sites that this sidechain will be grafted to. Indexing starts at 0.
(python):
fts.molecules.append(openfts.molecule.PolymerCombContinuous(volume_frac=1.0, backbone=dict(ds=0.01,alpha=0.6,nblocks=1,block_fractions=[1.0],block_species=['A']), sidechain1=dict(ds=0.01,alpha=0.2,nblocks=1,block_fractions=[1.0],block_species=['A'], graft_locations=[0,60])))
json:
"molecules": { "molecule0": { "backbone": { "alpha": 0.6, "block_fractions": [ 1.0 ], "block_species": [ "A" ], "ds": 0.01, "nblocks": 1 }, "chain_type": "continuous", "sidechain1": { "alpha": 0.2, "block_fractions": [ 1.0 ], "block_species": [ "A" ], "ds": 0.01, "graft_locations": [ 0, 60 ], "nblocks": 1 }, "type": "PolymerComb", "volume_frac": 1.0 }, ... },
- class openfts.molecule.PolymerCombDiscrete(label=None, volume_frac=None, backbone=None, **kwargs)¶
Molecule Polymer Comb (discrete)
- Parameters:
label (string) – label for this molecule
volume_frac (float) – Volume fraction of moleculeX in the simulation. Must be 0-1.
backbone (json object or dict) – Backbone chain information. Required arguments depend on chain_type specified earlier. For example, if chain_type=discrete the arguments nbeads, nblocks, block_species, block_fractions (or monomer_sequence) must be specified. See
molecule.PolymerLinearContinuous
andmolecule.PolymerLinearDiscrete
for required arguments.sidechainX (json object) – Sidechain information of sidechainX where X starts at 1. In each sidechainX object, all information of the corresponding chain_type must be specified (see backbone argument above). Additionally, the following argument must also be specified:
graft_locations (list int) – the indicies of backbone sites that this sidechain will be grafted to. Indexing starts at 0.
Example (python):
# this creates an A-B bottlebrush fA = 0.5 # fraction of A beads N_BB = 50 # backbone length N_SC = 10 # sidechain length B_graft_start = int(fA*N_BB) fts.add_molecule(type='PolymerComb',\ chain_type='discrete',\ backbone=dict(nbeads=N_BB,nblocks=2,block_fractions=[fA, 1-fA],block_species=['A', 'B']),\ sidechain1=dict(nbeads=N_SC,nblocks=1,block_fractions=[1.0],block_species=['A'], graft_locations=list(range(0,B_graft_start))),\ sidechain2=dict(nbeads=N_SC,nblocks=1,block_fractions=[1.0],block_species=['B'], graft_locations=list(range(B_graft_start,N_BB))),\ volume_frac=1.0)
Example (json):
"molecules": { "molecule0": { "backbone": { "block_fractions": [0.5,0.5], "block_species": ["A","B"], "nbeads": 50, "nblocks": 2 }, "chain_type": "discrete", "sidechain1": { "block_fractions": [1.0], "block_species": ["A"], "graft_locations": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], "nbeads": 10, "nblocks": 1 }, "sidechain2": { "block_fractions": [1.0], "block_species": ["B"], "graft_locations": [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49], "nbeads": 10, "nblocks": 1 }, "type": "PolymerComb", "volume_frac": 1.0 }, "nmolecule": 1 },