[FLASH-USERS] 1. Plotting particle positions (Joshua Wall)

Rahul Kashyap rkashyap at umassd.edu
Tue Nov 18 13:38:05 EST 2014


Hi Joshua,

I've struggled with it a little bit before with some success. Below are
details :

First, in *Config* of your problem directory define following :
PARAMETER particle_attribute_1 STRING "dens"   and other particle
properties
PARTICLETYPE
mapmethod for mapping fields onto particles

Second,  in *flash.par* set these :
useParticle = .true.
frequency of particlefile output


To read particle file in python(you need only partfiles) :

import h5py
import numpy as np
f=h5py.File("Sod_hdf5_part_0007",'r')
# will give you fields info
f.keys()
#will give you all fields mapped to particles, defined in Flash.h during
setup
f['particle names'][:]
# complete data-data array(of length equal to no. of fields) for all
particles, one of them is #time
f['tracer particles'][:]
#now you can plot "posx" vs time for any specific particle or scatter

I haven't been able to include species into particles. Particles does have
the field of all species but they are not being filled and have value -1 at
all time. These are the files to look into for these -
*Particle_mapFromMesh.F90,
pt_mapFromMeshQuadratic.F90*.

If anybody figure it out, please let us know.
thank you,

Best,
Rahul Kashyap
Physics, UMASS Dartmouth.




On Tue, Nov 18, 2014 at 1:00 PM, <flash-users-request at flash.uchicago.edu>
wrote:

