0

I have written the code below to create a function that creates a file of N particle positions in the file .xyz format which can be used to display particle trajectories.

However I am a little unsure of a few things.

Firstly, I want to create and write a file so that it is displayed like so...

 Point = 1
 p1 x11 y11 z11 
 p2 x21 y21 z21

Where all the lines are strings and taking i = 1 and j = 1,2 in this instance.

I feel that I have most definitely incorrectly written the sections of code where I have to append the .xyz file.

I should also note that...

co_ord_data = particles[j].str()

returns 4 strings.

(Main Code)

def VMD_init(timestep, filename)

particle_trajectory = open("filename", "a+")

for i in range(timestep):

    if i % 5:

        particle_trajectory.write("Point = i")

        for j in len(particles):

            co_ord_data = particles[j].str()

            particle_trajectory.write("co_ord_data")

    else:

I hope I have managed to explain this clearly enough! Please feel free to reply asking me to try and explain it again.

Any help is much appreciated!

Thank you :-)

0 Answers0