Пример #1
0
import numpy as np
import time
import sys
import os

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 90.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=10)
dmp = 100
scft_calc = True

t1 = time.time()

box.interactions.newType("a", 0.5, (1.0, 1.0, 1.5))

box.interactions.newType("b", 0.55, (1.0, 0.5, 1.5), ('a,b', (0.1, 0.2, 1.5)))

if scft_calc == True:
    box.meanfield.parameters(
        "test",
        [10, 10, 10],
        25.0,
        'cubic',
Пример #2
0
import sys

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

scft = False
print("NANOPOLY SIMULATION")
box_size = 80.0
cellnums = 70

t0 = time.time()
box = PolyLattice(box_size, cellnums)
t1 = time.time()

box.interactions.newType("a", 0.5, (0.1, 1.0, 1.5, (1, 1.0, 0.1)))

box.interactions.newType("b", 1.0, (0.1, 0.5, 1.5, (1, 1.0, 0.1)),
                         ('a,b', (0.1, 0.2, 1.5, (1, 1.0, 0.1))))

b_frac = 0.8
a_frac = (1 - b_frac) / 2

if scft == True:
    box.meanfield.parameters(
        "test",
        [int(0.5 * cellnums),
         int(0.5 * cellnums),
Пример #3
0
import time
import sys

sys.path.insert(0, '../../main')
from simulation import Simulation
from poly import PolyLattice
from analysis import Check, Percolation

print("NANOPOLY SIMULATION")
pair_cutoff = 1.5
pair_sigma = 0.3 # lennard jones potential length, pair potential information
pair_epsilon = 0.05
box_size = 4.0
t0 = time.time()    
box = PolyLattice(box_size, pair_cutoff, pair_sigma, pair_epsilon)
t1 = time.time()
print(f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}")

# types of atom in box-----------------------------------------------------------------------
# key = types, entry = masses
types={"a" : 1.0,
       "b" : 1.0,
       "c" : 1.0}

# RANDOM WALKS ------------------------------------------------------------------------------
nums = 10  # number of random walks
size = 20 # size of the chain
rw_kval = 30.0
rw_cutoff = 1.0
rw_epsilon = 0.05
rw_sigma = 0.4
Пример #4
0
import random
import sys

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

double = False

print("NANOPOLY SIMULATION")
box_size = 17.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=12)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# Atom interactions
# TYPES
box.interactions.newType("a", 1.0, (1.0, 0.2, 1.5))

box.interactions.newType("b", 0.5, (1.0, 1.0, 1.5), ('a,b', (1.0, 0.2, 1.5)))

size = 100  # size of the chain
rw_kval = 30.0
rw_cutoff = 1.5
rw_epsilon = 1.0
Пример #5
0
import numpy as np
import time
import random
import sys

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 17.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=12)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# Atom interactions
# TYPES
box.interactions.newType("a", 1.0, (1.0, 0.2, 1.5))

box.interactions.newType("b", 0.5, (1.0, 1.0, 1.5), ('a,b', (1.0, 0.2, 1.5)))

size = 100  # size of the chain
rw_kval = 30.0
rw_cutoff = 1.5
rw_epsilon = 1.0
Пример #6
0
# Author: Aravinthen Rajkumar
# Description: recreation of parker-rottler simulation

import numpy as np
import time
import sys

sys.path.insert(0, '../main')
from simulation import Simulation
from poly import PolyLattice
from analysis import Check

print("NANOPOLY SIMULATION")
box_size = 200.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=100)
t1 = time.time()

simname = "parker_rottler"
dmp = 1000
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# Order of properties: Sigma, energy, cutoff
box.interactions.newType("a", 1.0, (1.0, 1.0, 1.5))

box.interactions.newType("b", 0.5, (1.0, 0.5, 1.5), ('a,b', (1.0, 0.2, 1.5)))

# following values determine the bonding of the random walks
num_walks = 600
Пример #7
0
# Program Name: interactions.py
# Author: Aravinthen Rajkumar
# Description: Example of the interactions class

import numpy as np
import time
import sys
sys.path.insert(0, '../../../main')
from mdsim import MDSim
from poly import PolyLattice

# polylattice object
box = PolyLattice(50, 30)
dmp = 100

