[pooma-dev] particle suggestion
Julian C. Cummings
cummings at linkline.com
Thu Apr 5 08:29:30 UTC 2001
Steve,
The create() function already does something similar to push_back(),
and there is no need for the user to keep track of the end of the list.
You just say create(n), and n new slots get added to the end of every
particle attribute. (That's a little different from push_back(), which
requires that you provide the item to be stored as an argument.) You
do have to be a bit careful with create() in the multi-patch world,
specifying on which patch to add particles or whether to create the new
elements globally across all patches. Is there a specific scenario
you have in mind where this functionality is not adequate?
I'm not sure what you want first() and last() to do. Keep in mind
that there is a global domain across all patches, and the particles
are numbered from 0 to N-1, where N is the global number of particles.
This numbering is updated by the renumber() method, which is invoked
during a sync() operation. This global domain exists mainly to allow
Array data-parallel expressions to be evaluated properly. Then there
is a local numbering on each patch, from 0 to n-1, where n is the size
of the given patch. You can view a particular local patch of a
particle attribute using the method patchLocal(i). You can query the
size of this local patch using the size() method. The size() method
of Particles gives you the global size N.
I hope I have answered your questions.
-- Julian C.
-----Original Message-----
From: Steve Nolen [mailto:drnuke at lanl.gov]
Sent: Tuesday, April 03, 2001 3:30 PM
To: Pooma
Subject: [pooma-dev] particle suggestion
would it be possible to add a particle by simply calling a push_back type
function. this would avoid the user having to keep track of where the end
of a growing list of particles is. a supported call for first() or last()
would also be nice, and would also solve the previous problem (maybe not if
the last() is only valid after a call to sync()?)
-steve
More information about the pooma-dev
mailing list