Ejemplo n.º 1
0
for i in range(copolymer_frac):
    copolymer.append('a')
for i in range(copolymer_frac):
    copolymer.append('b')

sequence_range = 10

num_walks = 15

for i in range(num_walks):
    box.uniform_chain(size,
                      rw_kval,
                      rw_cutoff,
                      rw_epsilon,
                      rw_sigma,
                      termination='soften',
                      bead_sequence=copolymer,
                      srate=0.99,
                      suppress=False,
                      sequence_range=5,
                      retraction_limit=0,
                      danger=1.09)

    print(f"{i+1} random walked")

while box.dead_walks > 0:
    reattempts = box.dead_walks
    box.dead_walks = 0
    for i in range(reattempts):
        box.uniform_chain(size,
                          rw_kval,
                          rw_cutoff,
Ejemplo n.º 2
0
print(f"Density file read in. Time taken: {t1 - t0}")

#----------------------------------------------------------------------------------------
# RANDOM WALK ASSIGNMENT
#----------------------------------------------------------------------------------------
total_time = 0
for i in range(num_walks):
    t0 = time.time()
    box.uniform_chain(size,
                      rw_kval,
                      rw_cutoff,
                      rw_epsilon,
                      rw_sigma,
                      bead_sequence=copolymer,
                      meanfield=True,
                      termination='soften',
                      srate=0.98,
                      suppress=False,
                      danger=1.03,
                      initial_failures=15000,
                      walk_failures=15000,
                      retraction_limit=10,
                      sequence_range=int(0.9 * asize * size))
    t1 = time.time()
    print(f"Walk {i} complete. Time taken: {t1-t0} seconds.")
    total_time += t1 - t0

print(f"Walks complete. Total time: {total_time} seconds")

t0 = time.time()
box.mdsim.structure(f"structure-{ret}.in")
Ejemplo n.º 3
0
    for i in range(b_bead):
        copolymer.append('b')
    for i in range(a_bead):
        copolymer.append('a')

    print(a_bead)
    print(b_bead)
    print(a_bead + b_bead)

    total_time = 0
    for i in range(num_walks):
        t0 = time.time()
        box.uniform_chain(size,
                          rw_kval,
                          rw_cutoff,
                          rw_epsilon,
                          rw_sigma,
                          bead_sequence=copolymer,
                          sequence_range=int(seq_frac * a_bead),
                          meanfield=True)
        t1 = time.time()
        total_time += t1 - t0
        print(
            f"Walk {i} completed in {t1-t0} seconds. Total time elapsed: {total_time}"
        )

    total_time += t1 - t0
    print(f"Walks complete. Total time: {total_time} seconds")

    t0 = time.time()
    box.mdsim.structure(f"struc{seq_frac}.in")
    t1 = time.time()
Ejemplo n.º 4
0
# block = 100

copolymer = []
for i in range(400):
    copolymer.append('a')
for i in range(400):
    copolymer.append('b')

total_time = 0
for i in range(num_walks):
    t0 = time.time()
    box.uniform_chain(size,
                      rw_kval,
                      rw_cutoff,
                      rw_epsilon,
                      rw_sigma,
                      bead_sequence=copolymer,
                      meanfield=True)
    t1 = time.time()
    total_time += t1 - t0
    print(
        f"Walk {i} completed in {t1-t0} seconds. Total time elapsed: {total_time}"
    )

total_time += t1 - t0
print(f"Walks complete. Total time: {total_time} seconds")

t0 = time.time()
box.mdsim.structure("test_structure2.in")
t1 = time.time()
Ejemplo n.º 5
0
copolymer_frac = 5
copolymer = []
for i in range(copolymer_frac):
    copolymer.append('a')
for i in range(copolymer_frac):
    copolymer.append('b')

random_copolymer = []
num_walks = 15

for i in range(num_walks):
    box.uniform_chain(size,
                      rw_kval,
                      rw_cutoff,
                      rw_epsilon,
                      rw_sigma,
                      termination='soften',
                      bead_sequence=copolymer,
                      srate=0.99,
                      suppress=False,
                      danger=1.09)

    print(f"{i+1} random walked")

print(f"Walk completed in {t1-t0} seconds")

box.mdsim.structure("test_structure.in")
box.mdsim.settings("test_settings.in", prebuilt="test_structure.in")

timestep = 0.01
desc1 = "testing"
Ejemplo n.º 6
0
    box.meanfield.density_file("rgrid", [15, 15, 15])

    print(f"Density file read in. Time taken: {t1 - t0}")

    #----------------------------------------------------------------------------------------
    # RANDOM WALK ASSIGNMENT
    #----------------------------------------------------------------------------------------
    total_time = 0
    for i in range(num_walks):
        t0 = time.time()
        box.uniform_chain(size,
                          rw_kval,
                          rw_cutoff,
                          rw_epsilon,
                          rw_sigma,
                          bead_sequence=copolymer,
                          meanfield=True,
                          srate=0.99,
                          suppress=False,
                          initial_failures=1000,
                          sequence_range=sequence_range,
                          walk_failures=5000)
        t1 = time.time()
        print(f"Walk {i} complete. Time taken: {t1-t0} seconds.")
        total_time += t1 - t0

    total_time += t1 - t0
    print(f"Walks complete. Total time: {total_time} seconds")

    t0 = time.time()
    box.mdsim.structure(f"structure-{sequence_range}.in")
    box.mdsim.settings(f"settings-{sequence_range}.in",
Ejemplo n.º 7
0
    print(f"Density file read in. Time taken: {t1 - t0}")

    #----------------------------------------------------------------------------------------
    # RANDOM WALK ASSIGNMENT
    #----------------------------------------------------------------------------------------
    total_time = 0
    for i in range(num_walks):
        t0 = time.time()
        box.uniform_chain(size,
                          rw_kval,
                          rw_cutoff,
                          rw_epsilon,
                          rw_sigma,
                          bead_sequence = copolymer,
                          meanfield = True,
                          srate = 0.99, 
                          suppress= False,
                          danger = 1.03,
                          initial_failures=15000,
                          walk_failures=15000,
                          sequence_range=int(0.125*size))
        t1 = time.time()
        print(f"Walk {i} complete. Time taken: {t1-t0} seconds.")
        total_time+= t1-t0

    print(f"Walks complete. Total time: {total_time} seconds")

    t0 = time.time()
    box.mdsim.structure(f"structure-{stretch_val}.in")
    box.mdsim.settings(f"settings-{stretch_val}.in", nskin=4.0, nlist=[10,10000]) 
Ejemplo n.º 8
0
for i in range(int(0.25 * size)):
    copolymer.append('a')
for i in range(int(0.75 * size)):
    copolymer.append('b')

print(int(0.25 * size))
print(int(0.75 * size))

total_time = 0
for i in range(num_walks):
    t0 = time.time()
    box.uniform_chain(size,
                      rw_kval,
                      rw_cutoff,
                      rw_epsilon,
                      rw_sigma,
                      bead_sequence=copolymer,
                      meanfield=True,
                      srate=0.85,
                      sequence_range=75,
                      suppress=False)
    t1 = time.time()
    total_time += t1 - t0
    print(
        f"Walk {i} completed in {t1-t0} seconds. Total time elapsed: {total_time}"
    )

total_time += t1 - t0
print(f"Walks complete. Total time: {total_time} seconds")

t0 = time.time()
box.mdsim.structure(f"test_structure{cellnums}.in")
Ejemplo n.º 9
0
copolymer = []
for i in range(10):
    copolymer.append('a')
for i in range(10):
    copolymer.append('b')

random_copolymer = []

for i in range(1):
    box.uniform_chain(size,
                      rw_kval,
                      rw_cutoff,
                      rw_epsilon,
                      rw_sigma,
                      copolymer,
                      mini=1.1,
                      suppress=False,
                      termination='soften',
                      sequence_range=3,
                      srate=0.95,
                      danger=1.0,
                      initial_failures=100,
                      walk_failures=1000)

    print(f"{i+1} random walked")

print(f"Walk completed in {t1-t0} seconds")
print(f"Number of retractions: {box.retractions}")

box.mdsim.structure("test_structure.in")
box.mdsim.settings("test_settings.in")