def print_type():
    print(box.interactions.types)
    print(box.interactions.type_matrix)
    print(box.interactions.sigma_matrix)
    print(box.interactions.energy_matrix)
    print(box.interactions.cutoff_matrix)
    print(box.interactions.n_matrix)
    print(box.interactions.alpha_matrix)
    print(box.interactions.lmbda_matrix)
    
box.interactions.newType("mainbead", 0.5,
                         (0.1, 0.2, 1.5))

box.interactions.newType("subbead", 1.0,
                         (0.1, 0.5, 1.5),
                         ('mainbead,subbead', (0.1, 0.2, 1.5)))
Пример #8
0
import numpy as np
import time
import sys

sys.path.insert(0, '../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 10.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=10)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# Atom interactions
# TYPES
box.interactions.newType("a", 0.5, (0.2, 2, 1))

box.interactions.newType("b", 1.0, (0.3, 3, 1), ('a,b', (0.3, 4, 2)))

box.interactions.newType("c", 1.0, (0.3, 3, 1), ('c,a', (0.2, 4, 3)),
                         ('c,b', (0.2, 4, 2)))

box.interactions.newType("d", 1.0, (0.24, 3, 1), ('d,a', (0.1, 4, 2)),
Пример #9
0
import numpy as np
import time
import sys

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 70.0
t0 = time.time()
cellnums = 70
box = PolyLattice(box_size, cellnums)
dmp = 100
scft_calc = True
t1 = time.time()

box.interactions.newType("a", 0.5, (0.0, 1.0, 1.5))

box.interactions.newType("b", 0.55, (0.0, 0.5, 1.5), ('a,b', (0.0, 0.2, 1.5)))
if scft_calc == True:
    box.meanfield.parameters(f"test", [35, 35, 35],
                             25.0,
                             'cubic',
                             1.0e-2,
                             'I m -3 m', [[("a", 1.0, 0.25),
                                           ("b", 1.0, 0.75)]],
                             cell_param=1.923202,
Пример #10
0
cl_values = [100]
number_of_samples = 10

for i in cl_values:
    for sample in range(number_of_samples):
        print(
            "--------------------------------------------------------------------------------------"
        )
        print(
            f"               MOLECULAR DYNAMICS SIMULATION WITH {i} CROSSLINKERS"
        )
        print(f"                                SAMPLE NUMBER: {sample}")
        print(
            "--------------------------------------------------------------------------------------"
        )
        box = PolyLattice(celllen, cellnums, pair_cutoff, pair_sigma,
                          pair_epsilon)
        t0 = time.time()
        for j in range(num_walks):
            current_walks = box.num_walks
            while True:
                try:
                    box.random_walk(j,
                                    size,
                                    rw_kval,
                                    rw_cutoff,
                                    rw_epsilon,
                                    rw_sigma,
                                    bead_types=types)
                    if box.num_walks == current_walks + 1:
                        print(
                            f"Simulation {i}_{sample}: Random walk {j} complete"
Пример #11
0
# Program Name: interactions.py
# Author: Aravinthen Rajkumar
# Description: Example of the interactions class

import numpy as np
import time
import sys
sys.path.insert(0, '../../../main')
from mdsim import MDSim
from poly import PolyLattice

# polylattice object
box = PolyLattice(22.0, 40)
dmp = 100


def print_type():
    print(box.interactions.types)
    print(box.interactions.type_matrix)
    print(box.interactions.sigma_matrix)
    print(box.interactions.energy_matrix)
    print(box.interactions.cutoff_matrix)
    print(box.interactions.n_matrix)
    print(box.interactions.alpha_matrix)
    print(box.interactions.lmbda_matrix)


box.interactions.newType("mainbead", 0.5, (0.1, 0.2, 1.5, (1, 1.0, 0.3)))

box.interactions.newType("subbead", 1.0, (0.1, 0.5, 1.5, (1, 1.0, 0.3)),
                         ('mainbead,subbead', (0.1, 0.2, 1.5, (1, 1.0, 0.3))))
Пример #12
0
# Author: Aravinthen Rajkumar
# Description: nanopoly configuration that runs random walks and unbonded crosslink beads

import numpy as np
import time
import sys

sys.path.insert(0, '../main')
from simulation import Simulation
from poly import PolyLattice
from analysis import Check

print("NANOPOLY SIMULATION")
box_size = 10.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=10)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# Atom interactions
# TYPES
box.interactions.newType("a", 0.5, (0.2, 2, 1))

box.interactions.newType("b", 1.0, (0.3, 3, 1), ('a,b', (0.3, 4, 2)))

box.interactions.newType("c", 1.0, (0.3, 3, 1), ('c,a', (0.2, 4, 3)),
                         ('c,b', (0.2, 4, 2)))

box.interactions.newType("d", 1.0, (0.24, 3, 1), ('d,a', (0.1, 4, 2)),
Пример #13
0
import numpy as np
import time
import random
import sys

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 10.0
t0 = time.time()    
box = PolyLattice(box_size, cellnums=5)
t1 = time.time()
print(f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}")

# Atom interactions
# TYPES
box.interactions.newType("a", 1.0,
                         (1.0, 0.2, 1.5))

box.interactions.newType("b", 0.5,
                         (1.0, 1.0, 1.5),
                         ('a,b', (1.0, 0.2, 1.5)))

numwalks = 12
size = 30 # size of the chain
rw_kval = 30.0
Пример #14
0
import numpy as np
import time
import sys

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 50.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=40)
t1 = time.time()

simname = "walks_example"
dmp = 100
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)
#----------------------------------------------------------------------------------------
# INTERACTION ASSIGNMENTS
#----------------------------------------------------------------------------------------
# Order of properties: Sigma, energy, cutoff
box.interactions.newType("a", 1.0, (0.01, 0.2, 1.5))

box.interactions.newType("b", 0.5, (0.01, 1.0, 1.5), ('a,b', (0.01, 0.2, 1.5)))
Пример #15
0
import time
import sys

sys.path.insert(0, '../../main')
from simulation import Simulation
from poly import PolyLattice
from analysis import Check, Percolation

print("NANOPOLY SIMULATION")
pair_cutoff = 1.5
pair_sigma = 0.3  # lennard jones potential length, pair potential information
pair_epsilon = 0.05
box_size = 4.0
t0 = time.time()
box = PolyLattice(box_size, pair_cutoff, pair_sigma, pair_epsilon)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# types of atom in box-----------------------------------------------------------------------
# key = types, entry = masses
types = {"a": 1.0, "b": 1.0, "c": 1.0}

# RANDOM WALKS ------------------------------------------------------------------------------
nums = 10  # number of random walks
size = 20  # size of the chain
rw_kval = 30.0
rw_cutoff = 1.0
rw_epsilon = 0.05
Пример #16
0
# Description: nanopoly configuration that just runs the random walks

import numpy as np
import time
import random
import sys

sys.path.insert(0, '../main')
from simulation import Simulation
from poly import PolyLattice
from analysis import Check

print("NANOPOLY SIMULATION")
box_size = 10.0
t0 = time.time()    
box = PolyLattice(box_size, cellnums=8)
t1 = time.time()

simname = "condensed_relax2"
dmp = 100
print(f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}")

# Order of properties: Sigma, energy, cutoff
box.interactions.newType("a", 1.0,
                         (1.0, 1.0, 1.5))

box.interactions.newType("b", 0.5,
                         (1.0, 0.5, 1.5),
                         ('a,b', (1.0, 0.2, 1.5)))

# following values determine the bonding of the random walks
Пример #17
0
# Author: Aravinthen Rajkumar
# Description: test of the chain grafting mechanism

import numpy as np
import time
import sys

sys.path.insert(0, '../main')
from simulation import Simulation
from poly import PolyLattice
from analysis import Check

print("NANOPOLY SIMULATION")
box_size = 10.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=10)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# Atom interactions
# TYPES
box.interactions.newType("a", 1.0, (0.3, 0.01, 1.5))

box.interactions.newType("b", 0.5, (0.3, 0.15, 1.5), ('a,b', (0.3, 0.01, 1.5)))

box.interactions.newType("c", 0.3, (0.2, 0.1, 1.5), ('c,a', (0.3, 0.01, 1.5)),
                         ('c,b', (0.2, 0.01, 1.5)))

# following values determine the bonding of the random walks
Пример #18
0
import time
import sys

sys.path.insert(0, '../../main')
from simulation import Simulation
from poly import PolyLattice
from analysis import Check, Percolation

print("NANOPOLY SIMULATION")
pair_cutoff = 1.5
pair_sigma = 0.3  # lennard jones potential length, pair potential information
pair_epsilon = 0.05
box_size = 5.0
t0 = time.time()
box = PolyLattice(box_size, pair_cutoff, pair_sigma, pair_epsilon)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# Parameters ------------------------------------------------------------------------------
# Random walks
nums = 20  # number of random walks
size = 10  # size of the chain
rw_kval = 30.0
rw_cutoff = 1.0
rw_epsilon = 0.05
rw_sigma = 0.4

# Crosslinks
Пример #19
0
# Program Name: interactions.py
# Author: Aravinthen Rajkumar
# Description: Example of the interactions class

import numpy as np
import time
import sys
sys.path.insert(0, '../../main')
from simulation import Simulation
from poly import PolyLattice

# polylattice object
box = PolyLattice(20.0, 15)
dmp = 0


def print_type():
    print(box.interactions.types)
    print(box.interactions.type_matrix)
    print(box.interactions.sigma_matrix)
    print(box.interactions.energy_matrix)
    print(box.interactions.cutoff_matrix)
    print(box.interactions.n_matrix)
    print(box.interactions.alpha_matrix)
    print(box.interactions.lmbda_matrix)


box.interactions.newType("mainbead", 0.5, (0.1, 0.2, 1.5, (1, 1.0, 0.1)))

box.interactions.newType("subbead", 1.0, (0.1, 0.5, 1.5, (1, 1.0, 0.1)),
                         ('mainbead,subbead', (0.1, 0.2, 1.5, (1, 1.0, 0.1))))
Пример #20
0
import numpy as np
import time
import sys

sys.path.insert(0, '../main')
from simulation import Simulation
from poly import PolyLattice
from analysis import Percolation

print("NANOPOLY SIMULATION")
pair_cutoff = 1.5
pair_sigma = 0.3  # lennard jones potential length, pair potential information
pair_epsilon = 0.05
box_size = 2.0
t0 = time.time()
box = PolyLattice(box_size, pair_cutoff, pair_sigma, pair_epsilon)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# types of atom in box-----------------------------------------------------------------------
# key = types, entry = masses

types = {1: 1.0, 2: 1.0, 3: 1.0}

nums = 2  # number of random walks
size = 10  # size of the chain
rw_kval = 30.0
rw_cutoff = 3.5
rw_epsilon = 0.05
Пример #21
0
import numpy as np
import time
import sys
import os

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 50.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=15)
dmp = 100
scft_calc = False

