[pooma-dev] RE: an attempt at your particle BC

Steve Nolen drnuke at lanl.gov
Tue Apr 3 19:06:31 UTC 2001


RE: [pooma-dev] RE: an attempt at your particle BCalright.  let me know when
you or julian have added this, and i'll try it out.

i didn't see a function signature amenable to the vector<int> call in the
particle stuff, but i was hoping providence would play a role when it got
reinterpreted as a domain. :)

-steve
  -----Original Message-----
  From: James Crotinger [mailto:JimC at proximation.com]
  Sent: Tuesday, April 03, 2001 11:30 AM
  To: 'Julian Cummings'; James Crotinger
  Cc: 'Steve Nolen'; 'Pooma'
  Subject: RE: [pooma-dev] RE: an attempt at your particle BC


  Oops - sorry about that Steve. Julian's right. Don't know how that feature
slipped through the cracks. I put it in DynamicEngine to make these sorts of
things easier and it never made it to DynamicArray. I'm in the middle of
debugging a socket problem. If I can get that sorted out soon, I'll take a
crack at this.

          Jim

  ---------------------------------------------------
  James A. Crotinger
  Software Research Scientist
  Proximation, LLC

   -----Original Message-----
  From:   Julian Cummings [mailto:cummings at cacr.caltech.edu]
  Sent:   Tuesday, April 03, 2001 11:27 AM
  To:     James Crotinger
  Cc:     'Steve Nolen'; 'Pooma'
  Subject:        Re: [pooma-dev] RE: an attempt at your particle BC

  Gentlemen:

  There's a problem here.  The interface that Jim cited,
  describing a destroy list with a pair of iterators into
  some list of indices, exists for DynamicEngine, but
  *not* for DynamicArray (or Particles).  We need to
  add this before Steve would be able to use this method.

  I can take a crack at this late in the day today, unless
  someone else has time to deal with it sooner.

  -- Julian C.



  James Crotinger wrote:

  > Don't send vector<int> - it will think you're sending a "domain", which
has a
  > size() method.
  > Instead, send a.begin() and a.end() where a is your vector<int>.
  >
  > Jim
  >
  > ---------------------------------------------------
  >
  > James A. Crotinger
  >
  > Software Research Scientist
  >
  > Proximation, LLC
  >
  > -----Original Message-----
  > From: Steve Nolen [mailto:drnuke at lanl.gov]
  > Sent: Tuesday, April 03, 2001 11:05 AM
  > To: James Crotinger; cummings at cacr.caltech.edu
  > Cc: 'Pooma'
  > Subject: RE: [pooma-dev] RE: an attempt at your particle BC
  >
  > i tried sending a vector<int> object but it (le compiler) complained
about not
  > having "domain[0].size()".
  > -----Original Message-----
  >
  >
  > From: James Crotinger [mailto:JimC at proximation.com]
  > Sent: Tuesday, April 03, 2001 10:54 AM
  > To: 'Steve Nolen'; 'cummings at cacr.caltech.edu'
  > Cc: 'Pooma'
  > Subject: RE: [pooma-dev] RE: an attempt at your particle BC
  >
  > Actually, I think destroy will take quite a variety of domain
representations.
  > For example, it will take a pair of iterators into a list:
  >
  > (from Engine/tests/dynamic_test2.cpp)
  >
  >     int kill_array[8] = {0, 1, 5, 6, 7, 14, 18, 19};
  >
  >     C.destroy(kill_array, kill_array+8, BackFill());
  >
  > It will also take our regular domain objects. IndirectionList is used
  > internally (for its shallow copy semantics, I think), but I do not
recommend
  > that users use it - it really wasn't designed to be an all-purpose
  > user-friendly class. (It is easy to get bitten by its shallow copy
semantics,
  > IMHO). I guess I'd tend to use a std::vector for these things, but I'd
have to
  > see the real application to understand if that is correct.
  >
  > Jim
  >
  > ---------------------------------------------------
  > James A. Crotinger
  > Software Research Scientist
  > Proximation, LLC
  >
  > -----Original Message-----
  > From:   Steve Nolen [mailto:drnuke at lanl.gov]
  > Sent:   Tuesday, April 03, 2001 10:41 AM
  > To:     cummings at cacr.caltech.edu
  > Cc:     Pooma
  > Subject:        [pooma-dev] RE: an attempt at your particle BC
  >
  > it would be nice if one of the destroy or sync functions accepted a list
or
  > vector of integers denoting which particles to destroy.  the conversion
to
  > an IndirectionList (or even a DynamicArray for this matter) is just a
little
  > too much pooma for the casual user.
  >
  > > -----Original Message-----
  > > From: Julian C. Cummings [mailto:cummings at cacr.caltech.edu]
  > > Sent: Monday, April 02, 2001 6:26 PM
  > > To: Steve Nolen
  > > Subject: RE: an attempt at your particle BC
  > >
  > <snip>
  > >
  > > To assign a particle to the destroy list, use the
  > > deferredDestroy() method.  The first argument is a
  > > Domain describing the particle(s) to be added to
  > > the list, and the second is a local patch id number
  > > (if this is a local particle destroy).  For a single
  > > particle, the Domain will be an int or a Loc<1>
  > > containing the local index number of the particle,
  > > and the patchID says which local patch has this
  > > particle.  Particles on the destroy list are not
  > > destroyed until you call performDestroy() (or it gets
  > > called by the sync() method).
  > >
  > > If you are going to do this repeatedly, you might want
  > > to create your own temporary destroy list.  Create a
  > > DynamicArray of ints to store the indices of local
  > > particles to be destroyed on a particular local patch.
  > > Call the create() method to add a new element for each
  > > particle to be destroyed.  Then assign the local index
  > > number of the particle to that element in your destroy
  > > list.  Once your destroy list is complete, you must
  > > convert it into an IndirectionList<int>.  The destroy
  > > functions only accept domain types as descriptors of
  > > the set of particles to be destroyed, so you must use
  > > the IndirectionList here.  IndirectionList has a
  > > constructor which takes a 1D Array as its argument.
  > > Now you can call either deferredDestroy (to destroy
  > > later on) or destroy (to do it now) and pass it the
  > > IndirectionList and the local patchID.
  > >
  > > DynamicArray<int> kill;
  > > kill.create(1);
  > > kill(0) = i;  // add particle i to list
  > > IndirectionList<int> klist(kill);
  > > Neutrons.destroy(klist,patch);  // destroy particles in klist on patch
  > >
  > >
  >
  --
  Dr. Julian C. Cummings                       E-mail:
cummings at cacr.caltech.edu
  California Institute of Technology           Phone:  626-395-2543
  1200 E. California Blvd., Mail Code 158-79   Fax:    626-584-5917
  Pasadena, CA 91125



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/pooma-dev/attachments/20010403/fff3cba9/attachment.html>


More information about the pooma-dev mailing list