espressomd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regarding creating more number of dimer using raspberry model


From: chandra shekhar maurya
Subject: Regarding creating more number of dimer using raspberry model
Date: Thu, 10 Dec 2020 19:28:35 +0530

Dear users,
I am creating a dimer and applying for a loop for creating two dimer, but I am getting an error. It may be because of id. But I am unable to fix this problem. Can anyone help me?
The error is:
Exception                                 Traceback (most recent call last)
<ipython-input-5-1e08fe5a06b8> in <module>
     21     print(system.box_l)
     22 # Place the central particle
---> 23     system.part.add(id=0, pos=colPos, type=0, q=q_col, fix=(1, 1, 1),
     24                 rotation=(1, 1, 1))  # Create central particle
     25     print('done')

particle_data.pyx in espressomd.particle_data.ParticleList.add()

particle_data.pyx in espressomd.particle_data.ParticleList._place_new_particle()

Exception: Particle 0 already exists.

The program is:
system.thermostat.set_langevin(kT=0.00001, gamma=40., seed=42)

print("# Creating raspberry")
center = system.box_l / 2
colPos = center

# Charge of the colloid
q_col = -40
# Number of particles making up the raspberry (surface particles + the central particle).
#n_col_part = int(4 * np.pi * np.power(radius_col, 2) + 1)
n_col_part = int(1 + 1)

for j in range(2):
    center = np.random.randn(3)
    print(center)
    center = system.box_l/2 + center/np.linalg.norm(center)*system.box_l/2
    colPos = center
    print(center)
    print(system.box_l)
# Place the central particle
    system.part.add(id=0, pos=colPos, type=0, q=q_col, fix=(1, 1, 1),
                rotation=(1, 1, 1))  # Create central particle

    print('done')
# Create surface beads uniformly distributed over the surface of the central particle
    for i in range(1, n_col_part):
        colSurfPos = np.random.randn(2)
        colSurfPos = colSurfPos / np.linalg.norm(colSurfPos) * radius_col
        print(colPos)
        colSurfPos = np.append(colSurfPos,0)
        print(colSurfPos)
        colSurfPos = colSurfPos + colPos
        print(colSurfPos)
        system.part.add(id=i, pos=colSurfPos, type=1)
        system.part[i].add_bond((col_center_surface_bond, 0))
print("# Number of colloid beads = {}".format(n_col_part)) 
system.force_cap = 1000
system.time_step = eq_tstep

print("Relaxation of the raspberry surface particles")
for i in range(n_cycle):
    system.integrator.run(integ_steps)

# Restore time step
system.time_step = time_step

Your help will be highly appreciated.

Thanks & Regards
Chandra Shekhar Maurya
Mechanical Eng. Dept.
Indian Institute of Technology Patna
Contact No:9793572837


reply via email to

[Prev in Thread] Current Thread [Next in Thread]