t1 = time.time()

box.interactions.newType("a", 0.5, (1.0, 1.0, 1.5))

box.interactions.newType("b", 0.55, (1.0, 0.5, 1.5), ('a,b', (0.1, 0.2, 1.5)))

if scft_calc == True:
    box.meanfield.parameters(
        "test",
        [15, 15, 15],
        25.0,
        'cubic',
Пример #22
0
import sys
import os
import shutil

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 90.0
cellnums = 80
t0 = time.time()
box = PolyLattice(box_size, cellnums)
dmp = 1000

scft_calc = True
t1 = time.time()
print(f"Box initialised. Time taken: {t1-t0} seconds.")

box.interactions.newType("a", 0.5, (1.0, 1.0, 1.5))

box.interactions.newType("b", 0.51, (1.0, 0.5, 1.5), ('a,b', (1.0, 0.2, 1.5)))

bsize = 0.8
asize = (1 - bsize) / 2

t0 = time.time()
if scft_calc == True:
Пример #23
0
import numpy as np
import time
import random
import sys

sys.path.insert(0, '../../main')

from mdsim import MDSim
from poly import PolyLattice
from analysis import Check
from meanfield import MeanField

print("NANOPOLY SIMULATION")
box_size = 5.0
t0 = time.time()
box = PolyLattice(box_size, cellnums=3)
t1 = time.time()
print(
    f"Box generated, with {len(box.Cells)} cells in total. Time taken: {t1 - t0}"
)

# Atom interactions
# TYPES
box.interactions.newType("a", 1.0, (1.0, 0.2, 1.5))

box.interactions.newType("b", 0.5, (1.0, 1.0, 1.5), ('a,b', (1.0, 0.2, 1.5)))

size = 20  # size of the chain
rw_kval = 30.0
rw_cutoff = 1.5
rw_epsilon = 1.0