A question about the instances in Enzo

Skip to first unread message

Erick Munive

Mar 18, 2021, 10:46:16 PM3/18/21
to enzo-dev
Hello there! I'd like to use the cloud-in-cell routine to interpolate particles onto a grid in order to get the density (for the gravity solver)
According to cic_interp_c.c file this is the input:

ndim       - dimensionality */
/*     cellsize   - the cell size of field */
/*     dim1,2,3   - real dimensions of field */
/*     field      - field to interpolate from */
/*     leftedge   - the left edge(s) of field */
/*     npositions - number of particles */
/*     posx,y,z   - particle positions */
/*     sumfield   - 1D field (length npositions) to interpolate into */

What type of field as input do I have to have? 

The only I have is N body particle positions and velocities. Do I need extra information to compute de density?

Also, I'd like to know what Is the meaning of sumfield,.
I know my questions are very simple but I'll be grateful if someone can help me

Britton Smith

Mar 23, 2021, 7:00:32 AM3/23/21
to enzo...@googlegroups.com
Hi Erick,

You can find an example of the cic deposition using the fortran routine cic_deposit inside Grid_DepositParticlePositions.C. The main inputs are arrays of particle positions and masses. The sumfield should be an array with the same size as the number of grid cells. After the function call, it will contain the deposited particle masses for each grid cell. In Enzo, the particle masses are already densities, so this array will contain the density values you need. My advice is to follow what's done in Grid_DepositParticlePositions.C.


You received this message because you are subscribed to the Google Groups "enzo-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enzo-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/enzo-dev/9e2d4ef1-e42c-4209-afa5-3af533f9a130n%40googlegroups.com.
Reply all
Reply to author
0 new messages