> Send flash-users mailing list submissions to
>         flash-users at flash.uchicago.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://flash.uchicago.edu/mailman/listinfo/flash-users
> or, via email, send a message with subject or body 'help' to
>         flash-users-request at flash.uchicago.edu
>
> You can reach the person managing the list at
>         flash-users-owner at flash.uchicago.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of flash-users digest..."
>
>
> Today's Topics:
>
>    1.  Plotting particle positions (Joshua Wall)
>    2.   Question about ray tracing (pchang)
>    3. Re:  Plotting particle positions (Mark L Richardson)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 17 Nov 2014 15:31:21 -0500
> From: Joshua Wall <joshua.e.wall at gmail.com>
> Subject: [FLASH-USERS] Plotting particle positions
> To: flash-users at flash.uchicago.edu
> Message-ID:
>         <
> CAHnUEoyp4cCzmi5fcHuNtibas+y8mbjqgq0Ua-nqpsZb5pZ_2g at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Users,
>
>
>     I'm having some difficultly plotting particles in either Visit or yt.
> Initially I thought it might be my particular script, but now I'm just
> trying to plot the particle in the Sink Momentum Test problem. When I load
> the plot files, I don't see a particle subset in Visit. When I load the
> checkpoint files or the particle files I see a subset named Particles,
> which has posx, posy, and posz. However attempting to scatter plot these is
> unsuccessful.
>
>    In my own script, I don't see anything called Particles in the
> checkpoint or particle files, even though I used the Sink Momentum Test par
> and config files as a template. If I look at the particle files using
> HDFView, I don't see anything labelled "posx", "posy" or "posz".
>
>    The Sink Momentum Test is being run unedited. My own config file
> contains:
>
> REQUIRES Particles/ParticlesMain/active/Sink
> REQUIRES physics/Gravity/GravityMain/Poisson
> REQUIRES physics/sourceTerms/Polytrope/PolytropeMain
>
>     and my par file has:
>
>
> plot_var_12 = "posx"
> plot_var_13 = "posy"
> plot_var_14 = "posz"
>
> useParticles              = .true.
> useSinkParticles          = .true.
>
>    among other things.
>
>
>    Can anyone enlighten me on the necessary switches I need to throw in the
> config and par files that I am missing to make sure all the data is there
> to plot? I should note that for my application I'm specifically needing to
> use sink particles (star cluster in a gas).
>
> Thanks,
>
>
> Joshua Wall
>
> Doctoral Candidate
> Department of Physics
> Drexel University
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://flash.uchicago.edu/pipermail/flash-users/attachments/20141117/efa8562a/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Mon, 17 Nov 2014 16:40:30 -0500
> From: pchang <pchang at lle.rochester.edu>
> Subject: [FLASH-USERS]  Question about ray tracing
> To: flash-users at flash.uchicago.edu
> Message-ID: <546A6B4E.4010500 at lle.rochester.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi all,
> I am simulating a cylindrical target being imploded by illuminating 10
> laser beams around the cylindrical target. I start with the fully
> azimuthal symmetric case first, i.e., all the beams are point to z-axis
> (r=0). Following are my questions:
> (1) In 2D laser ray tracing in 2D cylindrical symmetric simulation, does
> it take the average of the laser energy in azimuthal direction? or does
> it just treat the azimuthal direction as one of the boundary? In my
> case, 10 beams distributed in azimuthal direction uniformly. How do I
> setup the beams?
> (a) have only one beam on the plane of phi=0 with the actual laser
> energy of single beam?
> (b) have only one beam on the plane of phi=0 and with the actual total
> laser energy of 10 beams?
> (c) have all the beams given in the flash.par with the correct pointing
> setup?
>
> (2) The same question, what if I am using 3D laser ray tracing in 2D
> cylindrical symmetric simulation?
>
> (3) I may use up to 40 beams in future. Especially I may use 3D ray
> tracing in 2D cylindrical symmetry since I may point the laser off
> z-axis. Do I type the laser setting manually in flash.par? or can I have
> a subroutine to generate the beams just like Simulation_initBlock.f90 is
> used to generate the target?
>
> Thank you
>
> Po-Yu
>
> --
> Po-Yu Chang
> Postdoc
> Fusion Science Center,
> Laboratory for Laser Energetics
> University of Rochester
> 250 East River Road
> Rochester, New York 14623
> Phone: (585) 273-5179
> FAX: (585) 275-5960
> pchang at lle.rochester.edu
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 18 Nov 2014 09:37:10 +0000
> From: Mark L Richardson <Mark.L.Richardson at asu.edu>
> Subject: Re: [FLASH-USERS] Plotting particle positions
> To: Joshua Wall <joshua.e.wall at gmail.com>
> Cc: "flash-users at flash.uchicago.edu" <flash-users at flash.uchicago.edu>
> Message-ID:
>         <CAPAaoGXhVUtMfn7i70bUigUKA3CLJq=
> zYyX42HGSLFU-WV3+Hw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> If I remember correctly, particle data cannot be added to the plot files.
> Instead all particle variables are found in the particle files and in the
> checkpoint files under tracer\ particles. The variable names are defined in
> particle\ names.
>
> If you want to see the particle data in the grid (assuming active
> particles) then add pden to your plot_vars, as that's the density from
> particles mapped to the grid for the gravity solver.
>
> I'm as yet unfamiliar with how yt handles particles in FLASH, but pre-3.0
> you needed to use the checkpoint file if you wanted yt to see them. There
> may be a way now to read the particle files, but I'm not sure. I don't have
> experience with Visit, sorry.
>
> Good luck,
>   -Mark
>
> On Mon, Nov 17, 2014 at 8:31 PM, Joshua Wall <joshua.e.wall at gmail.com>
> wrote:
>
> > Dear Users,
> >
> >
> >     I'm having some difficultly plotting particles in either Visit or yt.
> > Initially I thought it might be my particular script, but now I'm just
> > trying to plot the particle in the Sink Momentum Test problem. When I
> load
> > the plot files, I don't see a particle subset in Visit. When I load the
> > checkpoint files or the particle files I see a subset named Particles,
> > which has posx, posy, and posz. However attempting to scatter plot these
> is
> > unsuccessful.
> >
> >    In my own script, I don't see anything called Particles in the
> > checkpoint or particle files, even though I used the Sink Momentum Test
> par
> > and config files as a template. If I look at the particle files using
> > HDFView, I don't see anything labelled "posx", "posy" or "posz".
> >
> >    The Sink Momentum Test is being run unedited. My own config file
> > contains:
> >
> > REQUIRES Particles/ParticlesMain/active/Sink
> > REQUIRES physics/Gravity/GravityMain/Poisson
> > REQUIRES physics/sourceTerms/Polytrope/PolytropeMain
> >
> >     and my par file has:
> >
> >
> > plot_var_12 = "posx"
> > plot_var_13 = "posy"
> > plot_var_14 = "posz"
> >
> > useParticles              = .true.
> > useSinkParticles          = .true.
> >
> >    among other things.
> >
> >
> >    Can anyone enlighten me on the necessary switches I need to throw in
> > the config and par files that I am missing to make sure all the data is
> > there to plot? I should note that for my application I'm specifically
> > needing to use sink particles (star cluster in a gas).
> >
> > Thanks,
> >
> >
> > Joshua Wall
> >
> > Doctoral Candidate
> > Department of Physics
> > Drexel University
> >
>
>
>
> --
> Mark Richardson,
> Mark.L.Richardson at asu.edu
> Ph.D. Astrophysics
> Beecroft Postdoctoral Fellow
> Department of Physics, University of Oxford
> +44 7445 922707
> www.public.asu.edu/~mlricha4
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://flash.uchicago.edu/pipermail/flash-users/attachments/20141118/9abd55cf/attachment-0001.html
>
> ------------------------------
>
> _______________________________________________
> flash-users mailing list
> flash-users at flash.uchicago.edu
> http://flash.uchicago.edu/mailman/listinfo/flash-users
>
>
> End of flash-users Digest, Vol 85, Issue 8
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20141118/761bff72/attachment.htm>


More information about the flash-users mailing list