fix print - variable in title

Hello,

What is the correct way to print a calculated value in the title section of “fix print”. This is what I’m thinking:

“”""
variable eng equal pe
variable current_time equal time
variable surface_area equal lx*ly
fix 2 all print 1000 “{current_time}, {eng}” file potential_energy.csv title “Surface area = ${surface_area}”

“”""

Thanks for the help!
Stacey

Why ask? Why don’t you just try it out with a quick test example?

I currently do not have a data file since the calculation is based on a previous calculation that is running. I’m trying to put together the next input file and was not sure if the way I want to specify the title section was right.

Hello,

I have tried this and it did not work:

“”""
variable eng equal pe
variable current_time equal time
variable surface_area equal lx*ly
fix 2 all print 1000 “{current_time}, {eng}” file potential_energy.csv title “Surface area = ${surface_area}”

“”""

What is the proper way to print a variable in the title keyword?

Thanks!

Hello,

I have tried this and it did not work:

“”""
variable eng equal pe
variable current_time equal time
variable surface_area equal lx*ly
fix 2 all print 1000 “{current_time}, {eng}” file potential_energy.csv title “Surface area = ${surface_area}”

“”""

What is the proper way to print a variable in the title keyword?

then there is no way. does it say anywhere in the documentation of fix print, that you can put variables into the title string?

axel.

Hi Axel,

Nope, the fix print documentation does not mention anything about variables in the title string.

Thanks!

you could work around it by using the print command to print to a file and then in fix print use “append” instead of “file” and an empty title.
or you could encode the property you want to record simply into the filename.

axel.

Thanks Axel

I like the print and append approach.