ufpGetParticleData()
Get the array of particle data.
Syntax
data = ufpGetParticleData( ufpHd, dataName ) ;
Type
AcuTrace User-Defined Function Particle Routine
Parameters
- ufpHd (pointer)
- The opaque handle which was passed to the user function.
- dataName (integer)
- Symbolic name of the requested data.
Table 1. Symbolic Name Data returned Array size UFP_PARTICLE_ID particle id 1 UFP_PARTICLE_MARKER marker 1 UFP_PARTICLE_POSITION position 3 UFP_PARTICLE_VELOCITY velocity 3 UFP_PARTICLE_LENGTH stretch vector 3 UFP_PARTICLE_MASS mass 1 UFP_PARTICLE_DENSITY density 1 UFP_PARTICLE_RADIUS radius 1 UFP_PARTICLE_VOLUME volume 1
Return Value
The return value is a pointer to a one-dimensional real array.
The size of the array depends on the value of dataName.
Particle user defined equation data is not accessed by this routine but instead by ufpGetUdfData.
Description
This routine returns the array of particle data at the current particle location and time. For
example,
Real *pCrd ;
...
pCrd = ufpGetParticleData( ufpHd, UFP_PARTICLE_POSITION ) ;
/*---------------------------------------------------------------------------
* Compute source term for residence time:
* Set source to 1 if the particle is in the residence box, 0 otherwise
*---------------------------------------------------------------------------
*/
if ( pCrd[0] >= xlo && pCrd[0] <= xhi &&
pCrd[1] >= ylo && pCrd[1] <= yhi &&
pCrd[2] >= zlo && pCrd[2] <= zhi ) {
outVec[0] = 1.0 ;
} else {
outVec[0] = 0.0 ;
}
Errors
This routine expects valid ufpHd and dataName as arguments; invalid arguments return an error.