Questions about averaging virial pressure and velocity over trigger value

21 views
Skip to first unread message

clara bae

unread,
Mar 29, 2023, 2:28:48 PM3/29/23
to hoomd-users
Dear all,
I am currently using hoomdBlue v3.1
My simulation consist of 1,000+ particles with periodic boundary condition.(simulation picture is attached) Right now, I am using data from gsd file after simulation runs to post process virial pressure and velocity by slicing box into smaller slabs. However, right now I can only output virial pressure and velocity every 10,000 or defined trigger. The code I used to log are provided below.


logger = hoomd.logging.Logger()

St = hoomd.md.force.Force()

thermodynamic_properties = hoomd.md.compute.ThermodynamicQuantities(filter=all_)

sim.operations.computes.append(thermodynamic_properties)

logger.add(thermodynamic_properties,quantities=['kinetic_temperature','pressure_tensor','virial_ind_tensor','potential_energy'])

logger.add(sim,quantities=['tps'])

logger.add(morse,quantities=['virials'])


gsd_writer2 = hoomd.write.GSD(filename='p0.003_gel_poiseuille_12kT-6kT_LX=300_smallTrigger.gsd',trigger=1000,filter=all_,dynamic=['property','momentum','attribute'],mode='wb')


sim.operations.writers.append(gsd_writer2)

gsd_writer2.log = logger

'''



I want to average virial pressure (may need only one out of six of the component) and velocity over defined trigger value in sliced slabs. So for trigger=10,000 I want the code to output virial pressure averaged over 10,000 different time frame in different slabs(so for each pressure, I would have p_xz= [bin1 bin2 ....bin#n] something like this.  

I want to know if there is any way I can do this.
If there are any other information needed please let me know, I am happy to provide it!
Thank you!


Screen Shot 2023-03-29 at 2.23.12 PM.png

Brandon Butler

unread,
Mar 29, 2023, 2:38:33 PM3/29/23
to hoomd...@googlegroups.com

Hello,

If you want to average over every single frame (which is what it seems like you are suggesting) I would suggest creating a custom writer (documentation) that would run every frame and then average after being called n times. I would caution that averaging over every frame is likely not be useful given the high degree of correlations between consecutive frames. As for the binning you could use local snapshots to bin the particles (documentation).

Best,

Brandon

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/ae5919b8-a187-43c4-9ace-4206590caf12n%40googlegroups.com.
--
Brandon Butler
MolSSI Fellow
PhD Candidate, Chemical Engineering and Scientific Computing | Glotzer Lab, University of Michigan
Email: butl...@umich.edu
Reply all
Reply to author
Forward
Message has been deleted
0 new messages