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

James Crotinger JimC at proximation.com
Tue Apr 3 17:13:02 UTC 2001


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 <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
<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 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/pooma-dev/attachments/20010403/1de65ae8/attachment.html>


More information about the pooma-dev mailing list